models

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ArticleClass = class.Make[Article]()
)
View Source
var UserClass = class.Make[User]()

Functions

func Articles added in v0.3.0

func Articles() *table.Table[Article]

func UserQuery

func UserQuery() *table.Table[User]

Types

type Article

type Article struct {
	table.Model[Article] `json:"-"`

	Id    string `json:"id"`
	Title string `json:"title"`
}

type Settings added in v0.3.0

type Settings struct {
	XxxSwitch bool `json:"xxx_switch"`
}

type User

type User struct {
	Id       string   `json:"id"` // 没有 db tag 默认解析 json
	NickName string   `json:"name"`
	Role     string   `json:"role"`
	Settings Settings `json:"settings"`
}

func (User) GetId

func (u User) GetId() string

GetId 实现 auth 需要的方法

Jump to

Keyboard shortcuts

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