pmb

package module
v0.0.0-...-7dbae93 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserModelName  = "users"
	UserContextKey = "user_model"
)

Variables

View Source
var (
	UserInstance    = NewUserModel()
	UserIdFieldName = "user_id"
)

Functions

func ActionRun

func ActionRun(ctx iris.Context, model IModelItem, user *SimpleUserModel)

func CheckConditions

func CheckConditions(data map[string]interface{}, conds []ut.Kov) (bool, string)

func DynamicRun

func DynamicRun(ctx iris.Context, model IModelItem, user *SimpleUserModel)

func IrisRespErr

func IrisRespErr(msg string, err error, ctx iris.Context, code ...int)

func MustOpLog

func MustOpLog(ctx iris.Context, db *qmgo.Collection, method string, user *SimpleUserModel, sheet string, msg string, rowId string, toFields []ut.Kov)

func OpLogSyncIndex

func OpLogSyncIndex(ctx context.Context, coll *qmgo.Collection) error

func ToJsonSchema

func ToJsonSchema[T any](origin T, omitFields ...string) *jsonschema.Schema

ToJsonSchema 把一个struct转换为jsonschema 在后台的前端ui-schema中不支持patternProperties 也就是说不支持map[string]any的写法 omitFields 是需要跳过的字段名 是struct的字段名

Types

type ActionPostArgs

type ActionPostArgs[T, F any] struct {
	Rows     []T              `json:"rows"`
	FormData F                `json:"form_data"`
	User     *SimpleUserModel `json:"user"`
	Model    IModelItem       `json:"model"`
}

ActionPostArgs T是行数据 F是表单数据

type ActionPostPart

type ActionPostPart[F any] struct {
	Name     string   `json:"name"`                // action名称
	Rows     []string `json:"rows,omitempty"`      // 选中的行id
	FormData F        `json:"form_data,omitempty"` // 表单填写的值
}

type Backend

type Backend struct {
	Prefix string
	// contains filtered or unexported fields
}
var (
	BkInst *Backend
)

func NewBackend

func NewBackend() *Backend

func NewFullBackend

func NewFullBackend(party iris.Party, mongodb *qmgo.Database, redisAddress string, redisPassword string, redisDb int) (*Backend, error)

func (*Backend) AddDb

func (c *Backend) AddDb(mdb *qmgo.Database)

func (*Backend) AddModel

func (b *Backend) AddModel(m IModelItem)

func (*Backend) AddModelAny

func (b *Backend) AddModelAny(raw any) IModelItem

func (*Backend) AddRbac

func (c *Backend) AddRbac(rbac *pipe.RbacDomain)

func (*Backend) AddRbacUseUri

func (c *Backend) AddRbacUseUri(redisAddress, password string) bool

func (*Backend) AddRdb

func (c *Backend) AddRdb(rdb rueidis.Client)

func (*Backend) CloneConn

func (c *Backend) CloneConn() *connectInfo

func (*Backend) Db

func (c *Backend) Db() *qmgo.Database

func (*Backend) GetModel

func (b *Backend) GetModel(name string) (IModelItem, bool)

func (*Backend) GetMsgHandler

func (b *Backend) GetMsgHandler(ctx iris.Context)

func (*Backend) InsertLogModel

func (b *Backend) InsertLogModel()

func (*Backend) InsertUserModel

func (b *Backend) InsertUserModel()

func (*Backend) OpLog

func (c *Backend) OpLog() *qmgo.Collection

func (*Backend) RegistryRoute

func (b *Backend) RegistryRoute(party iris.Party)

func (*Backend) SendMsg

func (b *Backend) SendMsg(ctx context.Context, uid, content string)

func (*Backend) SetConn

func (c *Backend) SetConn(conn *connectInfo)

type ContextValueInject

type ContextValueInject struct {
	FromKey    string `json:"from_key,omitempty"`
	ToKey      string `json:"to_key,omitempty"`
	AllowEmpty bool   `json:"allow_empty,omitempty"`
}

type DynamicCall

type DynamicCall func(fieldId string, model IModelItem, user *SimpleUserModel, row map[string]any) (*DynamicResult, error)

type DynamicField

type DynamicField struct {
	Id      string `json:"id"`      // 字段唯一id
	Name    string `json:"name"`    // 字段名
	Trigger string `json:"trigger"` // 触发方式 默认interval
	// contains filtered or unexported fields
}

