user.go 462 B

1234567891011121314151617181920212223
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/admin/main/tv/model"
  5. "go-common/library/log"
  6. "github.com/jinzhu/gorm"
  7. )
  8. //UserInfo select user info by mid
  9. func (s *Service) UserInfo(c context.Context, mid int64) (userInfo *model.TvUserInfoResp, err error) {
  10. if userInfo, err = s.dao.GetByMId(c, mid); err != nil {
  11. if err == gorm.ErrRecordNotFound {
  12. return nil, nil
  13. }
  14. log.Error("UserInfo (%v) error(%v)", userInfo, err)
  15. return
  16. }
  17. return
  18. }