12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- package logic
- import (
- "app.yhyue.com/moapp/jyInfo/rpc/consumer/consumerclient"
- "context"
- "app.yhyue.com/moapp/jybase/common"
- "app.yhyue.com/moapp/jyInfo/api/internal/svc"
- "app.yhyue.com/moapp/jyInfo/api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type SupplySearchLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewSupplySearchLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SupplySearchLogic {
- return &SupplySearchLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *SupplySearchLogic) SupplySearch(req *types.PubSupplyInfoReq) (resp *types.CommonRes, err error) {
- supplySearch, err0 := l.svcCtx.Consumer.SupplyInfoSearch(l.ctx, &consumerclient.SupplyInfoSearchReq{
- Keywords: req.Keywords,
- SearchType: req.SearchType,
- Province: req.Province,
- City: req.City,
- Time: req.Time,
- Status: req.Status,
- PageSize: req.PageSize,
- PageIndex: req.PageIndex,
- })
- if err0 != nil {
- return &types.CommonRes{
- Err_code: -1,
- Err_msg: "错误",
- Data: nil,
- }, nil
- }
- return &types.CommonRes{
- Err_code: common.IntAll(supplySearch.ErrCode),
- Err_msg: supplySearch.ErrMsg,
- Data: supplySearch.Data,
- }, nil
- }
|