func NewDynamicField

func NewDynamicField(id, name string) *DynamicField

func (*DynamicField) AddCall

func (c *DynamicField) AddCall(call DynamicCall) *DynamicField

func (*DynamicField) SetTrigger

func (c *DynamicField) SetTrigger(trigger string) *DynamicField

func (*DynamicField) SetTriggerClick

func (c *DynamicField) SetTriggerClick() *DynamicField

func (*DynamicField) SetTriggerInterval

func (c *DynamicField) SetTriggerInterval() *DynamicField

type DynamicReq

type DynamicReq struct {
	RowUid string `json:"row_uid"` // 行id
	Id     string `json:"id"`      // 动态字段id
}

type DynamicResult

type DynamicResult struct {
	ShowType string `json:"show_type"`
	Data     any    `json:"data"`
}

func (*DynamicResult) Normal

func (r *DynamicResult) Normal(data string)

func (*DynamicResult) Raw

func (r *DynamicResult) Raw(data any)

type EmailPasswordLoginReq

type EmailPasswordLoginReq struct {
	Email    string `json:"email,omitempty" comment:"邮箱号码" validate:"required,email"`
	Password string `json:"password,omitempty" comment:"密码" validate:"required,min=6,max=36"`
	Force    bool   `json:"force,omitempty" comment:"强制"`
}

type IModelItem

type IModelItem interface {
	GetBase() SchemaBase
	SetRaw(raw any)
	AddAction(action ISchemaAction)
	GetAction(name string) (ISchemaAction, bool)
	AddQueryFilterInject(fl *ut.Kov)
	ParseInject(ctx iris.Context) ([]*ut.Kov, error)
	GetCollection() *qmgo.Collection
	GetDb() *qmgo.Database
	GetTableName() string
	GetHandler(ctx iris.Context, queryParams pipe.QueryParseConfig, getParams pipe.ModelGetData, uid string) error
	PostHandler(ctx iris.Context, params pipe.ModelCtxMapperPack) error
	PutHandler(ctx iris.Context, params pipe.ModelPutConfig) error
	DelHandler(ctx iris.Context, params pipe.ModelDelConfig) error
	ActionEntry(ctx iris.Context)
	DynamicFieldsEntry(ctx iris.Context)
	Registry(part iris.Party)
	RegistryConfigAction(p iris.Party)
	RegistryCrud(p iris.Party)
	AddQueryContextInject(q ContextValueInject)
	GetContextUser(ctx iris.Context) *SimpleUserModel
	GetAllAction() []ISchemaAction
	SetPathId(newId string)
	GetRoles() *SchemaRole
	HaveUserKey(schema *jsonschema.Schema) bool
	GetSchema(mode ISchemaMode) *jsonschema.Schema
	SetSchemaRaw(mode ISchemaMode, raw any)
	SetSchema(mode ISchemaMode, schema *jsonschema.Schema)
	AddDynamicField(f *DynamicField)
	AddDF(id, name string, call DynamicCall)
	DfIdFind(id string) *DynamicField
}

type ISchemaAction

type ISchemaAction interface {
	Execute(ctx iris.Context, args any) (responseInfo any, err error)
	GetBase() *SchemaActionBase
	SetCall(func(ctx iris.Context, args any) (responseInfo any, err error))
}

func NewAction

func NewAction[T any, F any](name string, form F) ISchemaAction

NewAction action的名称必填 form没有可传nil

func NewRowAction

func NewRowAction[T any, F any](name string, form F) ISchemaAction

func NewTableAction

func NewTableAction[T any, F any](name string, form F) ISchemaAction

type ISchemaMode

type ISchemaMode int
const (
	SchemaModeAdd ISchemaMode = iota
	SchemaModeEdit
	SchemaModeTable
	SchemaModeDelete
)

type ManySchema

type ManySchema struct {
	Table  *jsonschema.Schema `json:"table"`
	Edit   *jsonschema.Schema `json:"edit"`
	Add    *jsonschema.Schema `json:"add"`
	Delete *jsonschema.Schema `json:"delete"`
}

type Message

type Message struct {
	UID       string          `json:"-"`
	Content   string          `json:"content,omitempty"`
	CreatedAt time.Time       `json:"created_at,omitempty"`
	Sequence  int             `json:"sequence,omitempty"`
	UA        map[string]bool `json:"-"`
}

