Documentation ¶
Index ¶
- Variables
- type AdColumns
- type AdDao
- type AdSortColumns
- type AdSortDao
- func (dao *AdSortDao) Columns() AdSortColumns
- func (dao *AdSortDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *AdSortDao) DB() gdb.DB
- func (dao *AdSortDao) Group() string
- func (dao *AdSortDao) Table() string
- func (dao *AdSortDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type CityColumns
- type CityDao
- func (dao *CityDao) Columns() CityColumns
- func (dao *CityDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *CityDao) DB() gdb.DB
- func (dao *CityDao) Group() string
- func (dao *CityDao) Table() string
- func (dao *CityDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type ConfigColumns
- type ConfigDao
- func (dao *ConfigDao) Columns() ConfigColumns
- func (dao *ConfigDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *ConfigDao) DB() gdb.DB
- func (dao *ConfigDao) Group() string
- func (dao *ConfigDao) Table() string
- func (dao *ConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type ConfigDataColumns
- type ConfigDataDao
- func (dao *ConfigDataDao) Columns() ConfigDataColumns
- func (dao *ConfigDataDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *ConfigDataDao) DB() gdb.DB
- func (dao *ConfigDataDao) Group() string
- func (dao *ConfigDataDao) Table() string
- func (dao *ConfigDataDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type DeptColumns
- type DeptDao
- func (dao *DeptDao) Columns() DeptColumns
- func (dao *DeptDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *DeptDao) DB() gdb.DB
- func (dao *DeptDao) Group() string
- func (dao *DeptDao) Table() string
- func (dao *DeptDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type DictColumns
- type DictDao
- func (dao *DictDao) Columns() DictColumns
- func (dao *DictDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *DictDao) DB() gdb.DB
- func (dao *DictDao) Group() string
- func (dao *DictDao) Table() string
- func (dao *DictDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type DictDataColumns
- type DictDataDao
- func (dao *DictDataDao) Columns() DictDataColumns
- func (dao *DictDataDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *DictDataDao) DB() gdb.DB
- func (dao *DictDataDao) Group() string
- func (dao *DictDataDao) Table() string
- func (dao *DictDataDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type ExampleColumns
- type ExampleDao
- func (dao *ExampleDao) Columns() ExampleColumns
- func (dao *ExampleDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *ExampleDao) DB() gdb.DB
- func (dao *ExampleDao) Group() string
- func (dao *ExampleDao) Table() string
- func (dao *ExampleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type ItemCateColumns
- type ItemCateDao
- func (dao *ItemCateDao) Columns() ItemCateColumns
- func (dao *ItemCateDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *ItemCateDao) DB() gdb.DB
- func (dao *ItemCateDao) Group() string
- func (dao *ItemCateDao) Table() string
- func (dao *ItemCateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type ItemColumns
- type ItemDao
- func (dao *ItemDao) Columns() ItemColumns
- func (dao *ItemDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *ItemDao) DB() gdb.DB
- func (dao *ItemDao) Group() string
- func (dao *ItemDao) Table() string
- func (dao *ItemDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type LevelColumns
- type LevelDao
- func (dao *LevelDao) Columns() LevelColumns
- func (dao *LevelDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *LevelDao) DB() gdb.DB
- func (dao *LevelDao) Group() string
- func (dao *LevelDao) Table() string
- func (dao *LevelDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type LinkColumns
- type LinkDao
- func (dao *LinkDao) Columns() LinkColumns
- func (dao *LinkDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *LinkDao) DB() gdb.DB
- func (dao *LinkDao) Group() string
- func (dao *LinkDao) Table() string
- func (dao *LinkDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type LoginLogColumns
- type LoginLogDao
- func (d *LoginLogDao) All(where ...interface{}) ([]*model.LoginLog, error)
- func (d *LoginLogDao) And(where interface{}, args ...interface{}) *LoginLogDao
- func (d *LoginLogDao) Args(args ...interface{}) *LoginLogDao
- func (d *LoginLogDao) As(as string) *LoginLogDao
- func (d *LoginLogDao) Batch(batch int) *LoginLogDao
- func (d *LoginLogDao) Cache(duration time.Duration, name ...string) *LoginLogDao
- func (d *LoginLogDao) Chunk(limit int, callback func(entities []*model.LoginLog, err error) bool)
- func (d *LoginLogDao) Ctx(ctx context.Context) *LoginLogDao
- func (d *LoginLogDao) Data(data ...interface{}) *LoginLogDao
- func (d *LoginLogDao) Fields(fieldNamesOrMapStruct ...interface{}) *LoginLogDao
- func (d *LoginLogDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *LoginLogDao
- func (d *LoginLogDao) Filter() *LoginLogDao
- func (d *LoginLogDao) FindAll(where ...interface{}) ([]*model.LoginLog, error)
- func (d *LoginLogDao) FindOne(where ...interface{}) (*model.LoginLog, error)
- func (d *LoginLogDao) Group(groupBy string) *LoginLogDao
- func (d *LoginLogDao) InnerJoin(table ...string) *LoginLogDao
- func (d *LoginLogDao) LeftJoin(table ...string) *LoginLogDao
- func (d *LoginLogDao) Limit(limit ...int) *LoginLogDao
- func (d *LoginLogDao) LockShared() *LoginLogDao
- func (d *LoginLogDao) LockUpdate() *LoginLogDao
- func (d *LoginLogDao) Master() *LoginLogDao
- func (d *LoginLogDao) Offset(offset int) *LoginLogDao
- func (d *LoginLogDao) OmitEmpty() *LoginLogDao
- func (d *LoginLogDao) One(where ...interface{}) (*model.LoginLog, error)
- func (d *LoginLogDao) Option(option int) *LoginLogDao
- func (d *LoginLogDao) Or(where interface{}, args ...interface{}) *LoginLogDao
- func (d *LoginLogDao) Order(orderBy ...string) *LoginLogDao
- func (d *LoginLogDao) Page(page, limit int) *LoginLogDao
- func (d *LoginLogDao) RightJoin(table ...string) *LoginLogDao
- func (d *LoginLogDao) Scan(pointer interface{}, where ...interface{}) error
- func (d *LoginLogDao) Slave() *LoginLogDao
- func (d *LoginLogDao) Struct(pointer interface{}, where ...interface{}) error
- func (d *LoginLogDao) Structs(pointer interface{}, where ...interface{}) error
- func (d *LoginLogDao) TX(tx *gdb.TX) *LoginLogDao
- func (d *LoginLogDao) Unscoped() *LoginLogDao
- func (d *LoginLogDao) Where(where interface{}, args ...interface{}) *LoginLogDao
- func (d *LoginLogDao) WherePri(where interface{}, args ...interface{}) *LoginLogDao
- type MemberColumns
- type MemberDao
- func (dao *MemberDao) Columns() MemberColumns
- func (dao *MemberDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *MemberDao) DB() gdb.DB
- func (dao *MemberDao) Group() string
- func (dao *MemberDao) Table() string
- func (dao *MemberDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type MemberLevelColumns
- type MemberLevelDao
- func (dao *MemberLevelDao) Columns() MemberLevelColumns
- func (dao *MemberLevelDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *MemberLevelDao) DB() gdb.DB
- func (dao *MemberLevelDao) Group() string
- func (dao *MemberLevelDao) Table() string
- func (dao *MemberLevelDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type MenuColumns
- type MenuDao
- func (d *MenuDao) All(where ...interface{}) ([]*model.Menu, error)
- func (d *MenuDao) And(where interface{}, args ...interface{}) *MenuDao
- func (d *MenuDao) Args(args ...interface{}) *MenuDao
- func (d *MenuDao) As(as string) *MenuDao
- func (d *MenuDao) Batch(batch int) *MenuDao
- func (d *MenuDao) Cache(duration time.Duration, name ...string) *MenuDao
- func (d *MenuDao) Chunk(limit int, callback func(entities []*model.Menu, err error) bool)
- func (dao *MenuDao) Columnsx() MenuColumns
- func (d *MenuDao) Ctx(ctx context.Context) *MenuDao
- func (dao *MenuDao) CtxO(ctx context.Context) *gdb.Model
- func (dao *MenuDao) DBO() gdb.DB
- func (d *MenuDao) Data(data ...interface{}) *MenuDao
- func (d *MenuDao) Fields(fieldNamesOrMapStruct ...interface{}) *MenuDao
- func (d *MenuDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *MenuDao
- func (d *MenuDao) Filter() *MenuDao
- func (d *MenuDao) FindAll(where ...interface{}) ([]*model.Menu, error)
- func (d *MenuDao) FindOne(where ...interface{}) (*model.Menu, error)
- func (d *MenuDao) Group(groupBy string) *MenuDao
- func (d *MenuDao) InnerJoin(table ...string) *MenuDao
- func (d *MenuDao) LeftJoin(table ...string) *MenuDao
- func (d *MenuDao) Limit(limit ...int) *MenuDao
- func (d *MenuDao) LockShared() *MenuDao
- func (d *MenuDao) LockUpdate() *MenuDao
- func (d *MenuDao) Master() *MenuDao
- func (d *MenuDao) Offset(offset int) *MenuDao
- func (d *MenuDao) OmitEmpty() *MenuDao
- func (d *MenuDao) One(where ...interface{}) (*model.Menu, error)
- func (d *MenuDao) Option(option int) *MenuDao
- func (d *MenuDao) Or(where interface{}, args ...interface{}) *MenuDao
- func (d *MenuDao) Order(orderBy ...string) *MenuDao
- func (d *MenuDao) Page(page, limit int) *MenuDao
- func (d *MenuDao) RightJoin(table ...string) *MenuDao
- func (d *MenuDao) Scan(pointer interface{}, where ...interface{}) error
- func (d *MenuDao) Slave() *MenuDao
- func (d *MenuDao) Struct(pointer interface{}, where ...interface{}) error
- func (d *MenuDao) Structs(pointer interface{}, where ...interface{}) error
- func (d *MenuDao) TX(tx *gdb.TX) *MenuDao
- func (d *MenuDao) Unscoped() *MenuDao
- func (d *MenuDao) Where(where interface{}, args ...interface{}) *MenuDao
- func (d *MenuDao) WherePri(where interface{}, args ...interface{}) *MenuDao
- type NoticeColumns
- type NoticeDao
- func (dao *NoticeDao) Columns() NoticeColumns
- func (dao *NoticeDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *NoticeDao) DB() gdb.DB
- func (dao *NoticeDao) Group() string
- func (dao *NoticeDao) Table() string
- func (dao *NoticeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type OperLogColumns
- type OperLogDao
- func (d *OperLogDao) All(where ...interface{}) ([]*model.OperLog, error)
- func (d *OperLogDao) And(where interface{}, args ...interface{}) *OperLogDao
- func (d *OperLogDao) Args(args ...interface{}) *OperLogDao
- func (d *OperLogDao) As(as string) *OperLogDao
- func (d *OperLogDao) Batch(batch int) *OperLogDao
- func (d *OperLogDao) Cache(duration time.Duration, name ...string) *OperLogDao
- func (d *OperLogDao) Chunk(limit int, callback func(entities []*model.OperLog, err error) bool)
- func (d *OperLogDao) Ctx(ctx context.Context) *OperLogDao
- func (d *OperLogDao) Data(data ...interface{}) *OperLogDao
- func (d *OperLogDao) Fields(fieldNamesOrMapStruct ...interface{}) *OperLogDao
- func (d *OperLogDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *OperLogDao
- func (d *OperLogDao) Filter() *OperLogDao
- func (d *OperLogDao) FindAll(where ...interface{}) ([]*model.OperLog, error)
- func (d *OperLogDao) FindOne(where ...interface{}) (*model.OperLog, error)
- func (d *OperLogDao) Group(groupBy string) *OperLogDao
- func (d *OperLogDao) InnerJoin(table ...string) *OperLogDao
- func (d *OperLogDao) LeftJoin(table ...string) *OperLogDao
- func (d *OperLogDao) Limit(limit ...int) *OperLogDao
- func (d *OperLogDao) LockShared() *OperLogDao
- func (d *OperLogDao) LockUpdate() *OperLogDao
- func (d *OperLogDao) Master() *OperLogDao
- func (d *OperLogDao) Offset(offset int) *OperLogDao
- func (d *OperLogDao) OmitEmpty() *OperLogDao
- func (d *OperLogDao) One(where ...interface{}) (*model.OperLog, error)
- func (d *OperLogDao) Option(option int) *OperLogDao
- func (d *OperLogDao) Or(where interface{}, args ...interface{}) *OperLogDao
- func (d *OperLogDao) Order(orderBy ...string) *OperLogDao
- func (d *OperLogDao) Page(page, limit int) *OperLogDao
- func (d *OperLogDao) RightJoin(table ...string) *OperLogDao
- func (d *OperLogDao) Scan(pointer interface{}, where ...interface{}) error
- func (d *OperLogDao) Slave() *OperLogDao
- func (d *OperLogDao) Struct(pointer interface{}, where ...interface{}) error
- func (d *OperLogDao) Structs(pointer interface{}, where ...interface{}) error
- func (d *OperLogDao) TX(tx *gdb.TX) *OperLogDao
- func (d *OperLogDao) Unscoped() *OperLogDao
- func (d *OperLogDao) Where(where interface{}, args ...interface{}) *OperLogDao
- func (d *OperLogDao) WherePri(where interface{}, args ...interface{}) *OperLogDao
- type PositionColumns
- type PositionDao
- func (dao *PositionDao) Columns() PositionColumns
- func (dao *PositionDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *PositionDao) DB() gdb.DB
- func (dao *PositionDao) Group() string
- func (dao *PositionDao) Table() string
- func (dao *PositionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type RoleColumns
- type RoleDao
- func (dao *RoleDao) Columns() RoleColumns
- func (dao *RoleDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *RoleDao) DB() gdb.DB
- func (dao *RoleDao) Group() string
- func (dao *RoleDao) Table() string
- func (dao *RoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type RoleMenuColumns
- type RoleMenuDao
- func (dao *RoleMenuDao) Columns() RoleMenuColumns
- func (dao *RoleMenuDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *RoleMenuDao) DB() gdb.DB
- func (dao *RoleMenuDao) Group() string
- func (dao *RoleMenuDao) Table() string
- func (dao *RoleMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- type UserColumns
- type UserDao
- func (d *UserDao) All(where ...interface{}) ([]*model.User, error)
- func (d *UserDao) And(where interface{}, args ...interface{}) *UserDao
- func (d *UserDao) Args(args ...interface{}) *UserDao
- func (d *UserDao) As(as string) *UserDao
- func (d *UserDao) Batch(batch int) *UserDao
- func (d *UserDao) Cache(duration time.Duration, name ...string) *UserDao
- func (d *UserDao) Chunk(limit int, callback func(entities []*model.User, err error) bool)
- func (d *UserDao) Ctx(ctx context.Context) *UserDao
- func (dao *UserDao) Ctxo(ctx context.Context) *gdb.Model
- func (dao *UserDao) DBO() gdb.DB
- func (d *UserDao) Data(data ...interface{}) *UserDao
- func (d *UserDao) Fields(fieldNamesOrMapStruct ...interface{}) *UserDao
- func (d *UserDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *UserDao
- func (d *UserDao) Filter() *UserDao
- func (d *UserDao) FindAll(where ...interface{}) ([]*model.User, error)
- func (d *UserDao) FindOne(where ...interface{}) (*model.User, error)
- func (d *UserDao) Group(groupBy string) *UserDao
- func (d *UserDao) InnerJoin(table ...string) *UserDao
- func (d *UserDao) LeftJoin(table ...string) *UserDao
- func (d *UserDao) Limit(limit ...int) *UserDao
- func (d *UserDao) LockShared() *UserDao
- func (d *UserDao) LockUpdate() *UserDao
- func (d *UserDao) Master() *UserDao
- func (d *UserDao) Offset(offset int) *UserDao
- func (d *UserDao) OmitEmpty() *UserDao
- func (d *UserDao) One(where ...interface{}) (*model.User, error)
- func (d *UserDao) Option(option int) *UserDao
- func (d *UserDao) Or(where interface{}, args ...interface{}) *UserDao
- func (d *UserDao) Order(orderBy ...string) *UserDao
- func (d *UserDao) Page(page, limit int) *UserDao
- func (d *UserDao) RightJoin(table ...string) *UserDao
- func (d *UserDao) Scan(pointer interface{}, where ...interface{}) error
- func (d *UserDao) Slave() *UserDao
- func (d *UserDao) Struct(pointer interface{}, where ...interface{}) error
- func (d *UserDao) Structs(pointer interface{}, where ...interface{}) error
- func (d *UserDao) TX(tx *gdb.TX) *UserDao
- func (dao *UserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
- func (d *UserDao) Unscoped() *UserDao
- func (d *UserDao) Where(where interface{}, args ...interface{}) *UserDao
- func (d *UserDao) WherePri(where interface{}, args ...interface{}) *UserDao
- type UserRoleColumns
- type UserRoleDao
- func (dao *UserRoleDao) Columns() UserRoleColumns
- func (dao *UserRoleDao) Ctx(ctx context.Context) *gdb.Model
- func (dao *UserRoleDao) DB() gdb.DB
- func (dao *UserRoleDao) Group() string
- func (dao *UserRoleDao) Table() string
- func (dao *UserRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( MenuColumnsX = MenuColumns{} Menu = MenuDao{ M: g.DB("default").Model("sys_menu").Safe(), DB: g.DB("default"), Table: "sys_menu", Columns: MenuColumns{ Id: "id", ParentId: "parent_id", Title: "title", Icon: "icon", Path: "path", Component: "component", Target: "target", Permission: "permission", Type: "type", Method: "method", Status: "status", Hide: "hide", Note: "note", Sort: "sort", CreateUser: "create_user", CreateTime: "create_time", UpdateUser: "update_user", UpdateTime: "update_time", Mark: "mark", }, } )
MenuColumns holds the columns for table sys_menu.
var ( UserColumn = UserColumns{} User = UserDao{ M: g.DB("default").Model("sys_user").Safe(), DB: g.DB("default"), Table: "sys_user", Columns: UserColumns{ Id: "id", Realname: "realname", Nickname: "nickname", Gender: "gender", Avatar: "avatar", Mobile: "mobile", Email: "email", Birthday: "birthday", DeptId: "dept_id", LevelId: "level_id", PositionId: "position_id", ProvinceCode: "province_code", CityCode: "city_code", DistrictCode: "district_code", Address: "address", CityName: "city_name", Username: "username", Password: "password", Salt: "salt", Intro: "intro", Status: "status", Note: "note", Sort: "sort", LoginNum: "login_num", LoginIp: "login_ip", LoginTime: "login_time", CreateUser: "create_user", CreateTime: "create_time", UpdateUser: "update_user", UpdateTime: "update_time", Mark: "mark", }, } )
UserColumns holds the columns for table sys_user.
var AdColumns = AdColumns{}
AdColumns holds the columns for table sys_ad.
var AdSortColumns = AdSortColumns{}
AdSortColumns holds the columns for table sys_ad_sort.
var CityColumns = CityColumns{}
CityColumns holds the columns for table sys_city.
var ConfigColumns = ConfigColumns{}
ConfigColumns holds the columns for table sys_config.
var ConfigDataColumns = ConfigDataColumns{}
ConfigDataColumns holds the columns for table sys_config_data.
var DeptColumns = DeptColumns{}
DeptColumns holds the columns for table sys_dept.
var DictColumns = DictColumns{}
DictColumns holds the columns for table sys_dict.
var DictDataColumns = DictDataColumns{}
DictDataColumns holds the columns for table sys_dict_data.
var ExampleColumns = ExampleColumns{}
ExampleColumns holds the columns for table sys_example.
var ItemCateColumns = ItemCateColumns{}
ItemCateColumns holds the columns for table sys_item_cate.
var ItemColumns = ItemColumns{}
ItemColumns holds the columns for table sys_item.
var LevelColumns = LevelColumns{}
LevelColumns holds the columns for table sys_level.
var LinkColumns = LinkColumns{}
LinkColumns holds the columns for table sys_link.
var ( // LoginLog is globally public accessible object for table sys_login_log operations. LoginLog = LoginLogDao{ M: g.DB("default").Model("sys_login_log").Safe(), DB: g.DB("default"), Table: "sys_login_log", Columns: LoginLogColumns{ Id: "id", Username: "username", Method: "method", OperUrl: "oper_url", OperIp: "oper_ip", OperLocation: "oper_location", Os: "os", RequestParam: "request_param", Browser: "browser", Result: "result", Status: "status", Type: "type", UserAgent: "user_agent", Note: "note", CreateUser: "create_user", CreateTime: "create_time", UpdateUser: "update_user", UpdateTime: "update_time", Mark: "mark", }, } )
var MemberColumns = MemberColumns{}
MemberColumns holds the columns for table ums_member.
var MemberLevelColumns = MemberLevelColumns{}
MemberLevelColumns holds the columns for table ums_member_level.
var NoticeColumns = NoticeColumns{}
NoticeColumns holds the columns for table sys_notice.
var ( // OperLog is globally public accessible object for table sys_oper_log operations. OperLog = OperLogDao{ M: g.DB("default").Model("sys_oper_log").Safe(), DB: g.DB("default"), Table: "sys_oper_log", Columns: OperLogColumns{ Id: "id", Model: "model", OperType: "oper_type", OperMethod: "oper_method", Username: "username", OperName: "oper_name", OperUrl: "oper_url", OperIp: "oper_ip", OperLocation: "oper_location", RequestParam: "request_param", Result: "result", Status: "status", UserAgent: "user_agent", Note: "note", CreateUser: "create_user", CreateTime: "create_time", UpdateUser: "update_user", UpdateTime: "update_time", Mark: "mark", }, } )
var PositionColumns = PositionColumns{}
PositionColumns holds the columns for table sys_position.
var RoleColumns = RoleColumns{}
RoleColumns holds the columns for table sys_role.
var RoleMenuColumns = RoleMenuColumns{}
RoleMenuColumns holds the columns for table sys_role_menu.
var UserRoleColumns = UserRoleColumns{}
UserRoleColumns holds the columns for table sys_user_role.
Functions ¶
This section is empty.
Types ¶
type AdColumns ¶
type AdColumns struct { }
AdColumns defines and stores column names for table sys_ad.
type AdDao ¶
type AdDao struct {
// contains filtered or unexported fields
}
AdDao is the data access object for table sys_ad.
func NewAdDao ¶
func NewAdDao() *AdDao
NewAdDao creates and returns a new DAO object for table data access.
func (*AdDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*AdDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*AdDao) Transaction ¶
func (dao *AdDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type AdSortColumns ¶
type AdSortColumns struct { }
AdSortColumns defines and stores column names for table sys_ad_sort.
type AdSortDao ¶
type AdSortDao struct {
// contains filtered or unexported fields
}
AdSortDao is the data access object for table sys_ad_sort.
func NewAdSortDao ¶
func NewAdSortDao() *AdSortDao
NewAdSortDao creates and returns a new DAO object for table data access.
func (*AdSortDao) Columns ¶
func (dao *AdSortDao) Columns() AdSortColumns
Columns returns all column names of current dao.
func (*AdSortDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*AdSortDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*AdSortDao) Transaction ¶
func (dao *AdSortDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type CityColumns ¶
type CityColumns struct { }
CityColumns defines and stores column names for table sys_city.
type CityDao ¶
type CityDao struct {
// contains filtered or unexported fields
}
CityDao is the data access object for table sys_city.
func NewCityDao ¶
func NewCityDao() *CityDao
NewCityDao creates and returns a new DAO object for table data access.
func (*CityDao) Columns ¶
func (dao *CityDao) Columns() CityColumns
Columns returns all column names of current dao.
func (*CityDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*CityDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*CityDao) Transaction ¶
func (dao *CityDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type ConfigColumns ¶
type ConfigColumns struct { }
ConfigColumns defines and stores column names for table sys_config.
type ConfigDao ¶
type ConfigDao struct {
// contains filtered or unexported fields
}
ConfigDao is the data access object for table sys_config.
func NewConfigDao ¶
func NewConfigDao() *ConfigDao
NewConfigDao creates and returns a new DAO object for table data access.
func (*ConfigDao) Columns ¶
func (dao *ConfigDao) Columns() ConfigColumns
Columns returns all column names of current dao.
func (*ConfigDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*ConfigDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*ConfigDao) Transaction ¶
func (dao *ConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type ConfigDataColumns ¶
type ConfigDataColumns struct { }
ConfigDataColumns defines and stores column names for table sys_config_data.
type ConfigDataDao ¶
type ConfigDataDao struct {
// contains filtered or unexported fields
}
ConfigDataDao is the data access object for table sys_config_data.
func NewConfigDataDao ¶
func NewConfigDataDao() *ConfigDataDao
NewConfigDataDao creates and returns a new DAO object for table data access.
func (*ConfigDataDao) Columns ¶
func (dao *ConfigDataDao) Columns() ConfigDataColumns
Columns returns all column names of current dao.
func (*ConfigDataDao) Ctx ¶
func (dao *ConfigDataDao) Ctx(ctx context.Context) *gdb.Model
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*ConfigDataDao) DB ¶
func (dao *ConfigDataDao) DB() gdb.DB
DB retrieves and returns the underlying raw database management object of current DAO.
func (*ConfigDataDao) Group ¶
func (dao *ConfigDataDao) Group() string
Group returns the configuration group name of database of current dao.
func (*ConfigDataDao) Table ¶
func (dao *ConfigDataDao) Table() string
Table returns the table name of current dao.
func (*ConfigDataDao) Transaction ¶
func (dao *ConfigDataDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type DeptColumns ¶
type DeptColumns struct { }
DeptColumns defines and stores column names for table sys_dept.
type DeptDao ¶
type DeptDao struct {
// contains filtered or unexported fields
}
DeptDao is the data access object for table sys_dept.
func NewDeptDao ¶
func NewDeptDao() *DeptDao
NewDeptDao creates and returns a new DAO object for table data access.
func (*DeptDao) Columns ¶
func (dao *DeptDao) Columns() DeptColumns
Columns returns all column names of current dao.
func (*DeptDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*DeptDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*DeptDao) Transaction ¶
func (dao *DeptDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type DictColumns ¶
type DictColumns struct { }
DictColumns defines and stores column names for table sys_dict.
type DictDao ¶
type DictDao struct {
// contains filtered or unexported fields
}
DictDao is the data access object for table sys_dict.
func NewDictDao ¶
func NewDictDao() *DictDao
NewDictDao creates and returns a new DAO object for table data access.
func (*DictDao) Columns ¶
func (dao *DictDao) Columns() DictColumns
Columns returns all column names of current dao.
func (*DictDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*DictDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*DictDao) Transaction ¶
func (dao *DictDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type DictDataColumns ¶
type DictDataColumns struct { }
DictDataColumns defines and stores column names for table sys_dict_data.
type DictDataDao ¶
type DictDataDao struct {
// contains filtered or unexported fields
}
DictDataDao is the data access object for table sys_dict_data.
func NewDictDataDao ¶
func NewDictDataDao() *DictDataDao
NewDictDataDao creates and returns a new DAO object for table data access.
func (*DictDataDao) Columns ¶
func (dao *DictDataDao) Columns() DictDataColumns
Columns returns all column names of current dao.
func (*DictDataDao) Ctx ¶
func (dao *DictDataDao) Ctx(ctx context.Context) *gdb.Model
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*DictDataDao) DB ¶
func (dao *DictDataDao) DB() gdb.DB
DB retrieves and returns the underlying raw database management object of current DAO.
func (*DictDataDao) Group ¶
func (dao *DictDataDao) Group() string
Group returns the configuration group name of database of current dao.
func (*DictDataDao) Table ¶
func (dao *DictDataDao) Table() string
Table returns the table name of current dao.
func (*DictDataDao) Transaction ¶
func (dao *DictDataDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type ExampleColumns ¶
type ExampleColumns struct { }
ExampleColumns defines and stores column names for table sys_example.
type ExampleDao ¶
type ExampleDao struct {
// contains filtered or unexported fields
}
ExampleDao is the data access object for table sys_example.
func NewExampleDao ¶
func NewExampleDao() *ExampleDao
NewExampleDao creates and returns a new DAO object for table data access.
func (*ExampleDao) Columns ¶
func (dao *ExampleDao) Columns() ExampleColumns
Columns returns all column names of current dao.
func (*ExampleDao) Ctx ¶
func (dao *ExampleDao) Ctx(ctx context.Context) *gdb.Model
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*ExampleDao) DB ¶
func (dao *ExampleDao) DB() gdb.DB
DB retrieves and returns the underlying raw database management object of current DAO.
func (*ExampleDao) Group ¶
func (dao *ExampleDao) Group() string
Group returns the configuration group name of database of current dao.
func (*ExampleDao) Table ¶
func (dao *ExampleDao) Table() string
Table returns the table name of current dao.
func (*ExampleDao) Transaction ¶
func (dao *ExampleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type ItemCateColumns ¶
type ItemCateColumns struct { }
ItemCateColumns defines and stores column names for table sys_item_cate.
type ItemCateDao ¶
type ItemCateDao struct {
// contains filtered or unexported fields
}
ItemCateDao is the data access object for table sys_item_cate.
func NewItemCateDao ¶
func NewItemCateDao() *ItemCateDao
NewItemCateDao creates and returns a new DAO object for table data access.
func (*ItemCateDao) Columns ¶
func (dao *ItemCateDao) Columns() ItemCateColumns
Columns returns all column names of current dao.
func (*ItemCateDao) Ctx ¶
func (dao *ItemCateDao) Ctx(ctx context.Context) *gdb.Model
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*ItemCateDao) DB ¶
func (dao *ItemCateDao) DB() gdb.DB
DB retrieves and returns the underlying raw database management object of current DAO.
func (*ItemCateDao) Group ¶
func (dao *ItemCateDao) Group() string
Group returns the configuration group name of database of current dao.
func (*ItemCateDao) Table ¶
func (dao *ItemCateDao) Table() string
Table returns the table name of current dao.
func (*ItemCateDao) Transaction ¶
func (dao *ItemCateDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type ItemColumns ¶
type ItemColumns struct { }
ItemColumns defines and stores column names for table sys_item.
type ItemDao ¶
type ItemDao struct {
// contains filtered or unexported fields
}
ItemDao is the data access object for table sys_item.
func NewItemDao ¶
func NewItemDao() *ItemDao
NewItemDao creates and returns a new DAO object for table data access.
func (*ItemDao) Columns ¶
func (dao *ItemDao) Columns() ItemColumns
Columns returns all column names of current dao.
func (*ItemDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*ItemDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*ItemDao) Transaction ¶
func (dao *ItemDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type LevelColumns ¶
type LevelColumns struct { }
LevelColumns defines and stores column names for table sys_level.
type LevelDao ¶
type LevelDao struct {
// contains filtered or unexported fields
}
LevelDao is the data access object for table sys_level.
func NewLevelDao ¶
func NewLevelDao() *LevelDao
NewLevelDao creates and returns a new DAO object for table data access.
func (*LevelDao) Columns ¶
func (dao *LevelDao) Columns() LevelColumns
Columns returns all column names of current dao.
func (*LevelDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*LevelDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*LevelDao) Transaction ¶
func (dao *LevelDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type LinkColumns ¶
type LinkColumns struct { }
LinkColumns defines and stores column names for table sys_link.
type LinkDao ¶
type LinkDao struct {
// contains filtered or unexported fields
}
LinkDao is the data access object for table sys_link.
func NewLinkDao ¶
func NewLinkDao() *LinkDao
NewLinkDao creates and returns a new DAO object for table data access.
func (*LinkDao) Columns ¶
func (dao *LinkDao) Columns() LinkColumns
Columns returns all column names of current dao.
func (*LinkDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*LinkDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*LinkDao) Transaction ¶
func (dao *LinkDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type LoginLogColumns ¶
type LoginLogColumns struct { Id string // 主键ID Username string // 操作账号 Method string // 操作方法 OperUrl string // 请求URL OperIp string // 主机地址 OperLocation string // 操作地点 Os string // 操作系统 RequestParam string // 请求参数 Browser string // 浏览器 Result string // 返回参数 Status string // 操作状态:0操作成功 1操作失败 Type string // 操作类型:1登录成功 2登录失败 3注销成功 2注销失败 UserAgent string // 代理信息 Note string // 备注 CreateUser string // 添加人 CreateTime string // 操作时间 UpdateUser string // 更新人 UpdateTime string // 更新时间 Mark string // 有效标识 }
type LoginLogDao ¶
func (*LoginLogDao) All ¶
func (d *LoginLogDao) All(where ...interface{}) ([]*model.LoginLog, error)
func (*LoginLogDao) And ¶
func (d *LoginLogDao) And(where interface{}, args ...interface{}) *LoginLogDao
And adds "AND" condition to the where statement.
func (*LoginLogDao) Args ¶
func (d *LoginLogDao) Args(args ...interface{}) *LoginLogDao
Args sets custom arguments for model operation.
func (*LoginLogDao) As ¶
func (d *LoginLogDao) As(as string) *LoginLogDao
As sets an alias name for current table.
func (*LoginLogDao) Batch ¶
func (d *LoginLogDao) Batch(batch int) *LoginLogDao
func (*LoginLogDao) Cache ¶
func (d *LoginLogDao) Cache(duration time.Duration, name ...string) *LoginLogDao
func (*LoginLogDao) Ctx ¶
func (d *LoginLogDao) Ctx(ctx context.Context) *LoginLogDao
a global or package variable for long using.
func (*LoginLogDao) Data ¶
func (d *LoginLogDao) Data(data ...interface{}) *LoginLogDao
func (*LoginLogDao) Fields ¶
func (d *LoginLogDao) Fields(fieldNamesOrMapStruct ...interface{}) *LoginLogDao
Fields sets the operation fields of the model, multiple fields joined using char ','. The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
func (*LoginLogDao) FieldsEx ¶
func (d *LoginLogDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *LoginLogDao
FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','. The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
func (*LoginLogDao) Filter ¶
func (d *LoginLogDao) Filter() *LoginLogDao
Filter marks filtering the fields which does not exist in the fields of the operated table.
func (*LoginLogDao) FindAll ¶
func (d *LoginLogDao) FindAll(where ...interface{}) ([]*model.LoginLog, error)
FindAll retrieves and returns Result by by M.WherePri and M.All. Also see M.WherePri and M.All.
func (*LoginLogDao) FindOne ¶
func (d *LoginLogDao) FindOne(where ...interface{}) (*model.LoginLog, error)
func (*LoginLogDao) Group ¶
func (d *LoginLogDao) Group(groupBy string) *LoginLogDao
Group sets the "GROUP BY" statement for the model.
func (*LoginLogDao) InnerJoin ¶
func (d *LoginLogDao) InnerJoin(table ...string) *LoginLogDao
func (*LoginLogDao) LeftJoin ¶
func (d *LoginLogDao) LeftJoin(table ...string) *LoginLogDao
func (*LoginLogDao) Limit ¶
func (d *LoginLogDao) Limit(limit ...int) *LoginLogDao
Limit sets the "LIMIT" statement for the model. The parameter <limit> can be either one or two number, if passed two number is passed, it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]" statement.
func (*LoginLogDao) LockShared ¶
func (d *LoginLogDao) LockShared() *LoginLogDao
func (*LoginLogDao) LockUpdate ¶
func (d *LoginLogDao) LockUpdate() *LoginLogDao
func (*LoginLogDao) Master ¶
func (d *LoginLogDao) Master() *LoginLogDao
Master marks the following operation on master node.
func (*LoginLogDao) Offset ¶
func (d *LoginLogDao) Offset(offset int) *LoginLogDao
func (*LoginLogDao) OmitEmpty ¶
func (d *LoginLogDao) OmitEmpty() *LoginLogDao
OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers the data and where attributes for empty values.
func (*LoginLogDao) Option ¶
func (d *LoginLogDao) Option(option int) *LoginLogDao
Option sets the extra operation option for the model.
func (*LoginLogDao) Or ¶
func (d *LoginLogDao) Or(where interface{}, args ...interface{}) *LoginLogDao
Or adds "OR" condition to the where statement.
func (*LoginLogDao) Order ¶
func (d *LoginLogDao) Order(orderBy ...string) *LoginLogDao
Order sets the "ORDER BY" statement for the model.
func (*LoginLogDao) Page ¶
func (d *LoginLogDao) Page(page, limit int) *LoginLogDao
func (*LoginLogDao) RightJoin ¶
func (d *LoginLogDao) RightJoin(table ...string) *LoginLogDao
func (*LoginLogDao) Scan ¶
func (d *LoginLogDao) Scan(pointer interface{}, where ...interface{}) error
func (*LoginLogDao) Slave ¶
func (d *LoginLogDao) Slave() *LoginLogDao
func (*LoginLogDao) Struct ¶
func (d *LoginLogDao) Struct(pointer interface{}, where ...interface{}) error
func (*LoginLogDao) Structs ¶
func (d *LoginLogDao) Structs(pointer interface{}, where ...interface{}) error
func (*LoginLogDao) TX ¶
func (d *LoginLogDao) TX(tx *gdb.TX) *LoginLogDao
TX sets the transaction for current operation.
func (*LoginLogDao) Unscoped ¶
func (d *LoginLogDao) Unscoped() *LoginLogDao
Unscoped enables/disables the soft deleting feature.
func (*LoginLogDao) Where ¶
func (d *LoginLogDao) Where(where interface{}, args ...interface{}) *LoginLogDao
Where sets the condition statement for the model. The parameter <where> can be type of string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times, multiple conditions will be joined into where statement using "AND". Eg: Where("uid=10000") Where("uid", 10000) Where("money>? AND name like ?", 99999, "vip_%") Where("uid", 1).Where("name", "john") Where("status IN (?)", g.Slice{1,2,3}) Where("age IN(?,?)", 18, 50) Where(User{ Id : 1, UserName : "john"})
func (*LoginLogDao) WherePri ¶
func (d *LoginLogDao) WherePri(where interface{}, args ...interface{}) *LoginLogDao
WherePri does the same logic as M.Where except that if the parameter <where> is a single condition like int/string/float/slice, it treats the condition as the primary key value. That is, if primary key is "id" and given <where> parameter as "123", the WherePri function treats the condition as "id=123", but M.Where treats the condition as string "123".
type MemberColumns ¶
type MemberColumns struct { }
MemberColumns defines and stores column names for table ums_member.
type MemberDao ¶
type MemberDao struct {
// contains filtered or unexported fields
}
MemberDao is the data access object for table ums_member.
func NewMemberDao ¶
func NewMemberDao() *MemberDao
NewMemberDao creates and returns a new DAO object for table data access.
func (*MemberDao) Columns ¶
func (dao *MemberDao) Columns() MemberColumns
Columns returns all column names of current dao.
func (*MemberDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*MemberDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*MemberDao) Transaction ¶
func (dao *MemberDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type MemberLevelColumns ¶
type MemberLevelColumns struct { }
MemberLevelColumns defines and stores column names for table ums_member_level.
type MemberLevelDao ¶
type MemberLevelDao struct {
// contains filtered or unexported fields
}
MemberLevelDao is the data access object for table ums_member_level.
func NewMemberLevelDao ¶
func NewMemberLevelDao() *MemberLevelDao
NewMemberLevelDao creates and returns a new DAO object for table data access.
func (*MemberLevelDao) Columns ¶
func (dao *MemberLevelDao) Columns() MemberLevelColumns
Columns returns all column names of current dao.
func (*MemberLevelDao) Ctx ¶
func (dao *MemberLevelDao) Ctx(ctx context.Context) *gdb.Model
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*MemberLevelDao) DB ¶
func (dao *MemberLevelDao) DB() gdb.DB
DB retrieves and returns the underlying raw database management object of current DAO.
func (*MemberLevelDao) Group ¶
func (dao *MemberLevelDao) Group() string
Group returns the configuration group name of database of current dao.
func (*MemberLevelDao) Table ¶
func (dao *MemberLevelDao) Table() string
Table returns the table name of current dao.
func (*MemberLevelDao) Transaction ¶
func (dao *MemberLevelDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type MenuColumns ¶
type MenuColumns struct { Id string // 主键ID ParentId string // 父级ID Title string // 菜单标题 Icon string // 图标 Path string // 菜单路径 Component string // 菜单组件 Target string // 打开方式:0组件 1内链 2外链 Permission string // 权限标识 Type string // 类型:0菜单 1节点 Method string // 请求方式 Status string // 状态:1正常 2禁用 Hide string // 是否可见:1是 2否 Note string // 备注 Sort string // 显示顺序 CreateUser string // 添加人 CreateTime string // 创建时间 UpdateUser string // 更新人 UpdateTime string // 更新时间 Mark string // 有效标识 }
MenuColumns defines and stores column names for table sys_menu.
type MenuDao ¶
type MenuDao struct { gmvc.M DB gdb.DB Table string Columns MenuColumns // columns contains all the column names of Table for convenient usage. // contains filtered or unexported fields }
MenuDao is the data access object for table sys_menu.
func NewMenuDao ¶
func NewMenuDao() *MenuDao
NewMenuDao creates and returns a new DAO object for table data access.
func (*MenuDao) All ¶
All does "SELECT FROM ..." statement for the model. It retrieves the records from table and returns the result as []*model.Menu. It returns nil if there's no record retrieved with the given conditions from table.
The optional parameter <where> is the same as the parameter of M.Where function, see M.Where.
func (*MenuDao) Cache ¶
Cache sets the cache feature for the model. It caches the result of the sql, which means if there's another same sql request, it just reads and returns the result from cache, it but not committed and executed into the database.
If the parameter <duration> < 0, which means it clear the cache with given <name>. If the parameter <duration> = 0, which means it never expires. If the parameter <duration> > 0, which means it expires after <duration>.
The optional parameter <name> is used to bind a name to the cache, which means you can later control the cache like changing the <duration> or clearing the cache with specified <name>.
Note that, the cache feature is disabled if the model is operating on a transaction.
func (*MenuDao) Columnsx ¶
func (dao *MenuDao) Columnsx() MenuColumns
Columns returns all column names of current dao.
func (*MenuDao) CtxO ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*MenuDao) DBO ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*MenuDao) Data ¶
Data sets the operation data for the model. The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc. Eg: Data("uid=10000") Data("uid", 10000) Data(g.Map{"uid": 10000, "name":"john"}) Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
func (*MenuDao) Fields ¶
Fields sets the operation fields of the model, multiple fields joined using char ','. The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
func (*MenuDao) FieldsEx ¶
FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','. The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
func (*MenuDao) Filter ¶
Filter marks filtering the fields which does not exist in the fields of the operated table.
func (*MenuDao) FindAll ¶
FindAll retrieves and returns Result by by M.WherePri and M.All. Also see M.WherePri and M.All.
func (*MenuDao) FindOne ¶
FindOne retrieves and returns a single Record by M.WherePri and M.One. Also see M.WherePri and M.One.
func (*MenuDao) InnerJoin ¶
InnerJoin does "INNER JOIN ... ON ..." statement on the model. The parameter <table> can be joined table and its joined condition, and also with its alias name, like: Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid") Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
func (*MenuDao) LeftJoin ¶
LeftJoin does "LEFT JOIN ... ON ..." statement on the model. The parameter <table> can be joined table and its joined condition, and also with its alias name, like: Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid") Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
func (*MenuDao) Limit ¶
Limit sets the "LIMIT" statement for the model. The parameter <limit> can be either one or two number, if passed two number is passed, it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]" statement.
func (*MenuDao) LockShared ¶
LockShared sets the lock in share mode for current operation.
func (*MenuDao) LockUpdate ¶
LockUpdate sets the lock for update for current operation.
func (*MenuDao) Offset ¶
Offset sets the "OFFSET" statement for the model. It only makes sense for some databases like SQLServer, PostgreSQL, etc.
func (*MenuDao) OmitEmpty ¶
OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers the data and where attributes for empty values.
func (*MenuDao) One ¶
One retrieves one record from table and returns the result as *model.Menu. It returns nil if there's no record retrieved with the given conditions from table.
The optional parameter <where> is the same as the parameter of M.Where function, see M.Where.
func (*MenuDao) Page ¶
Page sets the paging number for the model. The parameter <page> is started from 1 for paging. Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
func (*MenuDao) RightJoin ¶
RightJoin does "RIGHT JOIN ... ON ..." statement on the model. The parameter <table> can be joined table and its joined condition, and also with its alias name, like: Table("user").RightJoin("user_detail", "user_detail.uid=user.uid") Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
func (*MenuDao) Scan ¶
Scan automatically calls Struct or Structs function according to the type of parameter <pointer>. It calls function Struct if <pointer> is type of *struct/**struct. It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
The optional parameter <where> is the same as the parameter of Model.Where function, see Model.Where.
Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
Eg: user := new(User) err := dao.User.Where("id", 1).Scan(user)
user := (*User)(nil) err := dao.User.Where("id", 1).Scan(&user)
users := ([]User)(nil) err := dao.User.Scan(&users)
users := ([]*User)(nil) err := dao.User.Scan(&users)
func (*MenuDao) Slave ¶
Slave marks the following operation on slave node. Note that it makes sense only if there's any slave node configured.
func (*MenuDao) Struct ¶
Struct retrieves one record from table and converts it into given struct. The parameter <pointer> should be type of *struct/**struct. If type **struct is given, it can create the struct internally during converting.
The optional parameter <where> is the same as the parameter of Model.Where function, see Model.Where.
Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions from table and <pointer> is not nil.
Eg: user := new(User) err := dao.User.Where("id", 1).Struct(user)
user := (*User)(nil) err := dao.User.Where("id", 1).Struct(&user)
func (*MenuDao) Structs ¶
Structs retrieves records from table and converts them into given struct slice. The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct slice internally during converting.
The optional parameter <where> is the same as the parameter of Model.Where function, see Model.Where.
Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions from table and <pointer> is not empty.
Eg: users := ([]User)(nil) err := dao.User.Structs(&users)
users := ([]*User)(nil) err := dao.User.Structs(&users)
func (*MenuDao) Where ¶
Where sets the condition statement for the model. The parameter <where> can be type of string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times, multiple conditions will be joined into where statement using "AND". Eg: Where("uid=10000") Where("uid", 10000) Where("money>? AND name like ?", 99999, "vip_%") Where("uid", 1).Where("name", "john") Where("status IN (?)", g.Slice{1,2,3}) Where("age IN(?,?)", 18, 50) Where(User{ Id : 1, UserName : "john"})
func (*MenuDao) WherePri ¶
WherePri does the same logic as M.Where except that if the parameter <where> is a single condition like int/string/float/slice, it treats the condition as the primary key value. That is, if primary key is "id" and given <where> parameter as "123", the WherePri function treats the condition as "id=123", but M.Where treats the condition as string "123".
type NoticeColumns ¶
type NoticeColumns struct { }
NoticeColumns defines and stores column names for table sys_notice.
type NoticeDao ¶
type NoticeDao struct {
// contains filtered or unexported fields
}
NoticeDao is the data access object for table sys_notice.
func NewNoticeDao ¶
func NewNoticeDao() *NoticeDao
NewNoticeDao creates and returns a new DAO object for table data access.
func (*NoticeDao) Columns ¶
func (dao *NoticeDao) Columns() NoticeColumns
Columns returns all column names of current dao.
func (*NoticeDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*NoticeDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*NoticeDao) Transaction ¶
func (dao *NoticeDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type OperLogColumns ¶
type OperLogColumns struct { Id string // 主键ID Model string // 操作模块 OperType string // 操作类型:0其它 1新增 2修改 3删除 4查询 5设置状态 6导入 7导出 8设置权限 9设置密码 OperMethod string // 操作方法 Username string // 操作账号 OperName string // 操作用户 OperUrl string // 请求URL OperIp string // 主机地址 OperLocation string // 操作地点 RequestParam string // 请求参数 Result string // 返回参数 Status string // 日志状态:0正常日志 1错误日志 UserAgent string // 代理信息 Note string // 备注 CreateUser string // 添加人 CreateTime string // 操作时间 UpdateUser string // 更新人 UpdateTime string // 更新时间 Mark string // 有效标识 }
OperLogColumns defines and stores column names for table sys_oper_log.
type OperLogDao ¶
func (*OperLogDao) All ¶
func (d *OperLogDao) All(where ...interface{}) ([]*model.OperLog, error)
All does "SELECT FROM ..." statement for the model. It retrieves the records from table and returns the result as []*model.OperLog. It returns nil if there's no record retrieved with the given conditions from table.
The optional parameter <where> is the same as the parameter of M.Where function, see M.Where.
func (*OperLogDao) And ¶
func (d *OperLogDao) And(where interface{}, args ...interface{}) *OperLogDao
And adds "AND" condition to the where statement.
func (*OperLogDao) Args ¶
func (d *OperLogDao) Args(args ...interface{}) *OperLogDao
Args sets custom arguments for model operation.
func (*OperLogDao) As ¶
func (d *OperLogDao) As(as string) *OperLogDao
As sets an alias name for current table.
func (*OperLogDao) Batch ¶
func (d *OperLogDao) Batch(batch int) *OperLogDao
Batch sets the batch operation number for the model.
func (*OperLogDao) Cache ¶
func (d *OperLogDao) Cache(duration time.Duration, name ...string) *OperLogDao
Cache sets the cache feature for the model. It caches the result of the sql, which means if there's another same sql request, it just reads and returns the result from cache, it but not committed and executed into the database.
If the parameter <duration> < 0, which means it clear the cache with given <name>. If the parameter <duration> = 0, which means it never expires. If the parameter <duration> > 0, which means it expires after <duration>.
The optional parameter <name> is used to bind a name to the cache, which means you can later control the cache like changing the <duration> or clearing the cache with specified <name>.
Note that, the cache feature is disabled if the model is operating on a transaction.
func (*OperLogDao) Ctx ¶
func (d *OperLogDao) Ctx(ctx context.Context) *OperLogDao
Ctx is a chaining function, which creates and returns a new DB that is a shallow copy of current DB object and with given context in it. Note that this returned DB object can be used only once, so do not assign it to a global or package variable for long using.
func (*OperLogDao) Data ¶
func (d *OperLogDao) Data(data ...interface{}) *OperLogDao
Data sets the operation data for the model. The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc. Eg: Data("uid=10000") Data("uid", 10000) Data(g.Map{"uid": 10000, "name":"john"}) Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
func (*OperLogDao) Fields ¶
func (d *OperLogDao) Fields(fieldNamesOrMapStruct ...interface{}) *OperLogDao
Fields sets the operation fields of the model, multiple fields joined using char ','. The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
func (*OperLogDao) FieldsEx ¶
func (d *OperLogDao) FieldsEx(fieldNamesOrMapStruct ...interface{}) *OperLogDao
FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','. The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
func (*OperLogDao) Filter ¶
func (d *OperLogDao) Filter() *OperLogDao
Filter marks filtering the fields which does not exist in the fields of the operated table.
func (*OperLogDao) FindAll ¶
func (d *OperLogDao) FindAll(where ...interface{}) ([]*model.OperLog, error)
FindAll retrieves and returns Result by by M.WherePri and M.All. Also see M.WherePri and M.All.
func (*OperLogDao) FindOne ¶
func (d *OperLogDao) FindOne(where ...interface{}) (*model.OperLog, error)
FindOne retrieves and returns a single Record by M.WherePri and M.One. Also see M.WherePri and M.One.
func (*OperLogDao) Group ¶
func (d *OperLogDao) Group(groupBy string) *OperLogDao
Group sets the "GROUP BY" statement for the model.
func (*OperLogDao) InnerJoin ¶
func (d *OperLogDao) InnerJoin(table ...string) *OperLogDao
InnerJoin does "INNER JOIN ... ON ..." statement on the model. The parameter <table> can be joined table and its joined condition, and also with its alias name, like: Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid") Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
func (*OperLogDao) LeftJoin ¶
func (d *OperLogDao) LeftJoin(table ...string) *OperLogDao
LeftJoin does "LEFT JOIN ... ON ..." statement on the model. The parameter <table> can be joined table and its joined condition, and also with its alias name, like: Table("user").LeftJoin("user_detail", "user_detail.uid=user.uid") Table("user", "u").LeftJoin("user_detail", "ud", "ud.uid=u.uid")
func (*OperLogDao) Limit ¶
func (d *OperLogDao) Limit(limit ...int) *OperLogDao
Limit sets the "LIMIT" statement for the model. The parameter <limit> can be either one or two number, if passed two number is passed, it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]" statement.
func (*OperLogDao) LockShared ¶
func (d *OperLogDao) LockShared() *OperLogDao
LockShared sets the lock in share mode for current operation.
func (*OperLogDao) LockUpdate ¶
func (d *OperLogDao) LockUpdate() *OperLogDao
LockUpdate sets the lock for update for current operation.
func (*OperLogDao) Master ¶
func (d *OperLogDao) Master() *OperLogDao
Master marks the following operation on master node.
func (*OperLogDao) Offset ¶
func (d *OperLogDao) Offset(offset int) *OperLogDao
Offset sets the "OFFSET" statement for the model. It only makes sense for some databases like SQLServer, PostgreSQL, etc.
func (*OperLogDao) OmitEmpty ¶
func (d *OperLogDao) OmitEmpty() *OperLogDao
OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers the data and where attributes for empty values.
func (*OperLogDao) One ¶
func (d *OperLogDao) One(where ...interface{}) (*model.OperLog, error)
One retrieves one record from table and returns the result as *model.OperLog. It returns nil if there's no record retrieved with the given conditions from table.
The optional parameter <where> is the same as the parameter of M.Where function, see M.Where.
func (*OperLogDao) Option ¶
func (d *OperLogDao) Option(option int) *OperLogDao
Option sets the extra operation option for the model.
func (*OperLogDao) Or ¶
func (d *OperLogDao) Or(where interface{}, args ...interface{}) *OperLogDao
Or adds "OR" condition to the where statement.
func (*OperLogDao) Order ¶
func (d *OperLogDao) Order(orderBy ...string) *OperLogDao
Order sets the "ORDER BY" statement for the model.
func (*OperLogDao) Page ¶
func (d *OperLogDao) Page(page, limit int) *OperLogDao
Page sets the paging number for the model. The parameter <page> is started from 1 for paging. Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
func (*OperLogDao) RightJoin ¶
func (d *OperLogDao) RightJoin(table ...string) *OperLogDao
RightJoin does "RIGHT JOIN ... ON ..." statement on the model. The parameter <table> can be joined table and its joined condition, and also with its alias name, like: Table("user").RightJoin("user_detail", "user_detail.uid=user.uid") Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
func (*OperLogDao) Scan ¶
func (d *OperLogDao) Scan(pointer interface{}, where ...interface{}) error
Scan automatically calls Struct or Structs function according to the type of parameter <pointer>. It calls function Struct if <pointer> is type of *struct/**struct. It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
The optional parameter <where> is the same as the parameter of Model.Where function, see Model.Where.
Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
Eg: user := new(User) err := dao.User.Where("id", 1).Scan(user)
user := (*User)(nil) err := dao.User.Where("id", 1).Scan(&user)
users := ([]User)(nil) err := dao.User.Scan(&users)
users := ([]*User)(nil) err := dao.User.Scan(&users)
func (*OperLogDao) Slave ¶
func (d *OperLogDao) Slave() *OperLogDao
Slave marks the following operation on slave node. Note that it makes sense only if there's any slave node configured.
func (*OperLogDao) Struct ¶
func (d *OperLogDao) Struct(pointer interface{}, where ...interface{}) error
Struct retrieves one record from table and converts it into given struct. The parameter <pointer> should be type of *struct/**struct. If type **struct is given, it can create the struct internally during converting.
The optional parameter <where> is the same as the parameter of Model.Where function, see Model.Where.
Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions from table and <pointer> is not nil.
Eg: user := new(User) err := dao.User.Where("id", 1).Struct(user)
user := (*User)(nil) err := dao.User.Where("id", 1).Struct(&user)
func (*OperLogDao) Structs ¶
func (d *OperLogDao) Structs(pointer interface{}, where ...interface{}) error
Structs retrieves records from table and converts them into given struct slice. The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct slice internally during converting.
The optional parameter <where> is the same as the parameter of Model.Where function, see Model.Where.
Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions from table and <pointer> is not empty.
Eg: users := ([]User)(nil) err := dao.User.Structs(&users)
users := ([]*User)(nil) err := dao.User.Structs(&users)
func (*OperLogDao) TX ¶
func (d *OperLogDao) TX(tx *gdb.TX) *OperLogDao
TX sets the transaction for current operation.
func (*OperLogDao) Unscoped ¶
func (d *OperLogDao) Unscoped() *OperLogDao
Unscoped enables/disables the soft deleting feature.
func (*OperLogDao) Where ¶
func (d *OperLogDao) Where(where interface{}, args ...interface{}) *OperLogDao
Where sets the condition statement for the model. The parameter <where> can be type of string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times, multiple conditions will be joined into where statement using "AND". Eg: Where("uid=10000") Where("uid", 10000) Where("money>? AND name like ?", 99999, "vip_%") Where("uid", 1).Where("name", "john") Where("status IN (?)", g.Slice{1,2,3}) Where("age IN(?,?)", 18, 50) Where(User{ Id : 1, UserName : "john"})
func (*OperLogDao) WherePri ¶
func (d *OperLogDao) WherePri(where interface{}, args ...interface{}) *OperLogDao
WherePri does the same logic as M.Where except that if the parameter <where> is a single condition like int/string/float/slice, it treats the condition as the primary key value. That is, if primary key is "id" and given <where> parameter as "123", the WherePri function treats the condition as "id=123", but M.Where treats the condition as string "123".
type PositionColumns ¶
type PositionColumns struct { }
PositionColumns defines and stores column names for table sys_position.
type PositionDao ¶
type PositionDao struct {
// contains filtered or unexported fields
}
PositionDao is the data access object for table sys_position.
func NewPositionDao ¶
func NewPositionDao() *PositionDao
NewPositionDao creates and returns a new DAO object for table data access.
func (*PositionDao) Columns ¶
func (dao *PositionDao) Columns() PositionColumns
Columns returns all column names of current dao.
func (*PositionDao) Ctx ¶
func (dao *PositionDao) Ctx(ctx context.Context) *gdb.Model
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*PositionDao) DB ¶
func (dao *PositionDao) DB() gdb.DB
DB retrieves and returns the underlying raw database management object of current DAO.
func (*PositionDao) Group ¶
func (dao *PositionDao) Group() string
Group returns the configuration group name of database of current dao.
func (*PositionDao) Table ¶
func (dao *PositionDao) Table() string
Table returns the table name of current dao.
func (*PositionDao) Transaction ¶
func (dao *PositionDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type RoleColumns ¶
type RoleColumns struct { }
RoleColumns defines and stores column names for table sys_role.
type RoleDao ¶
type RoleDao struct {
// contains filtered or unexported fields
}
RoleDao is the data access object for table sys_role.
func NewRoleDao ¶
func NewRoleDao() *RoleDao
NewRoleDao creates and returns a new DAO object for table data access.
func (*RoleDao) Columns ¶
func (dao *RoleDao) Columns() RoleColumns
Columns returns all column names of current dao.
func (*RoleDao) Ctx ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*RoleDao) DB ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*RoleDao) Transaction ¶
func (dao *RoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type RoleMenuColumns ¶
type RoleMenuColumns struct { }
RoleMenuColumns defines and stores column names for table sys_role_menu.
type RoleMenuDao ¶
type RoleMenuDao struct {
// contains filtered or unexported fields
}
RoleMenuDao is the data access object for table sys_role_menu.
func NewRoleMenuDao ¶
func NewRoleMenuDao() *RoleMenuDao
NewRoleMenuDao creates and returns a new DAO object for table data access.
func (*RoleMenuDao) Columns ¶
func (dao *RoleMenuDao) Columns() RoleMenuColumns
Columns returns all column names of current dao.
func (*RoleMenuDao) Ctx ¶
func (dao *RoleMenuDao) Ctx(ctx context.Context) *gdb.Model
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*RoleMenuDao) DB ¶
func (dao *RoleMenuDao) DB() gdb.DB
DB retrieves and returns the underlying raw database management object of current DAO.
func (*RoleMenuDao) Group ¶
func (dao *RoleMenuDao) Group() string
Group returns the configuration group name of database of current dao.
func (*RoleMenuDao) Table ¶
func (dao *RoleMenuDao) Table() string
Table returns the table name of current dao.
func (*RoleMenuDao) Transaction ¶
func (dao *RoleMenuDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
type UserColumns ¶
type UserColumns struct { Id string // 主键ID Realname string // 真实姓名 Nickname string // 昵称 Gender string // 性别:1男 2女 3保密 Avatar string // 头像 Mobile string // 手机号码 Email string // 邮箱地址 Birthday string // 出生日期 DeptId string // 部门ID LevelId string // 职级ID PositionId string // 岗位ID ProvinceCode string // 省份编号 CityCode string // 市区编号 DistrictCode string // 区县编号 Address string // 详细地址 CityName string // 所属城市 Username string // 登录用户名 Password string // 登录密码 Salt string // 盐加密 Intro string // 个人简介 Status string // 状态:1正常 2禁用 Note string // 备注 Sort string // 排序号 LoginNum string // 登录次数 LoginIp string // 最近登录IP LoginTime string // 最近登录时间 CreateUser string // 添加人 CreateTime string // 创建时间 UpdateUser string // 更新人 UpdateTime string // 更新时间 Mark string // 有效标识(1正常 0删除) }
UserColumns defines and stores column names for table sys_user.
type UserDao ¶
type UserDao struct { gmvc.M DB gdb.DB Table string Columns UserColumns // columns contains all the column names of Table for convenient usage. // contains filtered or unexported fields }
UserDao is the data access object for table sys_user.
func NewUserDao ¶
func NewUserDao() *UserDao
NewUserDao creates and returns a new DAO object for table data access.
func (*UserDao) All ¶
All does "SELECT FROM ..." statement for the model. It retrieves the records from table and returns the result as []*model.User. It returns nil if there's no record retrieved with the given conditions from table.
The optional parameter <where> is the same as the parameter of M.Where function, see M.Where.
func (*UserDao) Cache ¶
Cache sets the cache feature for the model. It caches the result of the sql, which means if there's another same sql request, it just reads and returns the result from cache, it but not committed and executed into the database.
If the parameter <duration> < 0, which means it clear the cache with given <name>. If the parameter <duration> = 0, which means it never expires. If the parameter <duration> > 0, which means it expires after <duration>.
The optional parameter <name> is used to bind a name to the cache, which means you can later control the cache like changing the <duration> or clearing the cache with specified <name>.
Note that, the cache feature is disabled if the model is operating on a transaction.
func (*UserDao) Ctxo ¶
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*UserDao) DBO ¶
DB retrieves and returns the underlying raw database management object of current DAO.
func (*UserDao) Data ¶
Data sets the operation data for the model. The parameter <data> can be type of string/map/gmap/slice/struct/*struct, etc. Eg: Data("uid=10000") Data("uid", 10000) Data(g.Map{"uid": 10000, "name":"john"}) Data(g.Slice{g.Map{"uid": 10000, "name":"john"}, g.Map{"uid": 20000, "name":"smith"})
func (*UserDao) Fields ¶
Fields sets the operation fields of the model, multiple fields joined using char ','. The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
func (*UserDao) FieldsEx ¶
FieldsEx sets the excluded operation fields of the model, multiple fields joined using char ','. The parameter <fieldNamesOrMapStruct> can be type of string/map/*map/struct/*struct.
func (*UserDao) Filter ¶
Filter marks filtering the fields which does not exist in the fields of the operated table.
func (*UserDao) FindAll ¶
FindAll retrieves and returns Result by by M.WherePri and M.All. Also see M.WherePri and M.All.
func (*UserDao) FindOne ¶
FindOne retrieves and returns a single Record by M.WherePri and M.One. Also see M.WherePri and M.One.
func (*UserDao) InnerJoin ¶
InnerJoin does "INNER JOIN ... ON ..." statement on the model. The parameter <table> can be joined table and its joined condition, and also with its alias name, like: Table("user").InnerJoin("user_detail", "user_detail.uid=user.uid") Table("user", "u").InnerJoin("user_detail", "ud", "ud.uid=u.uid")
func (*UserDao) Limit ¶
Limit sets the "LIMIT" statement for the model. The parameter <limit> can be either one or two number, if passed two number is passed, it then sets "LIMIT limit[0],limit[1]" statement for the model, or else it sets "LIMIT limit[0]" statement.
func (*UserDao) LockShared ¶
LockShared sets the lock in share mode for current operation.
func (*UserDao) LockUpdate ¶
LockUpdate sets the lock for update for current operation.
func (*UserDao) Offset ¶
Offset sets the "OFFSET" statement for the model. It only makes sense for some databases like SQLServer, PostgreSQL, etc.
func (*UserDao) OmitEmpty ¶
OmitEmpty sets OPTION_OMITEMPTY option for the model, which automatically filers the data and where attributes for empty values.
func (*UserDao) One ¶
One retrieves one record from table and returns the result as *model.User. It returns nil if there's no record retrieved with the given conditions from table.
The optional parameter <where> is the same as the parameter of M.Where function, see M.Where.
func (*UserDao) Page ¶
Page sets the paging number for the model. The parameter <page> is started from 1 for paging. Note that, it differs that the Limit function start from 0 for "LIMIT" statement.
func (*UserDao) RightJoin ¶
RightJoin does "RIGHT JOIN ... ON ..." statement on the model. The parameter <table> can be joined table and its joined condition, and also with its alias name, like: Table("user").RightJoin("user_detail", "user_detail.uid=user.uid") Table("user", "u").RightJoin("user_detail", "ud", "ud.uid=u.uid")
func (*UserDao) Scan ¶
Scan automatically calls Struct or Structs function according to the type of parameter <pointer>. It calls function Struct if <pointer> is type of *struct/**struct. It calls function Structs if <pointer> is type of *[]struct/*[]*struct.
The optional parameter <where> is the same as the parameter of Model.Where function, see Model.Where.
Note that it returns sql.ErrNoRows if there's no record retrieved and given pointer is not empty or nil.
Eg: user := new(User) err := dao.User.Where("id", 1).Scan(user)
user := (*User)(nil) err := dao.User.Where("id", 1).Scan(&user)
users := ([]User)(nil) err := dao.User.Scan(&users)
users := ([]*User)(nil) err := dao.User.Scan(&users)
func (*UserDao) Slave ¶
Slave marks the following operation on slave node. Note that it makes sense only if there's any slave node configured.
func (*UserDao) Struct ¶
Struct retrieves one record from table and converts it into given struct. The parameter <pointer> should be type of *struct/**struct. If type **struct is given, it can create the struct internally during converting.
The optional parameter <where> is the same as the parameter of Model.Where function, see Model.Where.
Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions from table and <pointer> is not nil.
Eg: user := new(User) err := dao.User.Where("id", 1).Struct(user)
user := (*User)(nil) err := dao.User.Where("id", 1).Struct(&user)
func (*UserDao) Structs ¶
Structs retrieves records from table and converts them into given struct slice. The parameter <pointer> should be type of *[]struct/*[]*struct. It can create and fill the struct slice internally during converting.
The optional parameter <where> is the same as the parameter of Model.Where function, see Model.Where.
Note that it returns sql.ErrNoRows if there's no record retrieved with the given conditions from table and <pointer> is not empty.
Eg: users := ([]User)(nil) err := dao.User.Structs(&users)
users := ([]*User)(nil) err := dao.User.Structs(&users)
func (*UserDao) Transaction ¶
func (dao *UserDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.
func (*UserDao) Where ¶
Where sets the condition statement for the model. The parameter <where> can be type of string/map/gmap/slice/struct/*struct, etc. Note that, if it's called more than one times, multiple conditions will be joined into where statement using "AND". Eg: Where("uid=10000") Where("uid", 10000) Where("money>? AND name like ?", 99999, "vip_%") Where("uid", 1).Where("name", "john") Where("status IN (?)", g.Slice{1,2,3}) Where("age IN(?,?)", 18, 50) Where(User{ Id : 1, UserName : "john"})
func (*UserDao) WherePri ¶
WherePri does the same logic as M.Where except that if the parameter <where> is a single condition like int/string/float/slice, it treats the condition as the primary key value. That is, if primary key is "id" and given <where> parameter as "123", the WherePri function treats the condition as "id=123", but M.Where treats the condition as string "123".
type UserRoleColumns ¶
type UserRoleColumns struct { }
UserRoleColumns defines and stores column names for table sys_user_role.
type UserRoleDao ¶
type UserRoleDao struct {
// contains filtered or unexported fields
}
UserRoleDao is the data access object for table sys_user_role.
func NewUserRoleDao ¶
func NewUserRoleDao() *UserRoleDao
NewUserRoleDao creates and returns a new DAO object for table data access.
func (*UserRoleDao) Columns ¶
func (dao *UserRoleDao) Columns() UserRoleColumns
Columns returns all column names of current dao.
func (*UserRoleDao) Ctx ¶
func (dao *UserRoleDao) Ctx(ctx context.Context) *gdb.Model
Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
func (*UserRoleDao) DB ¶
func (dao *UserRoleDao) DB() gdb.DB
DB retrieves and returns the underlying raw database management object of current DAO.
func (*UserRoleDao) Group ¶
func (dao *UserRoleDao) Group() string
Group returns the configuration group name of database of current dao.
func (*UserRoleDao) Table ¶
func (dao *UserRoleDao) Table() string
Table returns the table name of current dao.
func (*UserRoleDao) Transaction ¶
func (dao *UserRoleDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error)
Transaction wraps the transaction logic using function f. It rollbacks the transaction and returns the error from function f if it returns non-nil error. It commits the transaction and returns nil if function f returns nil.
Note that, you should not Commit or Rollback the transaction in function f as it is automatically handled by this function.