panlei
2019-09-11 737eaa1a79c12c5dd53dcfb63e49ba12a815a8c1
algorithm/middleware/middleware.go
@@ -12,7 +12,7 @@
   "time"
)
func Entrance (args *structure.SdkDatas,groupRule protomsg.GroupRule) {
func Entrance (args *structure.SdkDatas,groupRule protomsg.GroupRule) ([]*structure.LittleRuleResult,string,string){
   resultSplice := []*structure.LittleRuleResult{}
   sdkNames := ""
   polygonId := ""
@@ -150,6 +150,7 @@
         }
      }
   }
   return resultSplice,sdkNames,polygonId
}
func timeRuleResult(rule *protomsg.Rule, am *structure.AreaMap) structure.LittleRuleResult {
@@ -211,16 +212,21 @@
func CallSo(sdkId string,rule *protomsg.Rule, am *structure.AreaMap) structure.LittleRuleResult{
   // 根据sdkId查出其对应的sdk的soName,调用相应so的Entrance方法
   var soName = ""
   if sdkId == "812b674b-2375-4589-919a-5c1c3278a97e" {
      soName = "face.so"
   } else if sdkId == "812b674b-2375-4589-919a-5c1c3278a975"{
      soName = "intrusion.so"
   } else if sdkId == "812b674b-2375-4589-919a-5c1c3278a976" {
      soName = "personUnsual.so"
   } else if sdkId == "812b674b-2375-4589-919a-5c1c3278a972" {
      soName = "faceCompare.so"
   //var soName = ""
   //if sdkId == "812b674b-2375-4589-919a-5c1c3278a97e" {
   //   soName = "face.so"
   //} else if sdkId == "812b674b-2375-4589-919a-5c1c3278a975"{
   //   soName = "intrusion.so"
   //} else if sdkId == "812b674b-2375-4589-919a-5c1c3278a976" {
   //   soName = "personUnsual.so"
   //} else if sdkId == "812b674b-2375-4589-919a-5c1c3278a972" {
   //   soName = "faceCompare.so"
   //}
   soInfo,errr := cache.GetSoInfoById(sdkId)
   if errr != nil {
      panic("没读到注册表")
   }
   soName := soInfo.SoName
   p,err :=  plugin.Open("./algorithm/"+soName)
   if err != nil {
      panic(err)