models

package
v0.0.0-...-165d932 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePostParams

type CreatePostParams struct {
	Title   string `json:"title"`
	Content string `json:"content"`
	Views   int64  `json:"views"`
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetPostByPageParams

type GetPostByPageParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type GoadminMenu

type GoadminMenu struct {
	ID         int32          `json:"id"`
	ParentID   int32          `json:"parent_id"`
	Type       int32          `json:"type"`
	Order      int32          `json:"order"`
	Title      string         `json:"title"`
	Icon       string         `json:"icon"`
	Uri        string         `json:"uri"`
	Header     sql.NullString `json:"header"`
	PluginName string         `json:"plugin_name"`
	Uuid       sql.NullString `json:"uuid"`
	CreatedAt  sql.NullTime   `json:"created_at"`
	UpdatedAt  sql.NullTime   `json:"updated_at"`
}

type GoadminOperationLog

type GoadminOperationLog struct {
	ID        int32        `json:"id"`
	UserID    int32        `json:"user_id"`
	Path      string       `json:"path"`
	Method    string       `json:"method"`
	Ip        string       `json:"ip"`
	Input     string       `json:"input"`
	CreatedAt sql.NullTime `json:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at"`
}

type GoadminPermission

type GoadminPermission struct {
	ID         int32          `json:"id"`
	Name       string         `json:"name"`
	Slug       string         `json:"slug"`
	HttpMethod sql.NullString `json:"http_method"`
	HttpPath   string         `json:"http_path"`
	CreatedAt  sql.NullTime   `json:"created_at"`
	UpdatedAt  sql.NullTime   `json:"updated_at"`
}

type GoadminRole

type GoadminRole struct {
	ID        int32        `json:"id"`
	Name      string       `json:"name"`
	Slug      string       `json:"slug"`
	CreatedAt sql.NullTime `json:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at"`
}

type GoadminRoleMenu

type GoadminRoleMenu struct {
	RoleID    int32        `json:"role_id"`
	MenuID    int32        `json:"menu_id"`
	CreatedAt sql.NullTime `json:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at"`
}

type GoadminRolePermission

type GoadminRolePermission struct {
	RoleID       int32        `json:"role_id"`
	PermissionID int32        `json:"permission_id"`
	CreatedAt    sql.NullTime `json:"created_at"`
	UpdatedAt    sql.NullTime `json:"updated_at"`
}

type GoadminRoleUser

type GoadminRoleUser struct {
	RoleID    int32        `json:"role_id"`
	UserID    int32        `json:"user_id"`
	CreatedAt sql.NullTime `json:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at"`
}

type GoadminSession

type GoadminSession struct {
	ID        int32        `json:"id"`
	Sid       string       `json:"sid"`
	Values    string       `json:"values"`
	CreatedAt sql.NullTime `json:"created_at"`
	UpdatedAt sql.NullTime `json:"updated_at"`
}

type GoadminSite

type GoadminSite struct {
	ID          int32          `json:"id"`
	Key         sql.NullString `json:"key"`
	Value       sql.NullString `json:"value"`
	Description sql.NullString `json:"description"`
	State       int32          `json:"state"`
	CreatedAt   sql.NullTime   `json:"created_at"`
	UpdatedAt   sql.NullTime   `json:"updated_at"`
}

type GoadminUser

type GoadminUser struct {
	ID            int32          `json:"id"`
	Username      string         `json:"username"`
	Password      string         `json:"password"`
	Name          string         `json:"name"`
	Avatar        sql.NullString `json:"avatar"`
	RememberToken sql.NullString `json:"remember_token"`
	CreatedAt     sql.NullTime   `json:"created_at"`
	UpdatedAt     sql.NullTime   `json:"updated_at"`
}

type GoadminUserPermission

type GoadminUserPermission struct {
	UserID       int32        `json:"user_id"`
	PermissionID int32        `json:"permission_id"`
	CreatedAt    sql.NullTime `json:"created_at"`
	UpdatedAt    sql.NullTime `json:"updated_at"`
}

type IrisMenu

type IrisMenu struct {
	ID     int64         `json:"id"`
	Name   string        `json:"name"`
	Path   string        `json:"path"`
	Weight sql.NullInt32 `json:"weight"`
}

type IrisPage

type IrisPage struct {
	ID        int64     `json:"id"`
	Title     string    `json:"title"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Slug      string    `json:"slug"`
}

type IrisPost

type IrisPost struct {
	ID        int64     `json:"id"`
	Title     string    `json:"title"`
	Content   string    `json:"content"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	Views     int64     `json:"views"`
}

type IrisSite

type IrisSite struct {
	ID        int64          `json:"id"`
	SiteName  string         `json:"site_name"`
	SiteEmail string         `json:"site_email"`
	Slogan    sql.NullString `json:"slogan"`
	Notice    sql.NullString `json:"notice"`
}

type IrisTag

type IrisTag struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

type IrisTagsPost

type IrisTagsPost struct {
	ID     int64 `json:"id"`
	TagID  int64 `json:"tag_id"`
	PostID int64 `json:"post_id"`
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreatePost

func (q *Queries) CreatePost(ctx context.Context, arg CreatePostParams) (sql.Result, error)

func (*Queries) DeletePost

func (q *Queries) DeletePost(ctx context.Context, id int64) error

func (*Queries) GetHotPost

func (q *Queries) GetHotPost(ctx context.Context, limit int32) ([]IrisPost, error)

func (*Queries) GetLatestPost

func (q *Queries) GetLatestPost(ctx context.Context, limit int32) ([]IrisPost, error)

func (*Queries) GetMenu

func (q *Queries) GetMenu(ctx context.Context) ([]IrisMenu, error)

func (*Queries) GetNextPost

func (q *Queries) GetNextPost(ctx context.Context, id int64) (IrisPost, error)

func (*Queries) GetPage

func (q *Queries) GetPage(ctx context.Context, slug string) (IrisPage, error)

func (*Queries) GetPost

func (q *Queries) GetPost(ctx context.Context, id int64) (IrisPost, error)

func (*Queries) GetPostByPage

func (q *Queries) GetPostByPage(ctx context.Context, arg GetPostByPageParams) ([]IrisPost, error)

func (*Queries) GetPrevPost

func (q *Queries) GetPrevPost(ctx context.Context, id int64) (IrisPost, error)

func (*Queries) GetSite

func (q *Queries) GetSite(ctx context.Context, id int64) (IrisSite, error)

func (*Queries) GetTag

func (q *Queries) GetTag(ctx context.Context, id int64) (IrisTag, error)

func (*Queries) GetTagPostId

func (q *Queries) GetTagPostId(ctx context.Context, tagID int64) ([]int64, error)

func (*Queries) GetTags

func (q *Queries) GetTags(ctx context.Context) ([]IrisTag, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id int32) (GoadminUser, error)

func (*Queries) GetUsers

func (q *Queries) GetUsers(ctx context.Context) ([]GoadminUser, error)

func (*Queries) ListPosts

func (q *Queries) ListPosts(ctx context.Context) ([]IrisPost, error)

func (*Queries) ViewPlus

func (q *Queries) ViewPlus(ctx context.Context, id int64) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL