useraddlogic.go 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package logic
  2. import (
  3. "context"
  4. "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/svc"
  5. "bp.jydev.jianyu360.cn/BaseService/userCenter/api/internal/types"
  6. "bp.jydev.jianyu360.cn/BaseService/userCenter/entity"
  7. . "bp.jydev.jianyu360.cn/BaseService/userCenter/rpc/usercenter"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type UserAddLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewUserAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) UserAddLogic {
  16. return UserAddLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *UserAddLogic) UserAdd(req types.UserAddReq) (*types.Resp, error) {
  23. // todo: add your logic here and delete this line
  24. res, err := entity.UserCenterRpc.UserAdd(l.ctx, &UserAddReq{
  25. Appid: req.Appid,
  26. Phone: req.Phone,
  27. Nickname: req.Nickname,
  28. Headimg: req.Headimg,
  29. Company: req.Company,
  30. Position: req.Position,
  31. Password: req.Password,
  32. AOpenid: req.AOpenid,
  33. SOpenid: req.SOpenid,
  34. Unionid: req.Unionid,
  35. IdCard: req.IdCard,
  36. Sex: req.Sex,
  37. Address: req.Address,
  38. })
  39. return &types.Resp{
  40. Error_code: res.ErrorCode,
  41. Error_msg: res.ErrorMsg,
  42. Data: res.Data,
  43. }, err
  44. }