Skip to content

Commit 53a9d69

Browse files
authored
Merge branch 'flipped-aurora:main' into main
2 parents f93b4b8 + 7d3e7b5 commit 53a9d69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3996
-3587
lines changed

.claude/rules/project_rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ description: |
3737

3838
#### **角色与目标**
3939

40-
你是一名资深的 Go 后端开发专家**专精于 `gin-vue-admin` (GVA) 框架的架构与开发范式**
40+
你是一名资深的全栈开发专家**专精于 `gin-vue-admin` (GVA) 框架的架构与开发范式**,熟练使用Golang、Vue3、Gin、GORM等技术栈
4141

4242
你的核心任务是,根据需求开发**完整、生产级别的全栈功能包或插件**。你必须严格遵循 GVA 的分层架构、代码规范和核心设计模式,确保你生成的每一部分代码都能无缝集成到现有项目中。
4343

.cursor/rules/project_rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ description: |
3737

3838
#### **角色与目标**
3939

40-
你是一名资深的 Go 后端开发专家**专精于 `gin-vue-admin` (GVA) 框架的架构与开发范式**
40+
你是一名资深的全栈开发专家**专精于 `gin-vue-admin` (GVA) 框架的架构与开发范式**,熟练使用Golang、Vue3、Gin、GORM等技术栈
4141

