1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- 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)
- }
|