Explorar el Código

数据抽取~备份 11~18

zhengkun hace 2 años
padre
commit
2ad801b9f0
Se han modificado 2 ficheros con 17 adiciones y 31 borrados
  1. 17 29
      src/jy/extract/extractInit.go
  2. 0 2
      src/main.go

+ 17 - 29
src/jy/extract/extractInit.go

@@ -72,7 +72,6 @@ type ExtractTask struct {
 	RuleBacks     []*RegLuaInfo //通用后置规则
 	SiteRuleBacks []*RegLuaInfo //站点通用后置规则
 	RuleBlock     *ju.RuleBlock
-	//RuleCores      []*RuleCore         //抽取规则
 	RuleCores     map[string]map[string][]*RuleCore //分类抽取规则
 	SiteRuleCores map[string]map[string][]*RuleCore //站点分类抽取规则
 	PkgRuleCores  []*RuleCore                       //分包抽取规则
@@ -83,26 +82,18 @@ type ExtractTask struct {
 	IsExtractCity bool                              //是否开启城市抽取
 	Fields        map[string]int                    //抽取属性组
 	SiteFields    map[string]int                    //抽取站点属性组
-
-	IsFileField bool      //是否开启附件抽取
-	FileFields  *sync.Map //抽取附件属性组
-
-	ResultChanel chan bool //抽取结果详情
+	IsFileField   bool                              //是否开启附件抽取
+	FileFields    *sync.Map                         //抽取附件属性组
+	ResultChanel  chan bool                         //抽取结果详情
 	sync.RWMutex
-	ResultArr [][]map[string]interface {
-	} //抽取结果详情
-	BidChanel chan bool //抽取结果
-	BidArr    [][]map[string]interface {
-	} //抽取结果
-	BidTotal int //结果数量
-
-	RecogFieldMap map[string]map[string]interface {
-	} //识别字段
-	FidClassMap map[string][]map[string]interface {
-	} //分类
-	CidRuleMap map[string][]map[string]interface {
-	} //规则
-	AuditFields []string //需要审核的字段名称
+	ResultArr     [][]map[string]interface{}          //抽取结果详情
+	BidChanel     chan bool                           //抽取结果
+	BidArr        [][]map[string]interface{}          //抽取结果
+	BidTotal      int                                 //结果数量
+	RecogFieldMap map[string]map[string]interface{}   //识别字段
+	FidClassMap   map[string][]map[string]interface{} //分类
+	CidRuleMap    map[string][]map[string]interface{} //规则
+	AuditFields   []string                            //需要审核的字段名称
 
 	SiteCityMap       map[string]*SiteCity          //站点对应的省市区
 	ProvinceMap       map[string]string             //省全称简称(key:浙江省 val:浙江)
@@ -165,19 +156,18 @@ type ClearLua struct {
 	Code    string //代码
 	Name    string //名称
 	LuaText string
+	LFields map[string]string //lua抽取字段属性组
 	//LuaLogic string            //进入逻辑
 	//ExtFrom string            //从哪个字段抽取
-	LFields map[string]string //lua抽取字段属性组
 }
 
 type ClearTask struct {
 	sync.RWMutex
-	Id            string                 //任务id
-	Content       string                 //信息内容
-	ClearTaskInfo *ClearTaskInfo         //任务信息
-	ClearLuas     map[string][]*ClearLua //清理脚本
-
-	UpdateResult [][]map[string]interface{} //清理后结果
+	Id            string                     //任务id
+	Content       string                     //信息内容
+	ClearTaskInfo *ClearTaskInfo             //任务信息
+	ClearLuas     map[string][]*ClearLua     //清理脚本
+	UpdateResult  [][]map[string]interface{} //清理后结果
 	//ClearChannel chan bool
 }
 
@@ -1298,7 +1288,6 @@ func (e *ExtractTask) InitVar() {
 	if e.DistrictSimAndAll == nil {
 		e.DistrictSimAndAll = make(map[string][]map[string]*City)
 	}
-
 	if e.CityBriefMap == nil {
 		e.CityBriefMap = make(map[string]*City)
 	}
@@ -1311,7 +1300,6 @@ func (e *ExtractTask) InitVar() {
 	if e.DistrictCityMap == nil {
 		e.DistrictCityMap = make(map[string][]*City)
 	}
-
 	if e.StreetDistrictMap == nil {
 		e.StreetDistrictMap = make(map[string][]*District)
 	}

+ 0 - 2
src/main.go

@@ -28,12 +28,10 @@ func init() {
 }
 
 func main() {
-	//调试
 	extract.ExtractUdpUpdateMachine() //节点上传~构建
 	extract.ExtractUdp()              //udp通知抽取
 	go Router.Run(":" + qu.ObjToString(u.Config["port"]))
 	go log.Debug("启动..", qu.ObjToString(u.Config["port"]))
-
 	go func() {
 		http.ListenAndServe("localhost:10000", nil)
 	}()