Jianghan 3 年之前
父节点
当前提交
556f17a543

+ 165 - 0
common_utils/clearHtml.go

@@ -0,0 +1,165 @@
+package util
+
+import (
+	"github.com/PuerkitoBio/goquery"
+	"regexp"
+	"strings"
+	"unicode/utf8"
+)
+
+//
+type Cut struct {
+	annotate      *regexp.Regexp
+	tag           *regexp.Regexp
+	scripttag     *regexp.Regexp
+	inputag       *regexp.Regexp
+	isborder      *regexp.Regexp
+	hiddentag     *regexp.Regexp
+	styletag      *regexp.Regexp
+	colstag       *regexp.Regexp
+	rowstag       *regexp.Regexp
+	display       *regexp.Regexp
+	multiCR       *regexp.Regexp
+	replBlankLine *regexp.Regexp
+	replStartWrap *regexp.Regexp
+	replTags2CR   []string
+	retainTags2CR []string
+}
+
+//
+func NewCut() *Cut {
+	t, _ := regexp.Compile("<[^>]+>")
+	m, _ := regexp.Compile("([\r\n][\u3000\u2003\u00a0\\s]*)+|[\r\n]+")
+	//sc, _ := regexp.Compile("\\<script[^\\>]*\\>*[^\\>]+\\</script\\>")
+	//ss, _ := regexp.Compile("\\<style[^\\>]*\\>*[^\\>]+\\</style\\>")
+	scs := regexp.MustCompile("(?s)<(script|style)[^>]*>.+?</(script|style)>")
+	at := regexp.MustCompile("(?s)<(!%-%-|!--).*?(%-%-|--)>") //注释 css
+	hiddentag := regexp.MustCompile(`<\s*input[^<]*type=("|')hidden("|')[^<]*>`)
+	input := regexp.MustCompile(`<\s*input[^<]*value=("|')([^>"']*)[^<]*>`)
+	cols, _ := regexp.Compile(`colspan="\d+"`)
+	rows, _ := regexp.Compile(`rowspan="\d+"`)
+	border, _ := regexp.Compile(`(border="(\d+)")|(cellpadding="(\d+)")|(cellspacing="(\d+)")`)
+	dis, _ := regexp.Compile(`display:none`)
+	return &Cut{
+		annotate:      at,
+		tag:           t,
+		scripttag:     scs,
+		hiddentag:     hiddentag,
+		inputag:       input,
+		colstag:       cols,
+		isborder:      border,
+		rowstag:       rows,
+		display:       dis,
+		multiCR:       m,
+		replBlankLine: regexp.MustCompile("\\s+[\r\n]"),
+		replStartWrap: regexp.MustCompile("^[\u3000\u2003\u00a0\\s]+|[\u3000\u2003\u00a0\\s]+$"),
+		replTags2CR:   []string{"div", "p", "br", "h1", "h2", "h3", "h4", "h5"},
+		retainTags2CR: []string{"table", "thead", "tfoot", "tbody", "th", "td", "tr"},
+	}
+}
+
+//清理HTML标签
+func (c *Cut) ClearHtml(src string) string {
+	src = c.replBlankLine.ReplaceAllString(src, "")
+	src = strings.Replace(src, ">\n", ">", -1)
+	src = strings.Replace(src, " ", "", -1)
+	//标签全转小写
+	src = c.tag.ReplaceAllStringFunc(src, strings.ToLower)
+	//清script,style
+	src = c.scripttag.ReplaceAllString(src, "")
+	//清理注释文本
+	src = c.annotate.ReplaceAllString(src, "")
+	//清理input
+	src = c.hiddentag.ReplaceAllString(src, "")
+	src = c.inputag.ReplaceAllString(src, "$2")
+	document, err := goquery.NewDocumentFromReader(strings.NewReader(src))
+	if err == nil {
+		if tmpstr, err := document.Each(func(i int, sel *goquery.Selection) {
+			sel.Find("td").Each(func(i int, selection *goquery.Selection) {
+				val, b := selection.Attr("title")
+				if b && strings.Trim(val, " ") != "" {
+					tmpstr := strings.TrimFunc(selection.Text(), func(r rune) bool {
+						return r == 9 || r == 32
+					})
+					if utf8.RuneCountInString(strings.Trim(tmpstr, " ")) < utf8.RuneCountInString(strings.Trim(val, " ")) {
+						selection.SetText(strings.Trim(val, " "))
+					}
+				}
+			})
+		}).Html(); err == nil {
+			src = tmpstr
+		}
+	}
+	//换结束标签
+	src = c.tag.ReplaceAllStringFunc(src, func(tmp string) string {
+		tmp = strings.Replace(tmp, " ", "", -1)
+		//保留这些标签
+		for _, v := range c.retainTags2CR {
+			if "<"+v+">" == tmp || "</"+v+">" == tmp {
+				if tmp == "</table>" {
+					return tmp + "\n"
+				}
+				return tmp
+			}
+			if strings.HasPrefix(tmp, "<"+v) {
+				dispstrs := c.display.FindAllString(tmp, -1)
+				rowstrs := c.rowstag.FindAllString(tmp, -1)
+				colstrs := c.colstag.FindAllString(tmp, -1)
+				con := "<" + v
+				if con == "<table" {
+					if isHasBoder(tmp, c.isborder) {
+						con = con + ` border="1"`
+					}
+				}
+				if len(colstrs) > 0 { //处理多列合并
+					con += " " + colstrs[0]
+				}
+				if len(rowstrs) > 0 { //处理多行合并
+					con += " " + rowstrs[0]
+				}
+				if len(dispstrs) > 0 {
+					con += " style=\"" + dispstrs[0] + "\""
+				}
+				return con + ">"
+
+			}
+		}
+		if tmp == "<br>" || tmp == "<br/>" || tmp == "<center>" || tmp == "</center>" || tmp == "<ul>" || tmp == "</ul>" {
+			return "\n"
+		}
+		if tmp[1] != 47 { //开始标签
+			for _, v := range c.replTags2CR {
+				if v == tmp[1:len(tmp)-1] {
+					return "\n"
+				}
+			}
+			return ""
+		}
+		for _, v := range c.replTags2CR {
+			if v == tmp[2:len(tmp)-1] {
+				return "\n"
+			}
+		}
+		return ""
+	})
+	src = c.replStartWrap.ReplaceAllString(src, "")
+	src = c.replBlankLine.ReplaceAllString(src, "\n")
+	//清除多余换行
+	c.multiCR.ReplaceAllString(src, "\n")
+	return strings.Replace(src, "\n", "<br/>", -1)
+}
+
+//判断table是否加表格线
+func isHasBoder(con string, reg *regexp.Regexp) bool {
+	res := reg.FindAllStringSubmatch(con, -1)
+	hasBorder := false
+	for _, v := range res {
+		for k, val := range v {
+			if k > 0 && k%2 == 0 && IntAll(val) > 0 {
+				hasBorder = true
+				break
+			}
+		}
+	}
+	return hasBorder
+}

+ 3 - 1
common_utils/go.mod

@@ -3,12 +3,14 @@ module common_utils
 go 1.14
 
 require (
+	github.com/PuerkitoBio/goquery v1.8.0
 	github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f
 	github.com/fortytw2/leaktest v1.3.0 // indirect
 	github.com/gomodule/redigo v1.8.2
-	github.com/natefinch/lumberjack v2.0.0+incompatible // indirect
+	github.com/natefinch/lumberjack v2.0.0+incompatible
 	go.mongodb.org/mongo-driver v1.4.1
 	go.uber.org/zap v1.21.0
 	gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
+	gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
 	gopkg.in/olivere/elastic.v2 v2.0.61
 )

+ 12 - 2
common_utils/go.sum

@@ -1,4 +1,9 @@
+github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U=
+github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI=
+github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
+github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
 github.com/aws/aws-sdk-go v1.29.15 h1:0ms/213murpsujhsnxnNKNeVouW60aJqSd992Ks3mxs=
 github.com/aws/aws-sdk-go v1.29.15/go.mod h1:1KvfttTE3SPKMpo8g2c6jL3ZKfXtFvKscTgahTma5Xg=
 github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
@@ -117,8 +122,9 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
 golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
 golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 h1:4nGaVu0QrbjT/AK2PRLuQfQuh6DJve+pELhqTdAj3x0=
 golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