type MessageQueue

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

func NewMessageQueue

func NewMessageQueue() *MessageQueue

func (*MessageQueue) Consume

func (mq *MessageQueue) Consume(uid, ua string) (Message, bool)

func (*MessageQueue) Put

func (mq *MessageQueue) Put(uid, content string)

type OperationLog

type OperationLog struct {
	pipe.ModelBase `bson:",inline"`

	Method   string   `json:"method,omitempty" bson:"method,omitempty" comment:"操作方法"`
	UserId   string   `json:"user_id,omitempty" bson:"user_id,omitempty" comment:"操作用户ID"`
	UserName string   `json:"user_name,omitempty" bson:"user_name,omitempty" comment:"操作用户名"`
	ToSheet  string   `json:"to_sheet,omitempty" bson:"to_sheet,omitempty" comment:"操作的表名"`
	ToRowId  string   `json:"to_row_id,omitempty" bson:"to_row_id,omitempty" comment:"行ID"`
	ToFields []ut.Kov `json:"to_fields,omitempty" bson:"to_fields,omitempty" comment:"字段内容"`
	Msg      string   `json:"msg,omitempty" bson:"msg,omitempty" comment:"消息"`
}

type Platform

type Platform struct {
	Name      string `json:"name,omitempty" bson:"name,omitempty" comment:"平台名称"`
	Id        string `json:"id,omitempty" bson:"id,omitempty" comment:"平台唯一ID"`
	NickName  string `json:"nick_name,omitempty" bson:"nick_name,omitempty" comment:"平台昵称"`
	AvatarUrl string `json:"avatar_url,omitempty" bson:"avatar_url,omitempty" comment:"平台头像"`
	Data      string `json:"data,omitempty" bson:"data,omitempty" comment:"平台数据"`
}

type RoleUpLoginReq

type RoleUpLoginReq struct {
	Id     string `json:"id" comment:"id" validate:"required,max=50"`
	Secret string `json:"secret" comment:"秘钥" validate:"required,max=50"`
	Role   string `json:"role" comment:"权限" validate:"required,max=50"`
}

type SchemaActionBase

type SchemaActionBase struct {
	Name                        string             `json:"name,omitempty"`                   // 动作名称 需要唯一
	Prefix                      string             `json:"prefix,omitempty"`                 // 前缀标识 仅展示用
	Types                       []uint             `json:"types,omitempty"`                  // 0 表可用 1 行可用
	Form                        *jsonschema.Schema `json:"form,omitempty"`                   // 若form为nil 则不会弹出表单填写
	MustSelect                  bool               `json:"must_select,omitempty"`            // 必须有所选择表选择适用 行是必须选一行
	TableEmptySelectUseAllSheet bool               `json:"table_empty_select_use_all_sheet"` // 表模式未选中行则默认是整表
	Conditions                  []ut.Kov           `json:"conditions,omitempty"`             // 选中/执行的前置条件 判断数据为选中的每一行数据 常用场景为 限定只有字段a=b时才可用或a!=b时 挨个执行 任意一个不成功都返回
	FaWarning                   bool               `json:"fa_warning,omitempty"`             // 是否弹出二次确认操作
}

func (*SchemaActionBase) AddCondition

func (s *SchemaActionBase) AddCondition(cond ut.Kov)

func (*SchemaActionBase) SetForm

func (s *SchemaActionBase) SetForm(raw any)

func (*SchemaActionBase) SetType

func (s *SchemaActionBase) SetType(tp []uint)

type SchemaBase

type SchemaBase struct {
	Group     string `json:"group,omitempty"`      // 组名
	Priority  int    `json:"priority,omitempty"`   // 在组下显示的优先级 越大越优先
	TableName string `json:"table_name,omitempty"` // 表名
	UniqueId  string `json:"unique_id,omitempty"`  // 唯一ID 默认生成sonyflakeId
	PathId    string `json:"path_id,omitempty"`    // 路径ID 默认取UniqueId 在加入backend时会自动修改
	RawName   string `json:"raw_name,omitempty"`   // 原始名称
	Alias     string `json:"alias,omitempty"`      // 别名 中文名
}

type SchemaGetResp

