updateentlogic.go 855 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package logic
  2. import (
  3. "context"
  4. "userCenter/api/internal/svc"
  5. "userCenter/api/internal/types"
  6. "userCenter/entity"
  7. "userCenter/rpc/pb"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type UpdateEntLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewUpdateEntLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateEntLogic {
  16. return &UpdateEntLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *UpdateEntLogic) UpdateEnt(req *types.UpdateEntReq) (resp *types.Resp, err error) {
  23. // todo: add your logic here and delete this line
  24. res, err := entity.UserCenterRpc.EntUpdate(l.ctx, &pb.EntUpdateReq{
  25. EntId: req.EntId,
  26. UpdateType: req.UpdateType,
  27. })
  28. return &types.Resp{
  29. Error_code: res.ErrorCode,
  30. Error_msg: res.ErrorMsg,
  31. Data: res.Data,
  32. }, err
  33. }