package isapi import ( "github.com/gin-gonic/gin" "github.com/sirupsen/logrus" "io/ioutil" "lcfns/isapi" ) /* 监测目标的尺寸-最大尺寸和最小尺寸 */ type FieldDetectionApi struct { } // GetFieldDectionCap 获取单个通道区域入侵规则参数配置能力 func (api FieldDetectionApi) GetFieldDectionCap(c *gin.Context) { host, err := GetHost(c) if err != nil { logrus.Errorf("获取host失败:%s", err.Error()) return } isapi.TouChuan(host, isapi.GetFieldDetectionCap, nil, c) } // GetSizeFd get size for field detection 区域入侵 func (api FieldDetectionApi) GetSizeFd(c *gin.Context) { host, err := GetHost(c) if err != nil { logrus.Errorf("获取host失败:%e\n", err) return } isapi.TouChuan(host, isapi.GetFieldDetectionCal, nil, c) } func (api FieldDetectionApi) PutSizeFd(c *gin.Context) { defer c.Request.Body.Close() data, err := ioutil.ReadAll(c.Request.Body) if err != nil { logrus.Errorf("读取数据失败:%e\n", err) return } host, err := GetHost(c) if err != nil { logrus.Errorf("获取host失败:%e\n", err) return } isapi.TouChuan(host, isapi.PutFieldDetectionCal, data, c) } func (api FieldDetectionApi) GetFieldDection(c *gin.Context) { host, err := GetHost(c) if err != nil { logrus.Errorf("获取host失败:%e\n", err) return } isapi.TouChuan(host, isapi.GetFieldDetection, nil, c) } func (api FieldDetectionApi) PutFieldDection(c *gin.Context) { defer c.Request.Body.Close() data, err := ioutil.ReadAll(c.Request.Body) if err != nil { logrus.Errorf("读取数据失败:%e\n", err) return } host, err := GetHost(c) if err != nil { logrus.Errorf("获取host失败:%e\n", err) return } isapi.TouChuan(host, isapi.PutFieldDetection, data, c) }