userdellogic.go 789 B

12345678910111213141516171819202122232425262728293031323334353637
  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 UserDelLogic struct {
  11. logx.Logger
  12. ctx context.Context
  13. svcCtx *svc.ServiceContext
  14. }
  15. func NewUserDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) UserDelLogic {
  16. return UserDelLogic{
  17. Logger: logx.WithContext(ctx),
  18. ctx: ctx,
  19. svcCtx: svcCtx,
  20. }
  21. }
  22. func (l *UserDelLogic) UserDel(req types.UserDelReq) (*types.Resp, error) {
  23. // todo: add your logic here and delete this line
  24. res, err := entity.UserCenterRpc.UserDel(l.ctx, &UserIdReq{
  25. Id: req.Id,
  26. })
  27. return &types.Resp{
  28. Error_code: res.ErrorCode,
  29. Error_msg: res.ErrorMsg,
  30. Data: res.Data,
  31. }, err
  32. }