优化结构

This commit is contained in:
Yvan
2026-08-28 09:19:54 +08:00
parent 03a4131f6e
commit 279692375b
57 changed files with 778 additions and 799 deletions
+8 -4
View File
@@ -210,7 +210,7 @@ func (h *Dictionary) Details(c *gin.Context) {
func (h *Dictionary) Tree(byType bool) gin.HandlerFunc {
return func(c *gin.Context) {
rawID := c.Query("sysDictionaryID")
id, parseErr := strconv.ParseUint(rawID, 10, 32)
var id uint64
typ := ""
if byType {
typ = c.Query("type")
@@ -221,9 +221,13 @@ func (h *Dictionary) Tree(byType bool) gin.HandlerFunc {
} else if rawID == "" {
Fail(c, "字典ID不能为空")
return
} else if parseErr != nil {
Fail(c, "字典ID格式错误")
return
} else {
var parseErr error
id, parseErr = strconv.ParseUint(rawID, 10, 32)
if parseErr != nil {
Fail(c, "字典ID格式错误")
return
}
}
items, err := h.service.DictionaryTree(c.Request.Context(), uint(id), typ)
if err != nil {