mirror of
https://gitee.com/samwaf/SamWaf.git
synced 2026-10-31 02:01:44 +08:00
@@ -94,3 +94,13 @@ func (w *WafSystemConfigApi) ModifyApi(c *gin.Context) {
|
||||
response.FailWithMessage("解析失败", c)
|
||||
}
|
||||
}
|
||||
func (w *WafSystemConfigApi) GetDetailByItemApi(c *gin.Context) {
|
||||
var req request.WafSystemConfigDetailByItemReq
|
||||
err := c.ShouldBind(&req)
|
||||
if err == nil {
|
||||
bean := wafSystemConfigService.GetDetailByItemApi(req)
|
||||
response.OkWithDetailed(bean, "获取成功", c)
|
||||
} else {
|
||||
response.FailWithMessage("解析失败", c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,3 +30,6 @@ type WafSystemConfigSearchReq struct {
|
||||
Remarks string `json:"remarks" form:"remarks"`
|
||||
request.PageInfo
|
||||
}
|
||||
type WafSystemConfigDetailByItemReq struct {
|
||||
Item string `json:"item" form:"item"` //item
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ func (receiver *SystemConfigRouter) InitSystemConfigRouter(group *gin.RouterGrou
|
||||
router := group.Group("")
|
||||
router.POST("/samwaf/systemconfig/list", api.GetListApi)
|
||||
router.GET("/samwaf/systemconfig/detail", api.GetDetailApi)
|
||||
router.GET("/samwaf/systemconfig/getdetailByItem", api.GetDetailByItemApi)
|
||||
router.POST("/samwaf/systemconfig/add", api.AddApi)
|
||||
router.GET("/samwaf/systemconfig/del", api.DelApi)
|
||||
router.POST("/samwaf/systemconfig/edit", api.ModifyApi)
|
||||
|
||||
@@ -63,6 +63,11 @@ func (receiver *WafSystemConfigService) GetDetailApi(req request.WafSystemConfig
|
||||
global.GWAF_LOCAL_DB.Where("id=?", req.Id).Find(&bean)
|
||||
return bean
|
||||
}
|
||||
func (receiver *WafSystemConfigService) GetDetailByItemApi(req request.WafSystemConfigDetailByItemReq) model.SystemConfig {
|
||||
var bean model.SystemConfig
|
||||
global.GWAF_LOCAL_DB.Where("Item=?", req.Item).Find(&bean)
|
||||
return bean
|
||||
}
|
||||
func (receiver *WafSystemConfigService) GetDetailByIdApi(id string) model.SystemConfig {
|
||||
var bean model.SystemConfig
|
||||
global.GWAF_LOCAL_DB.Where("id=?", id).Find(&bean)
|
||||
|
||||
Reference in New Issue
Block a user