| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- // ============================================================================
- // This is auto-generated by gf cli tool only once. Fill this file as you wish.
- // ============================================================================
- package dao
- import (
- "context"
- "dashoo.cn/micro/app/dao/internal"
- "dashoo.cn/micro/app/model"
- "github.com/gogf/gf/errors/gerror"
- "github.com/gogf/gf/frame/g"
- )
- // sysUserDao is the manager for logic model data accessing
- // and custom defined data operations functions management. You can define
- // methods on it to extend its functionality as you wish.
- type sysUserDao struct {
- internal.SysUserDao
- }
- var (
- // SysUser is globally public accessible object for table sys_user operations.
- SysUser = sysUserDao{
- internal.SysUser,
- }
- )
- type SysUserDao struct {
- internal.SysUserDao
- }
- func NewSysUserDao(tenant string) *SysUserDao {
- dao := internal.NewSysUserDao(tenant)
- return &SysUserDao{
- dao,
- }
- }
- // Fill with you ideas below.
- // FindByUsername 通过用户名获取用户信息
- func (d *sysUserDao) FindByUsername(ctx context.Context, username string) (user *model.LoginUserRes, err error) {
- user = &model.LoginUserRes{}
- err = d.Ctx(ctx).Fields(user).Where(d.Columns.UserName, username).Scan(user)
- if err != nil {
- g.Log().Error(err)
- err = gerror.New("获取用户信息失败")
- }
- return
- }
|