1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- package logic
- import (
- "context"
- "jyBXCore/rpc/type/bxcore"
- "net/http"
- "jyBXCore/api/internal/svc"
- "jyBXCore/api/internal/types"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type LimitSearchContentLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- r *http.Request
- }
- func NewLimitSearchContentLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Request) *LimitSearchContentLogic {
- return &LimitSearchContentLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- r: r,
- }
- }
- func (l *LimitSearchContentLogic) LimitSearchContent(req *types.SearchLimitReq) (resp *types.CommonResp, err error) {
- res, err := l.svcCtx.BxCore.SearchLimit(l.ctx, &bxcore.SearchLimitReq{
- Appid: req.AppId,
- TimeOut: req.TimeOut,
- Count: req.Count,
- Flag: req.Flag,
- Percentage: req.Percentage,
- UserId: l.r.Header.Get("userId"),
- SearchType: req.SearchType,
- })
- if err != nil {
- return &types.CommonResp{
- Err_code: res.ErrCode,
- Err_msg: res.ErrMsg,
- Data: nil,
- }, nil
- }
- return &types.CommonResp{
- Err_code: res.ErrCode,
- Err_msg: res.ErrMsg,
- Data: res.Data,
- }, nil
- }
|