user.go 451 B

1234567891011121314151617
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/admin/ep/merlin/model"
  5. )
  6. // QueryUserInfo query user info.
  7. func (s *Service) QueryUserInfo(c context.Context, username string) (userInfo *model.User, err error) {
  8. if userInfo, err = s.dao.FindUserByUserName(username); err != nil {
  9. user := model.User{Name: username, EMail: username + "@bilibili.com"}
  10. s.dao.CreateUser(&user)
  11. userInfo, err = s.dao.FindUserByUserName(username)
  12. }
  13. return
  14. }