Browse Source

feat:新增无消息提醒开关字段

zhangxinlei1996 2 năm trước cách đây
mục cha
commit
65a547eb51
1 tập tin đã thay đổi với 20 bổ sung29 xóa
  1. 20 29
      p/struct.go

+ 20 - 29
p/struct.go

@@ -11,7 +11,6 @@ import (
 	"bp.jydev.jianyu360.cn/BaseService/pushpkg/dfa"
 )
 
-//
 type MgoConf struct {
 	Address          string
 	Size             int
@@ -23,12 +22,10 @@ type MgoConf struct {
 	ExperienceDbName string
 }
 
-//
 type RedisConf struct {
 	Address string
 }
 
-//
 type MysqlConf struct {
 	DbName       string
 	Address      string
@@ -38,7 +35,6 @@ type MysqlConf struct {
 	MaxIdleConns int
 }
 
-//
 type EsConf struct {
 	Address  string
 	Size     int
@@ -47,19 +43,17 @@ type EsConf struct {
 	Password string
 }
 
-//
 type MemberService struct {
 	IsBuy    bool
 	Services map[int]*memberService
 }
 
-//
 type memberService struct {
 	Id        int
 	StartTime string
 }
 
-//关键词
+// 关键词
 type KeySet struct {
 	Item       string   `json:"item"`      //分类名称
 	Keys       []string `json:"key"`       //关键词
@@ -70,7 +64,7 @@ type KeySet struct {
 	MatchWay   int      `json:"matchway"`  //匹配模式 0:精准匹配 1:模糊匹配
 }
 
-//解析订阅词
+// 解析订阅词
 type SubSet struct {
 	MatchWay              int                        //匹配方式 1-标题 2-正文
 	Matchbuyerclass_other int                        //是否开启其他按钮
@@ -94,7 +88,7 @@ type SubSet struct {
 	MaxMailSize           int                        //邮件最大条数
 }
 
-//推送设置
+// 推送设置
 type PushSet struct {
 	Email              string        //邮箱
 	SubSet             *PushSetChild //订阅推送设置
@@ -127,9 +121,10 @@ type PushSetChild struct {
 	WxPush   int      //是否开启微信推送
 	AppPush  int      //是否开启app推送
 	MailPush int      //是否开启邮箱推送
+	Nomsgtip int      //是否开启无消息推送提醒
 }
 
-//用户基本信息
+// 用户基本信息
 type UserInfo struct {
 	Id               string //mongoid
 	BaseUserId       int64  //mysql用户id
@@ -193,7 +188,7 @@ func NewUserInfo(temp map[string]interface{}, tp int) *UserInfo {
 	return ui
 }
 
-//解析用户的推送设置
+// 解析用户的推送设置
 func (u *UserInfo) GetPushSet(obj map[string]interface{}) {
 	subSet, _ := obj["o_subset"].(map[string]interface{})
 	times, _ := subSet["a_times"].([]interface{})
@@ -203,6 +198,7 @@ func (u *UserInfo) GetPushSet(obj map[string]interface{}) {
 	entInfo, _ := obj["o_entinfo"].(map[string]interface{})
 	followProject, _ := obj["o_follow_project"].(map[string]interface{})
 	followEnt, _ := obj["o_follow_ent"].(map[string]interface{})
+
 	u.PushSet = &PushSet{
 		Email: strings.TrimSpace(util.ObjToString(obj["s_email"])),
 		SubSet: &PushSetChild{
@@ -211,6 +207,7 @@ func (u *UserInfo) GetPushSet(obj map[string]interface{}) {
 			MailPush: util.IntAll(subSet["i_mailpush"]),
 			RateMode: util.IntAll(subSet["i_ratemode"]),
 			Times:    util.ObjArrToStringArr(times),
+			Nomsgtip: util.IntAllDef(obj["i_nomsgtip"], 1), //默认开启
 		},
 		WeekReport: &PushSetChild{
 			WxPush:   util.IntAllDef(weekReport["i_wxpush"], 1),
@@ -246,7 +243,7 @@ func (u *UserInfo) GetPushSet(obj map[string]interface{}) {
 	u.PushSet.ResetSubSet()
 }
 
-//解析用户的推送设置
+// 解析用户的推送设置
 func (u *UserInfo) PushSetFilter() {
 	if u.Subscribe == 0 || u.S_m_openid == "" {
 		if u.PushSet.SubSet != nil {
@@ -327,7 +324,7 @@ func (u *UserInfo) PushSetFilter() {
 	}
 }
 
-//解析用户的订阅设置
+// 解析用户的订阅设置
 func (u *UserInfo) GetSubSet(isFreeUser bool, userId string, obj map[string]interface{}) {
 	subSet := &SubSet{
 		Keys:                  []string{},
@@ -483,7 +480,7 @@ func (u *UserInfo) GetSubSet(isFreeUser bool, userId string, obj map[string]inte
 	u.SubSet = subSet
 }
 
-//得到用户的关键词
+// 得到用户的关键词
 func (u *UserInfo) GetKeySets(a_key interface{}) ([]*KeySet, error) {
 	var keySets []*KeySet
 	if a_key == nil {
@@ -517,7 +514,6 @@ func (u *UserInfo) GetKeySets(a_key interface{}) ([]*KeySet, error) {
 	return keySets, err
 }
 
-//
 type Entniche struct {
 	EntId       int    //企业id
 	EntName     string //企业名称
@@ -535,7 +531,7 @@ type Entniche struct {
 	DisVip      int    //分发-大会员
 }
 
-//用户基本信息-扩展
+// 用户基本信息-扩展
 type UserInfoExtend struct {
 	CreateTime int64 //
 	Size       int
@@ -550,7 +546,7 @@ func (u *UserInfo) Add(k string, m *map[string]map[*UserInfo]bool) {
 	(*m)[k] = mk
 }
 
-//添加信息类型映射关系
+// 添加信息类型映射关系
 func (u *UserInfo) AddSbuype(m *map[string]map[*UserInfo]bool) {
 	if len(u.SubSet.Subtypes) == 0 {
 		u.Add("", m)
@@ -561,7 +557,7 @@ func (u *UserInfo) AddSbuype(m *map[string]map[*UserInfo]bool) {
 	}
 }
 
-//添加采购单位类型映射关系
+// 添加采购单位类型映射关系
 func (u *UserInfo) AddBuyerclass(m *map[string]map[*UserInfo]bool) {
 	//如果有关键词 有采购单位行业,行业加上“其它”
 	if len(u.SubSet.Buyerclasss) == 0 {
@@ -576,7 +572,7 @@ func (u *UserInfo) AddBuyerclass(m *map[string]map[*UserInfo]bool) {
 	}
 }
 
-//添加区域映射关系
+// 添加区域映射关系
 func (u *UserInfo) AddArea(m *map[string]map[*UserInfo]bool) {
 	if len(u.SubSet.Areas) == 0 {
 		u.Add("", m)
@@ -587,7 +583,7 @@ func (u *UserInfo) AddArea(m *map[string]map[*UserInfo]bool) {
 	}
 }
 
-//添加区域城市映射关系
+// 添加区域城市映射关系
 func (u *UserInfo) AddAreaCity(area, city *map[string]map[*UserInfo]bool) {
 	if len(u.SubSet.Area) == 0 {
 		u.Add("", area)
@@ -612,7 +608,7 @@ func (u *UserInfo) AddAreaCity(area, city *map[string]map[*UserInfo]bool) {
 	}
 }
 
-//把用户挂在词下面
+// 把用户挂在词下面
 func (u *UserInfo) MakeKeyUser(keys []string, key_user *map[string]*[]*UserInfo) {
 	mp := map[string]bool{}
 	for _, key := range keys {
@@ -678,7 +674,7 @@ type KeyDfa struct {
 	Notkey_user *map[string]*[]*UserInfo
 }
 
-//所有用户的关键词和排除词
+// 所有用户的关键词和排除词
 func (p *KeyDfa) CreateDaf() {
 	//关键词
 	p.Key = &dfa.DFA{}
@@ -696,25 +692,22 @@ func (p *KeyDfa) CreateDaf() {
 	p.NotKey.AddWord(notKeys...)
 }
 
-//
 type MatchUser struct {
 	Keys      []string
 	MatchWays []string
 	MatchWay  map[string]bool
 }
 
-//
 type RelationProjectUser struct {
 	TopTypes []string
 }
 
-//
 type PushInfo struct {
 	Ids  []interface{}
 	Info map[string]interface{}
 }
 
-//推送返回结果
+// 推送返回结果
 type PushResult struct {
 	WxStatus   int
 	AppStatus  int
@@ -723,7 +716,6 @@ type PushResult struct {
 	Infos      *SortList
 }
 
-//
 type PushParam struct {
 	JpushTitle   string
 	LastInfoDate int64
@@ -736,7 +728,6 @@ type PushParam struct {
 	IsPush       bool
 }
 
-//
 type BiddingInfo struct {
 	Id              string
 	Title           string
@@ -757,7 +748,7 @@ type BiddingInfo struct {
 	Infotype        string
 }
 
-//身份信息
+// 身份信息
 type IdentityInfo struct {
 	Name         string
 	PersonId     int64