type SchemaGetResp struct {
	*ut.MongoFacetResult
	Page     int64          `json:"page,omitempty"`
	PageSize int64          `json:"page_size,omitempty"`
	Sorts    *ut.BaseSort   `json:"sorts,omitempty"`
	Filters  *ut.QueryParse `json:"filters,omitempty"`
}

type SchemaHooks

type SchemaHooks[T any] struct {
	CustomAddHandler func(ctx iris.Context, params pipe.ModelCtxMapperPack, model *SchemaModel[T]) error
	OnAddBefore      func(ctx iris.Context, args *pipe.RunResp[any], model *SchemaModel[T]) error                                      // 在新增之前
	OnAddAfter       func(ctx iris.Context, args *pipe.RunResp[map[string]any], model *SchemaModel[T]) error                           // 在新增之后
	OnGetBefore      func(ctx iris.Context, args *pipe.RunResp[*ut.QueryFull], params *pipe.ModelGetData, model *SchemaModel[T]) error // 在获取之前
	OnGetAfter       func(ctx iris.Context, args *pipe.RunResp[*ut.MongoFacetResult], model *SchemaModel[T]) error                     // 在获取之后
	OnEditBefore     func(ctx iris.Context)                                                                                            // 在修改之前
	OnEditAfter      func(ctx iris.Context)                                                                                            // 在修改之后
	OnDelBefore      func(ctx iris.Context)                                                                                            // 在删除之前
	OnDelAfter       func(ctx iris.Context)                                                                                            // 在删除之后
}

type SchemaIframe

type SchemaIframe struct {
	Url string `json:"url,omitempty"`
}

type SchemaModel

type SchemaModel[T any] struct {
	SchemaBase

	Roles         *SchemaRole         `json:"roles,omitempty"`
	Schemas       ManySchema          `json:"schemas"`
	Iframe        *SchemaIframe       `json:"iframe,omitempty"`
	TableDisable  *SchemaTableDisable `json:"table_disable,omitempty"`
	Actions       []ISchemaAction     `json:"actions,omitempty"`        // 各类操作
	DynamicFields []*DynamicField     `json:"dynamic_fields,omitempty"` // 动态字段

	WriteInsert  bool     `json:"write_insert,omitempty"`   // 是否把注入内容写入新增体
	PostMustKeys []string `json:"post_must_keys,omitempty"` // 新增时候必须存在的key

	Hooks SchemaHooks[T]
	// contains filtered or unexported fields
}

func NewSchemaModel

func NewSchemaModel[T any](raw T, db *qmgo.Database) *SchemaModel[T]

func (*SchemaModel[T]) ActionEntry

func (s *SchemaModel[T]) ActionEntry(ctx iris.Context)

func (*SchemaModel[T]) AddAction

func (s *SchemaModel[T]) AddAction(action ISchemaAction)

func (*SchemaModel[T]) AddDF

func (s *SchemaModel[T]) AddDF(id, name string, call DynamicCall)

func (*SchemaModel[T]) AddDynamicField

func (s *SchemaModel[T]) AddDynamicField(f *DynamicField)

func (*SchemaModel[T]) AddQueryContextInject

func (s *SchemaModel[T]) AddQueryContextInject(q ContextValueInject)

func (*SchemaModel[T]) AddQueryFilterInject

func (s *SchemaModel[T]) AddQueryFilterInject(fl *ut.Kov)

func (*SchemaModel[T]) DelHandler

func (s *SchemaModel[T]) DelHandler(ctx iris.Context, params pipe.ModelDelConfig) error

func (*SchemaModel[T]) DfIdFind

func (s *SchemaModel[T]) DfIdFind(id string) *DynamicField

func (*SchemaModel[T]) DynamicFieldsEntry

func (s *SchemaModel[T]) DynamicFieldsEntry(ctx iris.Context)

func (*SchemaModel[T]) GetAction

func (s *SchemaModel[T]) GetAction(name string) (ISchemaAction, bool)

func (*SchemaModel[T]) GetAllAction

func (s *SchemaModel[T]) GetAllAction() []ISchemaAction

func (*SchemaModel[T]) GetBase

func (s *SchemaModel[T]) GetBase() SchemaBase

func (*SchemaModel[T]) GetCollection

func (s *SchemaModel[T]) GetCollection() *qmgo.Collection

func (*SchemaModel[T]) GetContextUser

