songzhibin97
3 years ago
169 changed files with 2057 additions and 1351 deletions
-
121server/api/v1/autocode/autocodeExample.go
-
7server/api/v1/autocode/enter.go
-
15server/api/v1/enter.go
-
15server/api/v1/example/enter.go
-
32server/api/v1/example/exa_breakpoint_continue.go
-
47server/api/v1/example/exa_customer.go
-
24server/api/v1/example/exa_excel.go
-
31server/api/v1/example/exa_file_upload_download.go
-
30server/api/v1/example/exa_simple_uploader.go
-
34server/api/v1/system/enter.go
-
56server/api/v1/system/sys_api.go
-
59server/api/v1/system/sys_authority.go
-
72server/api/v1/system/sys_auto_code.go
-
12server/api/v1/system/sys_captcha.go
-
21server/api/v1/system/sys_casbin.go
-
40server/api/v1/system/sys_dictionary.go
-
40server/api/v1/system/sys_dictionary_detail.go
-
9server/api/v1/system/sys_email.go
-
17server/api/v1/system/sys_initdb.go
-
16server/api/v1/system/sys_jwt_blacklist.go
-
68server/api/v1/system/sys_menu.go
-
41server/api/v1/system/sys_operation_record.go
-
29server/api/v1/system/sys_system.go
-
124server/api/v1/system/sys_user.go
-
10server/config.yaml
-
35server/initialize/gorm.go
-
42server/initialize/router.go
-
8server/middleware/casbin_rbac.go
-
10server/middleware/email.go
-
20server/middleware/jwt.go
-
2server/middleware/need_init.go
-
10server/middleware/operation.go
-
12server/model/autocode/autocodeExample.go
-
13server/model/autocode/request/autocodeExample.go
-
0server/model/common/request/common.go
-
0server/model/common/response/common.go
-
0server/model/common/response/response.go
-
14server/model/exa_customer.go
-
6server/model/exa_excel.go
-
2server/model/example/exa_breakpoint_continue.go
-
15server/model/example/exa_customer.go
-
8server/model/example/exa_excel.go
-
2server/model/example/exa_file_upload_download.go
-
2server/model/example/exa_simple_uploader.go
-
4server/model/example/response/exa_breakpoint_continue.go
-
7server/model/example/response/exa_customer.go
-
7server/model/example/response/exa_file_upload_download.go
-
8server/model/request/sys_dictionary.go
-
8server/model/request/sys_dictionary_detail.go
-
8server/model/request/sys_operation_record.go
-
7server/model/response/exa_customer.go
-
7server/model/response/exa_file_upload_download.go
-
11server/model/response/sys_api.go
-
12server/model/response/sys_authority.go
-
15server/model/response/sys_menu.go
-
15server/model/response/sys_user.go
-
36server/model/sys_base_menu.go
-
0server/model/system/request/jwt.go
-
9server/model/system/request/sys_api.go
-
4server/model/system/request/sys_autocode.go
-
0server/model/system/request/sys_casbin.go
-
11server/model/system/request/sys_dictionary.go
-
11server/model/system/request/sys_dictionary_detail.go
-
0server/model/system/request/sys_init.go
-
10server/model/system/request/sys_menu.go
-
11server/model/system/request/sys_operation_record.go
-
0server/model/system/request/sys_user.go
-
11server/model/system/response/sys_api.go
-
12server/model/system/response/sys_authority.go
-
0server/model/system/response/sys_captcha.go
-
4server/model/system/response/sys_casbin.go
-
15server/model/system/response/sys_menu.go
-
0server/model/system/response/sys_system.go
-
15server/model/system/response/sys_user.go
-
8server/model/system/sys_api.go
-
2server/model/system/sys_authority.go
-
2server/model/system/sys_authority_menu.go
-
2server/model/system/sys_auto_code.go
-
2server/model/system/sys_autocode_history.go
-
36server/model/system/sys_base_menu.go
-
2server/model/system/sys_casbin.go
-
2server/model/system/sys_dictionary.go
-
2server/model/system/sys_dictionary_detail.go
-
2server/model/system/sys_initdb.go
-
2server/model/system/sys_jwt_blacklist.go
-
2server/model/system/sys_operation_record.go
-
2server/model/system/sys_system.go
-
10server/model/system/sys_user.go
-
59server/resource/template/server/api.go.tpl
-
4server/resource/template/server/model.go.tpl
-
9server/resource/template/server/request.go.tpl
-
22server/resource/template/server/router.go.tpl
-
34server/resource/template/server/service.go.tpl
-
2server/resource/template/web/table.vue.tpl
-
22server/router/autocode/autocodeExample.go
-
7server/router/autocode/enter.go
-
15server/router/enter.go
-
18server/router/exa_customer.go
-
16server/router/exa_excel.go
-
19server/router/exa_file_upload_and_download.go
@ -0,0 +1,121 @@ |
|||
package autocode |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
|||
"gin-vue-admin/model/autocode" |
|||
autocodeReq "gin-vue-admin/model/autocode/request" |
|||
"gin-vue-admin/model/common/response" |
|||
"gin-vue-admin/service" |
|||
"gin-vue-admin/utils" |
|||
"github.com/gin-gonic/gin" |
|||
"go.uber.org/zap" |
|||
) |
|||
|
|||
type AutoCodeExampleApi struct { |
|||
} |
|||
|
|||
var autoCodeExampleService = service.ServiceGroupApp.AutoCodeServiceGroup.AutoCodeExampleService |
|||
|
|||
// @Tags AutoCodeExample
|
|||
// @Summary 创建AutoCodeExample
|
|||
// @Security ApiKeyAuth
|
|||
// @accept application/json
|
|||
// @Produce application/json
|
|||
// @Param data body autocode.AutoCodeExample true "AutoCodeExample模型"
|
|||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
|
|||
// @Router /autoCodeExample/createAutoCodeExample [post]
|
|||
func (autoCodeExampleApi *AutoCodeExampleApi) CreateAutoCodeExample(c *gin.Context) { |
|||
var autoCodeExample autocode.AutoCodeExample |
|||
_ = c.ShouldBindJSON(&autoCodeExample) |
|||
if err := autoCodeExampleService.CreateAutoCodeExample(autoCodeExample); err != nil { |
|||
global.GVA_LOG.Error("创建失败!", zap.Any("err", err)) |
|||
response.FailWithMessage("创建失败", c) |
|||
} else { |
|||
response.OkWithMessage("创建成功", c) |
|||
} |
|||
} |
|||
|
|||
// @Tags AutoCodeExample
|
|||
// @Summary 删除AutoCodeExample
|
|||
// @Security ApiKeyAuth
|
|||
// @accept application/json
|
|||
// @Produce application/json
|
|||
// @Param data body autocode.AutoCodeExample true "AutoCodeExample模型"
|
|||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
|
|||
// @Router /autoCodeExample/deleteAutoCodeExample [delete]
|
|||
func (autoCodeExampleApi *AutoCodeExampleApi) DeleteAutoCodeExample(c *gin.Context) { |
|||
var autoCodeExample autocode.AutoCodeExample |
|||
_ = c.ShouldBindJSON(&autoCodeExample) |
|||
if err := autoCodeExampleService.DeleteAutoCodeExample(autoCodeExample); err != nil { |
|||
global.GVA_LOG.Error("删除失败!", zap.Any("err", err)) |
|||
response.FailWithMessage("删除失败", c) |
|||
} else { |
|||
response.OkWithMessage("删除成功", c) |
|||
} |
|||
} |
|||
|
|||
// @Tags AutoCodeExample
|
|||
// @Summary 更新AutoCodeExample
|
|||
// @Security ApiKeyAuth
|
|||
// @accept application/json
|
|||
// @Produce application/json
|
|||
// @Param data body autocode.AutoCodeExample true "更新AutoCodeExample"
|
|||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
|
|||
// @Router /autoCodeExample/updateAutoCodeExample [put]
|
|||
func (autoCodeExampleApi *AutoCodeExampleApi) UpdateAutoCodeExample(c *gin.Context) { |
|||
var autoCodeExample autocode.AutoCodeExample |
|||
_ = c.ShouldBindJSON(&autoCodeExample) |
|||
if err := autoCodeExampleService.UpdateAutoCodeExample(&autoCodeExample); err != nil { |
|||
global.GVA_LOG.Error("更新失败!", zap.Any("err", err)) |
|||
response.FailWithMessage("更新失败", c) |
|||
} else { |
|||
response.OkWithMessage("更新成功", c) |
|||
} |
|||
} |
|||
|
|||
// @Tags AutoCodeExample
|
|||
// @Summary 用id查询AutoCodeExample
|
|||
// @Security ApiKeyAuth
|
|||
// @accept application/json
|
|||
// @Produce application/json
|
|||
// @Param data body autocode.AutoCodeExample true "用id查询AutoCodeExample"
|
|||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
|
|||
// @Router /autoCodeExample/findAutoCodeExample [get]
|
|||
func (autoCodeExampleApi *AutoCodeExampleApi) FindAutoCodeExample(c *gin.Context) { |
|||
var autoCodeExample autocode.AutoCodeExample |
|||
_ = c.ShouldBindQuery(&autoCodeExample) |
|||
if err := utils.Verify(autoCodeExample, utils.IdVerify); err != nil { |
|||
response.FailWithMessage(err.Error(), c) |
|||
return |
|||
} |
|||
if err, reAutoCodeExample := autoCodeExampleService.GetAutoCodeExample(autoCodeExample.ID); err != nil { |
|||
global.GVA_LOG.Error("查询失败!", zap.Any("err", err)) |
|||
response.FailWithMessage("查询失败", c) |
|||
} else { |
|||
response.OkWithDetailed(gin.H{"reAutoCodeExample": reAutoCodeExample}, "查询成功", c) |
|||
} |
|||
} |
|||
|
|||
// @Tags AutoCodeExample
|
|||
// @Summary 分页获取AutoCodeExample列表
|
|||
// @Security ApiKeyAuth
|
|||
// @accept application/json
|
|||
// @Produce application/json
|
|||
// @Param data body autocodeReq.AutoCodeExampleSearch true "页码, 每页大小, 搜索条件"
|
|||
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
|
|||
// @Router /autoCodeExample/getAutoCodeExampleList [get]
|
|||
func (autoCodeExampleApi *AutoCodeExampleApi) GetAutoCodeExampleList(c *gin.Context) { |
|||
var pageInfo autocodeReq.AutoCodeExampleSearch |
|||
_ = c.ShouldBindQuery(&pageInfo) |
|||
if err, list, total := autoCodeExampleService.GetAutoCodeExampleInfoList(pageInfo); err != nil { |
|||
global.GVA_LOG.Error("获取失败!", zap.Any("err", err)) |
|||
response.FailWithMessage("获取失败", c) |
|||
} else { |
|||
response.OkWithDetailed(response.PageResult{ |
|||
List: list, |
|||
Total: total, |
|||
Page: pageInfo.Page, |
|||
PageSize: pageInfo.PageSize, |
|||
}, "获取成功", c) |
|||
} |
|||
} |
@ -0,0 +1,7 @@ |
|||
package autocode |
|||
|
|||
type ApiGroup struct { |
|||
// Code generated by gin-vue-admin Begin; DO NOT EDIT.
|
|||
AutoCodeExampleApi |
|||
// Code generated by gin-vue-admin End; DO NOT EDIT.
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package v1 |
|||
|
|||
import ( |
|||
"gin-vue-admin/api/v1/autocode" |
|||
"gin-vue-admin/api/v1/example" |
|||
"gin-vue-admin/api/v1/system" |
|||
) |
|||
|
|||
type ApiGroup struct { |
|||
ExampleApiGroup example.ApiGroup |
|||
SystemApiGroup system.ApiGroup |
|||
AutoCodeApiGroup autocode.ApiGroup |
|||
} |
|||
|
|||
var ApiGroupApp = new(ApiGroup) |
@ -0,0 +1,15 @@ |
|||
package example |
|||
|
|||
import "gin-vue-admin/service" |
|||
|
|||
type ApiGroup struct { |
|||
CustomerApi |
|||
ExcelApi |
|||
FileUploadAndDownloadApi |
|||
SimpleUploaderApi |
|||
} |
|||
|
|||
var fileUploadAndDownloadService = service.ServiceGroupApp.ExampleServiceGroup.FileUploadAndDownloadService |
|||
var customerService = service.ServiceGroupApp.ExampleServiceGroup.CustomerService |
|||
var excelService = service.ServiceGroupApp.ExampleServiceGroup.ExcelService |
|||
var simpleUploaderService = service.ServiceGroupApp.ExampleServiceGroup.SimpleUploaderService |
@ -0,0 +1,34 @@ |
|||
package system |
|||
|
|||
import "gin-vue-admin/service" |
|||
|
|||
type ApiGroup struct { |
|||
SystemApiApi |
|||
AuthorityApi |
|||
AutoCodeApi |
|||
BaseApi |
|||
CasbinApi |
|||
DictionaryApi |
|||
DictionaryDetailApi |
|||
SystemApi |
|||
DBApi |
|||
JwtApi |
|||
OperationRecordApi |
|||
AuthorityMenuApi |
|||
} |
|||
|
|||
var authorityService = service.ServiceGroupApp.SystemServiceGroup.AuthorityService |
|||
var apiService = service.ServiceGroupApp.SystemServiceGroup.ApiService |
|||
var menuService = service.ServiceGroupApp.SystemServiceGroup.MenuService |
|||
var casbinService = service.ServiceGroupApp.SystemServiceGroup.CasbinService |
|||
var autoCodeService = service.ServiceGroupApp.SystemServiceGroup.AutoCodeService |
|||
var autoCodeHistoryService = service.ServiceGroupApp.SystemServiceGroup.AutoCodeHistoryService |
|||
var dictionaryService = service.ServiceGroupApp.SystemServiceGroup.DictionaryService |
|||
var dictionaryDetailService = service.ServiceGroupApp.SystemServiceGroup.DictionaryDetailService |
|||
var emailService = service.ServiceGroupApp.SystemServiceGroup.EmailService |
|||
var initDBService = service.ServiceGroupApp.SystemServiceGroup.InitDBService |
|||
var jwtService = service.ServiceGroupApp.SystemServiceGroup.JwtService |
|||
var baseMenuService = service.ServiceGroupApp.SystemServiceGroup.BaseMenuService |
|||
var operationRecordService = service.ServiceGroupApp.SystemServiceGroup.OperationRecordService |
|||
var userService = service.ServiceGroupApp.SystemServiceGroup.UserService |
|||
var systemConfigService = service.ServiceGroupApp.SystemServiceGroup.SystemConfigService |
@ -0,0 +1,12 @@ |
|||
// 自动生成模板SysDictionaryDetail
|
|||
package autocode |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
|||
) |
|||
|
|||
// 如果含有time.Time 请自行import time包
|
|||
type AutoCodeExample struct { |
|||
global.GVA_MODEL |
|||
AutoCodeExampleField string `json:"autoCodeExampleField" form:"autoCodeExampleField" gorm:"column:auto_code_example_field;comment:仅作示例条目无实际作用"` // 展示值
|
|||
} |
@ -0,0 +1,13 @@ |
|||
// 自动生成模板SysDictionaryDetail
|
|||
package request |
|||
|
|||
import ( |
|||
"gin-vue-admin/model/autocode" |
|||
"gin-vue-admin/model/common/request" |
|||
) |
|||
|
|||
// 如果含有time.Time 请自行import time包
|
|||
type AutoCodeExampleSearch struct { |
|||
autocode.AutoCodeExample |
|||
request.PageInfo |
|||
} |
@ -1,14 +0,0 @@ |
|||
package model |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
|||
) |
|||
|
|||
type ExaCustomer struct { |
|||
global.GVA_MODEL |
|||
CustomerName string `json:"customerName" form:"customerName" gorm:"comment:客户名"` // 客户名
|
|||
CustomerPhoneData string `json:"customerPhoneData" form:"customerPhoneData" gorm:"comment:客户手机号"` // 客户手机号
|
|||
SysUserID uint `json:"sysUserId" form:"sysUserId" gorm:"comment:管理ID"` // 管理ID
|
|||
SysUserAuthorityID string `json:"sysUserAuthorityID" form:"sysUserAuthorityID" gorm:"comment:管理角色ID"` // 管理角色ID
|
|||
SysUser SysUser `json:"sysUser" form:"sysUser" gorm:"comment:管理详情"` // 管理详情
|
|||
} |
@ -1,6 +0,0 @@ |
|||
package model |
|||
|
|||
type ExcelInfo struct { |
|||
FileName string `json:"fileName"` // 文件名
|
|||
InfoList []SysBaseMenu `json:"infoList"` |
|||
} |
@ -1,4 +1,4 @@ |
|||
package model |
|||
package example |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
@ -0,0 +1,15 @@ |
|||
package example |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
|||
"gin-vue-admin/model/system" |
|||
) |
|||
|
|||
type ExaCustomer struct { |
|||
global.GVA_MODEL |
|||
CustomerName string `json:"customerName" form:"customerName" gorm:"comment:客户名"` // 客户名
|
|||
CustomerPhoneData string `json:"customerPhoneData" form:"customerPhoneData" gorm:"comment:客户手机号"` // 客户手机号
|
|||
SysUserID uint `json:"sysUserId" form:"sysUserId" gorm:"comment:管理ID"` // 管理ID
|
|||
SysUserAuthorityID string `json:"sysUserAuthorityID" form:"sysUserAuthorityID" gorm:"comment:管理角色ID"` // 管理角色ID
|
|||
SysUser system.SysUser `json:"sysUser" form:"sysUser" gorm:"comment:管理详情"` // 管理详情
|
|||
} |
@ -0,0 +1,8 @@ |
|||
package example |
|||
|
|||
import "gin-vue-admin/model/system" |
|||
|
|||
type ExcelInfo struct { |
|||
FileName string `json:"fileName"` // 文件名
|
|||
InfoList []system.SysBaseMenu `json:"infoList"` |
|||
} |
@ -1,4 +1,4 @@ |
|||
package model |
|||
package example |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
@ -1,4 +1,4 @@ |
|||
package model |
|||
package example |
|||
|
|||
type ExaSimpleUploader struct { |
|||
ChunkNumber string `json:"chunkNumber" gorm:"comment:当前切片标记"` |
@ -1,11 +1,11 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model" |
|||
import "gin-vue-admin/model/example" |
|||
|
|||
type FilePathResponse struct { |
|||
FilePath string `json:"filePath"` |
|||
} |
|||
|
|||
type FileResponse struct { |
|||
File model.ExaFile `json:"file"` |
|||
File example.ExaFile `json:"file"` |
|||
} |
@ -0,0 +1,7 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model/example" |
|||
|
|||
type ExaCustomerResponse struct { |
|||
Customer example.ExaCustomer `json:"customer"` |
|||
} |
@ -0,0 +1,7 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model/example" |
|||
|
|||
type ExaFileResponse struct { |
|||
File example.ExaFileUploadAndDownload `json:"file"` |
|||
} |
@ -1,8 +0,0 @@ |
|||
package request |
|||
|
|||
import "gin-vue-admin/model" |
|||
|
|||
type SysDictionarySearch struct { |
|||
model.SysDictionary |
|||
PageInfo |
|||
} |
@ -1,8 +0,0 @@ |
|||
package request |
|||
|
|||
import "gin-vue-admin/model" |
|||
|
|||
type SysDictionaryDetailSearch struct { |
|||
model.SysDictionaryDetail |
|||
PageInfo |
|||
} |
@ -1,8 +0,0 @@ |
|||
package request |
|||
|
|||
import "gin-vue-admin/model" |
|||
|
|||
type SysOperationRecordSearch struct { |
|||
model.SysOperationRecord |
|||
PageInfo |
|||
} |
@ -1,7 +0,0 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model" |
|||
|
|||
type ExaCustomerResponse struct { |
|||
Customer model.ExaCustomer `json:"customer"` |
|||
} |
@ -1,7 +0,0 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model" |
|||
|
|||
type ExaFileResponse struct { |
|||
File model.ExaFileUploadAndDownload `json:"file"` |
|||
} |
@ -1,11 +0,0 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model" |
|||
|
|||
type SysAPIResponse struct { |
|||
Api model.SysApi `json:"api"` |
|||
} |
|||
|
|||
type SysAPIListResponse struct { |
|||
Apis []model.SysApi `json:"apis"` |
|||
} |
@ -1,12 +0,0 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model" |
|||
|
|||
type SysAuthorityResponse struct { |
|||
Authority model.SysAuthority `json:"authority"` |
|||
} |
|||
|
|||
type SysAuthorityCopyResponse struct { |
|||
Authority model.SysAuthority `json:"authority"` |
|||
OldAuthorityId string `json:"oldAuthorityId"` // 旧角色ID
|
|||
} |
@ -1,15 +0,0 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model" |
|||
|
|||
type SysMenusResponse struct { |
|||
Menus []model.SysMenu `json:"menus"` |
|||
} |
|||
|
|||
type SysBaseMenusResponse struct { |
|||
Menus []model.SysBaseMenu `json:"menus"` |
|||
} |
|||
|
|||
type SysBaseMenuResponse struct { |
|||
Menu model.SysBaseMenu `json:"menu"` |
|||
} |
@ -1,15 +0,0 @@ |
|||
package response |
|||
|
|||
import ( |
|||
"gin-vue-admin/model" |
|||
) |
|||
|
|||
type SysUserResponse struct { |
|||
User model.SysUser `json:"user"` |
|||
} |
|||
|
|||
type LoginResponse struct { |
|||
User model.SysUser `json:"user"` |
|||
Token string `json:"token"` |
|||
ExpiresAt int64 `json:"expiresAt"` |
|||
} |
@ -1,36 +0,0 @@ |
|||
package model |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
|||
) |
|||
|
|||
type SysBaseMenu struct { |
|||
global.GVA_MODEL |
|||
MenuLevel uint `json:"-"` |
|||
ParentId string `json:"parentId" gorm:"comment:父菜单ID"` // 父菜单ID
|
|||
Path string `json:"path" gorm:"comment:路由path"` // 路由path
|
|||
Name string `json:"name" gorm:"comment:路由name"` // 路由name
|
|||
Hidden bool `json:"hidden" gorm:"comment:是否在列表隐藏"` // 是否在列表隐藏
|
|||
Component string `json:"component" gorm:"comment:对应前端文件路径"` // 对应前端文件路径
|
|||
Sort int `json:"sort" gorm:"comment:排序标记"` // 排序标记
|
|||
Meta `json:"meta" gorm:"comment:附加属性"` // 附加属性
|
|||
SysAuthoritys []SysAuthority `json:"authoritys" gorm:"many2many:sys_authority_menus;"` |
|||
Children []SysBaseMenu `json:"children" gorm:"-"` |
|||
Parameters []SysBaseMenuParameter `json:"parameters"` |
|||
} |
|||
|
|||
type Meta struct { |
|||
KeepAlive bool `json:"keepAlive" gorm:"comment:是否缓存"` // 是否缓存
|
|||
DefaultMenu bool `json:"defaultMenu" gorm:"comment:是否是基础路由(开发中)"` // 是否是基础路由(开发中)
|
|||
Title string `json:"title" gorm:"comment:菜单名"` // 菜单名
|
|||
Icon string `json:"icon" gorm:"comment:菜单图标"` // 菜单图标
|
|||
CloseTab bool `json:"closeTab" gorm:"comment:自动关闭tab"` // 自动关闭tab
|
|||
} |
|||
|
|||
type SysBaseMenuParameter struct { |
|||
global.GVA_MODEL |
|||
SysBaseMenuID uint |
|||
Type string `json:"type" gorm:"comment:地址栏携带参数为params还是query"` // 地址栏携带参数为params还是query
|
|||
Key string `json:"key" gorm:"comment:地址栏携带参数的key"` // 地址栏携带参数的key
|
|||
Value string `json:"value" gorm:"comment:地址栏携带参数的值"` // 地址栏携带参数的值
|
|||
} |
@ -1,11 +1,14 @@ |
|||
package request |
|||
|
|||
import "gin-vue-admin/model" |
|||
import ( |
|||
"gin-vue-admin/model/common/request" |
|||
"gin-vue-admin/model/system" |
|||
) |
|||
|
|||
// api分页条件查询及排序结构体
|
|||
type SearchApiParams struct { |
|||
model.SysApi |
|||
PageInfo |
|||
system.SysApi |
|||
request.PageInfo |
|||
OrderKey string `json:"orderKey"` // 排序
|
|||
Desc bool `json:"desc"` // 排序方式:升序false(默认)|降序true
|
|||
} |
@ -1,7 +1,9 @@ |
|||
package request |
|||
|
|||
import "gin-vue-admin/model/common/request" |
|||
|
|||
type SysAutoHistory struct { |
|||
PageInfo |
|||
request.PageInfo |
|||
} |
|||
|
|||
type AutoHistoryByID struct { |
@ -0,0 +1,11 @@ |
|||
package request |
|||
|
|||
import ( |
|||
"gin-vue-admin/model/common/request" |
|||
"gin-vue-admin/model/system" |
|||
) |
|||
|
|||
type SysDictionarySearch struct { |
|||
system.SysDictionary |
|||
request.PageInfo |
|||
} |
@ -0,0 +1,11 @@ |
|||
package request |
|||
|
|||
import ( |
|||
"gin-vue-admin/model/common/request" |
|||
"gin-vue-admin/model/system" |
|||
) |
|||
|
|||
type SysDictionaryDetailSearch struct { |
|||
system.SysDictionaryDetail |
|||
request.PageInfo |
|||
} |
@ -0,0 +1,11 @@ |
|||
package request |
|||
|
|||
import ( |
|||
"gin-vue-admin/model/common/request" |
|||
"gin-vue-admin/model/system" |
|||
) |
|||
|
|||
type SysOperationRecordSearch struct { |
|||
system.SysOperationRecord |
|||
request.PageInfo |
|||
} |
@ -0,0 +1,11 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model/system" |
|||
|
|||
type SysAPIResponse struct { |
|||
Api system.SysApi `json:"api"` |
|||
} |
|||
|
|||
type SysAPIListResponse struct { |
|||
Apis []system.SysApi `json:"apis"` |
|||
} |
@ -0,0 +1,12 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model/system" |
|||
|
|||
type SysAuthorityResponse struct { |
|||
Authority system.SysAuthority `json:"authority"` |
|||
} |
|||
|
|||
type SysAuthorityCopyResponse struct { |
|||
Authority system.SysAuthority `json:"authority"` |
|||
OldAuthorityId string `json:"oldAuthorityId"` // 旧角色ID
|
|||
} |
@ -1,6 +1,8 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/model/request" |
|||
import ( |
|||
"gin-vue-admin/model/system/request" |
|||
) |
|||
|
|||
type PolicyPathResponse struct { |
|||
Paths []request.CasbinInfo `json:"paths"` |
@ -0,0 +1,15 @@ |
|||
package response |
|||
|
|||
import "gin-vue-admin/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"` |
|||
} |
@ -0,0 +1,15 @@ |
|||
package response |
|||
|
|||
import ( |
|||
"gin-vue-admin/model/system" |
|||
) |
|||
|
|||
type SysUserResponse struct { |
|||
User system.SysUser `json:"user"` |
|||
} |
|||
|
|||
type LoginResponse struct { |
|||
User system.SysUser `json:"user"` |
|||
Token string `json:"token"` |
|||
ExpiresAt int64 `json:"expiresAt"` |
|||
} |
@ -1,4 +1,4 @@ |
|||
package model |
|||
package system |
|||
|
|||
import ( |
|||
"time" |
@ -1,4 +1,4 @@ |
|||
package model |
|||
package system |
|||
|
|||
type SysMenu struct { |
|||
SysBaseMenu |
@ -1,4 +1,4 @@ |
|||
package model |
|||
package system |
|||
|
|||
import "errors" |
|||
|
@ -1,4 +1,4 @@ |
|||
package model |
|||
package system |
|||
|
|||
import "gin-vue-admin/global" |
|||
|
@ -0,0 +1,36 @@ |
|||
package system |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
|||
) |
|||
|
|||
type SysBaseMenu struct { |
|||
global.GVA_MODEL |
|||
MenuLevel uint `json:"-"` |
|||
ParentId string `json:"parentId" gorm:"comment:父菜单ID"` // 父菜单ID
|
|||
Path string `json:"path" gorm:"comment:路由path"` // 路由path
|
|||
Name string `json:"name" gorm:"comment:路由name"` // 路由name
|
|||
Hidden bool `json:"hidden" gorm:"comment:是否在列表隐藏"` // 是否在列表隐藏
|
|||
Component string `json:"component" gorm:"comment:对应前端文件路径"` // 对应前端文件路径
|
|||
Sort int `json:"sort" gorm:"comment:排序标记"` // 排序标记
|
|||
Meta `json:"meta" gorm:"comment:附加属性"` // 附加属性
|
|||
SysAuthoritys []SysAuthority `json:"authoritys" gorm:"many2many:sys_authority_menus;"` |
|||
Children []SysBaseMenu `json:"children" gorm:"-"` |
|||
Parameters []SysBaseMenuParameter `json:"parameters"` |
|||
} |
|||
|
|||
type Meta struct { |
|||
KeepAlive bool `json:"keepAlive" gorm:"comment:是否缓存"` // 是否缓存
|
|||
DefaultMenu bool `json:"defaultMenu" gorm:"comment:是否是基础路由(开发中)"` // 是否是基础路由(开发中)
|
|||
Title string `json:"title" gorm:"comment:菜单名"` // 菜单名
|
|||
Icon string `json:"icon" gorm:"comment:菜单图标"` // 菜单图标
|
|||
CloseTab bool `json:"closeTab" gorm:"comment:自动关闭tab"` // 自动关闭tab
|
|||
} |
|||
|
|||
type SysBaseMenuParameter struct { |
|||
global.GVA_MODEL |
|||
SysBaseMenuID uint |
|||
Type string `json:"type" gorm:"comment:地址栏携带参数为params还是query"` // 地址栏携带参数为params还是query
|
|||
Key string `json:"key" gorm:"comment:地址栏携带参数的key"` // 地址栏携带参数的key
|
|||
Value string `json:"value" gorm:"comment:地址栏携带参数的值"` // 地址栏携带参数的值
|
|||
} |
@ -1,4 +1,4 @@ |
|||
package model |
|||
package system |
|||
|
|||
type CasbinModel struct { |
|||
Ptype string `json:"ptype" gorm:"column:ptype"` |
@ -1,5 +1,5 @@ |
|||
// 自动生成模板SysDictionary
|
|||
package model |
|||
package system |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
@ -1,5 +1,5 @@ |
|||
// 自动生成模板SysDictionaryDetail
|
|||
package model |
|||
package system |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
@ -1,4 +1,4 @@ |
|||
package model |
|||
package system |
|||
|
|||
type InitDBFunc interface { |
|||
Init() (err error) |
@ -1,4 +1,4 @@ |
|||
package model |
|||
package system |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
@ -1,5 +1,5 @@ |
|||
// 自动生成模板SysOperationRecord
|
|||
package model |
|||
package system |
|||
|
|||
import ( |
|||
"gin-vue-admin/global" |
@ -1,4 +1,4 @@ |
|||
package model |
|||
package system |
|||
|
|||
import ( |
|||
"gin-vue-admin/config" |
@ -1,8 +1,11 @@ |
|||
package request |
|||
|
|||
import "gin-vue-admin/model" |
|||
import ( |
|||
"gin-vue-admin/model/autocode" |
|||
"gin-vue-admin/model/common/request" |
|||
) |
|||
|
|||
type {{.StructName}}Search struct{ |
|||
model.{{.StructName}} |
|||
PageInfo |
|||
autocode.{{.StructName}} |
|||
request.PageInfo |
|||
} |
@ -0,0 +1,22 @@ |
|||
package autocode |
|||
|
|||
import ( |
|||
"gin-vue-admin/api/v1" |
|||
"gin-vue-admin/middleware" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
type AutoCodeExampleRouter struct { |
|||
} |
|||
|
|||
func (s *AutoCodeExampleRouter) InitSysAutoCodeExampleRouter(Router *gin.RouterGroup) { |
|||
autoCodeExampleRouter := Router.Group("autoCodeExample").Use(middleware.OperationRecord()) |
|||
var autoCodeExampleApi = v1.ApiGroupApp.AutoCodeApiGroup.AutoCodeExampleApi |
|||
{ |
|||
autoCodeExampleRouter.POST("createSysAutoCodeExample", autoCodeExampleApi.CreateAutoCodeExample) // 新建AutoCodeExample
|
|||
autoCodeExampleRouter.DELETE("deleteSysAutoCodeExample", autoCodeExampleApi.DeleteAutoCodeExample) // 删除AutoCodeExample
|
|||
autoCodeExampleRouter.PUT("updateSysAutoCodeExample", autoCodeExampleApi.UpdateAutoCodeExample) // 更新AutoCodeExample
|
|||
autoCodeExampleRouter.GET("findSysAutoCodeExample", autoCodeExampleApi.FindAutoCodeExample) // 根据ID获取AutoCodeExample
|
|||
autoCodeExampleRouter.GET("getSysAutoCodeExampleList", autoCodeExampleApi.GetAutoCodeExampleList) // 获取AutoCodeExample列表
|
|||
} |
|||
} |
@ -0,0 +1,7 @@ |
|||
package autocode |
|||
|
|||
type RouterGroup struct { |
|||
// Code generated by gin-vue-admin Begin; DO NOT EDIT.
|
|||
AutoCodeExampleRouter |
|||
// Code generated by gin-vue-admin End; DO NOT EDIT.
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package router |
|||
|
|||
import ( |
|||
"gin-vue-admin/router/autocode" |
|||
"gin-vue-admin/router/example" |
|||
"gin-vue-admin/router/system" |
|||
) |
|||
|
|||
type RouterGroup struct { |
|||
System system.RouterGroup |
|||
Example example.RouterGroup |
|||
Autocode autocode.RouterGroup |
|||
} |
|||
|
|||
var RouterGroupApp = new(RouterGroup) |
@ -1,18 +0,0 @@ |
|||
package router |
|||
|
|||
import ( |
|||
"gin-vue-admin/api/v1" |
|||
"gin-vue-admin/middleware" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
func InitCustomerRouter(Router *gin.RouterGroup) { |
|||
CustomerRouter := Router.Group("customer").Use(middleware.OperationRecord()) |
|||
{ |
|||
CustomerRouter.POST("customer", v1.CreateExaCustomer) // 创建客户
|
|||
CustomerRouter.PUT("customer", v1.UpdateExaCustomer) // 更新客户
|
|||
CustomerRouter.DELETE("customer", v1.DeleteExaCustomer) // 删除客户
|
|||
CustomerRouter.GET("customer", v1.GetExaCustomer) // 获取单一客户信息
|
|||
CustomerRouter.GET("customerList", v1.GetExaCustomerList) // 获取客户列表
|
|||
} |
|||
} |
@ -1,16 +0,0 @@ |
|||
package router |
|||
|
|||
import ( |
|||
"gin-vue-admin/api/v1" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
func InitExcelRouter(Router *gin.RouterGroup) { |
|||
ExcelRouter := Router.Group("excel") |
|||
{ |
|||
ExcelRouter.POST("/importExcel", v1.ImportExcel) // 导入Excel
|
|||
ExcelRouter.GET("/loadExcel", v1.LoadExcel) // 加载Excel数据
|
|||
ExcelRouter.POST("/exportExcel", v1.ExportExcel) // 导出Excel
|
|||
ExcelRouter.GET("/downloadTemplate", v1.DownloadTemplate) // 下载模板文件
|
|||
} |
|||
} |
@ -1,19 +0,0 @@ |
|||
package router |
|||
|
|||
import ( |
|||
"gin-vue-admin/api/v1" |
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
func InitFileUploadAndDownloadRouter(Router *gin.RouterGroup) { |
|||
FileUploadAndDownloadRouter := Router.Group("fileUploadAndDownload") |
|||
{ |
|||
FileUploadAndDownloadRouter.POST("/upload", v1.UploadFile) // 上传文件
|
|||
FileUploadAndDownloadRouter.POST("/getFileList", v1.GetFileList) // 获取上传文件列表
|
|||
FileUploadAndDownloadRouter.POST("/deleteFile", v1.DeleteFile) // 删除指定文件
|
|||
FileUploadAndDownloadRouter.POST("/breakpointContinue", v1.BreakpointContinue) // 断点续传
|
|||
FileUploadAndDownloadRouter.GET("/findFile", v1.FindFile) // 查询当前文件成功的切片
|
|||
FileUploadAndDownloadRouter.POST("/breakpointContinueFinish", v1.BreakpointContinueFinish) // 查询当前文件成功的切片
|
|||
FileUploadAndDownloadRouter.POST("/removeChunk", v1.RemoveChunk) // 查询当前文件成功的切片
|
|||
} |
|||
} |
Some files were not shown because too many files changed in this diff
Write
Preview
Loading…
Cancel
Save
Reference in new issue