userauthinfologic.go 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package auth
  2. import (
  3. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
  4. "context"
  5. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/svc"
  6. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/api/medical/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type UserAuthInfoLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewUserAuthInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserAuthInfoLogic {
  15. return &UserAuthInfoLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *UserAuthInfoLogic) UserAuthInfo(req *types.CommonReq) (*types.CommonRes, error) {
  22. // todo: add your logic here and delete this line
  23. resp, err := l.svcCtx.Medical.UserAuthInfo(l.ctx, &medical.CommonReq{
  24. UserId: req.NewUserId,
  25. Appid: req.AppId,
  26. })
  27. if err != nil {
  28. return nil, err
  29. }
  30. return &types.CommonRes{
  31. Error_msg: resp.ErrorMsg,
  32. Error_code: int(resp.ErrorCode),
  33. Data: resp.Data,
  34. State: resp.Status,
  35. }, nil
  36. }