func (s *SchemaModel[T]) GetContextUser(ctx iris.Context) *SimpleUserModel

func (*SchemaModel[T]) GetDb

func (s *SchemaModel[T]) GetDb() *qmgo.Database

func (*SchemaModel[T]) GetHandler

func (s *SchemaModel[T]) GetHandler(ctx iris.Context, queryParams pipe.QueryParseConfig, getParams pipe.ModelGetData, uid string) error

GetHandler 仅获取数据

func (*SchemaModel[T]) GetRoles

func (s *SchemaModel[T]) GetRoles() *SchemaRole

func (*SchemaModel[T]) GetSchema

func (s *SchemaModel[T]) GetSchema(mode ISchemaMode) *jsonschema.Schema

func (*SchemaModel[T]) GetSelf

func (s *SchemaModel[T]) GetSelf() *SchemaModel[T]

func (*SchemaModel[T]) GetTableName

func (s *SchemaModel[T]) GetTableName() string

func (*SchemaModel[T]) HaveUserKey

func (s *SchemaModel[T]) HaveUserKey(schema *jsonschema.Schema) bool

func (*SchemaModel[T]) MarshalJSON

func (s *SchemaModel[T]) MarshalJSON() ([]byte, error)

func (*SchemaModel[T]) ParseInject

func (s *SchemaModel[T]) ParseInject(ctx iris.Context) ([]*ut.Kov, error)

func (*SchemaModel[T]) PostHandler

func (s *SchemaModel[T]) PostHandler(ctx iris.Context, params pipe.ModelCtxMapperPack) error

PostHandler 新增数据

func (*SchemaModel[T]) PutHandler

func (s *SchemaModel[T]) PutHandler(ctx iris.Context, params pipe.ModelPutConfig) error

func (*SchemaModel[T]) Registry

func (s *SchemaModel[T]) Registry(part iris.Party)

func (*SchemaModel[T]) RegistryConfigAction

func (s *SchemaModel[T]) RegistryConfigAction(p iris.Party)

func (*SchemaModel[T]) RegistryCrud

func (s *SchemaModel[T]) RegistryCrud(p iris.Party)

func (*SchemaModel[T]) SetFilterCanPass

func (s *SchemaModel[T]) SetFilterCanPass(filterCanPass func(ctx iris.Context, self *SchemaModel[T], query *ut.QueryFull) error)

func (*SchemaModel[T]) SetPathId

func (s *SchemaModel[T]) SetPathId(newId string)

func (*SchemaModel[T]) SetRaw

func (s *SchemaModel[T]) SetRaw(raw any)

func (*SchemaModel[T]) SetSchema

func (s *SchemaModel[T]) SetSchema(mode ISchemaMode, schema *jsonschema.Schema)

func (*SchemaModel[T]) SetSchemaRaw

func (s *SchemaModel[T]) SetSchemaRaw(mode ISchemaMode, raw any)

type SchemaModelAction

type SchemaModelAction[T, F any] struct {
	SchemaActionBase
	// contains filtered or unexported fields
}

SchemaModelAction 模型action T是模型数据 F是表单数据

func NewSchemaModelAction

func NewSchemaModelAction[T, F any]() *SchemaModelAction[T, F]

func (*SchemaModelAction[T, F]) Execute

func (s *SchemaModelAction[T, F]) Execute(ctx iris.Context, args any) (responseInfo any, err error)

func (*SchemaModelAction[T, F]) GetBase

func (s *SchemaModelAction[T, F]) GetBase() *SchemaActionBase

func (*SchemaModelAction[T, F]) SetCall

func (s *SchemaModelAction[T, F]) SetCall(call func(ctx iris.Context, args any) (responseInfo any, err error))

type SchemaRole

type SchemaRole struct {
	RoleGroup []string `json:"role_group"` // staff root
	NameGroup []string `json:"name_group"` // 自定义名称组
}

type SchemaTableDisable

type SchemaTableDisable struct {
	Read    bool `json:"read,omitempty"`
	Edit    bool `json:"edit,omitempty"`
	Del     bool `json:"del,omitempty"`
	Create  bool `json:"create,omitempty"`
	Actions bool `json:"actions,omitempty"`
}

type SimpleUserModel

type SimpleUserModel struct {
	pipe.GenericsAccount `bson:",inline"`
	// contains filtered or unexported fields
}

