userauthinfosavelogic.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package logic
  2. import (
  3. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/entity"
  4. IC "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/init"
  5. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/service"
  6. "context"
  7. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/internal/svc"
  8. "bp.jydev.jianyu360.cn/ApplicationCenter/medicalField/rpc/medical/medical"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type UserAuthInfoSaveLogic struct {
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. logx.Logger
  15. }
  16. func NewUserAuthInfoSaveLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserAuthInfoSaveLogic {
  17. return &UserAuthInfoSaveLogic{
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. Logger: logx.WithContext(ctx),
  21. }
  22. }
  23. // 用户认证信息保存
  24. func (l *UserAuthInfoSaveLogic) UserAuthInfoSave(in *medical.UserInfo) (*medical.CommonResp, error) {
  25. // todo: add your logic here and delete this line
  26. m := service.AuthService{
  27. BasesqlConn: entity.BaseMysql,
  28. GoodsSpecId: IC.C.GoodsSpecId,
  29. GoodsCode: IC.C.GoodsCode,
  30. }
  31. errcode, msg := m.UserAuthInfoSave(in)
  32. result := &medical.CommonResp{}
  33. if errcode {
  34. result.ErrorCode = entity.SUCCESSCODE
  35. } else {
  36. result.ErrorCode = entity.ERRORCODE
  37. result.ErrorMsg = msg
  38. }
  39. return result, nil
  40. }