|
@@ -1,67 +0,0 @@
|
|
-package h_rosbag_filter
|
|
|
|
-
|
|
|
|
-import (
|
|
|
|
- "cicv-data-closedloop/common/config/c_log"
|
|
|
|
- "cicv-data-closedloop/common/entity"
|
|
|
|
- "encoding/json"
|
|
|
|
- "fmt"
|
|
|
|
- "net/http"
|
|
|
|
-)
|
|
|
|
-
|
|
|
|
-var (
|
|
|
|
- deviceMap = map[string]Device{
|
|
|
|
- "1": {Name: "金龙车", CodePath: "/root/rosbag-handle-kinglong/", CompileCmd: "CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc GOARCH=arm64 go build --buildmode=plugin -o /root/rosbag-handle-kinglong/plugin/memoveroccupied.so /root/rosbag-handle-kinglong//plugin/sys_info/memoveroccupied/main/memoveroccupied.go"},
|
|
|
|
- "2": {Name: "朴津机器人", CodePath: "/root/rosbag-handle-pji/", CompileCmd: "CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc GOARCH=arm64 go build --buildmode=plugin -o /root/rosbag-handle-kinglong/plugin/memoveroccupied.so /root/rosbag-handle-kinglong//plugin/sys_info/memoveroccupied/main/memoveroccupied.go"},
|
|
|
|
- }
|
|
|
|
- vaildateCmd = "/root/vaildatePlugin.exe"
|
|
|
|
-)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-type Device struct {
|
|
|
|
- Name string
|
|
|
|
- CodePath string
|
|
|
|
- CompileCmd string
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-type FilterHandler struct{}
|
|
|
|
-
|
|
|
|
-func (h *FilterHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- queryParams := r.URL.Query()
|
|
|
|
- deviceType := queryParams.Get("deviceType")
|
|
|
|
- if deviceType == "" {
|
|
|
|
- result, _ := json.Marshal(entity.HttpResult{Status: false, Code: "1003", Message: "参数 deviceType 不能为空。"})
|
|
|
|
- _, _ = fmt.Fprintf(w, string(result))
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- goObjectKey := queryParams.Get("goObjectKey")
|
|
|
|
- if goObjectKey == "" {
|
|
|
|
- result, _ := json.Marshal(entity.HttpResult{Status: false, Code: "1003", Message: "参数 goObjectKey 不能为空。"})
|
|
|
|
- _, _ = fmt.Fprintf(w, string(result))
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- soObjectKey := queryParams.Get("soObjectKey")
|
|
|
|
- if soObjectKey == "" {
|
|
|
|
- result, _ := json.Marshal(entity.HttpResult{Status: false, Code: "1003", Message: "参数 soObjectKey 不能为空。"})
|
|
|
|
- _, _ = fmt.Fprintf(w, string(result))
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- c_log.GlobalLogger.Infof("接收到参数【deviceType】=%v,【goObjectKey】=%v,【soObjectKey】=%v", deviceType, goObjectKey, soObjectKey)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- result, _ := json.Marshal(entity.HttpResult{Status: true, Code: "2000", Message: "编译成功。"})
|
|
|
|
- _, _ = fmt.Fprintf(w, string(result))
|
|
|
|
-}
|
|
|