Documentation ¶
Index ¶
- Variables
- type APIDeleteMultiple
- type Api
- type ApiModel
- type CasbinRule
- type CasbinRuleModel
- type Menu
- type MenuModel
- type Option
- type Options
- type PagingAPIList
- type PagingUserList
- type Role
- type RoleMenu
- type RoleMenuModel
- type RoleModel
- type User
- type UserMenuParams
- type UserMenuParamsModel
- type UserModel
- type UserPageSet
- type UserPageSetModel
- type UserRole
- type UserRoleModel
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = sqlx.ErrNotFound
Functions ¶
This section is empty.
Types ¶
type APIDeleteMultiple ¶
type ApiModel ¶
type ApiModel interface { Trans(ctx context.Context, fn func(ctx context.Context, session sqlx.Session) error) error Total_NC(ctx context.Context, r *PagingAPIList) (int64, error) FindAll_NC(ctx context.Context) ([]Api, error) FindPaging_NC(ctx context.Context, r *PagingAPIList) ([]Api, error) TransUpdate(ctx context.Context, session sqlx.Session, newData *Api) error TransDeleteMultiple(ctx context.Context, session sqlx.Session, deleteMul []APIDeleteMultiple) error // contains filtered or unexported methods }
ApiModel is an interface to be customized, add more methods here, and implement the added methods in customApiModel.
type CasbinRule ¶
type CasbinRuleModel ¶
type CasbinRuleModel interface { TransUpdateV2V3(ctx context.Context, session sqlx.Session, newdata *Api, oldData *Api) error TransDeleteMultiple(ctx context.Context, session sqlx.Session, deleteMul []APIDeleteMultiple) error TransDeleteByV0(ctx context.Context, session sqlx.Session, roleid uint64) error // contains filtered or unexported methods }
CasbinRuleModel is an interface to be customized, add more methods here, and implement the added methods in customCasbinRuleModel.
func NewCasbinRuleModel ¶
func NewCasbinRuleModel(conn sqlx.SqlConn) CasbinRuleModel
NewCasbinRuleModel returns a model for the database table.
type Menu ¶
type Menu struct { Id uint64 `db:"id"` ParentId uint64 `db:"parent_id"` // 父菜单ID Name string `db:"name"` // 路由name Path string `db:"path"` // 路由path Component string `db:"component"` // 对应前端文件路径 Title string `db:"title"` // 附加属性 Icon string `db:"icon"` // 附加属性 Sort int64 `db:"sort"` // 排序 Hidden int64 `db:"hidden"` // 是否隐藏 0 false/1 true CreateTime time.Time `db:"create_time"` UpdateTime time.Time `db:"update_time"` DeleteTime sql.NullTime `db:"delete_time"` }
type MenuModel ¶
type MenuModel interface { Trans(ctx context.Context, fn func(ctx context.Context, session sqlx.Session) error) error FindAll_NC(ctx context.Context) ([]Menu, error) FindByParentID_NC(ctx context.Context, parentid uint64) ([]Menu, error) TransDelete(ctx context.Context, session sqlx.Session, id uint64) error // contains filtered or unexported methods }
MenuModel is an interface to be customized, add more methods here, and implement the added methods in customMenuModel.
type PagingAPIList ¶
type PagingUserList ¶
type Role ¶
type Role struct { Id uint64 `db:"id"` Role string `db:"role"` // 用户角色 Name string `db:"name"` CreateBy string `db:"create_by"` CreateTime time.Time `db:"create_time"` UpdateBy string `db:"update_by"` UpdateTime time.Time `db:"update_time"` DeleteBy string `db:"delete_by"` DeleteTime sql.NullTime `db:"delete_time"` }
type RoleMenuModel ¶
type RoleMenuModel interface { Trans(ctx context.Context, fn func(ctx context.Context, session sqlx.Session) error) error FindByMenuID_NC(ctx context.Context, menuid uint64) ([]RoleMenu, error) FindByRoleID(ctx context.Context, redis *redis.Redis, roleID uint64) ([]RoleMenu, error) TransDeleteByMenuId(ctx context.Context, session sqlx.Session, menuid uint64) error TransDeleteByRoleId(ctx context.Context, session sqlx.Session, roleid uint64) error TransReplaceByMenus(ctx context.Context, session sqlx.Session, roleid uint64, menuIDs []uint64) error }
RoleMenuModel is an interface to be customized, add more methods here, and implement the added methods in customRoleMenuModel.
func NewRoleMenuModel ¶
func NewRoleMenuModel(conn sqlx.SqlConn, c cache.CacheConf) RoleMenuModel
NewRoleMenuModel returns a model for the database table.
type RoleModel ¶
type RoleModel interface { FindAll_NC(ctx context.Context) ([]Role, error) Trans(ctx context.Context, fn func(ctx context.Context, session sqlx.Session) error) error TransDelete(ctx context.Context, session sqlx.Session, id uint64) error UpdateDeleteColumn(ctx context.Context, roleid uint64, deleteby string, deletetime sql.NullTime) error // contains filtered or unexported methods }
RoleModel is an interface to be customized, add more methods here, and implement the added methods in customRoleModel.
type User ¶
type User struct { Id uint64 `db:"id"` Name string `db:"name"` // 用户名 NickName string `db:"nick_name"` // 中文名 Password string `db:"password"` // 密码 Type int64 `db:"type"` // 账户类型 0-本地用户 1-ldap用户 Email string `db:"email"` // 邮箱 Phone string `db:"phone"` // 电话 Department string `db:"department"` // 部门 Position string `db:"position"` // 职位 CurrentRole uint64 `db:"current_role"` // 当前用户角色 CreateBy string `db:"create_by"` // 创建人 CreateTime time.Time `db:"create_time"` // 创建时间 UpdateBy string `db:"update_by"` // 更新人 UpdateTime time.Time `db:"update_time"` // 更新时间 DeleteBy string `db:"delete_by"` // 删除人 DeleteTime sql.NullTime `db:"delete_time"` // 删除时间 PageSetId sql.NullInt64 `db:"page_set_id"` }
type UserMenuParams ¶
type UserMenuParamsModel ¶
type UserMenuParamsModel interface { FindAll_NC(ctx context.Context) ([]UserMenuParams, error) Trans(ctx context.Context, fn func(ctx context.Context, session sqlx.Session) error) error FindByUserID(ctx context.Context, redis *redis.Redis, userid uint64) ([]UserMenuParams, error) InsertMultiple(ctx context.Context, data []*UserMenuParams) (sql.Result, error) DeleteByMenuID(ctx context.Context, menuid uint64) error TransDeleteByMenuID(ctx context.Context, session sqlx.Session, menuid uint64) error TransDeleteByUserID(ctx context.Context, session sqlx.Session, userid uint64) error TransInsertMultiple(ctx context.Context, session sqlx.Session, data []*UserMenuParams) (sql.Result, error) TransDeleteNotINANDMenuID(ctx context.Context, session sqlx.Session, data []*UserMenuParams, menuid uint64) error TransUpdate(ctx context.Context, session sqlx.Session, data *UserMenuParams) error }
UserMenuParamsModel is an interface to be customized, add more methods here, and implement the added methods in customUserMenuParamsModel.
func NewUserMenuParamsModel ¶
func NewUserMenuParamsModel(conn sqlx.SqlConn, c cache.CacheConf) UserMenuParamsModel
NewUserMenuParamsModel returns a model for the database table.
type UserModel ¶
type UserModel interface { TransCtx(ctx context.Context, fn func(ctx context.Context, session sqlx.Session) error) error FindPagingList_NC(ctx context.Context, r *PagingUserList) ([]User, error) FindAll_NC(ctx context.Context) ([]User, error) Total_NC(ctx context.Context) (int64, error) FindOneByNameWHEREDeleteTimeISNULL(ctx context.Context, name string) (*User, error) UpdateUserPassword(ctx context.Context, id uint64, pass string) error UpdateDeleteColumn(ctx context.Context, userid uint64, deleteby string, deletetime sql.NullTime) error UpdateWithOutPassword(ctx context.Context, newData *User) error UpdateCurrentRoleColumn(ctx context.Context, userid uint64, roleid uint64) error TransInsert(ctx context.Context, session sqlx.Session, data *User) (sql.Result, error) TransDelete(ctx context.Context, session sqlx.Session, id uint64) error // contains filtered or unexported methods }
UserModel is an interface to be customized, add more methods here, and implement the added methods in customUserModel.
type UserPageSet ¶
type UserPageSet struct { Id uint64 `db:"id"` UserId uint64 `db:"user_id"` Avatar string `db:"avatar"` // 头像 DefaultRouter string `db:"default_router"` // 默认路由 SideMode string `db:"side_mode"` // side颜色 TextColor string `db:"text_color"` // 文本颜色 ActiveTextColor string `db:"active_text_color"` // 选中路由文本颜色 }
type UserPageSetModel ¶
type UserPageSetModel interface { TransDeleteByUserID(ctx context.Context, session sqlx.Session, userid uint64) error // contains filtered or unexported methods }
UserPageSetModel is an interface to be customized, add more methods here, and implement the added methods in customUserPageSetModel.
func NewUserPageSetModel ¶
func NewUserPageSetModel(conn sqlx.SqlConn, c cache.CacheConf) UserPageSetModel
NewUserPageSetModel returns a model for the database table.
type UserRoleModel ¶
type UserRoleModel interface { TransCtx(ctx context.Context, fn func(ctx context.Context, session sqlx.Session) error) error FindByUserIDWhereRoleNotDel(ctx context.Context, redis *redis.Redis, userID uint64) ([]UserRole, error) TranInsertUserIDRoleIDs(ctx context.Context, session sqlx.Session, userID uint64, role_id_s []uint64) (sql.Result, error) TransDeleteByUserID(ctx context.Context, session sqlx.Session, userID uint64) error TransDeleteByRoleID(ctx context.Context, session sqlx.Session, roleID uint64) error }
UserRoleModel is an interface to be customized, add more methods here, and implement the added methods in customUserRoleModel.
func NewUserRoleModel ¶
func NewUserRoleModel(conn sqlx.SqlConn, c cache.CacheConf) UserRoleModel
NewUserRoleModel returns a model for the database table.
Source Files ¶
- apimodel.go
- apimodel_gen.go
- casbinrulemodel.go
- casbinrulemodel_gen.go
- cusumeCache.go
- menumodel.go
- menumodel_gen.go
- rolemenumodel.go
- rolemenumodel_gen.go
- rolemodel.go
- rolemodel_gen.go
- usermenuparamsmodel.go
- usermenuparamsmodel_gen.go
- usermodel.go
- usermodel_gen.go
- userpagesetmodel.go
- userpagesetmodel_gen.go
- userrolemodel.go
- userrolemodel_gen.go
- vars.go