func NewUserModel

func NewUserModel(conn ...connectInfo) *SimpleUserModel

func (*SimpleUserModel) AddDb

func (c *SimpleUserModel) AddDb(mdb *qmgo.Database)

func (*SimpleUserModel) AddRbac

func (c *SimpleUserModel) AddRbac(rbac *pipe.RbacDomain)

func (*SimpleUserModel) AddRbacUseUri

func (c *SimpleUserModel) AddRbacUseUri(redisAddress, password string) bool

func (*SimpleUserModel) AddRdb

func (c *SimpleUserModel) AddRdb(rdb rueidis.Client)

func (*SimpleUserModel) CloneConn

func (c *SimpleUserModel) CloneConn() *connectInfo

func (*SimpleUserModel) Db

func (c *SimpleUserModel) Db() *qmgo.Database

func (*SimpleUserModel) FuzzGetUser

func (c *SimpleUserModel) FuzzGetUser(ctx context.Context, idOrName string) (*SimpleUserModel, error)

func (*SimpleUserModel) GenJwtToken

func (c *SimpleUserModel) GenJwtToken(ctx iris.Context, force bool) (string, error)

func (*SimpleUserModel) GetUid

func (c *SimpleUserModel) GetUid() string

func (*SimpleUserModel) GetUserItem

func (c *SimpleUserModel) GetUserItem(ctx context.Context, filter bson.M) (*SimpleUserModel, error)

func (*SimpleUserModel) LoginUseEmailHandler

func (c *SimpleUserModel) LoginUseEmailHandler() iris.Handler

func (*SimpleUserModel) LoginUseUserNameHandler

func (c *SimpleUserModel) LoginUseUserNameHandler() iris.Handler

func (*SimpleUserModel) Masking

func (c *SimpleUserModel) Masking(level int) *SimpleUserModel

Masking 数据脱敏 传入level 1隐藏号码 2隐藏余额

func (*SimpleUserModel) MustLoginMiddleware

func (c *SimpleUserModel) MustLoginMiddleware() iris.Handler

func (*SimpleUserModel) OpLog

func (c *SimpleUserModel) OpLog() *qmgo.Collection

func (*SimpleUserModel) RegistryUseUserNameHandler

func (c *SimpleUserModel) RegistryUseUserNameHandler() iris.Handler

func (*SimpleUserModel) RemoveUser

func (c *SimpleUserModel) RemoveUser(ctx context.Context, uid string) error

func (*SimpleUserModel) RoleSecret

func (c *SimpleUserModel) RoleSecret() string

func (*SimpleUserModel) RoleSetHandler

func (c *SimpleUserModel) RoleSetHandler() iris.Handler

func (*SimpleUserModel) SetConn

func (c *SimpleUserModel) SetConn(conn *connectInfo)

func (*SimpleUserModel) SetRole

func (c *SimpleUserModel) SetRole(ctx context.Context, filters bson.M, roleTarget string) error

func (*SimpleUserModel) SetRoleSecret

func (c *SimpleUserModel) SetRoleSecret(roleSecret string)

func (*SimpleUserModel) SetRoleUseEmail

func (c *SimpleUserModel) SetRoleUseEmail(ctx context.Context, email string, roleTarget string) error

func (*SimpleUserModel) SetRoleUsePhone

func (c *SimpleUserModel) SetRoleUsePhone(ctx context.Context, phone string, roleTarget string) error

func (*SimpleUserModel) SetRoleUseUid

func (c *SimpleUserModel) SetRoleUseUid(ctx context.Context, uid string, roleTarget string) error

func (*SimpleUserModel) SetRoleUseUserName

func (c *SimpleUserModel) SetRoleUseUserName(ctx context.Context, userName string, roleTarget string) error

func (*SimpleUserModel) SyncIndex

func (c *SimpleUserModel) SyncIndex(ctx context.Context) error

type UserModel

type UserModel interface {
	InjectDefault(mp map[string]any) error
	GetUid() string
}

type UserPasswordLoginReq

type UserPasswordLoginReq struct {
	UserName string `json:"user_name,omitempty" comment:"用户名" validate:"required,min=3,max=24"`
	Password string `json:"password,omitempty" comment:"密码" validate:"required,min=6,max=36"`
	Force    bool   `json:"force,omitempty" comment:"强制"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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