Jelajahi Sumber

feat:删除文件

wangchuanjin 2 tahun lalu
induk
melakukan
7a909a11de
1 mengubah file dengan 0 tambahan dan 77 penghapusan
  1. 0 77
      p/mapping.go

+ 0 - 77
p/mapping.go

@@ -1,77 +0,0 @@
-package p
-
-import (
-	"log"
-
-	util "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/mysql"
-)
-
-var PushMapping = &pushMapping{}
-
-type pushMapping struct {
-	Area          map[string]int
-	City          map[string]int
-	Toptype       map[string]int
-	Subtype       map[string]int
-	Buyerclass    map[string]int
-	Subscopeclass map[string]int
-}
-
-func (p *pushMapping) Init(Mysql *mysql.Mysql) {
-	infotype := Mysql.SelectBySql("select id,type,name from base_service.infotype")
-	p.Toptype = map[string]int{}
-	p.Subtype = map[string]int{}
-	p.Buyerclass = map[string]int{}
-	p.Subscopeclass = map[string]int{}
-	if infotype != nil && len(*infotype) > 0 {
-		for _, v := range *infotype {
-			id := util.IntAll(v["id"])
-			tp := util.IntAll(v["type"])
-			name := util.ObjToString(v["name"])
-			if tp == 1 {
-				p.Toptype[name] = id
-			} else if tp == 2 {
-				p.Subtype[name] = id
-			} else if tp == 3 {
-				p.Buyerclass[name] = id
-			} else if tp == 4 {
-				p.Subscopeclass[name] = id
-			}
-		}
-		if len(p.Toptype) == 0 {
-			log.Fatalln("PushMapping Toptype Init Error")
-		}
-		if len(p.Subtype) == 0 {
-			log.Fatalln("PushMapping Subtype Init Error")
-		}
-		if len(p.Buyerclass) == 0 {
-			log.Fatalln("PushMapping Buyerclass Init Error")
-		}
-		if len(p.Subscopeclass) == 0 {
-			log.Fatalln("PushMapping Subscopeclass Init Error")
-		}
-	}
-	//
-	p.Area = map[string]int{}
-	p.City = map[string]int{}
-	province := Mysql.SelectBySql("select id,level,name from base_service.province")
-	if province != nil && len(*province) > 0 {
-		for _, v := range *province {
-			id := util.IntAll(v["id"])
-			level := util.IntAll(v["level"])
-			name := util.ObjToString(v["name"])
-			if level == 1 {
-				p.Area[name] = id
-			} else if level == 2 {
-				p.City[name] = id
-			}
-		}
-		if len(p.Area) == 0 {
-			log.Fatalln("PushMapping Area Init Error")
-		}
-		if len(p.City) == 0 {
-			log.Fatalln("PushMapping City Init Error")
-		}
-	}
-}