+golang.org/x/net v0.0.0-20210916014120-12bc252f5db8 h1:/6y1LfuqNuQdHAm0jjtPtgRcxIxjVZgm5OTu8/QhZvk=
+golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -134,12 +140,14 @@ golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20210510120138-977fb7262007 h1:gG67DSER+11cZvqIMb8S8bt0vZtiN6xWYARwirrOSfE=
 golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
-golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
 golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
 golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
 golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
@@ -159,6 +167,8 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
 gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw=
 gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
+gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
+gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
 gopkg.in/olivere/elastic.v2 v2.0.61 h1:7cpl3MW8ysa4GYFBXklpo5mspe4NK0rpZTdyZ+QcD4U=
 gopkg.in/olivere/elastic.v2 v2.0.61/go.mod h1:CTVyl1gckiFw1aLZYxC00g3f9jnHmhoOKcWF7W3c6n4=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

+ 11 - 11
common_utils/log/logger.go

@@ -2,9 +2,9 @@ package log
 
 import (
 	"fmt"
+	"github.com/natefinch/lumberjack"
 	"go.uber.org/zap"
 	"go.uber.org/zap/zapcore"
-	"os"
 	"time"
 )
 
@@ -12,14 +12,14 @@ var Logger *zap.Logger
 
 func InitLogger(logpath string, loglevel string) {
 	// 日志分割
-	//hook := lumberjack.Logger{
-	//	Filename:   logpath, // 日志文件路径,默认 os.TempDir()
-	//	MaxSize:    200,     // 每个日志文件保存10M,默认 100M
-	//	MaxBackups: 20,      // 保留30个备份,默认不限
-	//	MaxAge:     15,      // 保留7天,默认不限
-	//	Compress:   false,   // 是否压缩,默认不压缩
-	//}
-	//write := zapcore.AddSync(&hook)
+	hook := lumberjack.Logger{
+		Filename:   logpath, // 日志文件路径,默认 os.TempDir()
+		MaxSize:    200,     // 每个日志文件保存10M,默认 100M
+		MaxBackups: 20,      // 保留30个备份,默认不限
+		MaxAge:     15,      // 保留7天,默认不限
+		Compress:   false,   // 是否压缩,默认不压缩
+	}
+	write := zapcore.AddSync(&hook)
 	// 设置日志级别
 	// debug 可以打印出 info debug warn
 	// info  级别可以打印 warn info
@@ -56,9 +56,9 @@ func InitLogger(logpath string, loglevel string) {
 	core := zapcore.NewCore(
 		// zapcore.NewConsoleEncoder(encoderConfig),
 		zapcore.NewJSONEncoder(encoderConfig),
-		zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout)),
+		//zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout)),
 		//zapcore.NewMultiWriteSyncer(zapcore.AddSync(os.Stdout), zapcore.AddSync(write)), // 打印到控制台和文件
-		//write, //文件
+		write, //文件
 		level,
 	)
 	// 开启开发模式,堆栈跟踪

+ 8 - 8
jy_publishing/config.json

@@ -2,15 +2,15 @@
   "udpPort": ":11118",
   "mgoPoolSize": 5,
   "bidding": {
-    "addr": "192.168.3.207:27092",
-    "dbName": "qfw",
+    "addr": "192.168.3.207:27001",
+    "dbName": "qfw_data",
     "dbColl": "bidding",
-    "uname": "",
-    "upwd": ""
+    "uname": "root",
+    "upwd": "root"
   },
   "extract": {
     "addr": "192.168.3.207:27092",
-    "dbName": "wjh",
+    "dbName": "qfw",
     "dbColl": "extract",
     "dbColl1": "extract1"
   },
