增加删除配置接口

This commit is contained in:
zhangdeman committed 2021-12-01 14:15:05 +08:00
1 parent 9eb2fccd67
commit bf6d8adc4c
4 files changed
+87

No files matched your search

+13
View File
@@ -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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.