package logic import ( "context" "jyBXSubscribe/rpc/model" "jyBXSubscribe/rpc/internal/svc" "jyBXSubscribe/rpc/type/bxsubscribe" "github.com/zeromicro/go-zero/core/logx" ) type SetReadLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewSetReadLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SetReadLogic { return &SetReadLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // 推送数据浏览状态修改 func (l *SetReadLogic) SetRead(in *bxsubscribe.SetReadReq) (*bxsubscribe.StatusResp, error) { // todo: add your logic here and delete this line resp := &bxsubscribe.StatusResp{} //主体处理(fType:普通用户;vType:超级订阅用户;mType:大会员用户;eType:商机管理用户) userType := in.UserType /*infoCount := int64(0) if in.UserType == model.MemberFlag { infoCount = IC.MainMysql.CountBySql("select count(id) from entniche_wait_empower where ent_id=? and end_time>NOW() and product_type like '%大会员%' ", in.EntId) } else if in.UserType == model.SubVipFlag { infoCount = IC.MainMysql.CountBySql("select count(id) from entniche_wait_empower where ent_id=? and end_time>NOW() and product_type like '%VIP订阅%' ", in.EntId) } if infoCount > 0 { in.UserType = model.EntnicheFlag }*/ if in.UserType == model.MemberFlag || in.UserType == model.SubVipFlag || in.UserType == model.SubFreeFlag { if in.PositionType == 1 { in.UserType = model.EntnicheFlag } } model.NewSubscribePush(in.UserType).SetRead(in.NewUserId, in.Vsid, in.UserId, in.EntUserId, in.EntId, in.IsEnt, userType) return resp, nil }