delSearchScreenLogic.go 1010 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. "context"
  5. "jyBXBase/rpc/type/bxbase"
  6. "net/http"
  7. "jyBXBase/api/internal/svc"
  8. "jyBXBase/api/internal/types"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type DelSearchScreenLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. r *http.Request
  16. }
  17. func NewDelSearchScreenLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *DelSearchScreenLogic {
  18. return &DelSearchScreenLogic{
  19. Logger: logx.WithContext(ctx),
  20. ctx: ctx,
  21. svcCtx: svcCtx,
  22. r: r,
  23. }
  24. }
  25. func (l *DelSearchScreenLogic) DelSearchScreen(req *types.DelSearchScreen) (resp *types.CommonRes, err error) {
  26. res, err0 := l.svcCtx.Bxbase.DelSearch(l.ctx, &bxbase.DelSearchReq{
  27. Id: req.Id,
  28. })
  29. if err0 != nil {
  30. return &types.CommonRes{
  31. Err_code: -1,
  32. Err_msg: "错误",
  33. Data: nil,
  34. }, nil
  35. }
  36. return &types.CommonRes{
  37. Err_code: common.IntAll(res.ErrCode),
  38. Err_msg: res.ErrMsg,
  39. Data: nil,
  40. }, nil
  41. }