123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- package logic
- import (
- "context"
- "jyBXBuyer/rpc/type/bxbuyer"
- "net/http"
- "jyBXBuyer/api/internal/svc"
- "jyBXBuyer/api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type SearchListLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- r *http.Request
- }
- func NewSearchListLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *SearchListLogic {
- return &SearchListLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- r: r,
- }
- }
- func (l *SearchListLogic) SearchList(req *types.BuyerListReq) (resp *types.CommonResp, err error) {
- if req.EntUserId == "" {
- req.IsCheckReceive = false
- }
- if req.UserId == "" {
- req.IsCheckFollow = false
- }
- res, err0 := l.svcCtx.Buyer.BuyerList(l.ctx, &bxbuyer.BuyerListReq{
- AppId: req.AppId,
- BuyerName: req.BuyerName,
- Province: req.Province,
- City: req.City,
- BusinessScope: req.BusinessScope,
- Industry: req.Industry,
- BuyerClass: req.BuyerClass,
- IsCheckFollow: req.IsCheckFollow,
- IsCheckReceive: req.IsCheckReceive,
- UserType: req.UserType,
- UserId: l.r.Header.Get("userId"),
- EntId: req.EntId,
- EntUserId: req.EntUserId,
- Customer: req.Customer,
- })
- if err0 != nil {
- return &types.CommonResp{
- Err_code: -1,
- Err_msg: "错误",
- Data: nil,
- }, nil
- }
- return &types.CommonResp{
- Err_code: res.ErrCode,
- Err_msg: res.ErrMsg,
- Data: res.Data,
- }, nil
- return
- }
|