12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- package isapi
- import (
- "github.com/gin-gonic/gin"
- "github.com/sirupsen/logrus"
- "io/ioutil"
- "lcfns/isapi"
- )
- type RegionEntranceApi struct {
- }
- // GetRegionEntranceCap 获取单个通道区域入侵规则参数配置能力
- func (api RegionEntranceApi) GetRegionEntranceCap(c *gin.Context) {
- host, err := GetHost(c)
- if err != nil {
- logrus.Errorf("获取host失败:%e\n", err)
- return
- }
- isapi.TouChuan(host, isapi.GetRegionEntranceCap, nil, c)
- }
- // GetSizeRe 区域入侵
- func (api RegionEntranceApi) GetSizeRe(c *gin.Context) {
- host, err := GetHost(c)
- if err != nil {
- logrus.Errorf("获取host失败:%e\n", err)
- return
- }
- isapi.TouChuan(host, isapi.GetRegionEntranceCal, nil, c)
- }
- func (api RegionEntranceApi) PutSizeRe(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.PutRegionEntranceCal, data, c)
- }
- func (api RegionEntranceApi) GetRegionEntrance(c *gin.Context) {
- host, err := GetHost(c)
- if err != nil {
- logrus.Errorf("获取host失败:%e\n", err)
- return
- }
- isapi.TouChuan(host, isapi.GetRegionEntrance, nil, c)
- }
- func (api RegionEntranceApi) PutRegionEntrance(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.PutRegionEntrance, data, c)
- }
|