Documentation ¶
Index ¶
- func AddRole(m *Role) (id int64, err error)
- func AddUser(m *User) (id int64, err error)
- func DeleteRole(id int) (err error)
- func DeleteUser(id int) (err error)
- func GetAllUser(query map[string]string, fields []string, sortby []string, order []string, ...) (ml []interface{}, err error)
- func UpdateRoleById(m *Role) (err error)
- func UpdateUserById(m *User) (err error)
- type Role
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteRole ¶
DeleteRole deletes Role by Id and returns errors if the record to be deleted doesn't exist
func DeleteUser ¶
DeleteUser deletes User by Id and returns errors if the record to be deleted doesn't exist
func GetAllUser ¶
func GetAllUser(query map[string]string, fields []string, sortby []string, order []string, offset int64, limit int64) (ml []interface{}, err error)
GetAllUser retrieves all User matches certain condition. Returns empty list if no records exist
func UpdateRoleById ¶
UpdateRoleById updates Role by Id and returns errors if the record to be updated doesn't exist
func UpdateUserById ¶
UpdateUser updates User by Id and returns errors if the record to be updated doesn't exist
Types ¶
type Role ¶
type Role struct { Id int `orm:"column(id);auto"` RoleName string Description string CreateTime time.Time UpdateTime time.Time }
func GetRoleById ¶
GetRoleById retrieves Role by Id. Returns errors if Id doesn't exist
type User ¶
type User struct { Id int `orm:"column(id);auto"` Username string Password string RealName string Mobile string Email string CreateTime time.Time UpdateTime time.Time }
func GetUserById ¶
GetUserById retrieves User by Id. Returns errors if Id doesn't exist
func GetUserByUsername ¶
GetUserByUsername retrieves User by username. Returns false if user doesn't exist or have multi record