|
@@ -79,10 +79,10 @@ func Sensitive(info map[string]interface{}) {
|
|
|
for _, m := range attsMap {
|
|
|
m1 := m.(map[string]interface{})
|
|
|
attsArr = append(attsArr, &pb.Request{
|
|
|
- FileUrl: util.ObjToString(m1["fid"]),
|
|
|
- FileName: util.ObjToString(m1["filename"]),
|
|
|
- FileType: util.ObjToString(m1["ftype"]),
|
|
|
- ReturnType: 1,
|
|
|
+ FileUrl: util.ObjToString(m1["fid"]),
|
|
|
+ FileName: util.ObjToString(m1["filename"]),
|
|
|
+ FileType: util.ObjToString(m1["ftype"]),
|
|
|
+ //ReturnType: 0, // 不传
|
|
|
ExtractType: 0,
|
|
|
})
|
|
|
}
|
|
@@ -221,18 +221,24 @@ func InfoPub(info map[string]interface{}) {
|
|
|
if err := json.Unmarshal([]byte(s), &atts); err != nil {
|
|
|
Logger.Error("data Unmarshal Failed:", Field("error", err))
|
|
|
}
|
|
|
- delete(atts, "uid")
|
|
|
- delete(atts, "ossurl")
|
|
|
- atts["url"] = "oss"
|
|
|
+ for _, i := range atts {
|
|
|
+ i2 := i.(map[string]interface{})
|
|
|
+ //delete(i2, "uid")
|
|
|
+ delete(i2, "ossurl")
|
|
|
+ i2["url"] = "oss"
|
|
|
+ }
|
|
|
saveMap["projectinfo"] = map[string]interface{}{"attachments": atts}
|
|
|
}
|
|
|
} else if f == "discern_attach" {
|
|
|
if s := util.ObjToString(tmp[f]); s != "" {
|
|
|
- atts := map[string]interface{}{}
|
|
|
- if err := json.Unmarshal([]byte(s), &atts); err != nil {
|
|
|
+ atts_txt := map[string]interface{}{}
|
|
|
+ if err := json.Unmarshal([]byte(s), &atts_txt); err != nil {
|
|
|
Logger.Error("data Unmarshal Failed:", Field("error", err))
|
|
|
}
|
|
|
- saveMap[SaveFields[f]] = atts
|
|
|
+ for k, v := range atts_txt {
|
|
|
+ atts_txt[k] = map[string]interface{}{k: v}
|
|
|
+ }
|
|
|
+ saveMap[SaveFields[f]] = atts_txt
|
|
|
}
|
|
|
} else {
|
|
|
if s := util.ObjToString(tmp[f]); s != "" {
|
|
@@ -302,7 +308,8 @@ func taskAtts(obj map[string]interface{}) {
|
|
|
text := make(map[string]interface{})
|
|
|
at["state"] = r1["errorState"].(string)
|
|
|
if r1["errorState"].(string) == "200" {
|
|
|
- at["sensitive"] = WordsIdentify(r1["textContent"].(string))
|
|
|
+ textContent := OssGetObject(util.ObjToString(r1["textUrl"]))
|
|
|
+ at["sensitive"] = WordsIdentify(textContent)
|
|
|
text["file_name"] = r1["fileName"].(string)
|
|
|
text["attach_url"] = r1["textUrl"].(string)
|
|
|
}
|
|
@@ -349,6 +356,10 @@ func JyRpcSensitive(req *jypb.SensitiveRequest) {
|
|
|
// @Description 信息删除(es、bidding、extract、project)
|
|
|
// @Author J 2022/4/8 4:37 PM:00
|
|
|
func DelMethod(res string) {
|
|
|
+ if !bson.IsObjectIdHex(res) {
|
|
|
+ Logger.Error(" bidding del fail, id err" + res)
|
|
|
+ return
|
|
|
+ }
|
|
|
q := map[string]interface{}{"_id": mongodb.StringTOBsonId(res)}
|
|
|
b := MgoBid.Del(BidColl, q)
|
|
|
if !b {
|