1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- package logic
- import (
- "context"
- IC "jyBXSubscribe/rpc/init"
- "jyBXSubscribe/rpc/util"
- "log"
- "jyBXSubscribe/rpc/internal/svc"
- "jyBXSubscribe/rpc/type/bxsubscribe"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type GetSubListLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewGetSubListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetSubListLogic {
- return &GetSubListLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 获取订阅推送列表
- func (l *GetSubListLogic) GetSubList(in *bxsubscribe.SubscribeInfosReq) (*bxsubscribe.SubscribeInfosResp, error) {
- log.Println("in:", in)
- //1、推送信息已读标识
- //超级订阅 i_apppushunread=0
- //大会员 i_member_apppushunread=0
- //商机管理 i_entniche_apppushunread=0
- if in.PageNum == 1 {
- go util.UpdateUserPushUnread(in.UserId, in.UserType)
- }
- spqp := &util.SubPushQueryParam{
- Mgo_bidding: IC.MgoBidding, //mongo
- Bidding: IC.DB.MongoDB.Bidding.Collection, //招标信息 表
- Bidding_back: IC.DB.MongoDB.Bidding.CollectionBack, //招标信息备份数据 表名
- UserId: in.UserId, //用户id
- PageNum: int(in.PageNum), //当前页码
- PageSize: int(in.PageSize), //每页多少条数据
- SelectTime: in.SelectTime, //时间跨度
- Area: in.Area, //省份
- City: in.City, //城市
- Buyerclass: in.BuyerClass, //采购单位类型
- Subtype: in.Subtype, //信息类型
- Subscopeclass: in.Industry, //行业
- Key: in.KeyWords, //关键词
- Price: in.Price, //价格区间
- FileExists: in.FileExists, //是否有附件
- }
- if in.UserType == "mType" {
- spqp.PushMysql = IC.MemberPushMysql
- } else if in.UserType == "eType" {
- spqp.PushMysql = IC.EntnichePushMysql
- } else {
- spqp.PushMysql = IC.PushMysql
- }
- hasNextPage, total, list := util.NewSubscribePush(in.UserType).Datas(spqp)
- //查询是否收藏
- util.NewSubscribePush(in.UserType).MakeCollection(in.UserId, list)
- return &bxsubscribe.SubscribeInfosResp{
- Data: &bxsubscribe.SubscribeData{
- List: list,
- Count: total,
- HasNextPage: hasNextPage,
- },
- }, nil
- }
|