🎨 优化项目结构 && 完善ai配置

This commit is contained in:
2026-03-03 15:39:23 +08:00
parent 557c865948
commit 2714e63d2a
585 changed files with 62223 additions and 100018 deletions

View File

@@ -1,14 +1,18 @@
package response
import "time"
import (
"git.echol.cn/loser/ai_proxy/server/model/system"
)
// ApiInfo API信息
type ApiInfo struct {
ID uint `json:"id"`
Path string `json:"path"`
Description string `json:"description"`
ApiGroup string `json:"apiGroup"`
Method string `json:"method"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
type SysAPIResponse struct {
Api system.SysApi `json:"api"`
}
type SysAPIListResponse struct {
Apis []system.SysApi `json:"apis"`
}
type SysSyncApis struct {
NewApis []system.SysApi `json:"newApis"`
DeleteApis []system.SysApi `json:"deleteApis"`
}

View File

@@ -0,0 +1,12 @@
package response
import "git.echol.cn/loser/ai_proxy/server/model/system"
type SysAuthorityResponse struct {
Authority system.SysAuthority `json:"authority"`
}
type SysAuthorityCopyResponse struct {
Authority system.SysAuthority `json:"authority"`
OldAuthorityId uint `json:"oldAuthorityId"` // 旧角色ID
}

View File

@@ -0,0 +1,5 @@
package response
type SysAuthorityBtnRes struct {
Selected []uint `json:"selected"`
}

View File

@@ -0,0 +1,27 @@
package response
import "git.echol.cn/loser/ai_proxy/server/model/system"
type Db struct {
Database string `json:"database" gorm:"column:database"`
}
type Table struct {
TableName string `json:"tableName" gorm:"column:table_name"`
}
type Column struct {
DataType string `json:"dataType" gorm:"column:data_type"`
ColumnName string `json:"columnName" gorm:"column:column_name"`
DataTypeLong string `json:"dataTypeLong" gorm:"column:data_type_long"`
ColumnComment string `json:"columnComment" gorm:"column:column_comment"`
PrimaryKey bool `json:"primaryKey" gorm:"column:primary_key"`
}
type PluginInfo struct {
PluginName string `json:"pluginName"`
PluginType string `json:"pluginType"` // web, server, full
Apis []system.SysApi `json:"apis"`
Menus []system.SysBaseMenu `json:"menus"`
Dictionaries []system.SysDictionary `json:"dictionaries"`
}

View File

@@ -0,0 +1,8 @@
package response
type SysCaptchaResponse struct {
CaptchaId string `json:"captchaId"`
PicPath string `json:"picPath"`
CaptchaLength int `json:"captchaLength"`
OpenCaptcha bool `json:"openCaptcha"`
}

View File

@@ -0,0 +1,9 @@
package response
import (
"git.echol.cn/loser/ai_proxy/server/model/system/request"
)
type PolicyPathResponse struct {
Paths []request.CasbinInfo `json:"paths"`
}

View File

@@ -0,0 +1,15 @@
package response
import "git.echol.cn/loser/ai_proxy/server/model/system"
type SysMenusResponse struct {
Menus []system.SysMenu `json:"menus"`
}
type SysBaseMenusResponse struct {
Menus []system.SysBaseMenu `json:"menus"`
}
type SysBaseMenuResponse struct {
Menu system.SysBaseMenu `json:"menu"`
}

View File

@@ -0,0 +1,7 @@
package response
import "git.echol.cn/loser/ai_proxy/server/config"
type SysConfigResponse struct {
Config config.Server `json:"config"`
}

View File

@@ -1,17 +1,15 @@
package response
type LoginResponse struct {
Token string `json:"token"`
User UserInfo `json:"user"`
import (
"git.echol.cn/loser/ai_proxy/server/model/system"
)
type SysUserResponse struct {
User system.SysUser `json:"user"`
}
type UserInfo struct {
ID uint `json:"id"`
Username string `json:"username"`
Nickname string `json:"nickname"`
Email string `json:"email"`
Phone string `json:"phone"`
Avatar string `json:"avatar"`
Role string `json:"role"`
Status string `json:"status"`
type LoginResponse struct {
User system.SysUser `json:"user"`
Token string `json:"token"`
ExpiresAt int64 `json:"expiresAt"`
}

View File

@@ -0,0 +1,14 @@
package response
import (
"git.echol.cn/loser/ai_proxy/server/model/system"
"git.echol.cn/loser/ai_proxy/server/model/system/request"
)
// ExportVersionResponse 导出版本响应结构体
type ExportVersionResponse struct {
Version request.VersionInfo `json:"version"` // 版本信息
Menus []system.SysBaseMenu `json:"menus"` // 菜单数据直接复用SysBaseMenu
Apis []system.SysApi `json:"apis"` // API数据直接复用SysApi
Dictionaries []system.SysDictionary `json:"dictionaries"` // 字典数据直接复用SysDictionary
}