feat: complete Kra admin backend migration
This commit is contained in:
@@ -328,26 +328,24 @@ func registerParameterRoutes(group *gin.RouterGroup, svc *service.SettingsServic
|
||||
ok(c)
|
||||
})
|
||||
router.DELETE("/deleteSysParams", func(c *gin.Context) {
|
||||
var req parameterRequest
|
||||
if c.ShouldBindJSON(&req) != nil {
|
||||
id, err := strconv.ParseUint(c.Query("ID"), 10, 64)
|
||||
if err != nil || id == 0 {
|
||||
fail(c, "参数错误")
|
||||
return
|
||||
}
|
||||
if err := svc.DeleteParameters(c.Request.Context(), []uint{req.ID}); err != nil {
|
||||
if err := svc.DeleteParameters(c.Request.Context(), []uint{uint(id)}); err != nil {
|
||||
fail(c, "删除失败")
|
||||
return
|
||||
}
|
||||
ok(c)
|
||||
})
|
||||
router.DELETE("/deleteSysParamsByIds", func(c *gin.Context) {
|
||||
var req struct {
|
||||
IDs []uint `json:"ids"`
|
||||
}
|
||||
if c.ShouldBindJSON(&req) != nil {
|
||||
ids := idsFromQuery(c)
|
||||
if len(ids) == 0 {
|
||||
fail(c, "参数错误")
|
||||
return
|
||||
}
|
||||
if err := svc.DeleteParameters(c.Request.Context(), req.IDs); err != nil {
|
||||
if err := svc.DeleteParameters(c.Request.Context(), ids); err != nil {
|
||||
fail(c, "删除失败")
|
||||
return
|
||||
}
|
||||
@@ -368,7 +366,7 @@ func registerParameterRoutes(group *gin.RouterGroup, svc *service.SettingsServic
|
||||
fail(c, "查询失败")
|
||||
return
|
||||
}
|
||||
writeResult(c, codeSuccess, gin.H{"data": item}, "查询成功")
|
||||
writeResult(c, codeSuccess, item, "查询成功")
|
||||
})
|
||||
router.GET("/getSysParamsList", func(c *gin.Context) {
|
||||
page, _ := strconv.Atoi(c.DefaultQuery("page", "1"))
|
||||
|
||||
Reference in New Issue
Block a user