@@ -21,13 +21,13 @@
     "pool": 3
   },
   "jy_rpc": {
-    "addr": "192.168.3.240:2379",
+    "addr": "192.168.3.206:2379",
     "key": "common.rpc"
   },
   "nsq_jy": {
     "addr": "192.168.3.207:4150",
-    "topic": "jyinfo",
-    "channel": "data-processing",
+    "topic": "jyinfo_test",
+    "channel": "data-processing-1",
     "concurrent": 1
   },
   "nsq_attachment": {

+ 0 - 2
jy_publishing/go.mod

@@ -6,13 +6,11 @@ require (
 	app.yhyue.com/BP/servicerd v0.0.0-20201203055056-87643512f867
 	github.com/Chain-Zhang/pinyin v0.1.3
 	github.com/golang/protobuf v1.5.2
-	github.com/mitchellh/mapstructure v1.1.2
 	github.com/nsqio/go-nsq v1.1.0
 	github.com/zeromicro/go-zero v1.3.2
 	google.golang.org/grpc v1.44.0
 	google.golang.org/protobuf v1.27.1
 	gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
-	gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
 	utils v0.0.0
 )
 

+ 5 - 1
jy_publishing/go.sum

@@ -51,6 +51,8 @@ github.com/ClickHouse/clickhouse-go v1.5.1/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHg
 github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
 github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
 github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
+github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U=
+github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI=
 github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
 github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fTKCulPVs=
@@ -66,6 +68,8 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGn
 github.com/alicebob/miniredis/v2 v2.17.0 h1:EwLdrIS50uczw71Jc7iVSxZluTKj5nfSP8n7ARRnJy0=
 github.com/alicebob/miniredis/v2 v2.17.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I=
 github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
+github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
+github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
 github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
 github.com/aws/aws-sdk-go v1.29.15 h1:0ms/213murpsujhsnxnNKNeVouW60aJqSd992Ks3mxs=
@@ -343,7 +347,6 @@ github.com/mattn/go-sqlite3 v1.14.2/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71
 github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI=
 github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
-github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
 github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
 github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
@@ -588,6 +591,7 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
 golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
 golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
 golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
 golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=

+ 12 - 8
jy_publishing/main.go

@@ -20,6 +20,7 @@ var (
 	MgoBid, MgoExt    *mongodb.MongodbSim
 	BidColl           string
 	ExtColl, ExtColl1 string
+	FileTopicResult   string
 	Es                *elastic.Elastic
 	Index, IndexAll   string
 	Itype             string
@@ -65,16 +66,19 @@ func init() {
 
 	//加载敏感词文件
 	Ms = ms.NewMegaloscope("./rules.txt")
+	initEtcd()
+	initUdp()
+}
 
+func initEtcd() {
 	jyRpc := Sysconfig["jy_rpc"].(map[string]interface{})
+	Logger.Debug("etcd 注册rpc服务, " + util.ObjToString(jyRpc["key"]))
 	JyRpcClient = zrpc.MustNewClient(zrpc.RpcClientConf{
 		Etcd: discov.EtcdConf{
 			Hosts: strings.Split(util.ObjToString(jyRpc["addr"]), ","),
 			Key:   util.ObjToString(jyRpc["key"]),
 		},
 	})
-
-	initUdp()
 }
 
 func initUdp() {
@@ -126,24 +130,24 @@ func attsNsqMethod() {
 	if err != nil {
 		Logger.Error(err.Error())
 	}
+	FileTopicResult = util.ObjToString(cofAtts["topic-result"])
 	MCAtts, err = nsq.NewConsumer(&nsq.Cconfig{
-		IsJsonEncode: false, //与生产者配置对应,设为true会取第1个字节进行类型判断
+		IsJsonEncode: true, //与生产者配置对应,设为true会取第1个字节进行类型判断
 		Addr:         util.ObjToString(cofAtts["addr"]),
 		ConnectType:  0, //默认连接nsqd
-		Topic:        util.ObjToString(cofAtts["topic-result"]),
+		Topic:        FileTopicResult,
 		Channel:      util.ObjToString(cofAtts["channel"]),
 		Concurrent:   util.IntAllDef(cofAtts["concurrent"], 1), //并发数
 	})
 	if err != nil {
 		Logger.Error(err.Error())
 	}
+
 	for {
 		select {
 		case obj := <-MCAtts.Ch:
-			var resp *AttsResponse
-			_ = json.Unmarshal(obj.([]byte), &resp)
-			Logger.Debug("file nsq: " + fmt.Sprint(resp))
-			taskAtts(resp)
+			Logger.Debug("file extract receive nsq: " + fmt.Sprint(obj))
+			taskAtts(obj.(map[string]interface{}))
 		}
 	}
 }

+ 4 - 1
jy_publishing/megaloscope/discern.go

@@ -93,8 +93,11 @@ func (m *Megaloscope) checkWordsPY(line string) (ret MatchResults) {
 		}
 		//规则检查
 		for _, v := range m.AllRules {
+			if len(v.Words) == 1 {
+				// 跳过一个字的规则,避免误判		例:屄/标
+				continue
+			}
 			if isSubSlice(words, v.WordsPY) {
-				//log.Println(words, v.Raw)
 				//检查排除规则
 				if len(v.ExcludeWordsPY) == 0 || !isHasOneSlice(words, v.ExcludeWordsPY) {
 					ret = append(ret, &MatchResult{

+ 2 - 0
jy_publishing/megaloscope/megaloscope.go

@@ -39,6 +39,8 @@ func NewMegaloscope(filepath string) *Megaloscope {
 	return m
 }
 
+//博采+网站^打击|禁止|杜绝
+//赌博^打击|禁止|杜绝|取缔
 //规则解析
 func (m *Megaloscope) parseRule(line string) *Rule {
 	r := &Rule{Raw: line}

+ 29 - 16
jy_publishing/proto/common.proto

@@ -2,8 +2,8 @@ syntax = "proto3";
 
 package common;
 
-option go_package = "./common";
-
+option  go_package = "./common";
+//
 message ProjectReq {
   string appId = 1;//剑鱼标识 默认10000
 }
@@ -30,12 +30,24 @@ message City{
 message IndustryResp{
 	int64 err_code = 1;
 	string err_msg = 2;
-	repeated Industry data = 3;
+	Idata data = 3;
+}
+message Idata {
+	repeated Infotype infotype = 1;//信息类型
+	repeated Supply buyerclass = 2;//采购单位类型
+	repeated Industry	industry = 3;//行业
+}
+message Supply{
+	string name = 1;
 }
-//
 message Industry{
 	string name = 1;
-	repeated IndustryChildsResp childs = 2;
+}
+//
+message Infotype{
+	int64 id = 1;
+	string name = 2;
+	repeated IndustryChildsResp childs = 3;
 }
 //二级行业
 message IndustryChildsResp{
@@ -44,8 +56,8 @@ message IndustryChildsResp{
 }
 
 message StateRequest {
-	string Id = 1;
-	string publishId = 2;
+	string Id = 1;//mysql 信息id
+	string publishId = 2;//mongodb bidding信息id
 	//  repeated Request message = 1;
 }
 
@@ -55,12 +67,12 @@ message StateResponse {
 }
 
 message SensitiveRequest {
-	string Id = 1;
-	string MsgType = 2;
-	repeated string Title = 3;
-	repeated string Detail = 4;
-	string Attachments = 5;
-	string AttachTxt = 6;
+	string Id = 1;//信息id
+	string MsgType = 2;//信息类型:1:招标信息;2:采购信息;3:供应信息
+	repeated string Title = 3;//标题
+	repeated string Detail = 4;//详情
+	string Attachments = 5;//附件
+	string AttachTxt = 6;//附件备注
 }
 
 message SensitiveResponse {
@@ -69,12 +81,13 @@ message SensitiveResponse {
 }
 
 //
-service Common {
+service commonInfo {
 	//获取省份信息
-  	rpc AreaInfo(ProjectReq) returns(AreaResp);
+	rpc AreaInfo(ProjectReq) returns(AreaResp);
 	//获取行业信息
 	rpc IndustryInfo(ProjectReq) returns(IndustryResp);
-
+	//修改信息发布状态
 	rpc StateMethod(StateRequest) returns (StateResponse);
+	//
 	rpc SensitiveMethod(SensitiveRequest) returns (SensitiveResponse);
 }

+ 389 - 162
jy_publishing/proto/common/common.pb.go

@@ -29,6 +29,7 @@ const (
 // of the legacy proto package is being used.
 const _ = proto.ProtoPackageIsVersion4
 
+//
 type ProjectReq struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -266,9 +267,9 @@ type IndustryResp struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	ErrCode int64       `protobuf:"varint,1,opt,name=err_code,json=errCode,proto3" json:"err_code,omitempty"`
-	ErrMsg  string      `protobuf:"bytes,2,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"`
-	Data    []*Industry `protobuf:"bytes,3,rep,name=data,proto3" json:"data,omitempty"`
+	ErrCode int64  `protobuf:"varint,1,opt,name=err_code,json=errCode,proto3" json:"err_code,omitempty"`
+	ErrMsg  string `protobuf:"bytes,2,opt,name=err_msg,json=errMsg,proto3" json:"err_msg,omitempty"`
+	Data    *Idata `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
 }
 
 func (x *IndustryResp) Reset() {
@@ -317,27 +318,135 @@ func (x *IndustryResp) GetErrMsg() string {
 	return ""
 }
 
-func (x *IndustryResp) GetData() []*Industry {
+func (x *IndustryResp) GetData() *Idata {
 	if x != nil {
 		return x.Data
 	}
 	return nil
 }
 
-//
+type Idata struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Infotype   []*Infotype `protobuf:"bytes,1,rep,name=infotype,proto3" json:"infotype,omitempty"`     //信息类型
+	Buyerclass []*Supply   `protobuf:"bytes,2,rep,name=buyerclass,proto3" json:"buyerclass,omitempty"` //采购单位类型
+	Industry   []*Industry `protobuf:"bytes,3,rep,name=industry,proto3" json:"industry,omitempty"`     //行业
+}
+
+func (x *Idata) Reset() {
+	*x = Idata{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_common_proto_msgTypes[5]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Idata) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Idata) ProtoMessage() {}
+
+func (x *Idata) ProtoReflect() protoreflect.Message {
+	mi := &file_common_proto_msgTypes[5]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Idata.ProtoReflect.Descriptor instead.
+func (*Idata) Descriptor() ([]byte, []int) {
+	return file_common_proto_rawDescGZIP(), []int{5}
+}
+
+func (x *Idata) GetInfotype() []*Infotype {
+	if x != nil {
+		return x.Infotype
+	}
+	return nil
+}
+
+func (x *Idata) GetBuyerclass() []*Supply {
+	if x != nil {
+		return x.Buyerclass
+	}
+	return nil
+}
+
+func (x *Idata) GetIndustry() []*Industry {
+	if x != nil {
+		return x.Industry
+	}
+	return nil
+}
+
+type Supply struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *Supply) Reset() {
+	*x = Supply{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_common_proto_msgTypes[6]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Supply) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Supply) ProtoMessage() {}
+
+func (x *Supply) ProtoReflect() protoreflect.Message {
+	mi := &file_common_proto_msgTypes[6]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Supply.ProtoReflect.Descriptor instead.
+func (*Supply) Descriptor() ([]byte, []int) {
+	return file_common_proto_rawDescGZIP(), []int{6}
+}
+
+func (x *Supply) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
 type Industry struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Name   string                `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
-	Childs []*IndustryChildsResp `protobuf:"bytes,2,rep,name=childs,proto3" json:"childs,omitempty"`
+	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
 }
 
 func (x *Industry) Reset() {
 	*x = Industry{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_common_proto_msgTypes[5]
+		mi := &file_common_proto_msgTypes[7]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -350,7 +459,7 @@ func (x *Industry) String() string {
 func (*Industry) ProtoMessage() {}
 
 func (x *Industry) ProtoReflect() protoreflect.Message {
-	mi := &file_common_proto_msgTypes[5]
+	mi := &file_common_proto_msgTypes[7]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -363,7 +472,7 @@ func (x *Industry) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use Industry.ProtoReflect.Descriptor instead.
 func (*Industry) Descriptor() ([]byte, []int) {
-	return file_common_proto_rawDescGZIP(), []int{5}
+	return file_common_proto_rawDescGZIP(), []int{7}
 }
 
 func (x *Industry) GetName() string {
@@ -373,7 +482,64 @@ func (x *Industry) GetName() string {
 	return ""
 }
 
-func (x *Industry) GetChilds() []*IndustryChildsResp {
+//
+type Infotype struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Id     int64                 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
+	Name   string                `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
+	Childs []*IndustryChildsResp `protobuf:"bytes,3,rep,name=childs,proto3" json:"childs,omitempty"`
+}
+
+func (x *Infotype) Reset() {
+	*x = Infotype{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_common_proto_msgTypes[8]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *Infotype) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Infotype) ProtoMessage() {}
+
+func (x *Infotype) ProtoReflect() protoreflect.Message {
+	mi := &file_common_proto_msgTypes[8]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use Infotype.ProtoReflect.Descriptor instead.
+func (*Infotype) Descriptor() ([]byte, []int) {
+	return file_common_proto_rawDescGZIP(), []int{8}
+}
+
+func (x *Infotype) GetId() int64 {
+	if x != nil {
+		return x.Id
+	}
+	return 0
+}
+
+func (x *Infotype) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
+func (x *Infotype) GetChilds() []*IndustryChildsResp {
 	if x != nil {
 		return x.Childs
 	}
@@ -393,7 +559,7 @@ type IndustryChildsResp struct {
 func (x *IndustryChildsResp) Reset() {
 	*x = IndustryChildsResp{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_common_proto_msgTypes[6]
+		mi := &file_common_proto_msgTypes[9]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -406,7 +572,7 @@ func (x *IndustryChildsResp) String() string {
 func (*IndustryChildsResp) ProtoMessage() {}
 
 func (x *IndustryChildsResp) ProtoReflect() protoreflect.Message {
-	mi := &file_common_proto_msgTypes[6]
+	mi := &file_common_proto_msgTypes[9]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -419,7 +585,7 @@ func (x *IndustryChildsResp) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use IndustryChildsResp.ProtoReflect.Descriptor instead.
 func (*IndustryChildsResp) Descriptor() ([]byte, []int) {
-	return file_common_proto_rawDescGZIP(), []int{6}
+	return file_common_proto_rawDescGZIP(), []int{9}
 }
 
 func (x *IndustryChildsResp) GetName() string {
@@ -441,14 +607,14 @@ type StateRequest struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Id        string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"`
-	PublishId string `protobuf:"bytes,2,opt,name=publishId,proto3" json:"publishId,omitempty"` //  repeated Request message = 1;
+	Id        string `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"`               //mysql 信息id
+	PublishId string `protobuf:"bytes,2,opt,name=publishId,proto3" json:"publishId,omitempty"` //mongodb bidding信息id
 }
 
 func (x *StateRequest) Reset() {
 	*x = StateRequest{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_common_proto_msgTypes[7]
+		mi := &file_common_proto_msgTypes[10]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -461,7 +627,7 @@ func (x *StateRequest) String() string {
 func (*StateRequest) ProtoMessage() {}
 
 func (x *StateRequest) ProtoReflect() protoreflect.Message {
-	mi := &file_common_proto_msgTypes[7]
+	mi := &file_common_proto_msgTypes[10]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -474,7 +640,7 @@ func (x *StateRequest) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use StateRequest.ProtoReflect.Descriptor instead.
 func (*StateRequest) Descriptor() ([]byte, []int) {
-	return file_common_proto_rawDescGZIP(), []int{7}
+	return file_common_proto_rawDescGZIP(), []int{10}
 }
 
 func (x *StateRequest) GetId() string {
@@ -503,7 +669,7 @@ type StateResponse struct {
 func (x *StateResponse) Reset() {
 	*x = StateResponse{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_common_proto_msgTypes[8]
+		mi := &file_common_proto_msgTypes[11]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -516,7 +682,7 @@ func (x *StateResponse) String() string {
 func (*StateResponse) ProtoMessage() {}
 
 func (x *StateResponse) ProtoReflect() protoreflect.Message {
-	mi := &file_common_proto_msgTypes[8]
+	mi := &file_common_proto_msgTypes[11]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -529,7 +695,7 @@ func (x *StateResponse) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use StateResponse.ProtoReflect.Descriptor instead.
 func (*StateResponse) Descriptor() ([]byte, []int) {
-	return file_common_proto_rawDescGZIP(), []int{8}
+	return file_common_proto_rawDescGZIP(), []int{11}
 }
 
 func (x *StateResponse) GetErrCode() int64 {
@@ -551,18 +717,18 @@ type SensitiveRequest struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Id          string   `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"`
-	MsgType     string   `protobuf:"bytes,2,opt,name=MsgType,proto3" json:"MsgType,omitempty"`
-	Title       []string `protobuf:"bytes,3,rep,name=Title,proto3" json:"Title,omitempty"`
-	Detail      []string `protobuf:"bytes,4,rep,name=Detail,proto3" json:"Detail,omitempty"`
-	Attachments string   `protobuf:"bytes,5,opt,name=Attachments,proto3" json:"Attachments,omitempty"`
-	AttachTxt   string   `protobuf:"bytes,6,opt,name=AttachTxt,proto3" json:"AttachTxt,omitempty"`
+	Id          string   `protobuf:"bytes,1,opt,name=Id,proto3" json:"Id,omitempty"`                   //信息id
+	MsgType     string   `protobuf:"bytes,2,opt,name=MsgType,proto3" json:"MsgType,omitempty"`         //信息类型:1:招标信息;2:采购信息;3:供应信息
+	Title       []string `protobuf:"bytes,3,rep,name=Title,proto3" json:"Title,omitempty"`             //标题
+	Detail      []string `protobuf:"bytes,4,rep,name=Detail,proto3" json:"Detail,omitempty"`           //详情
+	Attachments string   `protobuf:"bytes,5,opt,name=Attachments,proto3" json:"Attachments,omitempty"` //附件
+	AttachTxt   string   `protobuf:"bytes,6,opt,name=AttachTxt,proto3" json:"AttachTxt,omitempty"`     //附件备注
 }
 
 func (x *SensitiveRequest) Reset() {
 	*x = SensitiveRequest{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_common_proto_msgTypes[9]
+		mi := &file_common_proto_msgTypes[12]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -575,7 +741,7 @@ func (x *SensitiveRequest) String() string {
 func (*SensitiveRequest) ProtoMessage() {}
 
 func (x *SensitiveRequest) ProtoReflect() protoreflect.Message {
-	mi := &file_common_proto_msgTypes[9]
+	mi := &file_common_proto_msgTypes[12]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -588,7 +754,7 @@ func (x *SensitiveRequest) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use SensitiveRequest.ProtoReflect.Descriptor instead.
 func (*SensitiveRequest) Descriptor() ([]byte, []int) {
-	return file_common_proto_rawDescGZIP(), []int{9}
+	return file_common_proto_rawDescGZIP(), []int{12}
 }
 
 func (x *SensitiveRequest) GetId() string {
@@ -645,7 +811,7 @@ type SensitiveResponse struct {
 func (x *SensitiveResponse) Reset() {
 	*x = SensitiveResponse{}
 	if protoimpl.UnsafeEnabled {
-		mi := &file_common_proto_msgTypes[10]
+		mi := &file_common_proto_msgTypes[13]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		ms.StoreMessageInfo(mi)
 	}
@@ -658,7 +824,7 @@ func (x *SensitiveResponse) String() string {
 func (*SensitiveResponse) ProtoMessage() {}
 
 func (x *SensitiveResponse) ProtoReflect() protoreflect.Message {
-	mi := &file_common_proto_msgTypes[10]
+	mi := &file_common_proto_msgTypes[13]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
 		if ms.LoadMessageInfo() == nil {
@@ -671,7 +837,7 @@ func (x *SensitiveResponse) ProtoReflect() protoreflect.Message {
 
 // Deprecated: Use SensitiveResponse.ProtoReflect.Descriptor instead.
 func (*SensitiveResponse) Descriptor() ([]byte, []int) {
-	return file_common_proto_rawDescGZIP(), []int{10}
+	return file_common_proto_rawDescGZIP(), []int{13}
 }
 
 func (x *SensitiveResponse) GetErrCode() int64 {
@@ -709,63 +875,78 @@ var file_common_proto_rawDesc = []byte{
 	0x79, 0x52, 0x05, 0x63, 0x69, 0x74, 0x79, 0x73, 0x22, 0x2e, 0x0a, 0x04, 0x43, 0x69, 0x74, 0x79,
 	0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
 	0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x68, 0x0a, 0x0c, 0x49, 0x6e, 0x64, 0x75,
+	0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x65, 0x0a, 0x0c, 0x49, 0x6e, 0x64, 0x75,
 	0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f,
 	0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43,
 	0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x24, 0x0a, 0x04,
-	0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d,
-	0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x52, 0x04, 0x64, 0x61,
-	0x74, 0x61, 0x22, 0x52, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x12, 0x12,
-	0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
-	0x6d, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03,
-	0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x75,
-	0x73, 0x74, 0x72, 0x79, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x52, 0x06,
-	0x63, 0x68, 0x69, 0x6c, 0x64, 0x73, 0x22, 0x3c, 0x0a, 0x12, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74,
-	0x72, 0x79, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04,
-	0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
-	0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
-	0x63, 0x6f, 0x64, 0x65, 0x22, 0x3c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71,
-	0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x02, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68, 0x49,
-	0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68,
-	0x49, 0x64, 0x22, 0x43, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
-	0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17,
-	0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0xaa, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x6e, 0x73,
-	0x69, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02,
-	0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07,
-	0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x4d,
-	0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x18,
-	0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06,
-	0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x44, 0x65,
-	0x74, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d, 0x65,
-	0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x41, 0x74, 0x74, 0x61, 0x63,
-	0x68, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68,
-	0x54, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x41, 0x74, 0x74, 0x61, 0x63,
-	0x68, 0x54, 0x78, 0x74, 0x22, 0x47, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76,
-	0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72,
-	0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x72, 0x72,
-	0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18,
-	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x32, 0xf8, 0x01,
-	0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x30, 0x0a, 0x08, 0x41, 0x72, 0x65, 0x61,
-	0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72,
-	0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
-	0x6e, 0x2e, 0x41, 0x72, 0x65, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x0c, 0x49, 0x6e,
-	0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x2e, 0x63, 0x6f, 0x6d,
-	0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x14,
-	0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x0b, 0x53, 0x74, 0x61, 0x74, 0x65, 0x4d, 0x65, 0x74,
-	0x68, 0x6f, 0x64, 0x12, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61,
-	0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
-	0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
-	0x12, 0x46, 0x0a, 0x0f, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x65, 0x74,
-	0x68, 0x6f, 0x64, 0x12, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e,
-	0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e,
-	0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65,
-	0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x63, 0x6f,
-	0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x12, 0x21, 0x0a, 0x04,
+	0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x63, 0x6f, 0x6d,
+	0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x64, 0x61, 0x74, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
+	0x93, 0x01, 0x0a, 0x05, 0x49, 0x64, 0x61, 0x74, 0x61, 0x12, 0x2c, 0x0a, 0x08, 0x69, 0x6e, 0x66,
+	0x6f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f,
+	0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x66, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x52, 0x08, 0x69,
+	0x6e, 0x66, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x0a, 0x62, 0x75, 0x79, 0x65, 0x72,
+	0x63, 0x6c, 0x61, 0x73, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x63, 0x6f,
+	0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x52, 0x0a, 0x62, 0x75, 0x79,
+	0x65, 0x72, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x12, 0x2c, 0x0a, 0x08, 0x69, 0x6e, 0x64, 0x75, 0x73,
+	0x74, 0x72, 0x79, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
+	0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x52, 0x08, 0x69, 0x6e, 0x64,
+	0x75, 0x73, 0x74, 0x72, 0x79, 0x22, 0x1c, 0x0a, 0x06, 0x53, 0x75, 0x70, 0x70, 0x6c, 0x79, 0x12,
+	0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
+	0x61, 0x6d, 0x65, 0x22, 0x1e, 0x0a, 0x08, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x12,
+	0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
+	0x61, 0x6d, 0x65, 0x22, 0x62, 0x0a, 0x08, 0x49, 0x6e, 0x66, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x12,
+	0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12,
+	0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
+	0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x73, 0x18, 0x03, 0x20,
+	0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64,
+	0x75, 0x73, 0x74, 0x72, 0x79, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x52,
+	0x06, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x73, 0x22, 0x3c, 0x0a, 0x12, 0x49, 0x6e, 0x64, 0x75, 0x73,
+	0x74, 0x72, 0x79, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a,
+	0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
+	0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x3c, 0x0a, 0x0c, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65,
+	0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73, 0x68,
+	0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x73,
+	0x68, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70,
+	0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72, 0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65,
+	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x72, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
+	0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0xaa, 0x01, 0x0a, 0x10, 0x53, 0x65, 0x6e,
+	0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a,
+	0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49, 0x64, 0x12, 0x18, 0x0a,
+	0x07, 0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
+	0x4d, 0x73, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65,
+	0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x05, 0x54, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x16, 0x0a,
+	0x06, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x44,
+	0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x0b, 0x41, 0x74, 0x74, 0x61, 0x63, 0x68, 0x6d,
+	0x65, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x41, 0x74, 0x74, 0x61,
+	0x63, 0x68, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x41, 0x74, 0x74, 0x61, 0x63,
+	0x68, 0x54, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x41, 0x74, 0x74, 0x61,
+	0x63, 0x68, 0x54, 0x78, 0x74, 0x22, 0x47, 0x0a, 0x11, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
+	0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x72,
+	0x72, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x65, 0x72,
+	0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x65, 0x72, 0x72, 0x5f, 0x6d, 0x73, 0x67,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x32, 0xfc,
+	0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x30, 0x0a,
+	0x08, 0x41, 0x72, 0x65, 0x61, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
+	0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e,
+	0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x41, 0x72, 0x65, 0x61, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x38, 0x0a, 0x0c, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12,
+	0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+	0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x49, 0x6e, 0x64,
+	0x75, 0x73, 0x74, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x0b, 0x53, 0x74, 0x61,
+	0x74, 0x65, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x14, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
+	0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15,
+	0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73,
+	0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x46, 0x0a, 0x0f, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69,
+	0x76, 0x65, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
+	0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
+	0x73, 0x74, 0x1a, 0x19, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6e, 0x73,
+	0x69, 0x74, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x0a, 0x5a,
+	0x08, 0x2e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x33,
 }
 
 var (
@@ -780,38 +961,44 @@ func file_common_proto_rawDescGZIP() []byte {
 	return file_common_proto_rawDescData
 }
 
-var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
+var file_common_proto_msgTypes = make([]protoimpl.MessageInfo, 14)
 var file_common_proto_goTypes = []interface{}{
 	(*ProjectReq)(nil),         // 0: common.ProjectReq
 	(*AreaResp)(nil),           // 1: common.AreaResp
 	(*Province)(nil),           // 2: common.Province
 	(*City)(nil),               // 3: common.City
 	(*IndustryResp)(nil),       // 4: common.IndustryResp
-	(*Industry)(nil),           // 5: common.Industry
-	(*IndustryChildsResp)(nil), // 6: common.IndustryChildsResp
-	(*StateRequest)(nil),       // 7: common.StateRequest
-	(*StateResponse)(nil),      // 8: common.StateResponse
-	(*SensitiveRequest)(nil),   // 9: common.SensitiveRequest
-	(*SensitiveResponse)(nil),  // 10: common.SensitiveResponse
+	(*Idata)(nil),              // 5: common.Idata
+	(*Supply)(nil),             // 6: common.Supply
+	(*Industry)(nil),           // 7: common.Industry
+	(*Infotype)(nil),           // 8: common.Infotype
+	(*IndustryChildsResp)(nil), // 9: common.IndustryChildsResp
+	(*StateRequest)(nil),       // 10: common.StateRequest
+	(*StateResponse)(nil),      // 11: common.StateResponse
+	(*SensitiveRequest)(nil),   // 12: common.SensitiveRequest
+	(*SensitiveResponse)(nil),  // 13: common.SensitiveResponse
 }
 var file_common_proto_depIdxs = []int32{
 	2,  // 0: common.AreaResp.data:type_name -> common.Province
 	3,  // 1: common.Province.citys:type_name -> common.City
-	5,  // 2: common.IndustryResp.data:type_name -> common.Industry
-	6,  // 3: common.Industry.childs:type_name -> common.IndustryChildsResp
-	0,  // 4: common.Common.AreaInfo:input_type -> common.ProjectReq
-	0,  // 5: common.Common.IndustryInfo:input_type -> common.ProjectReq
-	7,  // 6: common.Common.StateMethod:input_type -> common.StateRequest
-	9,  // 7: common.Common.SensitiveMethod:input_type -> common.SensitiveRequest
-	1,  // 8: common.Common.AreaInfo:output_type -> common.AreaResp
-	4,  // 9: common.Common.IndustryInfo:output_type -> common.IndustryResp
-	8,  // 10: common.Common.StateMethod:output_type -> common.StateResponse
-	10, // 11: common.Common.SensitiveMethod:output_type -> common.SensitiveResponse
-	8,  // [8:12] is the sub-list for method output_type
-	4,  // [4:8] is the sub-list for method input_type
-	4,  // [4:4] is the sub-list for extension type_name
-	4,  // [4:4] is the sub-list for extension extendee
-	0,  // [0:4] is the sub-list for field type_name
+	5,  // 2: common.IndustryResp.data:type_name -> common.Idata
+	8,  // 3: common.Idata.infotype:type_name -> common.Infotype
+	6,  // 4: common.Idata.buyerclass:type_name -> common.Supply
+	7,  // 5: common.Idata.industry:type_name -> common.Industry
+	9,  // 6: common.Infotype.childs:type_name -> common.IndustryChildsResp
+	0,  // 7: common.commonInfo.AreaInfo:input_type -> common.ProjectReq
+	0,  // 8: common.commonInfo.IndustryInfo:input_type -> common.ProjectReq
+	10, // 9: common.commonInfo.StateMethod:input_type -> common.StateRequest
+	12, // 10: common.commonInfo.SensitiveMethod:input_type -> common.SensitiveRequest
+	1,  // 11: common.commonInfo.AreaInfo:output_type -> common.AreaResp
+	4,  // 12: common.commonInfo.IndustryInfo:output_type -> common.IndustryResp
+	11, // 13: common.commonInfo.StateMethod:output_type -> common.StateResponse
+	13, // 14: common.commonInfo.SensitiveMethod:output_type -> common.SensitiveResponse
+	11, // [11:15] is the sub-list for method output_type
+	7,  // [7:11] is the sub-list for method input_type
+	7,  // [7:7] is the sub-list for extension type_name
+	7,  // [7:7] is the sub-list for extension extendee
+	0,  // [0:7] is the sub-list for field type_name
 }
 
 func init() { file_common_proto_init() }
@@ -881,7 +1068,7 @@ func file_common_proto_init() {
 			}
 		}
 		file_common_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*Industry); i {
+			switch v := v.(*Idata); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -893,7 +1080,7 @@ func file_common_proto_init() {
 			}
 		}
 		file_common_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*IndustryChildsResp); i {
+			switch v := v.(*Supply); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -905,7 +1092,7 @@ func file_common_proto_init() {
 			}
 		}
 		file_common_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*StateRequest); i {
+			switch v := v.(*Industry); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -917,7 +1104,7 @@ func file_common_proto_init() {
 			}
 		}
 		file_common_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*StateResponse); i {
+			switch v := v.(*Infotype); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -929,7 +1116,7 @@ func file_common_proto_init() {
 			}
 		}
 		file_common_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*SensitiveRequest); i {
+			switch v := v.(*IndustryChildsResp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -941,6 +1128,42 @@ func file_common_proto_init() {
 			}
 		}
 		file_common_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*StateRequest); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_common_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*StateResponse); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_common_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*SensitiveRequest); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_common_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
 			switch v := v.(*SensitiveResponse); i {
 			case 0:
 				return &v.state
@@ -959,7 +1182,7 @@ func file_common_proto_init() {
 			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
 			RawDescriptor: file_common_proto_rawDesc,
 			NumEnums:      0,
-			NumMessages:   11,
+			NumMessages:   14,
 			NumExtensions: 0,
 			NumServices:   1,
 		},
@@ -981,184 +1204,188 @@ var _ grpc.ClientConnInterface
 // is compatible with the grpc package it is being compiled against.
 const _ = grpc.SupportPackageIsVersion6
 
-// CommonClient is the client API for Common service.
+// CommonInfoClient is the client API for CommonInfo service.
 //
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
-type CommonClient interface {
+type CommonInfoClient interface {
 	//获取省份信息
 	AreaInfo(ctx context.Context, in *ProjectReq, opts ...grpc.CallOption) (*AreaResp, error)
 	//获取行业信息
 	IndustryInfo(ctx context.Context, in *ProjectReq, opts ...grpc.CallOption) (*IndustryResp, error)
+	//修改信息发布状态
 	StateMethod(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error)
+	//
 	SensitiveMethod(ctx context.Context, in *SensitiveRequest, opts ...grpc.CallOption) (*SensitiveResponse, error)
 }
 
-type commonClient struct {
+type commonInfoClient struct {
 	cc grpc.ClientConnInterface
 }
 
-func NewCommonClient(cc grpc.ClientConnInterface) CommonClient {
-	return &commonClient{cc}
+func NewCommonInfoClient(cc grpc.ClientConnInterface) CommonInfoClient {
+	return &commonInfoClient{cc}
 }
 
-func (c *commonClient) AreaInfo(ctx context.Context, in *ProjectReq, opts ...grpc.CallOption) (*AreaResp, error) {
+func (c *commonInfoClient) AreaInfo(ctx context.Context, in *ProjectReq, opts ...grpc.CallOption) (*AreaResp, error) {
 	out := new(AreaResp)
-	err := c.cc.Invoke(ctx, "/common.Common/AreaInfo", in, out, opts...)
+	err := c.cc.Invoke(ctx, "/common.commonInfo/AreaInfo", in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
 	return out, nil
 }
 
-func (c *commonClient) IndustryInfo(ctx context.Context, in *ProjectReq, opts ...grpc.CallOption) (*IndustryResp, error) {
+func (c *commonInfoClient) IndustryInfo(ctx context.Context, in *ProjectReq, opts ...grpc.CallOption) (*IndustryResp, error) {
 	out := new(IndustryResp)
-	err := c.cc.Invoke(ctx, "/common.Common/IndustryInfo", in, out, opts...)
+	err := c.cc.Invoke(ctx, "/common.commonInfo/IndustryInfo", in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
 	return out, nil
 }
 
-func (c *commonClient) StateMethod(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) {
+func (c *commonInfoClient) StateMethod(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) {
 	out := new(StateResponse)
-	err := c.cc.Invoke(ctx, "/common.Common/StateMethod", in, out, opts...)
+	err := c.cc.Invoke(ctx, "/common.commonInfo/StateMethod", in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
 	return out, nil
 }
 
-func (c *commonClient) SensitiveMethod(ctx context.Context, in *SensitiveRequest, opts ...grpc.CallOption) (*SensitiveResponse, error) {
+func (c *commonInfoClient) SensitiveMethod(ctx context.Context, in *SensitiveRequest, opts ...grpc.CallOption) (*SensitiveResponse, error) {
 	out := new(SensitiveResponse)
-	err := c.cc.Invoke(ctx, "/common.Common/SensitiveMethod", in, out, opts...)
+	err := c.cc.Invoke(ctx, "/common.commonInfo/SensitiveMethod", in, out, opts...)
 	if err != nil {
 		return nil, err
 	}
 	return out, nil
 }
 
-// CommonServer is the server API for Common service.
-type CommonServer interface {
+// CommonInfoServer is the server API for CommonInfo service.
+type CommonInfoServer interface {
 	//获取省份信息
 	AreaInfo(context.Context, *ProjectReq) (*AreaResp, error)
 	//获取行业信息
 	IndustryInfo(context.Context, *ProjectReq) (*IndustryResp, error)
+	//修改信息发布状态
 	StateMethod(context.Context, *StateRequest) (*StateResponse, error)
+	//
 	SensitiveMethod(context.Context, *SensitiveRequest) (*SensitiveResponse, error)
 }
 
-// UnimplementedCommonServer can be embedded to have forward compatible implementations.
-type UnimplementedCommonServer struct {
+// UnimplementedCommonInfoServer can be embedded to have forward compatible implementations.
+type UnimplementedCommonInfoServer struct {
 }
 
-func (*UnimplementedCommonServer) AreaInfo(context.Context, *ProjectReq) (*AreaResp, error) {
+func (*UnimplementedCommonInfoServer) AreaInfo(context.Context, *ProjectReq) (*AreaResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method AreaInfo not implemented")
 }
-func (*UnimplementedCommonServer) IndustryInfo(context.Context, *ProjectReq) (*IndustryResp, error) {
+func (*UnimplementedCommonInfoServer) IndustryInfo(context.Context, *ProjectReq) (*IndustryResp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method IndustryInfo not implemented")
 }
-func (*UnimplementedCommonServer) StateMethod(context.Context, *StateRequest) (*StateResponse, error) {
+func (*UnimplementedCommonInfoServer) StateMethod(context.Context, *StateRequest) (*StateResponse, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method StateMethod not implemented")
 }
-func (*UnimplementedCommonServer) SensitiveMethod(context.Context, *SensitiveRequest) (*SensitiveResponse, error) {
+func (*UnimplementedCommonInfoServer) SensitiveMethod(context.Context, *SensitiveRequest) (*SensitiveResponse, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method SensitiveMethod not implemented")
 }
 
-func RegisterCommonServer(s *grpc.Server, srv CommonServer) {
-	s.RegisterService(&_Common_serviceDesc, srv)
+func RegisterCommonInfoServer(s *grpc.Server, srv CommonInfoServer) {
+	s.RegisterService(&_CommonInfo_serviceDesc, srv)
 }
 
-func _Common_AreaInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+func _CommonInfo_AreaInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(ProjectReq)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
 	if interceptor == nil {
-		return srv.(CommonServer).AreaInfo(ctx, in)
+		return srv.(CommonInfoServer).AreaInfo(ctx, in)
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/common.Common/AreaInfo",
+		FullMethod: "/common.commonInfo/AreaInfo",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(CommonServer).AreaInfo(ctx, req.(*ProjectReq))
+		return srv.(CommonInfoServer).AreaInfo(ctx, req.(*ProjectReq))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
-func _Common_IndustryInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+func _CommonInfo_IndustryInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(ProjectReq)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
 	if interceptor == nil {
-		return srv.(CommonServer).IndustryInfo(ctx, in)
+		return srv.(CommonInfoServer).IndustryInfo(ctx, in)
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/common.Common/IndustryInfo",
+		FullMethod: "/common.commonInfo/IndustryInfo",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(CommonServer).IndustryInfo(ctx, req.(*ProjectReq))
+		return srv.(CommonInfoServer).IndustryInfo(ctx, req.(*ProjectReq))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
-func _Common_StateMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+func _CommonInfo_StateMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(StateRequest)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
 	if interceptor == nil {
-		return srv.(CommonServer).StateMethod(ctx, in)
+		return srv.(CommonInfoServer).StateMethod(ctx, in)
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/common.Common/StateMethod",
+		FullMethod: "/common.commonInfo/StateMethod",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(CommonServer).StateMethod(ctx, req.(*StateRequest))
+		return srv.(CommonInfoServer).StateMethod(ctx, req.(*StateRequest))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
-func _Common_SensitiveMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+func _CommonInfo_SensitiveMethod_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
 	in := new(SensitiveRequest)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
 	if interceptor == nil {
-		return srv.(CommonServer).SensitiveMethod(ctx, in)
+		return srv.(CommonInfoServer).SensitiveMethod(ctx, in)
 	}
 	info := &grpc.UnaryServerInfo{
 		Server:     srv,
-		FullMethod: "/common.Common/SensitiveMethod",
+		FullMethod: "/common.commonInfo/SensitiveMethod",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(CommonServer).SensitiveMethod(ctx, req.(*SensitiveRequest))
+		return srv.(CommonInfoServer).SensitiveMethod(ctx, req.(*SensitiveRequest))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
-var _Common_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "common.Common",
-	HandlerType: (*CommonServer)(nil),
+var _CommonInfo_serviceDesc = grpc.ServiceDesc{
+	ServiceName: "common.commonInfo",
+	HandlerType: (*CommonInfoServer)(nil),
 	Methods: []grpc.MethodDesc{
 		{
 			MethodName: "AreaInfo",
-			Handler:    _Common_AreaInfo_Handler,
+			Handler:    _CommonInfo_AreaInfo_Handler,
 		},
 		{
 			MethodName: "IndustryInfo",
-			Handler:    _Common_IndustryInfo_Handler,
+			Handler:    _CommonInfo_IndustryInfo_Handler,
 		},
 		{
 			MethodName: "StateMethod",
-			Handler:    _Common_StateMethod_Handler,
+			Handler:    _CommonInfo_StateMethod_Handler,
 		},
 		{
 			MethodName: "SensitiveMethod",
-			Handler:    _Common_SensitiveMethod_Handler,
+			Handler:    _CommonInfo_SensitiveMethod_Handler,
 		},
 	},
 	Streams:  []grpc.StreamDesc{},

+ 1 - 1
jy_publishing/proto/fileText.proto

@@ -16,7 +16,7 @@ message Request {
   bytes fileBytes = 3;     //文件字节流
   string fileType = 4;    //文件类型 pdf ,xls ,doc
   int32 returnType = 5;    //文件类型 {0:url,1:content,2:url+content} 默认0
-  int32 extractType = 6;  //解析文件类型{2:oss,1:fileBytes,2:url} 默认2
+  int32 extractType = 6;  //解析文件类型{0:oss,1:fileBytes,2:url} 默认0
 }
 
 message FileResponse {

+ 93 - 0
jy_publishing/proto/proto/common.proto

@@ -0,0 +1,93 @@
+syntax = "proto3";
+
+package common;
+
+option  go_package = "./common";
+//
+message ProjectReq {
+  string appId = 1;//剑鱼标识 默认10000
+}
+
+//地区信息
+message AreaResp {
+  	int64 err_code = 1;
+	string err_msg = 2;
+	repeated Province data = 3;//城市信息
+}
+//
+message Province{
+	string code = 1;//省份编码
+	string name = 2;//省份名称
+	repeated City citys = 3;//城市信息
+}
+//
+message City{
+	string code = 1;//城市编码
+	string name = 2;//城市名称
+}
+
+//行业信息
+message IndustryResp{
+	int64 err_code = 1;
+	string err_msg = 2;
+	Idata data = 3;
+}
+message Idata {
+	repeated Infotype infotype = 1;
+	repeated Supply supply = 2;
+	repeated Industry	industry = 3;
+}
+message Supply{
+	string name = 1;
+}
+message Industry{
+	string name = 1;
+}
+//
+message Infotype{
+	int64 id = 1;
+	string name = 2;
+	repeated IndustryChildsResp childs = 3;
+}
+//二级行业
+message IndustryChildsResp{
+	string name = 1;
+	string code = 2;
+}
+
+message StateRequest {
+	string Id = 1;//mysql 信息id
+	string publishId = 2;//mongodb bidding信息id
+	//  repeated Request message = 1;
+}
+
+message StateResponse {
+	int64 err_code = 1;
+	string err_msg = 2;
+}
+
+message SensitiveRequest {
+	string Id = 1;//信息id
+	string MsgType = 2;//信息类型:1:招标信息;2:采购信息;3:供应信息
+	repeated string Title = 3;//标题
+	repeated string Detail = 4;//详情
+	string Attachments = 5;//附件
+	string AttachTxt = 6;//附件备注
+}
+
+message SensitiveResponse {
+	int64 err_code = 1;
+	string err_msg = 2;
+}
+
+//
+service commonInfo {
+	//获取省份信息
+	rpc AreaInfo(ProjectReq) returns(AreaResp);
+	//获取行业信息
+	rpc IndustryInfo(ProjectReq) returns(IndustryResp);
+	//修改信息发布状态
+	rpc StateMethod(StateRequest) returns (StateResponse);
+	//
+	rpc SensitiveMethod(SensitiveRequest) returns (SensitiveResponse);
+}

+ 1 - 1
jy_publishing/proto/proto/fileText.pb.go

@@ -104,7 +104,7 @@ type Request struct {
 	FileBytes   []byte `protobuf:"bytes,3,opt,name=fileBytes,proto3" json:"fileBytes,omitempty"`      //文件字节流
 	FileType    string `protobuf:"bytes,4,opt,name=fileType,proto3" json:"fileType,omitempty"`        //文件类型 pdf ,xls ,doc
 	ReturnType  int32  `protobuf:"varint,5,opt,name=returnType,proto3" json:"returnType,omitempty"`   //文件类型 {0:url,1:content,2:url+content} 默认0
-	ExtractType int32  `protobuf:"varint,6,opt,name=extractType,proto3" json:"extractType,omitempty"` //解析文件类型{2:oss,1:fileBytes,2:url} 默认2
+	ExtractType int32  `protobuf:"varint,6,opt,name=extractType,proto3" json:"extractType,omitempty"` //解析文件类型{0:oss,1:fileBytes,2:url} 默认0
 }
 
 func (x *Request) Reset() {

+ 3 - 2
jy_publishing/rules.txt

@@ -1,5 +1,5 @@
-博采+网站^打击|禁止|杜绝
-赌博^打击|禁止|杜绝|取缔
+博采
+赌博
 黄色
 腐败中国
 三个呆婊
@@ -233,6 +233,7 @@ a扁
 台wan
 taiwan
 台弯
+台湾
 台湾国
 台湾共和国
 台du

+ 43 - 34
jy_publishing/task.go

@@ -37,7 +37,7 @@ var SaveFields = map[string]string{
 	"contract_person": "buyerperson",
 	"contract_phone":  "buyertel",
 	"discern_attach":  "attach_text",
-	//"attch": "",
+	//"attch":           "",
 	//"industry": "",
 	//"contract_overt": "",
 }
@@ -66,14 +66,14 @@ func Sensitive(info map[string]interface{}) {
 	tmp := info["appendInfo"].(map[string]interface{})
 	tArr := WordsIdentify(util.ObjToString(tmp["title"]))
 	dArr := WordsIdentify(util.ObjToString(tmp["detail"]))
-	if tmp["attach"] != nil {
-		attsMap := tmp["attach"].(map[string]interface{})
+	Logger.Debug("" + fmt.Sprintln(tmp))
+	if attsMap, ok := tmp["attach"].(map[string]interface{}); ok && len(attsMap) > 0 {
 		other := map[string]interface{}{
-			"id":      tmp["id"],
-			"action":  tmp["action"],
-			"msgType": tmp["msgType"],
-			"title":   strings.Join(tArr, ","),
-			"detail":  strings.Join(dArr, ","),
+			"id":      info["id"],
+			"action":  info["action"],
+			"msgType": info["msgType"],
+			"title":   tArr,
+			"detail":  dArr,
 		}
 		otherJson, _ := json.Marshal(other)
 		var attsArr []*pb.Request
@@ -83,20 +83,21 @@ func Sensitive(info map[string]interface{}) {
 				FileUrl:     util.ObjToString(m1["fid"]),
 				FileName:    util.ObjToString(m1["filename"]),
 				FileType:    util.ObjToString(m1["ftype"]),
-				ReturnType:  2,
-				ExtractType: 2,
+				ReturnType:  1,
+				ExtractType: 0,
 			})
 		}
 		msginfo := &pb.FileRequest{
 			Message: attsArr,
 			Other:   string(otherJson),
+			Topic:   FileTopicResult,
 		}
-		Logger.Debug("file extract: " + fmt.Sprint(msginfo))
+		Logger.Debug("file extract send nsq: " + fmt.Sprint(msginfo))
 		_ = MProducer.Publish(msginfo)
 	} else {
 		// 没有附件
 		Logger.Debug("title sensitive array: " + fmt.Sprint(tArr))
-		Logger.Debug("title sensitive array: " + fmt.Sprint(dArr))
+		Logger.Debug("detail sensitive array: " + fmt.Sprint(dArr))
 		req := &jypb.SensitiveRequest{
 			Id:      util.ObjToString(info["id"]),
 			MsgType: util.ObjToString(info["msgType"]),
@@ -138,7 +139,7 @@ func WordsIdentify(str string) []string {
 	if len(ret) > 0 {
 		var words []string
 		for _, r := range ret {
-			words = append(words, r.Line)
+			words = append(words, r.MatchRule)
 		}
 		return words
 	}
@@ -221,7 +222,7 @@ func InfoPub(info map[string]interface{}) {
 				if err := json.Unmarshal([]byte(s), &atts); err != nil {
 					Logger.Error("data Unmarshal Failed:", Field("error", err))
 				}
-				saveMap[SaveFields[f]] = atts
+				saveMap["projectinfo"] = map[string]interface{}{"attachments": atts}
 			}
 		} else if f == "discern_attach" {
 			if s := util.ObjToString(tmp[f]); s != "" {
@@ -233,11 +234,7 @@ func InfoPub(info map[string]interface{}) {
 			}
 		} else {
 			if s := util.ObjToString(tmp[f]); s != "" {
-				if SaveFields[f] == "" {
-					Logger.Info("field ---: " + f)
-				}
 				saveMap[SaveFields[f]] = s
-
 				if SaveFields[f] == "buyer" || SaveFields[f] == "buyerperson" || SaveFields[f] == "buyertel" ||
 					SaveFields[f] == "area" || SaveFields[f] == "city" {
 					jyMap[SaveFields[f]] = s
@@ -250,6 +247,8 @@ func InfoPub(info map[string]interface{}) {
 	saveMap["comeintime"] = now.Unix()
 	saveMap["publishtime"] = now.Unix()
 	saveMap["contenthtml"] = tmp["detail"]
+	cut := util.NewCut().ClearHtml(util.ObjToString(tmp["detail"]))
+	tmp["detail"] = cut
 	saveMap["site"] = "剑鱼信息发布平台"
 	saveMap["channel"] = "公告"
 	saveMap["spidercode"] = "a_jyxxfbpt_gg"
@@ -292,17 +291,18 @@ type AttsResult struct {
 
 // @Description 附件处理完成队列
 // @Author J 2022/4/13 3:29 PM
-func taskAtts(obj *AttsResponse) {
+func taskAtts(obj map[string]interface{}) {
 	atts := make(map[string]interface{})
 	atts_text := make(map[string]interface{})
-	for i, r := range obj.Result {
+	for i, r := range obj["result"].([]interface{}) {
+		r1 := r.(map[string]interface{})
 		at := make(map[string]interface{})
 		text := make(map[string]interface{})
-		at["state"] = r.ErrorState
-		if r.ErrorState == "200" {
-			at["sensitive"] = WordsIdentify(r.TextContent)
-			text["file_name"] = r.FileName
-			text["attach_url"] = r.TextUrl
+		at["state"] = r1["errorState"].(string)
+		if r1["errorState"].(string) == "200" {
+			at["sensitive"] = WordsIdentify(r1["textContent"].(string))
+			text["file_name"] = r1["fileName"].(string)
+			text["attach_url"] = r1["textUrl"].(string)
 		}
 		atts[strconv.Itoa(i)] = at
 		if len(text) > 0 {
@@ -312,12 +312,14 @@ func taskAtts(obj *AttsResponse) {
 	attsJson, _ := json.Marshal(atts)
 	attsTextJson, _ := json.Marshal(atts_text)
 	// 直接调用剑鱼接口
+	var other map[string]interface{}
+	_ = json.Unmarshal([]byte(util.ObjToString(obj["other"])), &other)
 	req := &jypb.SensitiveRequest{
-		Id:      util.ObjToString(obj.Other.Id),
-		MsgType: util.ObjToString(obj.Other.MsgType),
+		Id:      util.ObjToString(other["id"]),
+		MsgType: util.ObjToString(other["msgType"]),
 		//Action:      util.ObjToString(obj.Other.Action),
-		Title:       obj.Other.Title,
-		Detail:      obj.Other.Detail,
+		Title:       util.ObjArrToStringArr(other["title"].([]interface{})),
+		Detail:      util.ObjArrToStringArr(other["detail"].([]interface{})),
 		Attachments: string(attsJson),
 		AttachTxt:   string(attsTextJson),
 	}
@@ -329,12 +331,15 @@ func taskAtts(obj *AttsResponse) {
 // @Author J 2022/4/13 11:16 AM
 func JyRpcSensitive(req *jypb.SensitiveRequest) {
 	conn := JyRpcClient.Conn()
-	defer conn.Close()
-	jyIntf := jypb.NewCommonClient(conn)
+	jyIntf := jypb.NewCommonInfoClient(conn)
 	resp, err := jyIntf.SensitiveMethod(context.Background(), req)
 	if err != nil {
 		Logger.Error(err.Error())
-		return
+		initEtcd()
+		resp, err = jyIntf.SensitiveMethod(context.Background(), req)
+		if err != nil {
+			Logger.Error(err.Error())
+		}
 	}
 	Logger.Info("JyRpcSensitive response: " + resp.String())
 }
@@ -375,16 +380,20 @@ func JyRpcDataFin(_id string) {
 		return
 	}
 	conn := JyRpcClient.Conn()
-	defer conn.Close()
 	req := &jypb.StateRequest{
 		Id:        util.ObjToString((*info)["jyfb_id"]),
 		PublishId: _id,
 	}
-	jyIntf := jypb.NewCommonClient(conn)
+	jyIntf := jypb.NewCommonInfoClient(conn)
 	Logger.Info("JyRpcDataFin request: " + req.String())
 	resp, err := jyIntf.StateMethod(context.Background(), req)
 	if err != nil {
 		Logger.Error(err.Error())
+		initEtcd()
+		resp, err = jyIntf.StateMethod(context.Background(), req)
+		if err != nil {
+			Logger.Error(err.Error())
+		}
 	}
 	Logger.Info("JyRpcDataFin response: " + resp.String())
 }