datasmtlistlogic.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package logic
  2. import (
  3. "context"
  4. "jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/rpc/datasmt"
  5. "jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/api/internal/svc"
  6. "jygit.jydev.jianyu360.cn/ApplicationCenter/publicService/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type DatasmtListLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewDatasmtListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DatasmtListLogic {
  15. return &DatasmtListLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *DatasmtListLogic) DatasmtList(req *types.DatasmtReqList) (resp *types.CommonResp, err error) {
  22. // todo: add your logic here and delete this line
  23. res, err := l.svcCtx.PublicService.List(l.ctx, &datasmt.DatasmtReqList{
  24. DataType: req.DataType,
  25. SearchValue: req.SearchValue,
  26. PageSize: req.PageSize,
  27. PageNum: req.PageNum,
  28. })
  29. if err != nil {
  30. return &types.CommonResp{
  31. Err_code: -1,
  32. Err_msg: "错误",
  33. Data: nil,
  34. }, nil
  35. }
  36. return &types.CommonResp{
  37. Data: res,
  38. }, nil
  39. }