Skip to content

Commit 5e26a38

Browse files
author
piexlmax
committed
Merge branch 'main' of github.com:flipped-aurora/gin-vue-admin
2 parents f9e7a8c + 5c5da6d commit 5e26a38

Some content is hidden

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

47 files changed

+1063
-693
lines changed

README.md

Lines changed: 70 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -212,17 +212,76 @@ swag init
212212
├── timer (定时器接口封装)
213213
└── upload (oss接口封装)
214214
215-
└─web (前端文件)
216-
├─public (发布模板)
217-
└─src (源码包)
218-
├─api (向后台发送ajax的封装层)
219-
├─assets (静态文件)
220-
├─components(组件)
221-
├─router (前端路由)
222-
├─store (vuex 状态管理仓)
223-
├─style (通用样式文件)
224-
├─utils (前端工具库)
225-
└─view (前端页面)
215+
web
216+
├── babel.config.js
217+
├── Dockerfile
218+
├── favicon.ico
219+
├── index.html -- 主页面
220+
├── limit.js -- 助手代码
221+
├── package.json -- 包管理器代码
222+
├── src -- 源代码
223+
│ ├── api -- api 组
224+
│ ├── App.vue -- 主页面
225+
│ ├── assets -- 静态资源
226+
│ ├── components -- 全局组件
227+
│ ├── core -- gva 组件包
228+
│ │ ├── config.js -- gva网站配置文件
229+
│ │ ├── gin-vue-admin.js -- 注册欢迎文件
230+
│ │ └── global.js -- 统一导入文件
231+
│ ├── directive -- v-auth 注册文件
232+
│ ├── main.js -- 主文件
233+
│ ├── permission.js -- 路由中间件
234+
│ ├── pinia -- pinia 状态管理器,取代vuex
235+
│ │ ├── index.js -- 入口文件
236+
│ │ └── modules -- modules
237+
│ │ ├── dictionary.js
238+
│ │ ├── router.js
239+
│ │ └── user.js
240+
│ ├── router -- 路由声明文件
241+
│ │ └── index.js
242+
│ ├── style -- 全局样式
243+
│ │ ├── base.scss
244+
│ │ ├── basics.scss
245+
│ │ ├── element_visiable.scss -- 此处可以全局覆盖 element-plus 样式
246+
│ │ ├── iconfont.css -- 顶部几个icon的样式文件
247+
│ │ ├── main.scss
248+
│ │ ├── mobile.scss
249+
│ │ └── newLogin.scss
250+
│ ├── utils -- 方法包库
251+
│ │ ├── asyncRouter.js -- 动态路由相关
252+
│ │ ├── btnAuth.js -- 动态权限按钮相关
253+
│ │ ├── bus.js -- 全局mitt声明文件
254+
│ │ ├── date.js -- 日期相关
255+
│ │ ├── dictionary.js -- 获取字典方法
256+
│ │ ├── downloadImg.js -- 下载图片方法
257+
│ │ ├── format.js -- 格式整理相关
258+
│ │ ├── image.js -- 图片相关方法
259+
│ │ ├── page.js -- 设置页面标题
260+
│ │ ├── request.js -- 请求
261+
│ │ └── stringFun.js -- 字符串文件
262+
| ├── view -- 主要view代码
263+
| | ├── about -- 关于我们
264+
| | ├── dashboard -- 面板
265+
| | ├── error -- 错误
266+
| | ├── example --上传案例
267+
| | ├── iconList -- icon列表
268+
| | ├── init -- 初始化数据
269+
| | | ├── index -- 新版本
270+
| | | ├── init -- 旧版本
271+
| | ├── layout -- layout约束页面
272+
| | | ├── aside
273+
| | | ├── bottomInfo -- bottomInfo
274+
| | | ├── screenfull -- 全屏设置
275+
| | | ├── setting -- 系统设置
276+
| | | └── index.vue -- base 约束
277+
| | ├── login --登录
278+
| | ├── person --个人中心
279+
| | ├── superAdmin -- 超级管理员操作
280+
| | ├── system -- 系统检测页面
281+
| | ├── systemTools -- 系统配置相关页面
282+
| | └── routerHolder.vue -- page 入口页面
283+
├── vite.config.js -- vite 配置文件
284+
└── yarn.lock
226285
227286
```
228287

server/api/v1/autocode/auto_code_example.go

Lines changed: 0 additions & 120 deletions
This file was deleted.

server/api/v1/enter.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
package v1
22

33
import (
4-
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/autocode"
54
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/example"
65
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/system"
76
)
87

98
type ApiGroup struct {
109
SystemApiGroup system.ApiGroup
1110
ExampleApiGroup example.ApiGroup
12-
AutoCodeApiGroup autocode.ApiGroup
1311
}
1412

1513
var ApiGroupApp = new(ApiGroup)

server/api/v1/system/sys_auto_code.go

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"net/url"
77
"os"
8+
"strings"
89

910
"github.com/flipped-aurora/gin-vue-admin/server/global"
1011
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
@@ -33,6 +34,7 @@ func (autoApi *AutoCodeApi) PreviewTemp(c *gin.Context) {
3334
response.FailWithMessage(err.Error(), c)
3435
return
3536
}
37+
a.PackageT = strings.Title(a.Package)
3638
autoCode, err := autoCodeService.PreviewTemp(a)
3739
if err != nil {
3840
global.GVA_LOG.Error("预览失败!", zap.Error(err))
@@ -69,6 +71,7 @@ func (autoApi *AutoCodeApi) CreateTemp(c *gin.Context) {
6971
apiIds = ids
7072
}
7173
}
74+
a.PackageT = strings.Title(a.Package)
7275
err := autoCodeService.CreateTemp(a, apiIds...)
7376
if err != nil {
7477
if errors.Is(err, system.AutoMoveErr) {
@@ -142,3 +145,71 @@ func (autoApi *AutoCodeApi) GetColumn(c *gin.Context) {
142145
}
143146
response.OkWithDetailed(gin.H{"columns": columns}, "获取成功", c)
144147
}
148+
149+
150+
// CreatePackage
151+
// @Tags AutoCode
152+
// @Summary 创建package
153+
// @Security ApiKeyAuth
154+
// @accept application/json
155+
// @Produce application/json
156+
// @Param data body system.SysAutoCode true "创建package"
157+
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建package成功"
158+
// @Router /autoCode/createPackage [post]
159+
func (autoApi *AutoCodeApi) CreatePackage(c *gin.Context) {
160+
var a system.SysAutoCode
161+
_ = c.ShouldBindJSON(&a)
162+
if err := utils.Verify(a, utils.AutoPackageVerify); err != nil {
163+
response.FailWithMessage(err.Error(), c)
164+
return
165+
}
166+
err := autoCodeService.CreateAutoCode(&a)
167+
if err != nil {
168+
global.GVA_LOG.Error("创建成功!", zap.Error(err))
169+
response.FailWithMessage("创建失败", c)
170+
} else {
171+
response.OkWithMessage("创建成功", c)
172+
}
173+
}
174+
175+
176+
// GetPackage
177+
// @Tags AutoCode
178+
// @Summary 获取package
179+
// @Security ApiKeyAuth
180+
// @accept application/json
181+
// @Produce application/json
182+
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建package成功"
183+
// @Router /autoCode/getPackage [post]
184+
func (autoApi *AutoCodeApi) GetPackage(c *gin.Context) {
185+
pkgs,err := autoCodeService.GetPackage()
186+
if err != nil {
187+
global.GVA_LOG.Error("获取失败!", zap.Error(err))
188+
response.FailWithMessage("获取失败", c)
189+
} else {
190+
response.OkWithDetailed(gin.H{"pkgs": pkgs},"获取成功", c)
191+
}
192+
}
193+
194+
195+
196+
// DelPackage
197+
// @Tags AutoCode
198+
// @Summary 删除package
199+
// @Security ApiKeyAuth
200+
// @accept application/json
201+
// @Produce application/json
202+
// @Param data body system.SysAutoCode true "创建package"
203+
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "删除package成功"
204+
// @Router /autoCode/delPackage [post]
205+
func (autoApi *AutoCodeApi) DelPackage(c *gin.Context) {
206+
var a system.SysAutoCode
207+
_ = c.ShouldBindJSON(&a)
208+
err := autoCodeService.DelPackage(a)
209+
if err != nil {
210+
global.GVA_LOG.Error("删除失败!", zap.Error(err))
211+
response.FailWithMessage("删除失败", c)
212+
} else {
213+
response.OkWithMessage("删除成功", c)
214+
}
215+
}

0 commit comments

Comments
 (0)