userauthinfosavelogic.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. EntCode: req.EntCode,
  33. OperationType: req.OperationType,
  34. })
  35. if err != nil {
  36. return nil, err
  37. }
  38. return &types.CommonRes{
  39. Error_msg: resp.ErrorMsg,
  40. Error_code: int(resp.ErrorCode),
  41. Data: resp.Data,
  42. }, nil
  43. }