增加删除配置接口
This commit is contained in:
@ -143,6 +143,19 @@ func initRouter(router *gin.Engine) {
|
||||
}
|
||||
response.ManagerAPISuccess(ctx, map[string]interface{}{})
|
||||
})
|
||||
// 删除配置
|
||||
router.POST("/config/delete", func(ctx *gin.Context) {
|
||||
deleteForm, err := manager.Config.ValidateDeleteConfigForm(ctx)
|
||||
if nil != err {
|
||||
response.ManagerAPIFail(ctx, -1, map[string]interface{}{"reason": err.Error()})
|
||||
return
|
||||
}
|
||||
if err := manager.Config.Delete(deleteForm); nil != err {
|
||||
response.ManagerAPIFail(ctx, -1, map[string]interface{}{"reason": err.Error()})
|
||||
return
|
||||
}
|
||||
response.ManagerAPISuccess(ctx, map[string]interface{}{})
|
||||
})
|
||||
|
||||
// 读取配置(从内存读取)
|
||||
router.GET("/config/read", func(ctx *gin.Context) {
|
||||
|
Reference in New Issue
Block a user