Documentation
¶
Index ¶
- func Check(ctx context.Context, db *gorm.DB) (bool, error)
- func ExecTrans(ctx context.Context, db *gorm.DB, fn TransFunc) error
- func ExecTransWithLock(ctx context.Context, db *gorm.DB, fn TransFunc) error
- func FindOne(ctx context.Context, db *gorm.DB, out interface{}) (bool, error)
- func FindPage(ctx context.Context, db *gorm.DB, pp dao.PaginationParam, out interface{}) (int, error)
- func ParseOrder(items []*dao.OrderField, handle ...OrderFieldFunc) string
- func WrapPageQuery(ctx context.Context, db *gorm.DB, pp dao.PaginationParam, out interface{}) (*dao.PaginationResult, error)
- type Login
- func (a *Login) DestroyToken(ctx context.Context, tokenString string) error
- func (a *Login) GenerateToken(ctx context.Context, userID string) (*stypes.LoginTokenInfo, error)
- func (a *Login) GetCaptcha(ctx context.Context, length int) (*stypes.LoginCaptcha, error)
- func (a *Login) GetLoginInfo(ctx context.Context, userID string) (*stypes.UserLoginInfo, error)
- func (a *Login) ResCaptcha(ctx context.Context, w http.ResponseWriter, captchaID string, ...) error
- func (a *Login) UpdatePassword(ctx context.Context, userID string, params stypes.UpdatePasswordParam) error
- func (a *Login) Verify(ctx context.Context, userName, password string) (*stypes.User, error)
- type OrderFieldFunc
- type Trans
- type TransFunc
- type User
- func (u *User) Create(ctx context.Context, item types2.User) error
- func (u *User) Delete(ctx context.Context, recordID string) error
- func (u *User) Get(ctx context.Context, recordID string, opts ...types2.UserQueryOptions) (*types2.User, error)
- func (u *User) Query(ctx context.Context, params types2.UserQueryParam, ...) (*types2.UserQueryResult, error)
- func (u *User) Update(ctx context.Context, recordID string, item types2.User) error
- func (u *User) UpdatePassword(ctx context.Context, recordID, password string) error
- func (u *User) UpdateStatus(ctx context.Context, recordID string, status int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecTransWithLock ¶
ExecTransWithLock 执行事务(加锁)
func FindPage ¶
func FindPage(ctx context.Context, db *gorm.DB, pp dao.PaginationParam, out interface{}) (int, error)
FindPage 查询分页数据
func ParseOrder ¶
func ParseOrder(items []*dao.OrderField, handle ...OrderFieldFunc) string
ParseOrder 解析排序字段
func WrapPageQuery ¶
func WrapPageQuery(ctx context.Context, db *gorm.DB, pp dao.PaginationParam, out interface{}) (*dao.PaginationResult, error)
WrapPageQuery 包装带有分页的查询
Types ¶
type Login ¶
Login 登录管理
func (*Login) DestroyToken ¶
DestroyToken 销毁令牌
func (*Login) GenerateToken ¶
GenerateToken 生成令牌
func (*Login) GetCaptcha ¶
GetCaptcha 获取图形验证码信息
func (*Login) GetLoginInfo ¶
GetLoginInfo 获取当前用户登录信息
func (*Login) ResCaptcha ¶
func (a *Login) ResCaptcha(ctx context.Context, w http.ResponseWriter, captchaID string, width, height int) error
ResCaptcha 生成并响应图形验证码
func (*Login) UpdatePassword ¶
func (a *Login) UpdatePassword(ctx context.Context, userID string, params stypes.UpdatePasswordParam) error
UpdatePassword 更新当前用户登录密码
type User ¶
User 用户存储
func (*User) Get ¶
func (u *User) Get(ctx context.Context, recordID string, opts ...types2.UserQueryOptions) (*types2.User, error)
Get 查询指定数据
func (*User) Query ¶
func (u *User) Query(ctx context.Context, params types2.UserQueryParam, opts ...types2.UserQueryOptions) (*types2.UserQueryResult, error)
Query 查询数据
func (*User) UpdatePassword ¶
UpdatePassword 更新密码
Click to show internal directories.
Click to hide internal directories.