userupdatelogic.go 1.0 KB

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