Documentation ¶
Index ¶
- Constants
- Variables
- func CreatePasswordHash(password string) (string, error)
- func CreateToken(tokenPairs map[string]interface{}) (string, error)
- func DecodeToken(tokenStr string) (map[string]interface{}, error)
- func IsPasswordRight(passwordHashInDb string, passwordLogin string) bool
- type SysRoleServiceType
- func (c *SysRoleServiceType) Clean() (int64, error)
- func (c *SysRoleServiceType) Create(model *model.SysRole) (*model.SysRole, error)
- func (c *SysRoleServiceType) CreateBatch(models []*model.SysRole, batchSize int) ([]*model.SysRole, error)
- func (c *SysRoleServiceType) Delete(ids []int64) (int64, error)
- func (c *SysRoleServiceType) GetOrderByExpr(orderBy string) ([]field.Expr, error)
- func (c *SysRoleServiceType) QueryAll(wheres []field.Expr, orderBys []field.Expr, page int, pageSize int) ([]*model.SysRole, int64, error)
- func (c *SysRoleServiceType) QueryById(id int64) (*model.SysRole, error)
- func (c *SysRoleServiceType) SoftDelete(ids []int64) (int64, error)
- func (c *SysRoleServiceType) Update(model *model.SysRole) (int64, error)
- func (c *SysRoleServiceType) UpdateBatch(models []*model.SysRole) (int64, error)
- func (c *SysRoleServiceType) UpdateColumns(whereExpr field.Expr, columns map[string]interface{}) (int64, error)
- type TestCatServiceType
- func (c *TestCatServiceType) Create(model *model.TestCat) (*model.TestCat, error)
- func (c *TestCatServiceType) CreateBatch(models []*model.TestCat, batchSize int) ([]*model.TestCat, error)
- func (c *TestCatServiceType) Delete(ids []int64) (int64, error)
- func (c *TestCatServiceType) GetOrderByExpr(orderBy string) ([]field.Expr, error)
- func (c *TestCatServiceType) QueryAll(wheres []field.Expr, orderBys []field.Expr, page int, pageSize int) ([]*model.TestCat, int64, error)
- func (c *TestCatServiceType) QueryById(id int64) (*model.TestCat, error)
- func (c *TestCatServiceType) Update(model *model.TestCat) (int64, error)
- func (c *TestCatServiceType) UpdateBatch(models []*model.TestCat) (int64, error)
- func (c *TestCatServiceType) UpdateColumns(whereExpr field.Expr, columns map[string]interface{}) (int64, error)
Constants ¶
View Source
const (
TOKEN_KEY = "GOCODEGEN20220808"
)
Variables ¶
View Source
var ( SysRoleService = SysRoleServiceType{} SysRoleConn = query.Use(dal.CreateDbConn("SysRole")) SysRoleDao = SysRoleConn.SysRole )
View Source
var ( TestCatService = TestCatServiceType{} TestCatConn = query.Use(dal.CreateDbConn("TestCat")) TestCatDao = TestCatConn.TestCat )
Functions ¶
func CreatePasswordHash ¶
func CreateToken ¶
func DecodeToken ¶
func IsPasswordRight ¶
passwordHashInDb: pasword hash str stored in db passwordLogin: password from login input
Types ¶
type SysRoleServiceType ¶
type SysRoleServiceType struct { }
func (*SysRoleServiceType) Clean ¶
func (c *SysRoleServiceType) Clean() (int64, error)
清除已软删除的记录,成功返回影响的行数, 有deleted字段时才有该方法
func (*SysRoleServiceType) CreateBatch ¶
func (c *SysRoleServiceType) CreateBatch(models []*model.SysRole, batchSize int) ([]*model.SysRole, error)
批量创建,成功返回成功插入的行数
func (*SysRoleServiceType) Delete ¶
func (c *SysRoleServiceType) Delete(ids []int64) (int64, error)
硬删除记录,成功返回影响的行数
func (*SysRoleServiceType) GetOrderByExpr ¶
func (c *SysRoleServiceType) GetOrderByExpr(orderBy string) ([]field.Expr, error)
解析orderby 字符串为表达式,orderBy格式: "id desc,name desc"
func (*SysRoleServiceType) QueryAll ¶
func (c *SysRoleServiceType) QueryAll(wheres []field.Expr, orderBys []field.Expr, page int, pageSize int) ([]*model.SysRole, int64, error)
查询所有,limits<0 时无限制
func (*SysRoleServiceType) QueryById ¶
func (c *SysRoleServiceType) QueryById(id int64) (*model.SysRole, error)
按id查询一个
func (*SysRoleServiceType) SoftDelete ¶
func (c *SysRoleServiceType) SoftDelete(ids []int64) (int64, error)
软删除,设置deleted=1,成功返回影响的行数, 有deleted字段时才有该方法
func (*SysRoleServiceType) Update ¶
func (c *SysRoleServiceType) Update(model *model.SysRole) (int64, error)
更新一个,成功返回影响的行数
func (*SysRoleServiceType) UpdateBatch ¶
func (c *SysRoleServiceType) UpdateBatch(models []*model.SysRole) (int64, error)
批量更新,成功返回成功的行数
func (*SysRoleServiceType) UpdateColumns ¶
func (c *SysRoleServiceType) UpdateColumns(whereExpr field.Expr, columns map[string]interface{}) (int64, error)
按条件更新一批指定的字段,成功返回影响的行数
type TestCatServiceType ¶
type TestCatServiceType struct { }
func (*TestCatServiceType) CreateBatch ¶
func (c *TestCatServiceType) CreateBatch(models []*model.TestCat, batchSize int) ([]*model.TestCat, error)
批量创建,成功返回成功插入的行数
func (*TestCatServiceType) Delete ¶
func (c *TestCatServiceType) Delete(ids []int64) (int64, error)
硬删除记录,成功返回影响的行数
func (*TestCatServiceType) GetOrderByExpr ¶
func (c *TestCatServiceType) GetOrderByExpr(orderBy string) ([]field.Expr, error)
解析orderby 字符串为表达式,orderBy格式: "id desc,name desc"
func (*TestCatServiceType) QueryAll ¶
func (c *TestCatServiceType) QueryAll(wheres []field.Expr, orderBys []field.Expr, page int, pageSize int) ([]*model.TestCat, int64, error)
查询所有,limits<0 时无限制
func (*TestCatServiceType) QueryById ¶
func (c *TestCatServiceType) QueryById(id int64) (*model.TestCat, error)
按id查询一个
func (*TestCatServiceType) Update ¶
func (c *TestCatServiceType) Update(model *model.TestCat) (int64, error)
更新一个,成功返回影响的行数
func (*TestCatServiceType) UpdateBatch ¶
func (c *TestCatServiceType) UpdateBatch(models []*model.TestCat) (int64, error)
批量更新,成功返回成功的行数
func (*TestCatServiceType) UpdateColumns ¶
func (c *TestCatServiceType) UpdateColumns(whereExpr field.Expr, columns map[string]interface{}) (int64, error)
按条件更新一批指定的字段,成功返回影响的行数
Click to show internal directories.
Click to hide internal directories.