4242
你的核心任务是,根据需求开发**完整、生产级别的全栈功能包或插件**。你必须严格遵循 GVA 的分层架构、代码规范和核心设计模式,确保你生成的每一部分代码都能无缝集成到现有项目中。
4343

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ rm_file/
2727
/server/server
2828
/server/latest_log
2929
/server/__debug_bin*
30+
/server/*.local.yaml
3031
server/uploads/
3132

3233
*.iml

.trae/rules/project_rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ description: |
3737

3838
#### **角色与目标**
3939

40-
你是一名资深的 Go 后端开发专家**专精于 `gin-vue-admin` (GVA) 框架的架构与开发范式**
40+
你是一名资深的全栈开发专家**专精于 `gin-vue-admin` (GVA) 框架的架构与开发范式**,熟练使用Golang、Vue3、Gin、GORM等技术栈
4141

4242
你的核心任务是,根据需求开发**完整、生产级别的全栈功能包或插件**。你必须严格遵循 GVA 的分层架构、代码规范和核心设计模式,确保你生成的每一部分代码都能无缝集成到现有项目中。
4343

server/api/v1/system/sys_dictionary.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"github.com/flipped-aurora/gin-vue-admin/server/global"
55
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
66
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
7+
"github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
78
"github.com/gin-gonic/gin"
89
"go.uber.org/zap"
910
)
@@ -116,10 +117,17 @@ func (s *DictionaryApi) FindSysDictionary(c *gin.Context) {
116117
// @Security ApiKeyAuth
117118
// @accept application/json
118119
// @Produce application/json
120+
// @Param data query request.SysDictionarySearch true "字典 name 或者 type"
119121
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取SysDictionary列表,返回包括列表,总数,页码,每页数量"
120122
// @Router /sysDictionary/getSysDictionaryList [get]
121123
func (s *DictionaryApi) GetSysDictionaryList(c *gin.Context) {
122-
list, err := dictionaryService.GetSysDictionaryInfoList()
124+
var dictionary request.SysDictionarySearch
125+
err := c.ShouldBindQuery(&dictionary)
126+
if err != nil {
127+
response.FailWithMessage(err.Error(), c)
128+
return
129+
}
130+
list, err := dictionaryService.GetSysDictionaryInfoList(c, dictionary)
123131
if err != nil {
124132
global.GVA_LOG.Error("获取失败!", zap.Error(err))
125133
response.FailWithMessage("获取失败", c)

server/api/v1/system/sys_dictionary_detail.go

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package system
22

33
import (
4+
"strconv"
5+
46
"github.com/flipped-aurora/gin-vue-admin/server/global"
57
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
68
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
@@ -146,3 +148,120 @@ func (s *DictionaryDetailApi) GetSysDictionaryDetailList(c *gin.Context) {
146148
PageSize: pageInfo.PageSize,
147149
}, "获取成功", c)
148150
}
151+
152+
// GetDictionaryTreeList
153+
// @Tags SysDictionaryDetail
154+
// @Summary 获取字典详情树形结构
155+
// @Security ApiKeyAuth
156+
// @accept application/json
157+
// @Produce application/json
158+
// @Param sysDictionaryID query int true "字典ID"
159+
// @Success 200 {object} response.Response{data=[]system.SysDictionaryDetail,msg=string} "获取字典详情树形结构"
160+
// @Router /sysDictionaryDetail/getDictionaryTreeList [get]
161+
func (s *DictionaryDetailApi) GetDictionaryTreeList(c *gin.Context) {
162+
sysDictionaryID := c.Query("sysDictionaryID")
163+
if sysDictionaryID == "" {
164+
response.FailWithMessage("字典ID不能为空", c)
165+
return
166+
}
167+
168+
var id uint
169+
if idUint64, err := strconv.ParseUint(sysDictionaryID, 10, 32); err != nil {
170+
response.FailWithMessage("字典ID格式错误", c)
171+
return
172+
} else {
173+
id = uint(idUint64)
174+
}
175+
176+
list, err := dictionaryDetailService.GetDictionaryTreeList(id)
177+
if err != nil {
178+
global.GVA_LOG.Error("获取失败!", zap.Error(err))
179+
response.FailWithMessage("获取失败", c)
180+
return
181+
}
182+
response.OkWithDetailed(gin.H{"list": list}, "获取成功", c)
183+
}
184+
185+
// GetDictionaryTreeListByType
186+
// @Tags SysDictionaryDetail
187+
// @Summary 根据字典类型获取字典详情树形结构
188+
// @Security ApiKeyAuth
189+
// @accept application/json
190+
// @Produce application/json
191+
// @Param type query string true "字典类型"
192+
// @Success 200 {object} response.Response{data=[]system.SysDictionaryDetail,msg=string} "获取字典详情树形结构"
193+
// @Router /sysDictionaryDetail/getDictionaryTreeListByType [get]
194+
func (s *DictionaryDetailApi) GetDictionaryTreeListByType(c *gin.Context) {
195+
dictType := c.Query("type")
196+
if dictType == "" {
197+
response.FailWithMessage("字典类型不能为空", c)
198+
return
199+
}
200+
201+
list, err := dictionaryDetailService.GetDictionaryTreeListByType(dictType)
202+
if err != nil {
203+
global.GVA_LOG.Error("获取失败!", zap.Error(err))
204+
response.FailWithMessage("获取失败", c)
205+
return
206+
}
207+
response.OkWithDetailed(gin.H{"list": list}, "获取成功", c)
208+
}
209+
210+
// GetDictionaryDetailsByParent
211+
// @Tags SysDictionaryDetail
212+
// @Summary 根据父级ID获取字典详情
213+
// @Security ApiKeyAuth
214+
// @accept application/json
215+
// @Produce application/json
216+
// @Param data query request.GetDictionaryDetailsByParentRequest true "查询参数"
217+
// @Success 200 {object} response.Response{data=[]system.SysDictionaryDetail,msg=string} "获取字典详情列表"
218+
// @Router /sysDictionaryDetail/getDictionaryDetailsByParent [get]
219+
func (s *DictionaryDetailApi) GetDictionaryDetailsByParent(c *gin.Context) {
220+
var req request.GetDictionaryDetailsByParentRequest
221+
err := c.ShouldBindQuery(&req)
222+
if err != nil {
223+
response.FailWithMessage(err.Error(), c)
224+
return
225+
}
226+
227+
list, err := dictionaryDetailService.GetDictionaryDetailsByParent(req)
228+
if err != nil {
229+
global.GVA_LOG.Error("获取失败!", zap.Error(err))
230+
response.FailWithMessage("获取失败", c)
231+
return
232+
}
233+
response.OkWithDetailed(gin.H{"list": list}, "获取成功", c)
234+
}
235+
236+
// GetDictionaryPath
237+
// @Tags SysDictionaryDetail
238+
// @Summary 获取字典详情的完整路径
239+
// @Security ApiKeyAuth
240+
// @accept application/json
241+
// @Produce application/json
242+
// @Param id query uint true "字典详情ID"
243+
// @Success 200 {object} response.Response{data=[]system.SysDictionaryDetail,msg=string} "获取字典详情路径"
244+
// @Router /sysDictionaryDetail/getDictionaryPath [get]
245+
func (s *DictionaryDetailApi) GetDictionaryPath(c *gin.Context) {
246+
idStr := c.Query("id")
247+
if idStr == "" {
248+
response.FailWithMessage("字典详情ID不能为空", c)
249+
return
250+
}
251+
252+
var id uint
253+
if idUint64, err := strconv.ParseUint(idStr, 10, 32); err != nil {
254+
response.FailWithMessage("字典详情ID格式错误", c)
255+
return
256+
} else {
257+
id = uint(idUint64)
258+
}
259+
260+
path, err := dictionaryDetailService.GetDictionaryPath(id)
261+
if err != nil {
262+
global.GVA_LOG.Error("获取失败!", zap.Error(err))
263+
response.FailWithMessage("获取失败", c)
264+
return
265+
}
266+
response.OkWithDetailed(gin.H{"path": path}, "获取成功", c)
267+
}

server/config.docker.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,6 @@ mcp:
280280
version: v1.0.0
281281
sse_path: /sse
282282
message_path: /message
283-
url_prefix: ''
283+
url_prefix: ''
284+
addr: 8889
285+
separate: false

server/config.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ system:
8787
router-prefix: ""
8888
# 严格角色模式 打开后权限将会存在上下级关系
8989
use-strict-auth: false
90+
# 自动迁移数据库表结构,生产环境建议设为false,手动迁移
91+
disable-auto-migrate: false
9092

9193
# captcha configuration
9294
captcha:
@@ -268,7 +270,6 @@ cors:
268270
allow-headers: Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id
269271
allow-methods: POST, GET
270272
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
271-
272273
allow-credentials: true # 布尔值
273274
- allow-origin: example2.com
274275
allow-headers: content-type
@@ -280,4 +281,6 @@ mcp:
280281
version: v1.0.0
281282
sse_path: /sse
282283
message_path: /message
283-
url_prefix: ''
284+
url_prefix: ''
285+
addr: 8889
286+
separate: false

server/config/mcp.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ type MCP struct {
66
SSEPath string `mapstructure:"sse_path" json:"sse_path" yaml:"sse_path"` // SSE路径
77
MessagePath string `mapstructure:"message_path" json:"message_path" yaml:"message_path"` // 消息路径
88
UrlPrefix string `mapstructure:"url_prefix" json:"url_prefix" yaml:"url_prefix"` // URL前缀
9+
Addr int `mapstructure:"addr" json:"addr" yaml:"addr"` // 独立MCP服务端口
10+
Separate bool `mapstructure:"separate" json:"separate" yaml:"separate"` // 是否独立运行MCP服务
911
}

server/config/system.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ type System struct {
1111
UseRedis bool `mapstructure:"use-redis" json:"use-redis" yaml:"use-redis"` // 使用redis
1212
UseMongo bool `mapstructure:"use-mongo" json:"use-mongo" yaml:"use-mongo"` // 使用mongo
1313
UseStrictAuth bool `mapstructure:"use-strict-auth" json:"use-strict-auth" yaml:"use-strict-auth"` // 使用树形角色分配模式
14+
DisableAutoMigrate bool `mapstructure:"disable-auto-migrate" json:"disable-auto-migrate" yaml:"disable-auto-migrate"` // 自动迁移数据库表结构,生产环境建议设为false,手动迁移
1415
}

0 commit comments

Comments
 (0)