Przeglądaj źródła

feat:修改类型

wangchuanjin 1 rok temu
rodzic
commit
9f210a9d40
4 zmienionych plików z 17 dodań i 17 usunięć
  1. 9 9
      matcher/paymatch.go
  2. 5 5
      p/public.go
  3. 1 1
      p/struct.go
  4. 2 2
      projecter/push.go

+ 9 - 9
matcher/paymatch.go

@@ -52,7 +52,7 @@ func (p *PayUser) Match(poolSize int, datas *[]map[string]interface{}) (*map[*Us
 				matchWaitGroup.Done()
 				<-matchPool
 			}()
-			users, projectUsers := p.ToMatch(&info)
+			users, projectUsers := p.ToMatch(info)
 			lock.Lock()
 			defer lock.Unlock()
 			if users != nil && len(*users) > 0 {
@@ -62,7 +62,7 @@ func (p *PayUser) Match(poolSize int, datas *[]map[string]interface{}) (*map[*Us
 						l = &SortList{}
 					}
 					*l = append(*l, &MatchInfo{
-						Info:      &info,
+						Info:      info,
 						Keys:      v.Keys,
 						Items:     v.Items,
 						MatchWays: v.MatchWays,
@@ -92,15 +92,15 @@ func (p *PayUser) Match(poolSize int, datas *[]map[string]interface{}) (*map[*Us
 }
 
 //
-func (p *PayUser) ToMatch(info *map[string]interface{}) (*map[*UserInfo]*MatchUser, *[]*UserInfo) {
-	buyerclass, _ := (*info)["buyerclass"].(string)
-	area, _ := (*info)["area"].(string)
+func (p *PayUser) ToMatch(info map[string]interface{}) (*map[*UserInfo]*MatchUser, *[]*UserInfo) {
+	buyerclass, _ := info["buyerclass"].(string)
+	area, _ := info["area"].(string)
 	if area == "全国" {
 		area = ""
 	}
-	city, _ := (*info)["city"].(string)
-	district, _ := (*info)["district"].(string)
-	subtype, _ := (*info)["subtype"].(string)
+	city, _ := info["city"].(string)
+	district, _ := info["district"].(string)
+	subtype, _ := info["subtype"].(string)
 	title := GetInfoTitle(info)
 	//订阅词
 	keys := p.Title_KeyDfa.Key.Analy(title)
@@ -113,7 +113,7 @@ func (p *PayUser) ToMatch(info *map[string]interface{}) (*map[*UserInfo]*MatchUs
 	if p.Detail_KeyDfa != nil {
 		//detail, _ := (*info)["projectscope"].(string)
 		//if detail == "" {
-		detail, _ := (*info)["detail"].(string)
+		detail, _ := info["detail"].(string)
 		//}
 		if detail != "" {
 			detail = strings.ToUpper(detail)

+ 5 - 5
p/public.go

@@ -204,9 +204,9 @@ func HasService(msl *Mysql, userId string, params ...int) *MemberService {
 }
 
 //
-func GetInfoTitle(info *map[string]interface{}) string {
-	title, _ := (*info)["title"].(string)
-	jsondata, _ := (*info)["jsondata"].(map[string]interface{})
+func GetInfoTitle(info map[string]interface{}) string {
+	title, _ := info["title"].(string)
+	jsondata, _ := info["jsondata"].(map[string]interface{})
 	if jsondata != nil {
 		goods, _ := jsondata["goods"].(string)
 		title += goods
@@ -332,10 +332,10 @@ func MergeSortList(o, n interface{}, maxPushSize int) *SortList {
 	}
 	idMap := map[string]bool{}
 	for _, v := range *nf {
-		idMap[util.ObjToString((*v.Info)["_id"])] = true
+		idMap[util.ObjToString(v.Info["_id"])] = true
 	}
 	for _, v := range *of {
-		if idMap[util.ObjToString((*v.Info)["_id"])] {
+		if idMap[util.ObjToString(v.Info["_id"])] {
 			continue
 		}
 		*nf = append(*nf, v)

+ 1 - 1
p/struct.go

@@ -772,7 +772,7 @@ func (s SortList) Len() int {
 }
 
 func (s SortList) Less(i, j int) bool {
-	return util.Int64All((*s[i].Info)["publishtime"]) > util.Int64All((*s[j].Info)["publishtime"])
+	return util.Int64All(s[i].Info["publishtime"]) > util.Int64All(s[j].Info["publishtime"])
 }
 
 func (s SortList) Swap(i, j int) {

+ 2 - 2
projecter/push.go

@@ -142,7 +142,7 @@ func (p *Push) Execute(pusher Pusher) int64 {
 									}
 									info["_id"] = infoId
 									info["attachment_count"] = GetAttachmentCountById(p.Mgo_Bidding, p.Mgo_Bidding_DbName, p.Mgo_Bidding_Collection, infoId)
-									*sortList = append(*sortList, &MatchInfo{Info: &info})
+									*sortList = append(*sortList, &MatchInfo{Info: info})
 								}
 								if !hasUpdate && isMain && publishTime > maxPublishTime {
 									updateProject = append(updateProject, []map[string]interface{}{
@@ -206,7 +206,7 @@ func (p *Push) Execute(pusher Pusher) int64 {
 						if pushDate := pusher.SaveToMysql(userInfo, &saveArray, &jobTime); pushDate > 0 {
 							redis.Put(Pushcache_2_a, dayCountKey, dayCount+length, OneDaySecond)
 							for _, v := range saveArray {
-								redis.Put(Pushcache_2_a, pusher.PushInfoKey(userInfo, util.ObjToString((*v.Info)["_id"])), 1, OneDaySecond)
+								redis.Put(Pushcache_2_a, pusher.PushInfoKey(userInfo, util.ObjToString(v.Info["_id"])), 1, OneDaySecond)
 							}
 						}
 					}