Skip to content
Closed

Dev 286 #2124

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0176e64
feat: 调整mcp策略
piexlmax Sep 9, 2025
5135b8c
fix: 调整mcp整体逻辑
piexlmax Sep 9, 2025
ec3c116
feat(mcp): 新增gva_review工具并优化字典和代码生成逻辑
piexlmax Sep 10, 2025
9712eea
fix: 调整mcp整体逻辑
piexlmax Sep 10, 2025
8a9b088
fix: 调整mcp整体逻辑
piexlmax Sep 10, 2025
55afc0b
chore: 更新.gitignore,添加对本地配置文件的忽略
Azir-11 Sep 20, 2025
a4cccb8
feat(logo): 新增Logo组件并在多个页面中替换原有logo实现
Azir-11 Sep 20, 2025
ec7c57e
fix: 修复菜单 Logo 部分删除文本后显示异常的问题
Azir-11 Sep 20, 2025
2e224a8
优化 Logo 相关内容 (#2099)
pixelmaxQm Sep 21, 2025
b2b68e5
fix:添加字典列表搜索,支持中英文搜索.添加字典详情搜索
bypanghu Sep 22, 2025
335bb83
feat: set correct content-type for minio upload
feitianbubu Sep 21, 2025
1c4ef73
style: 优化部分视觉样式
bypanghu Sep 23, 2025
ee04bb0
Merge pull request #2100 from bypanghu/dict
pixelmaxQm Sep 23, 2025
41cfda9
feat: add autoMigrate config
feitianbubu Sep 23, 2025
4caf233
feat: 增强错误预览组件的暗黑模式支持
Azir-11 Sep 27, 2025
6686c47
feat: 优化请求错误消息获取逻辑,增加状态文本优先级
Azir-11 Sep 27, 2025
c114a02
feat: 添加前端登录验证码静态验证逻辑
Azir-11 Sep 27, 2025
2bd804d
Merge pull request #2105 from Azir-11/dev-286
pixelmaxQm Sep 28, 2025
ed96a86
Merge pull request #2103 from feitianbubu/pr/add-auto-migrate-config
pixelmaxQm Sep 28, 2025
7101ec1
Merge pull request #2101 from feitianbubu/pr/fix-minio-content-type
pixelmaxQm Sep 28, 2025
bf0b2f7
feat: 添加开发环境启动脚本
Azir-11 Sep 29, 2025
23e5d74
feat: 更新 SvgIcon 组件,支持本地图标和 Iconify 图标、移除未使用的 unocss 依赖
Azir-11 Sep 29, 2025
9f73dfe
Merge pull request #2106 from Azir-11/dev-286
pixelmaxQm Sep 29, 2025
6a2e135
fix:字典支持 tree 结构
bypanghu Sep 30, 2025
780cff4
优化动态路由注册方式
Azir-11 Sep 30, 2025
be6ffd2
feat(路由): 添加配置控制标签页keep-alive功能
piexlmax Sep 30, 2025
f16a1da
feat: 添加全局错误处理机制,捕获 Vue 和 JS 错误
Azir-11 Oct 1, 2025
7c268b2
feat: 添加全局错误处理机制,捕获 Vue 和 JS 错误 (#2112)
pixelmaxQm Oct 9, 2025
c9bb6f5
Merge pull request #2109 from bypanghu/dict
pixelmaxQm Oct 9, 2025
6b50fbc
feat(config): 增加mcp独立服务
piexlmax Oct 9, 2025
1d9dbec
fix(config): 默认开启自动迁移
piexlmax Oct 9, 2025
30a5278
refactor: 移除API和菜单创建结果中的权限分配提醒,优化输出信息
piexlmax Oct 9, 2025
0c8714d
chore(deps): update mcp-go to v0.41.1 and add new indirect dependencies
piexlmax Oct 9, 2025
4b32d65
feat: 更新 reset.scss,优化全局样式重置,增强兼容性和可读性
Azir-11 Oct 9, 2025
c546e6d
Merge pull request #2120 from Azir-11/dev-286
pixelmaxQm Oct 10, 2025
fd03e44
refactor(字典详情): 优化字典详情查询逻辑,移除预加载改为按需加载
piexlmax Oct 11, 2025
c7f3504
refactor(路由管理): 优化路由添加逻辑,增强路径处理和顶级路由注册
Azir-11 Oct 14, 2025
d0829fb
Merge pull request #2123 from Azir-11/dev-286
pixelmaxQm Oct 14, 2025
e39f1d8
refactor(系统配置): 将auto-migrate修改为disable-auto-migrate,保证用户升级的兼容性
piexlmax Oct 16, 2025
1c749b0
feat(utils): 优化字典数据递归查找功能并替换select为tree-select
piexlmax Oct 16, 2025
db76d78
feat(字典详情): 添加disabled字段并根据status动态计算
piexlmax Oct 16, 2025
05bc924
feat: 修复字典管理页面
krank666 Oct 16, 2025
d39e396
Merge branch 'dev-286' of github.com:flipped-aurora/gin-vue-admin int…
krank666 Oct 16, 2025
c42d41c
fix(deps): 修复在字段类型为file生成搜索条件无法运行的bug
piexlmax Oct 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ rm_file/
/server/server
/server/latest_log
/server/__debug_bin*
/server/*.local.yaml
server/uploads/

*.iml
Expand Down
10 changes: 9 additions & 1 deletion server/api/v1/system/sys_dictionary.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
"github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
Expand Down Expand Up @@ -116,10 +117,17 @@ func (s *DictionaryApi) FindSysDictionary(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.SysDictionarySearch true "字典 name 或者 type"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取SysDictionary列表,返回包括列表,总数,页码,每页数量"
// @Router /sysDictionary/getSysDictionaryList [get]
func (s *DictionaryApi) GetSysDictionaryList(c *gin.Context) {
list, err := dictionaryService.GetSysDictionaryInfoList()
var dictionary request.SysDictionarySearch
err := c.ShouldBindQuery(&dictionary)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
list, err := dictionaryService.GetSysDictionaryInfoList(c, dictionary)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
Expand Down
119 changes: 119 additions & 0 deletions server/api/v1/system/sys_dictionary_detail.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package system

import (
"strconv"

"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
Expand Down Expand Up @@ -146,3 +148,120 @@ func (s *DictionaryDetailApi) GetSysDictionaryDetailList(c *gin.Context) {
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}

// GetDictionaryTreeList
// @Tags SysDictionaryDetail
// @Summary 获取字典详情树形结构
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param sysDictionaryID query int true "字典ID"
// @Success 200 {object} response.Response{data=[]system.SysDictionaryDetail,msg=string} "获取字典详情树形结构"
// @Router /sysDictionaryDetail/getDictionaryTreeList [get]
func (s *DictionaryDetailApi) GetDictionaryTreeList(c *gin.Context) {
sysDictionaryID := c.Query("sysDictionaryID")
if sysDictionaryID == "" {
response.FailWithMessage("字典ID不能为空", c)
return
}

var id uint
if idUint64, err := strconv.ParseUint(sysDictionaryID, 10, 32); err != nil {
response.FailWithMessage("字典ID格式错误", c)
return
} else {
id = uint(idUint64)
}

list, err := dictionaryDetailService.GetDictionaryTreeList(id)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
return
}
response.OkWithDetailed(gin.H{"list": list}, "获取成功", c)
}

// GetDictionaryTreeListByType
// @Tags SysDictionaryDetail
// @Summary 根据字典类型获取字典详情树形结构
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param type query string true "字典类型"
// @Success 200 {object} response.Response{data=[]system.SysDictionaryDetail,msg=string} "获取字典详情树形结构"
// @Router /sysDictionaryDetail/getDictionaryTreeListByType [get]
func (s *DictionaryDetailApi) GetDictionaryTreeListByType(c *gin.Context) {
dictType := c.Query("type")
if dictType == "" {
response.FailWithMessage("字典类型不能为空", c)
return
}

list, err := dictionaryDetailService.GetDictionaryTreeListByType(dictType)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
return
}
response.OkWithDetailed(gin.H{"list": list}, "获取成功", c)
}

// GetDictionaryDetailsByParent
// @Tags SysDictionaryDetail
// @Summary 根据父级ID获取字典详情
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.GetDictionaryDetailsByParentRequest true "查询参数"
// @Success 200 {object} response.Response{data=[]system.SysDictionaryDetail,msg=string} "获取字典详情列表"
// @Router /sysDictionaryDetail/getDictionaryDetailsByParent [get]
func (s *DictionaryDetailApi) GetDictionaryDetailsByParent(c *gin.Context) {
var req request.GetDictionaryDetailsByParentRequest
err := c.ShouldBindQuery(&req)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}

list, err := dictionaryDetailService.GetDictionaryDetailsByParent(req)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
return
}
response.OkWithDetailed(gin.H{"list": list}, "获取成功", c)
}

// GetDictionaryPath
// @Tags SysDictionaryDetail
// @Summary 获取字典详情的完整路径
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param id query uint true "字典详情ID"
// @Success 200 {object} response.Response{data=[]system.SysDictionaryDetail,msg=string} "获取字典详情路径"
// @Router /sysDictionaryDetail/getDictionaryPath [get]
func (s *DictionaryDetailApi) GetDictionaryPath(c *gin.Context) {
idStr := c.Query("id")
if idStr == "" {
response.FailWithMessage("字典详情ID不能为空", c)
return
}

var id uint
if idUint64, err := strconv.ParseUint(idStr, 10, 32); err != nil {
response.FailWithMessage("字典详情ID格式错误", c)
return
} else {
id = uint(idUint64)
}

path, err := dictionaryDetailService.GetDictionaryPath(id)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
return
}
response.OkWithDetailed(gin.H{"path": path}, "获取成功", c)
}
4 changes: 3 additions & 1 deletion server/config.docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -280,4 +280,6 @@ mcp:
version: v1.0.0
sse_path: /sse
message_path: /message
url_prefix: ''
url_prefix: ''
addr: 8889
separate: false
7 changes: 5 additions & 2 deletions server/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ system:
router-prefix: ""
# 严格角色模式 打开后权限将会存在上下级关系
use-strict-auth: false
# 自动迁移数据库表结构,生产环境建议设为false,手动迁移
disable-auto-migrate: false

# captcha configuration
captcha:
Expand Down Expand Up @@ -268,7 +270,6 @@ cors:
allow-headers: Content-Type,AccessToken,X-CSRF-Token, Authorization, Token,X-Token,X-User-Id
allow-methods: POST, GET
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type

allow-credentials: true # 布尔值
- allow-origin: example2.com
allow-headers: content-type
Expand All @@ -280,4 +281,6 @@ mcp:
version: v1.0.0
sse_path: /sse
message_path: /message
url_prefix: ''
url_prefix: ''
addr: 8889
separate: false
2 changes: 2 additions & 0 deletions server/config/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ type MCP struct {
SSEPath string `mapstructure:"sse_path" json:"sse_path" yaml:"sse_path"` // SSE路径
MessagePath string `mapstructure:"message_path" json:"message_path" yaml:"message_path"` // 消息路径
UrlPrefix string `mapstructure:"url_prefix" json:"url_prefix" yaml:"url_prefix"` // URL前缀
Addr int `mapstructure:"addr" json:"addr" yaml:"addr"` // 独立MCP服务端口
Separate bool `mapstructure:"separate" json:"separate" yaml:"separate"` // 是否独立运行MCP服务
}
1 change: 1 addition & 0 deletions server/config/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ type System struct {
UseRedis bool `mapstructure:"use-redis" json:"use-redis" yaml:"use-redis"` // 使用redis
UseMongo bool `mapstructure:"use-mongo" json:"use-mongo" yaml:"use-mongo"` // 使用mongo
UseStrictAuth bool `mapstructure:"use-strict-auth" json:"use-strict-auth" yaml:"use-strict-auth"` // 使用树形角色分配模式
DisableAutoMigrate bool `mapstructure:"disable-auto-migrate" json:"disable-auto-migrate" yaml:"disable-auto-migrate"` // 自动迁移数据库表结构,生产环境建议设为false,手动迁移
}
6 changes: 5 additions & 1 deletion server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ require (
github.com/gookit/color v1.5.4
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.24.9+incompatible
github.com/jordan-wright/email v4.0.1-0.20210109023952-943e75fe5223+incompatible
github.com/mark3labs/mcp-go v0.31.0
github.com/mark3labs/mcp-go v0.41.1
github.com/mholt/archives v0.1.1
github.com/minio/minio-go/v7 v7.0.84
github.com/mojocn/base64Captcha v1.3.8
Expand Down Expand Up @@ -61,10 +61,12 @@ require (
github.com/STARRY-S/zip v0.2.1 // indirect
github.com/alex-ant/gomath v0.0.0-20160516115720-89013a210a82 // indirect
github.com/andybalholm/brotli v1.1.1 // indirect
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/bmatcuk/doublestar/v4 v4.8.0 // indirect
github.com/bodgit/plumbing v1.3.0 // indirect
github.com/bodgit/sevenzip v1.6.0 // indirect
github.com/bodgit/windows v1.0.1 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/bytedance/sonic v1.12.7 // indirect
github.com/bytedance/sonic/loader v0.2.3 // indirect
github.com/casbin/govaluate v1.3.0 // indirect
Expand Down Expand Up @@ -99,6 +101,7 @@ require (
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/invopop/jsonschema v0.13.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
github.com/jackc/pgx/v5 v5.7.2 // indirect
Expand Down Expand Up @@ -153,6 +156,7 @@ require (
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.12 // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
github.com/xdg-go/scram v1.1.2 // indirect
github.com/xdg-go/stringprep v1.0.4 // indirect
Expand Down
12 changes: 10 additions & 2 deletions server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7X
github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA=
github.com/aws/aws-sdk-go v1.55.6 h1:cSg4pvZ3m8dgYcgqB97MrcdjUmZ1BeMYKUxMMB89IPk=
github.com/aws/aws-sdk-go v1.55.6/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU=
github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk=
github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg=
github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/bmatcuk/doublestar/v4 v4.8.0 h1:DSXtrypQddoug1459viM9X9D3dp1Z7993fw36I2kNcQ=
github.com/bmatcuk/doublestar/v4 v4.8.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
Expand All @@ -69,6 +71,8 @@ github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs=
github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0=
github.com/bytedance/sonic v1.12.7 h1:CQU8pxOy9HToxhndH0Kx/S1qU/CuS9GnKYrGioDcU1Q=
github.com/bytedance/sonic v1.12.7/go.mod h1:tnbal4mxOMju17EGfknm2XyYcpyCnIROYOEYuemj13I=
github.com/bytedance/sonic/loader v0.1.1/go.mod h1:ncP89zfokxS5LZrJxl5z0UJcsk4M4yY2JpfqGeCtNLU=
Expand Down Expand Up @@ -247,6 +251,8 @@ github.com/huaweicloud/huaweicloud-sdk-go-obs v3.24.9+incompatible h1:XQVXdk+WAJ
github.com/huaweicloud/huaweicloud-sdk-go-obs v3.24.9+incompatible/go.mod h1:l7VUhRbTKCzdOacdT4oWCwATKyvZqUOlOqr0Ous3k4s=
github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/invopop/jsonschema v0.13.0 h1:KvpoAJWEjR3uD9Kbm2HWJmqsEaHt8lBUpd0qHcIi21E=
github.com/invopop/jsonschema v0.13.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
Expand Down Expand Up @@ -315,8 +321,8 @@ github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a
github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4=
github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU=
github.com/mark3labs/mcp-go v0.31.0 h1:4UxSV8aM770OPmTvaVe/b1rA2oZAjBMhGBfUgOGut+4=
github.com/mark3labs/mcp-go v0.31.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4=
github.com/mark3labs/mcp-go v0.41.1 h1:w78eWfiQam2i8ICL7AL0WFiq7KHNJQ6UB53ZVtH4KGA=
github.com/mark3labs/mcp-go v0.41.1/go.mod h1:T7tUa2jO6MavG+3P25Oy/jR7iCeJPHImCZHRymCn39g=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.15/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
Expand Down Expand Up @@ -473,6 +479,8 @@ github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/unrolled/secure v1.17.0 h1:Io7ifFgo99Bnh0J7+Q+qcMzWM6kaDPCA5FroFZEdbWU=
github.com/unrolled/secure v1.17.0/go.mod h1:BmF5hyM6tXczk3MpQkFf1hpKSRqCyhqcbiQtiAF7+40=
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
github.com/xdg-go/scram v1.1.2 h1:FHX5I5B4i4hKRVRBCFRxq1iQRej7WO3hhBuJf+UUySY=
Expand Down
5 changes: 5 additions & 0 deletions server/initialize/gorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ func Gorm() *gorm.DB {
}

func RegisterTables() {
if global.GVA_CONFIG.System.DisableAutoMigrate {
global.GVA_LOG.Info("auto-migrate is disabled, skipping table registration")
return
}

db := global.GVA_DB
err := db.AutoMigrate(

Expand Down
19 changes: 11 additions & 8 deletions server/initialize/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,19 @@ func Routers() *gin.Engine {
Router.Use(gin.Logger())
}

sseServer := McpRun()
if !global.GVA_CONFIG.MCP.Separate {

// 注册mcp服务
Router.GET(global.GVA_CONFIG.MCP.SSEPath, func(c *gin.Context) {
sseServer.SSEHandler().ServeHTTP(c.Writer, c.Request)
})
sseServer := McpRun()

Router.POST(global.GVA_CONFIG.MCP.MessagePath, func(c *gin.Context) {
sseServer.MessageHandler().ServeHTTP(c.Writer, c.Request)
})
// 注册mcp服务
Router.GET(global.GVA_CONFIG.MCP.SSEPath, func(c *gin.Context) {
sseServer.SSEHandler().ServeHTTP(c.Writer, c.Request)
})

Router.POST(global.GVA_CONFIG.MCP.MessagePath, func(c *gin.Context) {
sseServer.MessageHandler().ServeHTTP(c.Writer, c.Request)
})
}

systemRouter := router.RouterGroupApp.System
exampleRouter := router.RouterGroupApp.Example
Expand Down
12 changes: 1 addition & 11 deletions server/mcp/api_creator.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,11 @@ func (a *ApiCreator) Handle(ctx context.Context, request mcp.CallToolRequest) (*
return nil, fmt.Errorf("序列化结果失败: %v", err)
}

// 添加权限分配提醒
permissionReminder := "\n\n⚠️ 重要提醒:\n" +
"API创建完成后,请前往【系统管理】->【角色管理】中为相关角色分配新创建的API权限," +
"以确保用户能够正常访问新接口。\n" +
"具体步骤:\n" +
"1. 进入角色管理页面\n" +
"2. 选择需要授权的角色\n" +
"3. 在API权限中勾选新创建的API接口\n" +
"4. 保存权限配置"

return &mcp.CallToolResult{
Content: []mcp.Content{
mcp.TextContent{
Type: "text",
Text: fmt.Sprintf("API创建结果:\n\n%s%s", string(resultJSON), permissionReminder),
Text: fmt.Sprintf("API创建结果:\n\n%s", string(resultJSON)),
},
},
}, nil
Expand Down
12 changes: 9 additions & 3 deletions server/mcp/dictionary_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ func init() {
// DictionaryOptionsGenerator 字典选项生成器
type DictionaryOptionsGenerator struct{}

// DictionaryOption 字典选项结构
type DictionaryOption struct {
Label string `json:"label"`
Value string `json:"value"`
Sort int `json:"sort"`
}

// DictionaryGenerateRequest 字典生成请求
type DictionaryGenerateRequest struct {
DictType string `json:"dictType"` // 字典类型
Expand Down Expand Up @@ -139,11 +146,11 @@ func (d *DictionaryOptionsGenerator) InputSchema() map[string]interface{} {
},
"dictName": map[string]interface{}{
"type": "string",
"description": "字典名称,可选,默认根据fieldDesc生成",
"description": "字典名称,必填,默认根据fieldDesc生成",
},
"description": map[string]interface{}{
"type": "string",
"description": "字典描述,可选",
"description": "字典描述,必填",
},
},
"required": []string{"dictType", "fieldDesc", "options"},
Expand Down Expand Up @@ -180,7 +187,6 @@ func (d *DictionaryOptionsGenerator) Handle(ctx context.Context, request mcp.Cal
return nil, errors.New("options 不能为空")
}

// 可选参数
dictName, _ := args["dictName"].(string)
description, _ := args["description"].(string)

Expand Down
Loading