Documentation
¶
Index ¶
- Constants
- func NewDBEngine(databaseSetting *setting.DatabaseSettingS) (*gorm.DB, error)
- type AdminMenu
- func (m *AdminMenu) Create(ctx context.Context, db *gorm.DB) error
- func (m *AdminMenu) Delete(ctx context.Context, db *gorm.DB, id int) error
- func (m *AdminMenu) Get(ctx context.Context, db *gorm.DB) (*AdminMenu, error)
- func (m *AdminMenu) List(ctx context.Context, db *gorm.DB, params *dto.GetAdminMenuListRequest) ([]*AdminMenu, int64, error)
- func (m *AdminMenu) TableName() string
- func (m *AdminMenu) Update(ctx context.Context, db *gorm.DB) error
- type AdminRole
- func (m *AdminRole) Create(ctx context.Context, db *gorm.DB) error
- func (m *AdminRole) DeleteBatch(ctx context.Context, db *gorm.DB, ids []int64) error
- func (m *AdminRole) Get(ctx context.Context, db *gorm.DB, id int64) (*AdminRole, error)
- func (m *AdminRole) List(ctx context.Context, db *gorm.DB, params *dto.GetAdminRoleListRequest) ([]*AdminRole, int64, error)
- func (role *AdminRole) TableName() string
- func (m *AdminRole) Update(ctx context.Context, db *gorm.DB) error
- type AdminRoleMenu
- func (roleMenu *AdminRoleMenu) BatchCreate(ctx context.Context, db *gorm.DB, record []*AdminRoleMenu) (int64, error)
- func (roleMenu *AdminRoleMenu) Delete(ctx context.Context, db *gorm.DB) error
- func (roleMenu *AdminRoleMenu) List(ctx context.Context, db *gorm.DB) ([]*AdminRoleMenu, error)
- func (roleMenu *AdminRoleMenu) TableName() string
- type AdminUser
- func (a *AdminUser) Create(ctx context.Context, db *gorm.DB) (*AdminUser, error)
- func (m *AdminUser) Delete(ctx context.Context, db *gorm.DB, id int) error
- func (a *AdminUser) Get(ctx context.Context, db *gorm.DB) (*AdminUser, error)
- func (a *AdminUser) List(ctx context.Context, db *gorm.DB, params *dto.GetAdminUserListRequest) ([]*AdminUser, int64, error)
- func (a *AdminUser) TableName() string
- func (a *AdminUser) Update(ctx context.Context, db *gorm.DB) error
- type AdminUserRole
- type Link
- func (l *Link) Create(ctx context.Context, db *gorm.DB) error
- func (l *Link) Delete(ctx context.Context, db *gorm.DB, id int) error
- func (l *Link) Get(ctx context.Context, db *gorm.DB) (*Link, error)
- func (l *Link) List(ctx context.Context, db *gorm.DB, params *dto.GetLinkListRequest) ([]*Link, int64, error)
- func (l *Link) TableName() string
- func (l *Link) Update(ctx context.Context, db *gorm.DB) error
- type LoggerWriter
- type Model
- type MyTime
Constants ¶
View Source
const ( STATE_OPEN = 1 STATE_CLOSE = 0 )
Variables ¶
This section is empty.
Functions ¶
func NewDBEngine ¶
func NewDBEngine(databaseSetting *setting.DatabaseSettingS) (*gorm.DB, error)
Types ¶
type AdminMenu ¶
type AdminMenu struct { *Model Name string `gorm:"column:name;NOT NULL" json:"name"` // 菜单名称 Icon string `gorm:"column:icon" json:"icon"` // 图标 Url string `gorm:"column:url" json:"url"` // URL地址 Pid int `gorm:"column:pid;default:0;NOT NULL" json:"pid"` // 上级ID Type int `gorm:"column:type;default:0;NOT NULL" json:"type"` // 类型:1模块 2导航 3菜单 4节点 IsShow int `gorm:"column:is_show;default:1" json:"is_show"` // 是否显示:1显示 2不显示 Sort int `gorm:"column:sort" json:"sort"` // 显示顺序 Permission string `gorm:"column:permission" json:"permission"` // 权限标识 Remark string `gorm:"column:remark" json:"remark"` // 菜单备注 Status int `gorm:"column:status;default:1" json:"status"` // 状态1-在用 2-禁用 }
type AdminRole ¶
type AdminRole struct { *Model Name string `gorm:"column:name;NOT NULL" json:"name"` // 角色名称 Code string `gorm:"column:code;NOT NULL" json:"code"` // 角色编码 Sort int `gorm:"column:sort;default:0" json:"sort"` // 排序 Status int `gorm:"column:status;default:1" json:"status"` // 状态 1-启用2-禁用 }
func (*AdminRole) DeleteBatch ¶
DeleteBatch 批量删除
type AdminRoleMenu ¶
type AdminRoleMenu struct { *Model RoleId int `gorm:"column:role_id;default:0;NOT NULL" json:"role_id"` // 角色id MenuId int `gorm:"column:menu_id;default:0;NOT NULL" json:"menu_id"` // 菜单id }
func (*AdminRoleMenu) BatchCreate ¶
func (roleMenu *AdminRoleMenu) BatchCreate(ctx context.Context, db *gorm.DB, record []*AdminRoleMenu) (int64, error)
BatchCreate 批量创建
func (*AdminRoleMenu) List ¶
func (roleMenu *AdminRoleMenu) List(ctx context.Context, db *gorm.DB) ([]*AdminRoleMenu, error)
List 列表
func (*AdminRoleMenu) TableName ¶
func (roleMenu *AdminRoleMenu) TableName() string
type AdminUser ¶
type AdminUser struct { *Model Realname string `gorm:"column:realname;NOT NULL" json:"realname"` // 真实姓名 Username string `gorm:"column:username;NOT NULL" json:"username"` // 登录用户名 Gender int `gorm:"column:gender;default:0;NOT NULL" json:"gender"` // 性别:1男 2女 3保密 Avatar string `gorm:"column:avatar;NOT NULL" json:"avatar"` // 头像 Mobile string `gorm:"column:mobile;NOT NULL" json:"mobile"` // 手机号 Email string `gorm:"column:email;NOT NULL" json:"email"` // 邮箱地址 Address string `gorm:"column:address;NOT NULL" json:"address"` // 地址 Password string `gorm:"column:password;NOT NULL" json:"password"` // 登录密码 Salt string `gorm:"column:salt;NOT NULL" json:"salt"` // 盐加密 Intro string `gorm:"column:intro" json:"intro"` // 备注 Status int `gorm:"column:status;default:1;NOT NULL" json:"status"` // 状态:1正常 2禁用 LoginNum int `gorm:"column:login_num;default:0;NOT NULL" json:"login_num"` // 登录次数 LoginIp string `gorm:"column:login_ip;NOT NULL" json:"login_ip"` // 最近登录ip LoginTime int64 `gorm:"column:login_time;default:0;NOT NULL" json:"login_time"` // 最近登录时间 }
type AdminUserRole ¶
type AdminUserRole struct { *Model UserId int `gorm:"column:user_id;default:0;NOT NULL" json:"user_id"` // 用户id RoleId int `gorm:"column:role_id;default:0;NOT NULL" json:"role_id"` // 角色id }
func (*AdminUserRole) BatchCreate ¶
func (userRole *AdminUserRole) BatchCreate(ctx context.Context, db *gorm.DB, record []*AdminUserRole) (int64, error)
BatchCreate 批量创建
func (*AdminUserRole) TableName ¶
func (userRole *AdminUserRole) TableName() string
type Link ¶
type Link struct { *Model Name string `gorm:"column:name;NOT NULL" json:"name"` // 友链名称 Url string `gorm:"column:url;NOT NULL" json:"url"` // 友链地址 Image string `gorm:"column:image" json:"image"` // logo Status int `gorm:"column:status;default:1;NOT NULL" json:"status"` // 状态 1-启用 2-禁用 Sort int `gorm:"column:sort;default:0;NOT NULL" json:"sort"` // 排序 }
type LoggerWriter ¶
type LoggerWriter struct {
// contains filtered or unexported fields
}
func (*LoggerWriter) New ¶
func (lw *LoggerWriter) New(loggerLevel logger.LogLevel) LoggerWriter
func (LoggerWriter) Printf ¶
func (lw LoggerWriter) Printf(msg string, v ...interface{})
type Model ¶
type MyTime ¶
MyTime 自定义时间
func (MyTime) MarshalJSON ¶
func (*MyTime) MyTime2Date ¶
func (*MyTime) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.