package logic import ( "context" "github.com/zeromicro/go-zero/core/logx" "userCenter/api/internal/svc" "userCenter/api/internal/types" "userCenter/entity" . "userCenter/rpc/usercenter" ) type UserAddLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewUserAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) UserAddLogic { return UserAddLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *UserAddLogic) UserAdd(req types.UserAddReq) (*types.Resp, error) { // todo: add your logic here and delete this line res, err := entity.UserCenterRpc.UserAdd(l.ctx, &UserAddReq{ Appid: req.Appid, Phone: req.Phone, Nickname: req.Nickname, Headimg: req.Headimg, Company: req.Company, Position: req.Position, Password: req.Password, AOpenid: req.AOpenid, SOpenid: req.SOpenid, Unionid: req.Unionid, }) return &types.Resp{ Error_code: res.ErrorCode, Error_msg: res.ErrorMsg, Data: res.Data, }, err }