userauthinfosavelogic.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 UserAuthInfoSaveLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewUserAuthInfoSaveLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserAuthInfoSaveLogic {
  15. return &UserAuthInfoSaveLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *UserAuthInfoSaveLogic) UserAuthInfoSave(req *types.UserInfoReq) (*types.CommonRes, error) {
  22. // todo: add your logic here and delete this line
  23. resp, err := l.svcCtx.Medical.UserAuthInfoSave(l.ctx, &medical.UserInfo{
  24. UserId: req.NewUserId,
  25. Appid: req.AppId,
  26. Name: req.Name,
  27. Phone: req.Phone,
  28. Mail: req.Mail,
  29. Position: req.Position,
  30. Department: req.Department,
  31. EntName: req.EntName,
  32. OperationType: req.OperationType,
  33. })
  34. if err != nil {
  35. return nil, err
  36. }
  37. return &types.CommonRes{
  38. Error_msg: resp.ErrorMsg,
  39. Error_code: int(resp.ErrorCode),
  40. Data: resp.Data,
  41. }, nil
  42. }