Compare commits

...
1044 Commits
Author SHA1 Message Date
piexlmax 3b6e6495c5 public 2.5.2 2022-06-02 14:31:06 +08:00
piexlmax b20a54f7e9 fixed: #1102 2022-05-31 17:53:58 +08:00
SliverHorn 3bb4d74fab feature: viper 读取gin自带的环境变量GIN_MODE,用于区分开发,测试,生产三个环境 #1098 (#1105) 2022-05-30 22:33:14 +08:00
lin93hand奇淼(piexlmax 4dd9c06850 解决historyComponent无法删除问题 (#1108)
* 修复historyComponent无法删除问题

Co-authored-by: 奇淼(piexlmax <qimiaojiangjizhao@gmail.com>
2022-05-30 21:44:45 +08:00
SliverHorn 2ca9322d82 Merge pull request #1104 from aaronwmy/main
将上传目录访问路径和存储路径分开成两个配置
2022-05-30 19:33:51 +08:00
aaronwmy 5e304a5a6b 修改系统工具-系统配置页面,增加本地文件存储路径的表单项。 2022-05-30 11:26:23 +08:00
aaronwmy 21eb039978 给后端的配置文件加上存储路径参数 2022-05-30 10:53:53 +08:00
aaronwmy 6026ac31b1 将上传目录访问路径和存储路径分开成两个配置 2022-05-29 12:21:24 +08:00
奇淼(piexlmax 72e11a7d31 侧边栏样式调整 (#1102)
* 添加侧边栏样式,增加变量配置,方便自定义主题

* 控制侧边栏二层传递样式
2022-05-28 23:59:09 +08:00
piexlmax b0656e70b8 清理误传配置文件 2022-05-28 22:02:04 +08:00
83141b3564 V2.5.2beta (#1101)
* fix: zap无法在运行时进行切割日志, config.docker.yaml与config.yaml同步 #1094

* feat: 为定时任务增加秒级控制

* feat: 调整代码结构,err更改为后置

* css 样式调整

Co-authored-by: SliverHorn <503551462@qq.com>
Co-authored-by: songzhibin97 <718428482@qq.com>
2022-05-28 19:22:23 +08:00
piexlmax b25c128051 排除多余css 2022-05-28 19:06:35 +08:00
piexlmax afc9d13d45 Merge remote-tracking branch 'origin/main' 2022-05-27 22:31:22 +08:00
piexlmax 7e106f3468 侧边栏样式微调 2022-05-27 22:30:44 +08:00
songzhibin97 e74a102700 Merge pull request #1096 from SliverHorn/fix-keyword
fix: 代码生成器 结构体简称发生的关键字冲突 #1089
2022-05-27 15:03:41 +08:00
SliverHorn 1037a1749b Merge pull request #1093 from nickmyb/fix_pgsql_initdb
fix: 修复初始化PostgreSQL时尝试数据库连接验证时用户名同名数据库不存在导致的初始化失败问题
2022-05-27 15:00:03 +08:00
SliverHorn 8c19622db2 fix: _ 加到后面 2022-05-27 14:51:10 +08:00
SliverHorn 0eae201401 fix: 代码生成器 结构体简称发生的关键字冲突 #1089 2022-05-27 13:50:27 +08:00
nickmyb 3de83d1178 fix: 修复初始化PostgreSQL时尝试数据库连接验证时用户名同名数据库不存在导致的初始化失败问题
https://www.postgresql.org/docs/current/app-initdb.html

The postgres database is a default database meant for use by users, utilities and third party applications.

默认数据库postgres一般存在,但用户名同名数据库不一定存在
2022-05-26 22:50:03 +08:00
piexlmax c17ebddcef Merge remote-tracking branch 'origin/main' 2022-05-26 14:45:34 +08:00
pnck 95fd9f92cd 一些小修复 (#1085)
* chore: 去掉初始化中误加的额外表

* chore: 修复初始化不应使用的GVA_DB
2022-05-26 14:45:20 +08:00
piexlmax fda1a2a728 Merge remote-tracking branch 'origin/main' 2022-05-26 14:38:40 +08:00
songzhibin97 98dc95d105 Merge pull request #1091 from songzhibin97/fix-db-list-alias-name
fix:alias name repetition
2022-05-26 14:26:12 +08:00
songzhibin97 c5da8d154d fix:alias name repetition 2022-05-26 14:24:59 +08:00
piexlmax 95209af8f9 Merge remote-tracking branch 'origin/main' 2022-05-26 10:27:16 +08:00
piexlmax 35255fdaee 将closeThisPage方法从global迁移到utils 2022-05-26 10:26:11 +08:00
SliverHorn cd7ad06a7d Merge pull request #1084 from masonFEI/main
修复分片上传-寻找目标文件(秒传)的请求方式有误
2022-05-25 17:34:15 +08:00
SliverHorn d0b8cd8221 Merge pull request #1087 from songzhibin97/fix-db-list-alias-name
fix:db list alias name
2022-05-25 17:32:48 +08:00
songzhibin97 1aac17aeff fix:db list alias name 2022-05-25 13:24:31 +08:00
piexlmax ccf0769f43 我偷偷改一个console错误不会有人知道吧 2022-05-24 21:43:38 +08:00
piexlmax 076e1092f0 发布2.5.1b 新增插件市场快捷入口 2022-05-24 21:33:58 +08:00
piexlmax 670df8c0cb Merge remote-tracking branch 'origin/main' 2022-05-24 21:24:31 +08:00
piexlmax a817dceb24 增加package空拦截 2022-05-24 21:23:47 +08:00
feixuanyu 227bcd509f 修复分片上传-寻找目标文件(秒传)的请求方式有误
会造成的问题是:项目初始化后,在菜单管理页面可以看到这个api的方式是post,然后再角色管理里面,普通用户的角色api的分片上传组-寻找目标文件(秒传)是没有选中的,如果勾选上点击确定提交,会造成断点续传功能无法上传文件,casbin校验不通过,因为数据被修改了。
如果对角色api这个复选框没有选中的情况不进行操作的话,不影响断点续传功能使用。
2022-05-24 20:34:48 +08:00
SliverHorn 1e6605ecd3 Merge pull request #1081 from pnck/main
fix: 修复多库模式不能使用 pg 的问题
2022-05-23 13:02:36 +08:00
pnck 84f35f55d4 fix: 修复多库模式不能使用 pg 的问题 2022-05-22 17:52:14 +08:00
pnck 43d1aa17a3 chore: 修正几个okwithdata 的误用 (#1077) 2022-05-20 14:55:28 +08:00
piexlmax fc0958e511 修改vite2.9.9的情况下右侧白页问题 2022-05-19 17:37:03 +08:00
piexlmax bfe3a861f5 Merge remote-tracking branch 'origin/main' 2022-05-19 12:07:38 +08:00
piexlmax 658ca60f58 修改本地文件的图片路径bug 2022-05-19 12:06:54 +08:00
songzhibin97 e4709c599b fix:replace the method of abandonment (#1075)
* fix:replace the method of abandonment
2022-05-19 11:10:05 +08:00
SliverHorn 02ffe71d80 Update config.yaml
更新初始化文档地址错误
2022-05-18 21:44:09 +08:00
tscuite 3ef3084070 修复docker中代码生成问题 (#1067)
* Update docker-compose-dev.yaml

* Update .env.development
2022-05-18 19:25:28 +08:00
Hessianand周海生 250fcf4bd6 自动生成代码添加枚举类型支持 (#1073)
* fieldDialog.vue feature 增加枚举字段类型支持

* model.go.tpl feature 增加枚举字段类型支持

Co-authored-by: 周海生 <zhouhaisheng@doxue.com>
2022-05-18 19:24:54 +08:00
songzhibin97andlongzhang83 86baabc452 规范自动化插件包功能
* 规范自动化插件包功能

Co-authored-by: longzhang83 <38556219+longzhang83@users.noreply.github.com>
2022-05-18 19:23:36 +08:00
piexlmax 6126aa146b 修复自动化代码复用不切换的bug 2022-05-18 18:59:53 +08:00
piexlmax 64ce7fedcd 修正jwt初始化位置,防止jwt出现配置错误。 2022-05-18 18:09:58 +08:00
piexlmax 6c85af386c 修复自动化插件模板的bug 2022-05-15 17:15:22 +08:00
piexlmax 7ff58c4e6d 发布2.5.1版本 2022-05-13 20:18:04 +08:00
piexlmax ecef8ddd72 Merge remote-tracking branch 'origin/main' 2022-05-11 22:22:03 +08:00
piexlmax 2f96e27adb 调整logo css,让菜单过长可以完整展示 2022-05-11 22:21:19 +08:00
spectatorMrZandspectatorMrZ 10bd7e9485 remove multi preload (#1062)
Co-authored-by: spectatorMrZ <13959374+SpectatorNan@users.noreply.github.com>
2022-05-11 22:04:58 +08:00
f6fa4c3064 Bug fix test (#1061)
* fix 腾讯云COS上传配置无效

* Create docker-cicd.yaml

* 修复InitDataFailed 打印bug

Co-authored-by: tesun <36953434+tesun@users.noreply.github.com>
Co-authored-by: task <ms.yangdan@gmail.com>
Co-authored-by: task <121913992@qq.com>
Co-authored-by: tscuite <tscuite@qq.com>
Co-authored-by: tscuite <64051240+tscuite@users.noreply.github.com>
Co-authored-by: wyh <yinhua_wu@arcplus.com.cn>
2022-05-10 14:24:36 +08:00
beyoung 64a525133b fix typo ymal -> yaml (#1059) 2022-05-10 14:23:49 +08:00
piexlmax 485b9f32df Merge remote-tracking branch 'origin/main' 2022-05-10 14:21:56 +08:00
piexlmax dc6859f4f0 删除会导致默认样式变化的css 2022-05-10 14:21:12 +08:00
xiushengxand奇淼(piexlmax f861f2ba3f 修复用户侧边主题更改不生效的问题 (#1052)
* 修复用户侧边主题更改不生效的问题

Co-authored-by: 奇淼(piexlmax <qimiaojiangjizhao@gmail.com>
2022-05-01 13:37:48 +08:00
tscuite 3a9b39b94b 优化docker-compose,默认去除淘宝源 (#1053)
* 优化docker-compose
2022-05-01 13:30:06 +08:00
SliverHorn 9a5d3461fe fix: #985 日志未按照日期分割 修复完成 2022-04-28 21:59:06 +08:00
6add2094a6 v2.5.1 beta2 (#1048)
* 修复日志中间件报文过大的报错问题

* 修复 Token 失效后导致的白屏问题

* 增加自动创建插件模板功能

* 密码加密方式改为 hash

* 增加刷新防抖

Co-authored-by: songzhibin97 <718428482@qq.com>
Co-authored-by: icedays <icedays@163.com>
Co-authored-by: hedeqiang <laravel_code@163.com>
2022-04-25 17:34:17 +08:00
pnck 843e5a9ad4 update: update echarts version to 5.x (#1047) 2022-04-25 11:45:55 +08:00
xiao-shanfeng a8d41e289c 修改多个字典管理标签切换 (#1042) 2022-04-20 10:44:36 +08:00
Key 3a591a5574 修复自动化包的bug及书写错误 (#1041)
* Update sys_auto_code.go

修复[自动化package] 删除数据的错误

* Update sys_auto_code.go

方法接收者名称书写错误
2022-04-19 21:21:51 +08:00
xiushengx 6076b4cde1 cors.go fix 修复角色切换bug (#1033)
修复角色切换bug
2022-04-16 21:14:06 +08:00
奇淼(piexlmax b158849d07 Update README.md 2022-04-15 16:09:59 +08:00
fengyikang88and奇淼(piexlmax e4d448a661 Update exa_file_upload_and_download.go (#1029)
* 更改上传文件路由文件 代码注释错误


Co-authored-by: 奇淼(piexlmax <qimiaojiangjizhao@gmail.com>
2022-04-14 17:58:24 +08:00
ShuBo6 42b51243a7 修改了Ram拼写错误 (#1030) 2022-04-14 17:56:01 +08:00
bx 8dd87d0172 更改自动化代码注释错别字
更改自动化代码注释错别字
2022-04-13 22:03:58 +08:00
lvshaoyuanandoldlv c92a94bdd2 email.go:再重新写回请求体body中,ioutil.ReadAll会清空c.Request.Body中的数据 (#1027)
Co-authored-by: oldlv <15237336850@163.com>
2022-04-13 21:20:09 +08:00
taskandtask c7ce98f1d5 初始化加入接口:/fileUploadAndDownload/editFileName (#1025)
* 初始化加入接口:/fileUploadAndDownload/editFileName

Co-authored-by: task <121913992@qq.com>
2022-04-13 12:29:32 +08:00
6fb6ac2d6c 修复漏洞,重构初始化功能,优化媒体库 (#1024)
* 媒体库增加 普通上传、压缩上传按钮,方便媒体库直接上传图片

* 增加数据类型切换后的的校验,避免使用错误的查询条件和字典条件。

* refactor: 重构初始化逻辑

* 媒体库功能丰富

* 修复注入漏洞和路径穿越

* 修复自动化接口获取数据库表失败后未能终止的bug

* 微调媒体库样式

Co-authored-by: bypanghu <bypanghu@163.com>
Co-authored-by: tesun <36953434+tesun@users.noreply.github.com>
Co-authored-by: pnck <hio131@gmail.com>
Co-authored-by: task <121913992@qq.com>
2022-04-12 17:57:11 +08:00
奇淼(piexlmax fe539baa34 Merge pull request #1020 from morya/main
fix swagger comment route typo
2022-04-12 14:44:59 +08:00
Morya 9aa7399484 fix swagger comment route typo
/authorityBtn/getAuthorityBtn -> /authorityBtn/setAuthorityBtn
2022-04-12 10:01:29 +08:00
eaa97e7eb8 Add upload (#1016)
* [style] 修改右上角图标,选择统一风格的iconfont

* [fix] fix webfont tree in readme file

* (fix) 菜单编辑的时候,icon不居中

* 更新为使用组件

* 媒体库增加 普通上传、压缩上传按钮,方便媒体库直接上传图片

* 普通上传组件

* 增加数据类型切换后的的校验,避免使用错误的查询条件和字典条件。

Co-authored-by: bypanghu <bypanghu@163.com>
Co-authored-by: tesun <36953434+tesun@users.noreply.github.com>
2022-04-10 22:01:36 +08:00
奇淼(piexlmax dd7e37ef6e Merge pull request #1004 from yesgs/main
增加请求发生异常的判断
2022-04-06 16:45:33 +08:00
king 64c46118b0 增加请求发生异常的判断 2022-04-02 17:02:37 +08:00
奇淼(piexlmax bdc5f69ae0 Merge pull request #999 from szluyu99/patch-2
exa_file_upload_download.go 注释错误
2022-04-02 16:40:51 +08:00
zhenyu 35616394bc exa_file_upload_download.go 注释错误 2022-04-01 15:47:13 +08:00
piexlmax f463e76f5e Merge remote-tracking branch 'origin/main' 2022-03-31 22:15:09 +08:00
piexlmax fb7b57210a 日志中间件对于上传文件做body过滤处理 2022-03-31 22:14:54 +08:00
奇淼(piexlmax 6ccd791574 Merge pull request #989 from szluyu99/patch-1
sys_user.go 注释错误
2022-03-31 21:53:07 +08:00
piexlmax 13b12d80da 增加回滚不删表按钮防止误删数据库重要数据 2022-03-30 22:48:43 +08:00
zhenyu 571de25e81 Update sys_user.go
注释错误
2022-03-29 16:23:04 +08:00
piexlmax 08c2b02be9 消除package warning 2022-03-29 12:20:33 +08:00
piexlmax 6e0a3387cd 修复密码错误遮罩不消失的bug 2022-03-29 11:45:45 +08:00
piexlmax c5f6e1262f 调整插件模板位置 2022-03-28 23:54:23 +08:00
piexlmax 27212da8df 自动化pkg不被允许以数字开头 2022-03-28 23:32:41 +08:00
奇淼(piexlmax 9d89d33701 Merge pull request #987 from songzhibin97/master
fix:config write back
2022-03-28 22:29:21 +08:00
songzhibin97 5754979918 fix:config write back 2022-03-28 20:38:27 +08:00
奇淼(piexlmax bf66fa386b Merge pull request #986 from flipped-aurora/fix-config
Fix config
2022-03-28 12:31:52 +08:00
piexlmax e91338a2e6 增加登录遮罩 2022-03-28 12:23:41 +08:00
piexlmax 58616d4927 修复右上角抽搐现象 2022-03-28 12:00:04 +08:00
piexlmax 2b2ac20feb 前端对应调整config 2022-03-27 19:58:37 +08:00
奇淼(piexlmax 7c11f8ab37 Merge pull request #984 from songzhibin97/master
fix:#977
2022-03-27 19:33:59 +08:00
songzhibin97 cc7fde9a27 feat:viper write back 2022-03-27 17:07:05 +08:00
songzhibin97 ed56a73821 fix:977 2022-03-27 16:52:11 +08:00
songzhibin97 7e7fa6af65 Merge remote-tracking branch 'upstream/main' 2022-03-27 16:21:48 +08:00
piexlmax 5d591bca35 初始化 config.yaml 2022-03-26 14:59:05 +08:00
piexlmax 0b8e15cad1 自动化代码不同包结构体不再冲突 2022-03-26 14:44:23 +08:00
piexlmax d96b963385 Merge branch 'main' of github.com:flipped-aurora/gin-vue-admin 2022-03-26 14:23:02 +08:00
piexlmax 671040a3a7 版本号 v2.5.0 => v2.5.1 beta 2022-03-26 14:22:40 +08:00
429353fa54 自动化代码可分包 (#982)
* [style] 修改右上角图标,选择统一风格的iconfont

* 增加路由排错处理

* 未输入tablename时前端自动生成下划线表名方式回滚误删表

* 支持自动化生成package功能

Co-authored-by: bypanghu <bypanghu@163.com>
Co-authored-by: songzhibin97 <718428482@qq.com>
2022-03-26 14:13:26 +08:00
weiyunxiao 8003603ffd 修复当字典没有详情列表时,删除字典提示失败的问题 (#976) 2022-03-24 10:28:19 +08:00
piexlmax f8e767511b 排除json循环引用的bug 2022-03-23 22:58:35 +08:00
songzhibin97 6a97980a18 mg 2022-03-21 10:19:51 +08:00
Leonardandyangping 2ab0df8e17 fixed(api/v1/example/exa_excel.go): 下载模版失败 (#916)
Co-authored-by: yangping <yangping@66nao.com>
2022-03-16 18:41:47 +08:00
songzhibin97 97a3ca223f Fix #942 #957
* fix:#957
* fix:#942
2022-03-16 18:21:15 +08:00
songzhibin97 bee9f61aa9 fix:#957 2022-03-16 16:05:34 +08:00
Kevin Wan c193eb155e chore: update docs of go-zero (#954) 2022-03-15 15:43:38 +08:00
junstyle cc5ac0c659 JSON.stringify出现循环引用错误 (#951)
JSON.stringify出现循环引用错误
2022-03-15 14:41:22 +08:00
奇淼(piexlmax 752d063d5f Update README.md 2022-03-15 14:31:33 +08:00
piexlmax 06229d0d1f Merge branch 'main' of github.com:flipped-aurora/gin-vue-admin 2022-03-14 15:08:52 +08:00
piexlmax 4ac8f5a354 修复面包屑 2022-03-14 15:08:30 +08:00
cubeerand奇淼(piexlmax 6628715e40 spelling corrected: initMsqlDB -->initMysqlDB (#949)
* spell corrected:  initMsqlDB -->initMysqlDB

Co-authored-by: 奇淼(piexlmax <qimiaojiangjizhao@gmail.com>
2022-03-14 14:56:44 +08:00
无星夜 d84dc0dd48 Fix invalid orderKey (#950)
* fix unmatched type of id field

* fix invalid order key
2022-03-14 14:54:05 +08:00
piexlmax 253e2a58be Merge branch 'main' of github.com:flipped-aurora/gin-vue-admin 2022-03-14 14:51:15 +08:00
piexlmax 5f8daf56b1 修复批量删除按钮失效问题 2022-03-14 14:51:02 +08:00
piexlmax cdd5aedadd 修复批量删除按钮失效问题 2022-03-14 14:49:44 +08:00
tscuite 52809a01d8 隐藏actios错误提示,Update docker-compose.yaml (#946)
* 隐藏actios错误提示

* Update docker-compose.yaml
2022-03-10 18:23:42 +08:00
b459413c0e 修复 开发环境中使用docker的一些问题 📝 (#944)
* 修复docker 开发环境问题 📝

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: tscuite <64051240+tscuite@users.noreply.github.com>
2022-03-10 16:54:38 +08:00
奇淼(piexlmax b147c4faaa Update README.md 2022-03-10 15:39:02 +08:00
奇淼(piexlmax e63ccb0541 Merge pull request #939 from junstyle/main 2022-03-03 11:52:08 +08:00
junstyle ea878ca627 这个isSame有问题
route1.query={}
route2.query={a:1}
route1的query,params为空时,还是会返回true
2022-03-02 20:05:42 +08:00
tscuite 2dc2a998ce 修复线上表单显示 (#935)
修复线上表单显示
2022-03-01 12:47:43 +08:00
piexlmax f747e01285 修复keepalive问题 #934 #903,调整刷新功能,增加页面跳转动画。 2022-03-01 12:40:56 +08:00
piexlmax d9a53805ee 增加角色按钮数据库备注 2022-02-28 11:54:10 +08:00
奇淼(piexlmax 9c3fc0dede Update README.md 2022-02-28 10:10:36 +08:00
RebellioncryandRebellioncry cc409fbab6 AwsS3新增配置属性,可以兼容minio (#932)
Co-authored-by: Rebellioncry <23714@aomai.com>
2022-02-26 20:28:11 +08:00
piexlmax 8de71ff2d3 Merge remote-tracking branch 'origin/main' 2022-02-26 20:23:18 +08:00
piexlmax 457768bb10 发布2.5.0正式版 2022-02-26 20:22:40 +08:00
songzhibin97 046b89efc5 fix: 规范yaml 2022-02-25 14:50:42 +08:00
piexlmax e7f7772a74 fixed:#933 调整vite版本到2.8.0 2022-02-24 18:16:41 +08:00
piexlmax 0082ebfdb1 Merge remote-tracking branch 'origin/main' 2022-02-24 12:03:58 +08:00
piexlmax a9f0c41cae 修复拷贝角色的错误提示 2022-02-24 12:03:37 +08:00
30b16984ed fixed:调整v2.5.0测试版bug (#931)
* update readme badge for en

* server/middleware/operation.go : fix 当记录日志当请求为GET时,不对query参数进行记录

* update element badge to element--plus-2.0.1-green

* fix unmatched type of id field

* update badge for vue gorm in readme

* fixed:#917

Co-authored-by: helight <helight@helight.info>
Co-authored-by: wan9xy <wan9xy@qq.com>
Co-authored-by: he <trumanhe0@gmail.com>
Co-authored-by: 无星夜 <31583810+TrumanH@users.noreply.github.com>
2022-02-24 11:49:37 +08:00
piexlmax c8ce379163 调整其他操作对按钮权限产生的影响 2022-02-24 10:52:29 +08:00
helight f5bfb0255c update reade gin badge to 1.7.0 (#925) 2022-02-22 11:01:35 +08:00
tscuite f2b92cc6e0 增加前端控制台开启redis (#924)
* 增加前端控制台开启redis

* 修复按钮控制权限加载问题
2022-02-22 11:01:22 +08:00
奇淼(piexlmaxandhelight 6a97f39f66 新增按钮权限,增加redis可独立配置 (#923)
* fix jwt to golang-jwt, gin to 1.7.0

* 增加按钮权限功能

* 增加redis可独立配置

Co-authored-by: helight <helight@helight.info>
2022-02-22 00:26:21 +08:00
piexlmax f389ff701a 增加主动使用redis的配置 2022-02-21 14:13:22 +08:00
piexlmax 648df02624 Merge remote-tracking branch 'origin/main' 2022-02-21 14:08:01 +08:00
piexlmax 4cee98bcce casbin结构修改为三方包内部结构,避免升级冲突。 2022-02-21 14:07:32 +08:00
songzhibin97 7e33dc7e25 Merge pull request #919 from songzhibin97/master
feat:zap.L
2022-02-20 15:59:25 +08:00
songzhibin97 6f68fbfd6d feat:zap.L 2022-02-20 15:58:47 +08:00
奇淼(piexlmax 7fe3c2b285 Merge pull request #914 from qazwsx9288/bugFix
bugfix:修复菜单未设置icon时,vue会弹出vnode警告的bug;
2022-02-15 17:22:39 +08:00
qazwsx9288 a07ba498d6 bugfix:修复菜单未设置icon时,vue会弹出vnode警告的bug; 2022-02-15 16:28:12 +08:00
piexlmax d7222c8e31 锁定关键信息ID 2022-02-14 14:59:22 +08:00
piexlmax 9426049095 增加初始化数据库连接池和日志配置 2022-02-14 11:13:52 +08:00
piexlmax edec8788c3 修复log-mode失效的问题 2022-02-14 10:45:19 +08:00
piexlmax 1a66f52f75 当页面默认路由不在权限范围内时可以正常登录跳转404 2022-02-13 23:49:21 +08:00
奇淼(piexlmax ccab152fe3 Merge pull request #905 from flipped-aurora/person-dev
public:让用户对信息修改更加全面和简便——v2.5.0 beta2
2022-02-11 11:08:26 +08:00
piexlmax e2e5ef7a93 发布2.5.0 beta.2 2022-02-11 11:06:53 +08:00
piexlmax c9b6b74020 增加用户自行修改手机号邮箱功能 2022-02-11 11:02:05 +08:00
piexlmax e353f9c295 禁止通过setUserInfo接口修改用户角色防止越权 2022-02-09 11:57:53 +08:00
piexlmax f2a24d0713 禁止通过setUserInfo接口修改用户密码 2022-02-08 17:19:52 +08:00
piexlmax 8423c124d7 修改用户管理编辑模式,增加手机号邮箱操作 2022-02-08 17:15:25 +08:00
piexlmax a9dec9fe4d 升级element至稳定版 2022-02-08 17:00:20 +08:00
piexl 343d3aaaf2 Merge remote-tracking branch 'origin/main' 2022-02-04 19:14:32 +08:00
piexl 1bec261878 防止用户修改username 2022-02-04 19:11:30 +08:00
奇淼(piexlmax 33cffb015e Merge pull request #902 from songzhibin97/endles
fix:自动迁移后重启异常
2022-01-30 17:39:00 +08:00
songzhibin97 b5da0c6043 Update sys_auto_code.go 2022-01-28 13:08:20 +08:00
奇淼(piexlmax dfc24c3c33 Update package.json 2022-01-25 23:35:52 +08:00
piexlmax 12fb1e7891 修复路由参数丢失的bug 2022-01-25 16:20:34 +08:00
奇淼(piexlmax 781f8d7961 Merge pull request #896 from 4lkaid/4lkaid_main_develop
fix(utils/file_operations.go): 同名目录存在时正确返回
2022-01-23 21:35:39 +08:00
https://github.com/CC11001100 的小迷弟 895cb65c10 Update sys_user.go 2022-01-22 15:51:01 +08:00
4lkaid fb1196785d fix(utils/file_operations.go): 同名目录存在时正确返回 2022-01-21 15:36:57 +08:00
奇淼(piexlmax 4c8ac48af0 Merge pull request #895 from 4lkaid/4lkaid_main_develop
fix(utils/directory.go): 同名文件存在时正确返回
2022-01-21 15:15:53 +08:00
4lkaid e8d0b39b5d fix(utils/directory.go): 同名文件存在时正确返回 2022-01-21 14:45:13 +08:00
piexlmax 6dbcd55727 调整readme 声明 2022-01-20 16:13:24 +08:00
piexlmax 40f5dfeb42 Merge remote-tracking branch 'origin/main' 2022-01-20 15:38:40 +08:00
piexlmax c5b96954bf 修改角色删除逻辑,有用户占用状态的角色禁止删除 2022-01-20 15:38:21 +08:00
奇淼(piexlmax debd8afe31 Update README.md 2022-01-18 20:02:33 +08:00
奇淼(piexlmax 46dc47727b Update README.md 2022-01-18 20:01:59 +08:00
奇淼(piexlmax 7a2380ffe8 Merge pull request #891 from songzhibin97/swagger
feat:swagger 优化
2022-01-18 19:57:06 +08:00
songzhibin97 ca1f4ba227 feat:swagger 优化 2022-01-18 16:02:54 +08:00
songzhibin97 dbf45502d1 fix:#887 2022-01-17 12:10:07 +08:00
piexlmax 44892d9401 Merge branch 'main' of github.com:flipped-aurora/gin-vue-admin 2022-01-14 18:14:23 +08:00
piexlmax 82b32f8b65 fixed: #882 2022-01-14 18:13:57 +08:00
奇淼(piexlmax 6026422056 Merge pull request #883 from tscuite/main
dockerfile优化:减小镜像大小 ,更改node版本为16,同时npm更换为yarn
2022-01-12 15:44:14 +08:00
tscuite 69ff39a46c 优化dockerfile:更改node版本为16,同时npm更换为yarn
优化dockerfile:更改node版本为16,同时npm更换为yarn
2022-01-12 10:48:25 +08:00
tscuite f90a51bf40 dockerfile优化:减小镜像大小
dockerfile优化:减小镜像大小,RUN合并为一条命令
2022-01-12 10:22:14 +08:00
奇淼(piexlmax 9ea885d908 修改menu初始化icon的bug
修改menu初始化icon的bug
2022-01-10 12:19:29 +08:00
奇淼(piexlmax ece494e897 Update README.md 2022-01-09 18:39:31 +08:00
piexlmax 85ca35684c 调整了前端接口调用防止越权 2022-01-07 19:26:29 +08:00
piexlmax 8d34adee14 后端增加 setSelfInfo 接口防止越权操作 2022-01-07 19:17:33 +08:00
piexlmax 3a74c9483e 修复了token错误无法退出的bug
修复了字段查询为空的bug
2022-01-07 19:09:41 +08:00
奇淼(piexlmaxandbypanghu 727caf3f4f 放弃vuex改用pinia (#872)
Co-authored-by: bypanghu <bypanghu@163.com>
2022-01-07 12:29:32 +08:00
奇淼(piexlmax eca5967b4d Merge pull request #869 from WqyJh/master
添加AWS S3上传功能
2022-01-07 10:57:22 +08:00
piexlmax 7dce65100a 放弃使用 vue-demi 全部替换为 vue 2022-01-06 11:10:01 +08:00
WqyJh 40d78ab69a 添加AWS S3上传功能 2022-01-05 22:45:02 +08:00
piexlmax 9196caec97 充值用户密码功能初始化数据修复 2022-01-05 17:15:55 +08:00
piexlmax 5fa6e32bbd 错别字调整 2022-01-05 15:13:37 +08:00
piexlmax bb5c65cf4e 修复删除气泡取消后无法再次弹出的问题 2022-01-05 14:23:23 +08:00
piexlmax f512bc0870 登录后调整获取菜单逻辑,不再重复请求getMenu 2022-01-01 20:06:13 +08:00
piexlmax b3b8de1c4c 发布setup语法糖的beta版 2022-01-01 00:56:02 +08:00
piexlmax b4b5eb9266 fixed: #862 2022-01-01 00:51:18 +08:00
piexlmax 9ddd280271 调整axios封装 2021-12-31 22:49:15 +08:00
piexlmax b5f16ee34d 修复断点续传前端部分 2021-12-31 22:49:03 +08:00
piexlmax bf0511efa4 修复切片上传后端部分 2021-12-31 22:47:53 +08:00
piexlmax 236d3c7f33 setup版本代码优化 2021-12-31 03:04:38 +08:00
piexlmax 7fd4b1d0f5 Merge remote-tracking branch 'origin/test' into gva-vue3-setup-dev 2021-12-31 01:29:18 +08:00
piexlmax 8825a18b22 自动化代码修改完成 2021-12-31 00:57:36 +08:00
piexlmax df9dc477ed 前端页面改造基本完成 待优化 2021-12-30 22:41:53 +08:00
piexlmax 8c2b6b2bc0 系统功能板块setup改造完成 2021-12-30 20:48:57 +08:00
piexlmax 512e91e2bc 超级管理员 setup 改造完成 2021-12-30 17:06:11 +08:00
tscuite 812c51804b 构建前修改表单生成器的url
构建前修改表单生成器的url
2021-12-30 13:19:24 +08:00
tscuite 93185149b3 修改单引号为双引号
单引号中参数获取失败
2021-12-30 13:03:02 +08:00
tscuite 6298f31a91 修改后端地址
修改后端地址
2021-12-30 11:00:04 +08:00
tscuite 49af66fb4f 增加测试环境
提交到这个分支会自动发布测试环境
2021-12-30 10:59:12 +08:00
piexlmax abcd1c54b4 菜单管理setup改造完成 2021-12-30 00:06:03 +08:00
piexlmax d2eaf0b38c 角色管理setup改造完成 2021-12-29 23:49:01 +08:00
piexlmax f0957c615e api管理 用户管理 修改完成 2021-12-28 23:57:43 +08:00
piexlmax ce5d5d13a3 登录注册 主要框架 个人中心 已成功更改为setup 2021-12-28 20:05:45 +08:00
piexlmax 274eb56d05 修复自动化代码报错信息提示 2021-12-27 12:10:45 +08:00
piexlmax 6bf3835728 fixed: #825 2021-12-26 23:11:50 +08:00
piexlmax be2681a114 fixed: #825 2021-12-26 22:59:17 +08:00
piexlmax 019829d0db fixed:#853 2021-12-26 14:09:20 +08:00
piexlmax 2ff07055b3 fixed:#854 2021-12-26 14:06:02 +08:00
piexlmax b8bac2ffb8 fixed:#855 2021-12-26 14:00:21 +08:00
piexlmax 382ae1f5ec 清理package中的无用包 2021-12-25 12:30:23 +08:00
piexlmax 5223281db6 发布v2.4.6正式版 2021-12-25 12:25:01 +08:00
piexlmax f64eb528ab Merge remote-tracking branch 'origin/master' 2021-12-24 15:21:28 +08:00
piexlmax 1549bb6dc5 修复退出前信息消失导致的bug 2021-12-24 15:20:47 +08:00
奇淼(piexlmax 9422a25804 Merge pull request #850 from tscuite/master
修改docker配置文件中mysql连接方式,增加自动构建tag
2021-12-24 15:09:05 +08:00
tscuite fd4df8e841 增加更新时静态资源目录替换(resource)
增加更新时静态资源目录替换(resource)
2021-12-24 09:13:15 +08:00
tscuite 4d17c8d1e5 修改docker配置文件中mysql连接方式
修改docker配置文件中mysql连接方式
2021-12-23 19:39:08 +08:00
tscuite 60402a298f 增加自动构建tag
增加自动构建tag
2021-12-23 19:36:54 +08:00
奇淼(piexlmax 3113494c0f Merge pull request #849 from zxaizhuanjiao/master
menuItem:修复图标错乱bug
2021-12-23 16:47:30 +08:00
周雪 ef974be05e menuItem:修复图标错乱bug 2021-12-23 16:03:34 +08:00
piexlmax 3d5b2f70e1 Merge remote-tracking branch 'origin/master' 2021-12-22 11:31:03 +08:00
piexlmax 1912f6b69c 适配element 1.2.0 bate6 css 2021-12-22 11:30:30 +08:00
奇淼(piexlmax 9670b53197 Update README.md 2021-12-21 16:17:01 +08:00
piexlmax 1727c4ef35 增加交流社区 2021-12-21 16:15:32 +08:00
piexlmax ab4d2a4482 增加社区入口 2021-12-21 14:10:07 +08:00
piexlmax 7ec6fffac6 增加反馈按钮 2021-12-21 12:52:10 +08:00
piexlmax 22121f0026 锁定element版本,修复日志图标 2021-12-20 16:58:14 +08:00
奇淼(piexlmax 6b9c9225eb Merge pull request #840 from flipped-aurora/pgsqlDevelop
更新版本
2021-12-13 18:07:16 +08:00
piexlmax 9705629b78 更新版本 2021-12-13 18:06:08 +08:00
奇淼(piexlmax 9c37a7be9d Merge pull request #839 from flipped-aurora/pgsqlDevelop
Pgsql develop
2021-12-13 17:36:49 +08:00
piexlmax d51888f445 Merge remote-tracking branch 'origin/master' into pgsqlDevelop
# Conflicts:
#	server/initialize/router.go
#	server/middleware/cors.go
2021-12-13 17:31:27 +08:00
piexlmax 5a83207b32 自动化代码取消数据库类型定义 对会产生报错的地方做了统一处理 2021-12-13 17:27:57 +08:00
奇淼(piexlmax 8830f59f74 Merge pull request #837 from ShadowWaIker/pgsqlDevelop
完善CORS组件
2021-12-11 19:59:46 +08:00
ShadowWalker 1e2d1796fe fix: 严格白名单模式拦截了健康检查导致健康检查逻辑失效的问题; 2021-12-11 00:27:51 +08:00
ShadowWalker 8bcd7a7a2c feat: CORS组件支持使用配置文件更灵活的配置处理跨域的逻辑; 2021-12-10 22:56:18 +08:00
蒋吉兆 f899b927cf 修改模板文件 2021-12-10 22:41:00 +08:00
奇淼(piexlmax d8704ad398 Merge pull request #836 from flipped-aurora/pgsqlDevelop
更换vite版本
2021-12-10 22:16:29 +08:00
蒋吉兆 a18c0d9653 更换vite版本 2021-12-10 22:15:57 +08:00
奇淼(piexlmax 3c3d642f6b Update build_test.yml 2021-12-10 19:34:25 +08:00
奇淼(piexlmax a442ad090e Update build_test.yml 2021-12-10 19:16:02 +08:00
奇淼(piexlmax 9030b9b75e Merge pull request #835 from flipped-aurora/pgsqlDevelop
升级element版本 修改icon
2021-12-10 19:10:51 +08:00
奇淼(piexlmax a6546138ea Update build_test.yml 2021-12-10 19:09:52 +08:00
piexlmax 8791206a5c 升级element版本 修改icon 2021-12-10 19:07:15 +08:00
奇淼(piexlmax c39b6f3958 Merge pull request #833 from flipped-aurora/pgsqlDevelop
v2.4.6 beta.2
2021-12-10 16:00:56 +08:00
piexlmax 255dba330d 更改gitgnore 2021-12-10 15:58:54 +08:00
piexlmax 35ace1b970 清理无用文件 2021-12-10 15:57:52 +08:00
piexlmax 827bef4f91 fix:#810 2021-12-10 15:51:19 +08:00
songzhibin97 bee4d4cf21 Merge branch 'pgsqlDevelop' 2021-12-10 11:44:39 +08:00
songzhibin97 85a1eb8215 Merge branch 'pr/829' 2021-12-10 11:41:18 +08:00
奇淼(piexlmax ed52dd5411 Merge pull request #832 from ShadowWaIker/pgsqlDevelop
fixed: 系统配置中OSS类型字段的注释错误;
2021-12-10 11:30:54 +08:00
ShadowWalker 649b5fbe8a fixed: 系统配置中OSS类型字段的注释错误; 2021-12-10 09:37:14 +08:00
奇淼(piexlmax bbc615ea5f Update README.md 2021-12-09 12:17:36 +08:00
songzhibin97 ca008145af fix:conflict 2021-12-08 13:16:25 +08:00
songzhibin97 32314bc464 feat: 多数据库适配低版本迁移 2021-12-08 12:57:15 +08:00
songzhibin97 fc003dbc16 feat: issues #809 2021-12-07 18:46:44 +08:00
songzhibin97 0fe4750991 style: linker 2021-12-06 12:44:26 +08:00
奇淼(piexlmax 8b94b8b043 Merge pull request #823 from SliverHorn/sliver
feature: 集成华为云obs 对象存储
2021-12-01 09:57:29 +08:00
SliverHorn 6a9a159642 feature: 集成华为云obs 对象存储 2021-11-29 21:56:01 +08:00
SliverHorn 2b9365da17 Merge pull request #822 from flipped-aurora/pgsqlDevelop
fixed: source/system/api 数据错误
2021-11-29 17:03:51 +08:00
SliverHorn ff850b7156 fixed: source/system/api 数据错误 2021-11-29 17:02:06 +08:00
奇淼(piexlmax 283d962d96 Merge pull request #819 from flipped-aurora/pgsqlDevelop
Pgsql develop
2021-11-25 16:24:10 +08:00
蒋吉兆 b5853a09ec 字典数据修复 2021-11-25 16:23:04 +08:00
蒋吉兆 5796287d88 修复获取用户列表的初始化数据bug 2021-11-25 16:19:31 +08:00
奇淼(piexlmax 77cd35a52a Merge pull request #818 from flipped-aurora/pgsqlDevelop
Pgsql develop
2021-11-25 15:53:46 +08:00
蒋吉兆 a3dd9e9e02 merge seo to pgsqlDevelop 2021-11-25 15:46:50 +08:00
蒋吉兆 1037ee5798 merge seo to pgsqlDevelop 2021-11-25 15:44:13 +08:00
蒋吉兆 21965dfce3 Merge remote-tracking branch 'origin/seo' into pgsqlDevelop
# Conflicts:
#	web/package.json
2021-11-25 15:42:57 +08:00
奇淼(piexlmax 931e144e43 Merge pull request #815 from dyzsoft/master
优化:casbin验证优化
2021-11-25 15:35:08 +08:00
奇淼(piexlmax 57fd8d6dde Merge pull request #816 from bypanghu/master
fixed:gva全局标志
2021-11-25 15:33:40 +08:00
奇淼(piexlmax db3d16af36 Merge branch 'seo' into master 2021-11-25 15:33:27 +08:00
奇淼(piexlmax fa0c1430c3 Merge pull request #817 from flipped-aurora/pgsqlDevelop
增加内存不足时使用的命令
2021-11-25 15:27:37 +08:00
蒋吉兆 23304c7a9a 增加内存不足时使用的命令 2021-11-25 15:25:36 +08:00
蒋吉兆 86c5f9184a update version 2021-11-25 14:59:50 +08:00
bypanghu 4a2ded7b8a fixed: web全端添加gva 权重 2021-11-24 15:58:43 +08:00
dyzsoft 99ae4056bc 优化:casbin验证优化,在中间件中获取请求的 Path,在CasbinModel定义中直接使用keymatch2进行匹配,减少一次path获取和函数调用。
server/middleware/casbin_rbac.go:18行修改为请求的path作为obj
server/service/system/sys_casbin.go:删掉无用的注册函数
server/resource/rbac_model.conf:验证函数修改为keyMathc2
2021-11-24 15:23:22 +08:00
奇淼(piexlmax da64403829 Merge pull request #811 from flipped-aurora/pgsqlDevelop
2.4.6 优化 && 修复
2021-11-24 00:23:17 +08:00
奇淼(piexlmax b4eb8c0add Merge pull request #814 from ThreeAndTwo/master
chore: fix db connector nil pointer dereference
2021-11-24 00:16:39 +08:00
蒋吉兆 f9c5c33f68 Merge branch 'pgsqlDevelop' of github.com:flipped-aurora/gin-vue-admin into pgsqlDevelop 2021-11-24 00:15:28 +08:00
蒋吉兆 2ac97ea099 修复sql注入安全隐患 感谢@Tom4t0提交漏洞 2021-11-24 00:15:09 +08:00
K 619c54ca17 chore: fix db connector nil pointer dereference 2021-11-23 23:47:02 +08:00
SliverHorn 1d43216b40 fixed: server/service/system/sys_initdb_pgsql.go 初始化数据 使用 PgsqlDataInitialize 2021-11-23 16:43:12 +08:00
SliverHorn aa309ce62c fixed: 修复jwt的signing-key 未转成string导致乱码的问题 2021-11-22 20:53:09 +08:00
SliverHorn a146265de5 refactor:
- pgsql 获取指定数据库和指定数据表的所有字段名,类型值等 sql 添加字段备注
2021-11-22 18:03:29 +08:00
蒋吉兆 6b69972230 增加pgsql获取数据库和表方法 更新版本为V2.4.6 Beta 2021-11-22 10:57:07 +08:00
SliverHorn 6cc495de95 update:
- pgsql 获取表名, 获取表字段(todo), 获取数据库名
refactor:
- 自动化代码与自动化代码历史 代码规范化
- mysql 获取表名, 获取表字段, 获取数据库名
- enter 代码优化
2021-11-20 22:46:05 +08:00
奇淼(piexlmax 9d019ca329 Merge pull request #808 from flipped-aurora/pgsqlDevelop
v2.4.6A测发布
2021-11-19 22:26:56 +08:00
蒋吉兆 77a9b20346 Merge branch 'master' into pgsqlDevelop
# Conflicts:
#	server/core/server_other.go
2021-11-19 22:25:12 +08:00
蒋吉兆 b88a1f91f7 恢复配置文件 2021-11-19 22:22:17 +08:00
蒋吉兆 81682914ff 增加pgsql适配 2021-11-19 22:20:04 +08:00
SliverHorn 8ef9e19a64 fixed:
- pgsql 修复初始化数据失败的bug
- pgsql 获取角色菜单时 报错
- SysOperationRecord longtext 改为 text
2021-11-18 23:13:17 +08:00
SliverHorn b8698cdcff fixed:
- casbin 数据问题
- AuthoritiesMenus 问题修复
- DataAuthorities 问题修复
- File 问题修复
- 初始化表 add CasbinRule
- ViewAuthorityMenuMysql 问题修复
2021-11-18 22:09:41 +08:00
蒋吉兆 ff4121510c 增加重置用户密码功能 2021-11-17 22:45:16 +08:00
蒋吉兆 7c72ab9dcb 修复错误单词#804 2021-11-17 21:20:09 +08:00
蒋吉兆 d156165d59 删除menu下无用代码 2021-11-17 21:15:47 +08:00
SliverHorn ed2e254cf4 refactor:
- zap.Any("err", err) 更改为 zap.Error(err) 提高性能
2021-11-16 02:13:54 +08:00
SliverHorn 98703f192a refactor:
- SysAutoCodeHistory 提供 ToRequestIds方法 方便代码回滚功能调用
2021-11-16 02:11:21 +08:00
SliverHorn b12a18a693 refactor:
- source 初始化数据 new 实现
- service mysql 与 pgsql 分开实现
- 代码备注优化
2021-11-16 02:02:21 +08:00
SliverHorn f19e719cbb refactor:
- 优化 postgresql 的配置文件
- dsn 优化
- gorm logger 代码优化
- 优化 注册表 函数名
- 更新 go.mod
2021-11-15 23:50:28 +08:00
蒋吉兆 1744c0b44d 增加pgsql适配(todo) 2021-11-15 23:00:14 +08:00
ipanghu a4f77cbc3d fix:api管理页面的错误 2021-11-15 11:38:20 +08:00
奇淼(piexlmax 7a6c78af6a Merge pull request #802 from flipped-aurora/update
fix:798:数据库列表候选丢失
2021-11-14 22:48:10 +08:00
蒋吉兆 0d9f9e41bb fix:798:数据库列表候选丢失 2021-11-14 22:47:47 +08:00
奇淼(piexlmax 16e1829730 Merge pull request #801 from flipped-aurora/update
fix:#800
2021-11-14 22:43:28 +08:00
蒋吉兆 f73b891272 Merge remote-tracking branch 'origin/update' into update 2021-11-14 22:41:42 +08:00
蒋吉兆 3a017741d2 fix:#800
修复了自动化代码公用字典出现多次创建字典相关代码的bug
2021-11-14 22:38:13 +08:00
ipanghu 0a111f7c33 Fix:修复首页echarts在特定node版本中报引用出错的bug 2021-11-12 16:16:15 +08:00
奇淼(piexlmax 6f24b8b448 Merge pull request #796 from FlameMida/develop
web/src/components/customPic/index.vue:vite无法使用require函数
2021-11-12 15:04:47 +08:00
奇淼(piexlmax 94f12d538b Merge branch 'update' into develop 2021-11-12 15:03:10 +08:00
Edward zZhang e057568bbb Update index.vue 2021-11-09 14:17:12 +08:00
奇淼(piexlmax edd81c548c Merge pull request #795 from flipped-aurora/update
调整验证码校验规则保证前后端配置一致 #794
2021-11-09 11:38:11 +08:00
piexl c6cf4d06bc 调整验证码校验规则保证前后端配置一致 #794 2021-11-09 11:37:28 +08:00
奇淼(piexlmax 9a840328aa Merge pull request #793 from flipped-aurora/update
修复字典相关的bug
2021-11-08 14:37:20 +08:00
piexl e12c1b7b8d 修复性别字典初始数据为空的问题
修复字典作废无效问题 #791
变更字典初始值为undefined #792
2021-11-08 14:36:40 +08:00
奇淼(piexlmax 7c4496d097 Merge pull request #790 from liqianjie/master
不通过本地nginx代理,直接访问时,10ms会导致概率性请求失败
2021-11-05 21:43:56 +08:00
liqianjie 9898491ce7 不通过本地nginx代理,直接访问时,10ms会导致概率性请求失败 2021-11-05 13:03:31 +08:00
奇淼(piexlmax cd41d3b5c7 Merge pull request #780 from iptop/master
解决echarts和vue存在的冲突问题
2021-11-04 22:23:51 +08:00
奇淼(piexlmax ae4ffc72d1 Merge pull request #787 from flipped-aurora/update
fix:#786
2021-11-04 22:22:03 +08:00
蒋吉兆 c877102f26 fix:#786
修复:生成表后无法回滚的bug
修复:api页面不能多删除的bug
2021-11-04 22:20:02 +08:00
奇淼(piexlmax c150c5242e Update README.md 2021-11-03 13:17:12 +08:00
蒋吉兆 da3fddf6c4 修复配置文件中的mysql配置类型错误 2021-10-29 21:52:58 +08:00
panzhenglong 0e0c563faf 解决echarts和vue存在的冲突问题 2021-10-28 11:20:55 +08:00
奇淼(piexlmax d07f59d061 Merge pull request #778 from flipped-aurora/update
fix:#768
2021-10-25 22:49:14 +08:00
蒋吉兆 c7fede0d15 fix:#768 2021-10-25 22:48:33 +08:00
奇淼(piexlmax 09dc0918c7 Merge pull request #777 from flipped-aurora/update
调整claims获取方法 修复前端选中样式
2021-10-25 22:39:19 +08:00
蒋吉兆 5a5487894f 前端配置文件页面更新 2021-10-25 22:33:47 +08:00
蒋吉兆 f999aa1faa 提出jwt的issuer签名到配置文件 增加claims的统一创建方法 2021-10-25 22:19:06 +08:00
蒋吉兆 8d0977e36b 配置文件变更 增加jwt签名 2021-10-25 22:14:57 +08:00
蒋吉兆 0081c7e47f 从头部获取用户信息的方法整理 增加不鉴权模式下的信息获取 2021-10-25 22:01:17 +08:00
蒋吉兆 7d8c99bc1b 从头部获取用户信息的方法整理 增加不鉴权模式下的信息获取 2021-10-25 21:59:26 +08:00
piexl 351b307074 回滚配置文件 2021-10-25 14:13:20 +08:00
piexl 706e6fe288 调整claims获取方法 修复前端选中样式 2021-10-25 14:08:07 +08:00
piexl b5fa7604c6 修改从jwt获取用信息的方法 2021-10-25 13:25:15 +08:00
奇淼(piexlmax 61614e12fd Merge pull request #773 from flipped-aurora/update
前端配置文件页面更新
2021-10-24 19:00:31 +08:00
蒋吉兆 533efe5a44 前端配置文件页面更新 2021-10-24 18:59:55 +08:00
奇淼(piexlmax 8873f8d555 Merge pull request #772 from flipped-aurora/update
V2.4.6版本A测
2021-10-23 22:44:26 +08:00
蒋吉兆 a90ddacb64 v2.4.6 Apache 版本 2021-10-23 22:41:14 +08:00
蒋吉兆 df928b49b7 前端配置文件页面更新 2021-10-23 22:39:24 +08:00
songzhibin97 e059a7e84d fix:#796 补充 2021-10-22 16:23:35 +08:00
songzhibin97 1f0cd6ef98 fix:#769 2021-10-22 16:08:00 +08:00
奇淼(piexlmax 757b04957d Update README.md 2021-10-15 10:01:53 +08:00
piexlmax 2c9a1656b6 Merge branch 'master' of github.com:flipped-aurora/gin-vue-admin into update 2021-10-13 14:59:49 +08:00
奇淼(piexlmax b1c6d26a0f 正式发布2.4.5 2021-10-13 14:43:35 +08:00
piexlmax 1d1401c620 Merge remote-tracking branch 'origin/update' into update 2021-10-13 14:27:48 +08:00
piexlmax 666fe5bc28 更新 element 2021-10-13 14:27:20 +08:00
songzhibin97 9b7db8ad09 feat:中间件日志聚集 2021-10-13 13:04:56 +08:00
songzhibin97 cc8facbda3 feat:优化初始化limit对象 2021-10-12 20:37:51 +08:00
songzhibin97 bdce75c2ea feat:优化限流中间件 2021-10-12 20:10:23 +08:00
piexlmax c4ef22f4a3 增加协议标注 2021-10-12 15:39:50 +08:00
piexlmax d3e175beb8 版本号回移 2021-10-11 10:49:21 +08:00
qimiao feec9e9ebf fix:#745 2021-10-11 10:40:42 +08:00
奇淼(piexlmax 67c429a09c Merge pull request #760 from yaooort/update_mysql
新增限流中间件,根据IP
2021-10-11 10:13:12 +08:00
奇淼(piexlmax a36d5f238c Merge pull request #759 from yaooort/update
Update 日志模块
2021-10-11 10:12:57 +08:00
yaooort 1cf455cfee 拦截 2021-10-09 20:37:28 +08:00
yaooort 2f46581ada 新增限流中间件,根据IP 2021-10-09 20:26:26 +08:00
yaooort c57eedf020 修改zap分级别打印到日志文件 2021-10-09 19:58:59 +08:00
yaooort ad5b9c1e80 Revert "发布V2.4.5 RC"
This reverts commit 4465450b48.
2021-10-09 19:44:04 +08:00
qimiao 8f8bef9ea2 发布V2.4.5 RC 2021-09-30 15:54:19 +08:00
奇淼(piexlmax 1457876698 [Feature]:#753 (#754)
[Feature]:#753 (#754)
2021-09-30 10:37:39 +08:00
奇淼(piexlmax 1d52614691 fix:#748 (#752)
fix:#748
2021-09-29 19:34:27 +08:00
奇淼(piexlmax 01eb096920 Fix 731 (#750)
* fix:#731 (#749)
* 代码生成器样式调整
Co-authored-by: songkang1993 <38366752+songkang1993@users.noreply.github.com>
2021-09-29 19:04:21 +08:00
奇淼(piexlmax 5b7c1fb8fe fix:#746
fix:#746
2021-09-26 18:11:25 +08:00
奇淼(piexlmax 7466ef21e5 清理无用的配置文件 web-flow (#743)
清理无用自动化字段 web-flow
2021-09-26 11:56:47 +08:00
奇淼(piexlmax 8cc56c7db5 修正生命周期钩子,将beforeDestroy更改为beforeUnmount (#738) (#742)
优化将beforeDestroy更改为beforeUnmount
2021-09-26 11:37:19 +08:00
songzhibin97 d4914d6eca feat:明确root语义 (#740)
feat:明确root语义 (#740)
2021-09-26 10:39:08 +08:00
奇淼(piexlmax 9dc78174a9 Merge pull request #737 from flipped-aurora/gva-vue3
修复预览自动化代码全选和复制的bug
2021-09-24 17:34:30 +08:00
piexlmax 22df94e6a0 主色调统一 2021-09-24 17:33:51 +08:00
奇淼(piexlmax d78f147889 修复预览自动化代码全选和复制的bug
修复预览自动化代码全选和复制的bug
2021-09-24 15:54:52 +08:00
piexlmax 25ae9f4dd2 修复预览自动化代码全选和复制的bug 2021-09-24 15:08:21 +08:00
奇淼(piexlmax 338664452b 样式细节调整 (#726)
增加健康检查

样式细节调整

规范化插件js模式

增加k8s yaml文件 (#734)
2021-09-24 14:15:16 +08:00
奇淼(piexlmax 98a257b7e3 Merge pull request #724 from flipped-aurora/gva-vue3
调整不同屏幕下的兼容性
2021-09-21 21:09:02 +08:00
蒋吉兆 2f402fe26d 调整不同屏幕下的兼容性 2021-09-21 21:02:40 +08:00
奇淼(piexlmax c5daed4a70 Merge pull request #723 from flipped-aurora/gva-vue3
发布v2.4.5 bate.1
2021-09-21 18:04:12 +08:00
蒋吉兆 46442f4a65 更新代码规范 2021-09-21 18:02:50 +08:00
蒋吉兆 2c06ca34c0 代码规范性调整 2021-09-21 17:55:18 +08:00
蒋吉兆 51e26a00a4 前端性能行以及样式细节调整 2021-09-21 17:40:28 +08:00
奇淼(piexlmax 54e3e5cb90 Merge pull request #722 from flipped-aurora/gva-vue3-fedev
Gva vue3 fedev
2021-09-21 17:24:19 +08:00
奇淼(piexlmax 9ee8c3ca38 Merge pull request #721 from flipped-aurora/revert-718-last
Revert "修改全局 dialog 样式,修改api管理的删除初始化显示问题"
2021-09-21 17:23:53 +08:00
奇淼(piexlmax 0193e61d72 Revert "修改全局 dialog 样式,修改api管理的删除初始化显示问题" 2021-09-21 17:23:42 +08:00
奇淼(piexlmax d4258eea9a Merge pull request #720 from flipped-aurora/gva-vue3-fedev
2.4.5 bate.1 版本
2021-09-21 16:48:40 +08:00
奇淼(piexlmax 634e395902 Merge pull request #719 from SliverHorn/sliver_horn_develop
fixed: Find两次数据库, db := global.GVA_DB加上Model 防止Count报错
2021-09-21 16:47:44 +08:00
奇淼(piexlmax 8ba6eee597 Merge pull request #718 from bypanghu/last
修改全局 dialog 样式,修改api管理的删除初始化显示问题
2021-09-21 16:47:07 +08:00
奇淼(piexlmax cd576a1e02 Merge branch 'gva-vue3-fedev' into last 2021-09-21 16:34:53 +08:00
奇淼(piexlmax 70d9ef63db Update sys_casbin.go 2021-09-21 16:33:37 +08:00
奇淼(piexlmax d69243d720 Update vite.config.js 2021-09-21 16:30:40 +08:00
蒋吉兆 c3480b3c49 修改版本号为 2.4.5 bate.1 2021-09-21 16:26:59 +08:00
蒋吉兆 ff79b2aa0f 修改form模板 调整form基本样式 2021-09-21 16:25:14 +08:00
蒋吉兆 2cbb87baaa 调整前端样式,调整日志记录路由组,调整对应自动化模板 2021-09-20 21:40:23 +08:00
蒋吉兆 6a8e35379a 调整搜索框和提示文字的样式细节 2021-09-20 17:34:44 +08:00
奇淼(piexlmax 203e999ec4 Update README.md 2021-09-19 23:10:02 +08:00
奇淼(piexlmax 528d45e58a Update README.md 2021-09-19 23:09:07 +08:00
蒋吉兆 d04ee96111 样式细节调整 2021-09-19 22:59:13 +08:00
SliverHorn 508691535f fixed: Find两次数据库, db := global.GVA_DB加上Model 防止Count报错 2021-09-19 09:13:13 +08:00
bypanghu@163.com edf38ae8ee 修改全局 dialog 样式,修改api管理的删除初始化显示问题 2021-09-18 23:01:36 +08:00
piexlmax a2f2b4178a 安全距离细节调整 2021-09-18 19:38:42 +08:00
qimiao b297129a26 展示细节调整 2021-09-18 19:00:31 +08:00
piexlmax e3bfa9ccd9 增加重置搜索条件功能 2021-09-18 17:45:54 +08:00
piexlmax 132c1b68b1 细节变更 2021-09-18 17:39:18 +08:00
piexlmax d85b481e68 dashboard调整 2021-09-18 17:09:15 +08:00
piexlmax a5b989d278 样式美化 2021-09-18 12:40:31 +08:00
ipanghu b61c8f0b19 Merge pull request #2 from flipped-aurora/master
拉取主仓库最新代码
2021-09-18 09:00:44 +08:00
蒋吉兆 5e3df6c742 修改新版样式 2021-09-18 00:10:17 +08:00
奇淼(piexlmax ea9d6d4e4c Merge pull request #716 from flipped-aurora/gva-vue3
清除多余public文件夹,修复ico替换不生效的问题
2021-09-17 10:43:59 +08:00
piexlmax fbd5fcbefd 清除多余public文件夹,修复ico替换不生效的问题 2021-09-17 10:06:57 +08:00
songzhibin97 9c57f5f877 Update main.go 2021-09-16 14:28:20 +08:00
奇淼(piexlmax 8b08758b85 Merge pull request #713 from flipped-aurora/gva-vue3
代码规范性提升
2021-09-16 10:24:34 +08:00
qimiao 98c5e8d774 代码规范性优化 2021-09-16 10:19:54 +08:00
qimiao bca1bcb42d Merge remote-tracking branch 'origin/gva-vue3' into gva-vue3
# Conflicts:
#	server/core/viper.go
2021-09-16 10:00:31 +08:00
奇淼(piexlmax 55b7003aa9 Merge pull request #710 from bypanghu/master
删除主仓库下无用的包管理文件,添加验证码验证
2021-09-16 09:59:45 +08:00
奇淼(piexlmax fd8f63161f Merge pull request #712 from MZqk/patch-2
Update viper.go
2021-09-16 09:56:56 +08:00
MZZZ c1800b685f Update viper.go
core/viper.go:61:95: syntax error: unexpected newline, expecting comma or )
2021-09-15 20:18:59 +08:00
songzhibin97 0f18854c40 feat:增加测试用例 2021-09-15 18:42:17 +08:00
songzhibin97 d80edb16df Merge branch 'gva-vue3' of https://github.com/flipped-aurora/gin-vue-admin into gva-vue3 2021-09-15 18:06:18 +08:00
songzhibin97 beb39cc5c7 fix:style 2021-09-15 18:06:07 +08:00
songzhibin97 f6155302e8 fix:stype 2021-09-15 17:42:28 +08:00
范庆磊 81b773bee6 删除主仓库目录下无用的前端包管理工具,添加登陆页面的验证函数 2021-09-15 16:43:13 +08:00
ipanghu 725d779682 Merge pull request #1 from flipped-aurora/master
拉取主仓库最新代码
2021-09-15 16:14:20 +08:00
奇淼(piexlmax b903ff7e78 Create .deepsource.toml 2021-09-15 15:13:34 +08:00
奇淼(piexlmax 517c5b60a8 Merge pull request #707 from flipped-aurora/gva-vue3
修复了一些已知bug
2021-09-15 12:21:47 +08:00
qimiao 88fd6c719a Merge branch 'master' of github.com:flipped-aurora/gin-vue-admin into gva-vue3 2021-09-15 12:19:59 +08:00
qimiao 76a6c8c255 Merge branch 'develop' of github.com:flipped-aurora/gin-vue-admin into gva-vue3
 Conflicts:
	server/core/viper.go
2021-09-15 12:19:40 +08:00
奇淼(piexlmax fb57e864e1 Merge pull request #705 from songzhibin97/gva_gormv2_dev
fix: cache初始化时间问题
2021-09-15 12:15:58 +08:00
奇淼(piexlmax 4a1a294658 Merge pull request #704 from iciness/develop
bug修复:jwt黑名单启动时候未加载及未生效
2021-09-15 12:15:43 +08:00
奇淼(piexlmax 6d74d7c9f6 Merge pull request #706 from TrumanH/master
revise file name typo
2021-09-15 12:15:05 +08:00
he 5b56ebb5fd revise file name typo 2021-09-15 12:06:14 +08:00
Benny dd4d42295b fix:在GVA_DB初始化后,从db加载jwt黑名单数据 2021-09-15 12:04:02 +08:00
songzhibin97 56c26e35b5 fix: cache初始化时间问题 2021-09-15 11:53:39 +08:00
蒋吉兆 2bf7b78d39 vue 版本 3.0.0 --> 3.2.0 2021-09-14 22:33:00 +08:00
奇淼(piexlmax 3a5f8f8a1e Merge pull request #702 from flipped-aurora/gva-vue3
解决使用自动二级路由导致的切换tab白屏问题
2021-09-14 22:27:57 +08:00
蒋吉兆 9e17fbb807 解决使用自动二级路由导致的切换tab白屏问题 2021-09-14 22:25:44 +08:00
奇淼(piexlmax 440bc3b730 Merge pull request #701 from flipped-aurora/gva-vue3
Gva vue3
2021-09-14 19:57:05 +08:00
奇淼(piexlmax 863d0826a7 Merge pull request #697 from songzhibin97/gva_gormv2_dev
fix:重复生成判断回滚
2021-09-14 19:56:48 +08:00
奇淼(piexlmax e564eff45a Merge pull request #700 from SliverHorn/sliver_horn_develop
fixed: #699 go build 报错 gcc问题
2021-09-14 19:53:08 +08:00
qimiao 6cb9ab45d9 Merge remote-tracking branch 'origin/gva-vue3' into gva-vue3 2021-09-14 19:49:51 +08:00
piexlmax 3706937d4a 前端ui样式优化 2021-09-14 19:49:06 +08:00
SliverHorn ccce04df1c fixed: #699 go build 报错 gcc问题 2021-09-14 17:41:21 +08:00
songzhibin97 f2e5e56fdb feat:jwt签名初始化 2021-09-14 16:26:55 +08:00
songzhibin97 c993e2d070 fix:重复生成判断回滚 2021-09-13 11:07:59 +08:00
奇淼(piexlmax fffc2b7a57 Update bug_report.yaml 2021-09-10 19:00:07 +08:00
奇淼(piexlmax 59eb684b47 Merge pull request #694 from songzhibin97/gva_gormv2_dev
feat: issues #692
2021-09-10 14:36:52 +08:00
songzhibin97 f0969e09d3 feat: issues #692 2021-09-10 11:57:27 +08:00
qimiao 108959c84c 自动化图片路径由http切换为https 修复安全性报错 2021-09-09 17:56:23 +08:00
奇淼(piexlmax a2bf105ba9 Merge pull request #691 from flipped-aurora/gva-vue3
修复在登录状态下访问白名单路由导致白屏的bug
2021-09-09 10:45:07 +08:00
qimiao ff1b004a2c Merge remote-tracking branch 'origin/gva-vue3' into gva-vue3 2021-09-09 10:44:26 +08:00
piexlmax a54144d4e1 修复在登录状态下访问白名单路由导致白屏的bug 2021-09-09 10:43:58 +08:00
奇淼(piexlmax 81f31a4ba8 Merge pull request #689 from flipped-aurora/gva-vue3
同步 develop
2021-09-08 17:50:23 +08:00
奇淼(piexlmax 8bf77ff52c Merge pull request #688 from flipped-aurora/gva-vue3
去除表名空格
2021-09-08 17:49:42 +08:00
奇淼(piexlmax f16d8455a8 Merge pull request #685 from supine-win/patch-4
tableName添加空格删除
2021-09-08 17:49:01 +08:00
piexlmax aee0fecaed 增加 issueid 2021-09-08 17:42:51 +08:00
piexlmax 4587e49ff6 提交issue模板 2021-09-08 17:33:58 +08:00
奇淼(piexlmax 2dc2ef4f0c Update feature_request.yaml 2021-09-08 17:31:40 +08:00
奇淼(piexlmax 98d0e69173 Update feature_request.yaml 2021-09-08 17:29:18 +08:00
奇淼(piexlmax ceddd99dc4 Create config.yml 2021-09-08 17:23:27 +08:00
piexlmax 833a31ae14 修改后缀 2021-09-08 17:15:50 +08:00
piexlmax 1c4a774765 修改issue模板 2021-09-08 17:10:59 +08:00
奇淼(piexlmax 6f2fcdcf65 Update issue templates 2021-09-08 17:08:32 +08:00
奇淼(piexlmax 3d502b6414 Merge pull request #686 from flipped-aurora/gva-vue3
增加issue模板 修复person页面的跳转bug
2021-09-08 17:06:43 +08:00
piexlmax d275ed1942 issue提供表单结构 修复了person页面的跳转bug 2021-09-08 17:03:22 +08:00
奇淼(piexlmax 5b4e113b71 Update and rename ----bug.ymal to config.ymal 2021-09-08 16:49:58 +08:00
奇淼(piexlmax 2fc2cea1cc Update and rename ----bug.md to ----bug.ymal 2021-09-08 15:35:03 +08:00
奇淼(piexlmax bf37b6a132 Update issue templates 2021-09-08 15:30:33 +08:00
supine-win a16f0cb894 tableName添加空格删除
1.tableName添加空格删除
2.修改拼写错误
2021-09-07 21:54:05 +08:00
SliverHorn d06e2aa5e6 Merge pull request #682 from SliverHorn/sliver_horn_develop
add go.sum and update server/Dockerfile
2021-09-07 20:53:30 +08:00
SliverHorn 2a4f2cf396 fix: docker 使用go generate有问题 2021-09-07 20:49:41 +08:00
SliverHorn b2005ae82a add go.sum 2021-09-07 20:05:48 +08:00
奇淼(piexlmax fbf67e1a34 Merge pull request #681 from flipped-aurora/gva-vue3
修复本地模式下的文件下载问题
2021-09-07 16:50:55 +08:00
piexlmax 63702633a9 修复本地模式下的文件下载问题 2021-09-07 16:50:08 +08:00
piexlmax 5df0fa3853 增加getTableData的请求发起前后钩子 2021-09-07 15:11:36 +08:00
奇淼(piexlmax 2997bccd6c Merge pull request #679 from flipped-aurora/gva-vue3
修复user表切换页面和size后角色消失的bug
2021-09-07 14:58:18 +08:00
qimiao ff2868883d Merge remote-tracking branch 'origin/gva-vue3' into gva-vue3 2021-09-07 14:57:01 +08:00
qimiao 37ea0f5fb6 Merge branch 'master' of github.com:flipped-aurora/gin-vue-admin into gva-vue3 2021-09-07 14:56:35 +08:00
奇淼(piexlmax fd730e32ed Merge pull request #678 from songzhibin97/gva_gormv2_dev
fix:修复可能会绕过删除的漏洞
2021-09-07 14:56:11 +08:00
piexlmax 0c9f05147e 修复user表切换页面和size后角色消失的bug 2021-09-07 14:55:45 +08:00
奇淼(piexlmax 373ac3ec24 修改版本号 进入beta测试 目前内部以跑线上 2021-09-07 14:18:36 +08:00
songzhibin97 e5cf5695ff fix:修复可能会绕过删除的漏洞 2021-09-06 15:00:15 +08:00
奇淼(piexlmax f0f332481a Merge pull request #675 from flipped-aurora/gva-vue3
修复字典逻辑bug
2021-09-05 14:17:29 +08:00
奇淼(piexlmax ed5cb4776c Merge pull request #674 from SliverHorn/sliver_horn_develop
update: service/system/sys_dictionary.go UpdateSysDictionary 方法 代码优化
2021-09-05 14:15:01 +08:00
SliverHorn 6d83b62153 update: LoadAll函数优化 2021-09-05 12:56:59 +08:00
SliverHorn 0971012dca Merge remote-tracking branch 'gva/gva-vue3' into sliver_horn_develop 2021-09-05 12:43:51 +08:00
SliverHorn 1afc5191c4 update: service/system/sys_dictionary.go UpdateSysDictionary 方法 代码优化 2021-09-04 22:59:13 +08:00
奇淼(piexlmax 947433c57c Update README.md 2021-09-04 19:47:35 +08:00
奇淼(piexlmax 42f69f0a5e Merge pull request #673 from flipped-aurora/gva-vue3
前端打包工具更换为vite
2021-09-04 19:39:50 +08:00
奇淼(piexlmax a0f3b79479 Merge pull request #672 from flipped-aurora/gva-vue3-vite
Gva vue3 vite
2021-09-04 19:39:13 +08:00
奇淼(piexlmax 0b19de6d94 Merge pull request #671 from SliverHorn/sliver_horn_develop
update: model/system/sys_user.go comment 错误
2021-09-04 19:38:46 +08:00
蒋吉兆 024e5fa210 自动开启web 修复了user创建用户后信息未清空的bug 2021-09-04 17:12:07 +08:00
蒋吉兆 d0d13aa287 修复自定义指令修改为vue3模式 2021-09-04 16:27:46 +08:00
蒋吉兆 e606cc9323 删除webpack携带内容 2021-09-04 16:22:16 +08:00
蒋吉兆 fa70742a35 适配vite基本完成 2021-09-04 16:21:21 +08:00
蒋吉兆 ebca96d95c 修改vite需要替换的原始配置 2021-09-04 16:04:07 +08:00
SliverHorn 815ebd038e update: model/system/sys_user.go comment 错误 2021-09-04 14:59:20 +08:00
piexlmax a785f12fb3 切换为vite模式 2021-09-03 19:20:08 +08:00
奇淼(piexlmax 2824a946f8 Merge pull request #669 from flipped-aurora/gva-vue3
修改最低版本约束
2021-09-03 11:28:12 +08:00
奇淼(piexlmax d82ac9fc1a 修改最低版本约束 2021-09-03 11:27:17 +08:00
奇淼(piexlmax f76793f50b Merge pull request #668 from flipped-aurora/gva-vue3-2.4.5
修复初始化时跳出的两个bug提示(不影响使用)
2021-09-03 10:29:29 +08:00
奇淼(piexlmax bfd4714df9 Merge pull request #667 from flipped-aurora/gva-vue3-2.4.5
修复初始化时跳出的两个bug提示(不影响使用)
2021-09-03 10:28:59 +08:00
qimiao c94c6c49a8 修复初始化时跳出的两个bug提示(不影响使用) 2021-09-03 10:26:29 +08:00
奇淼(piexlmax 70eb2175d1 Merge pull request #666 from flipped-aurora/gva-vue3-2.4.5
Gva vue3 2.4.5
2021-09-03 09:52:22 +08:00
奇淼(piexlmax e200dd908d Merge pull request #665 from flipped-aurora/gva-vue3-2.4.5
清除cdn打包 调整切换用户角色时出现的bug
2021-09-02 23:48:45 +08:00
蒋吉兆 ff9ab4b0b6 清除cdn打包 调整切换用户角色时出现的bug 2021-09-02 23:47:47 +08:00
奇淼(piexlmax 03c9798e71 Merge pull request #664 from flipped-aurora/gva-vue3-2.4.5
增加背景图 准备发布demo
2021-09-02 22:23:41 +08:00
奇淼(piexlmax 91c015943e Merge pull request #663 from flipped-aurora/gva-vue3-2.4.5
增加背景图 准备发布demo
2021-09-02 22:23:19 +08:00
蒋吉兆 594b3923c3 增加背景图 准备发布demo 2021-09-02 22:20:02 +08:00
奇淼(piexlmax c352735dc8 Merge pull request #662 from flipped-aurora/gva-vue3-2.4.5
Gva vue3 2.4.5
2021-09-02 19:06:37 +08:00
奇淼(piexlmax 0598b5cead Merge pull request #661 from flipped-aurora/gva-vue3-2.4.5
Gva vue3 2.4.5
2021-09-02 19:06:06 +08:00
piexlmax 611026d8ea 清除旧版dashbord 调整新版头图位置 2021-09-02 19:03:45 +08:00
qimiao 11db344a23 增加静态代理注释 2021-09-02 17:54:36 +08:00
qimiao 3a38ad62a6 Merge branch 'develop' of github.com:flipped-aurora/gin-vue-admin into gva-vue3-2.4.5 2021-09-02 17:53:28 +08:00
奇淼(piexlmax cc0dcaa27b Merge pull request #659 from jtyoui/gva-vue3-2.4.5
增加代理静态网页
2021-09-02 17:51:52 +08:00
piexlmax 15ffc705f4 首页优化 2021-09-02 15:11:44 +08:00
张伟 4c6d3008bc 代理前端网页 2021-09-02 14:38:48 +08:00
奇淼(piexlmax e2e8acec3b Merge pull request #657 from bypanghu/gva-vue3-2.4.5
Gva vue3 2.4.5
2021-09-02 11:53:56 +08:00
ipanghu 91be5e57d0 Merge pull request #656 from bypanghu/master
Merge pull request #651 from flipped-aurora/gva-vue3-2.4.5
2021-09-02 11:51:03 +08:00
范庆磊 836a3d0957 美化dashbord 2021-09-02 11:49:22 +08:00
奇淼(piexlmax bcf0d4352a Merge pull request #655 from flipped-aurora/gva-vue3-2.4.5
Gva vue3 2.4.5
2021-09-02 11:44:30 +08:00
奇淼(piexlmax 4998831c1f Merge pull request #654 from flipped-aurora/gva-vue3-2.4.5
Gva vue3 2.4.5
2021-09-01 23:13:21 +08:00
蒋吉兆 076b70d031 清除packagebug 2021-09-01 23:09:31 +08:00
蒋吉兆 f5171528d6 提升性能 修复前端tab页面bug 增加ws插件 2021-09-01 23:06:25 +08:00
奇淼(piexlmax e01bf225c4 Merge pull request #653 from songzhibin97/gva_gormv2_dev
feat:新增定时任务 删除jwt
2021-09-01 21:58:21 +08:00
奇淼(piexlmax 8ec2e5f6b6 Merge branch 'gva-vue3-2.4.5' into gva_gormv2_dev 2021-09-01 21:57:52 +08:00
songzhibin97 f807dc228b Merge branch 'develop' into gva_gormv2_dev 2021-09-01 18:42:14 +08:00
songzhibin97 a98d6fb31a fix:go mod 2021-09-01 18:42:03 +08:00
songzhibin97 14fd932829 feat:black jwt 2021-09-01 18:40:06 +08:00
范庆磊 55ba5d2fef 修改dashbord 样式 2021-09-01 18:00:16 +08:00
songzhibin97 4f98686595 Merge branch 'gva_gormv2_dev' of https://github.com/songzhibin97/gin-vue-admin into gva_gormv2_dev 2021-09-01 17:56:56 +08:00
songzhibin97 b36c58bd03 feat:新增定时任务 删除jwt 2021-09-01 17:56:51 +08:00
piexlmax 8080c38936 增加$CloseThisPage全局方法 2021-09-01 15:20:46 +08:00
奇淼(piexlmax 88a2fd63a8 Merge pull request #651 from flipped-aurora/gva-vue3-2.4.5
增加关闭当前标签方法
2021-09-01 14:30:12 +08:00
piexlmax f5677e6858 增加关闭当前页面方法 2021-09-01 14:29:25 +08:00
qimiao 9838725a3f Merge branches 'gva-vue3-2.4.5' and 'master' of github.com:flipped-aurora/gin-vue-admin into gva-vue3-2.4.5 2021-09-01 14:16:28 +08:00
ipanghu 2ef1205b06 Merge branch 'master' into master 2021-09-01 09:12:17 +08:00
qimiao 92e4ddee93 Merge remote-tracking branch 'origin/gva-vue3-2.4.5' into gva-vue3-2.4.5 2021-08-31 17:42:39 +08:00
krank b83e35adf5 清理无用包 2021-08-31 17:40:58 +08:00
krank 6725f6c73a 错误码报错细分 2021-08-31 14:33:51 +08:00
qimiao b4158075e3 清除无效gomod 2021-08-31 11:02:09 +08:00
奇淼(piexlmax e59e29bf31 Merge branch 'gva-plugins' into gva_gormv2_dev 2021-08-30 23:59:40 +08:00
奇淼(piexlmax bb27385a3a Merge pull request #649 from flipped-aurora/gva-vue3-2.4.5
修复新增用户的bug
2021-08-30 23:51:59 +08:00
蒋吉兆 070e70d801 修复新增用户的bug 2021-08-30 23:49:54 +08:00
songzhibin97 4a2390f147 feat:ws插件 2021-08-29 18:23:52 +08:00
奇淼(piexlmax 6845acd8fa Merge pull request #646 from flipped-aurora/gva-vue3-2.4.5
VUE3版本 提交master测试
2021-08-28 15:25:44 +08:00
蒋吉兆 090a1a0727 前端bug修复 2021-08-28 15:13:39 +08:00
蒋吉兆 3b9e48d305 更新插件仓库 2021-08-28 14:28:47 +08:00
蒋吉兆 26a7b77bf8 Merge remote-tracking branch 'origin/gva-vue3-2.4.5' into gva-vue3-2.4.5 2021-08-28 14:07:01 +08:00
klausY 9a32684dc9 增加首页视频 2021-08-28 13:31:32 +08:00
蒋吉兆 f9fa512ff3 Merge branch 'gva-plugins' of github.com:flipped-aurora/gin-vue-admin into gva-vue3-2.4.5
 Conflicts:
	server/initialize/plugin.go
2021-08-28 13:10:27 +08:00
蒋吉兆 732143b9bb 更新插件仓库 2021-08-28 13:09:17 +08:00
蒋吉兆 5964d70023 规范化插件代码 2021-08-28 12:38:26 +08:00
蒋吉兆 f5e0268d0f 插件优化 2021-08-28 00:00:08 +08:00
奇淼(piexlmax d99efa76b3 Merge pull request #645 from nightsimon/feat/notify-dingding
Feat/notify dingding
2021-08-27 23:21:10 +08:00
奇淼(piexlmax bf0110c94b Merge branch 'gva-plugins' into feat/notify-dingding 2021-08-27 23:20:59 +08:00
Espoir 32363e78f6 fix(): update 2021-08-26 23:32:24 +08:00
Espoir df7163a78e docs(): update readme 2021-08-26 23:12:11 +08:00
Espoir 73b8b9d098 docs(): update readme 2021-08-26 23:05:18 +08:00
Espoir c430ec317a docs(): update readme 2021-08-26 22:58:29 +08:00
Espoir fe57d6adfd fix(): 钉钉通知取消全局配置 2021-08-26 22:44:36 +08:00
Espoir fb1a243db7 fix(): fix config 2021-08-26 21:31:00 +08:00
Espoir 5fe92dcc89 feat(): notify dingding 2021-08-26 21:10:13 +08:00
piexlmax a70b2b67ac 自动化代码提示变更 且符合vue3规则 2021-08-26 15:18:31 +08:00
piexlmax 59ffff1a6a 修改vue3 template 2021-08-26 14:32:50 +08:00
piexlmax 265e42f513 vue3版本初版上线 自测已可用 2021-08-26 12:45:41 +08:00
蒋吉兆 adc7f567f9 插件模式代码优化 2021-08-24 22:15:45 +08:00
奇淼(piexlmax 20876243ed Merge pull request #639 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-08-24 20:02:01 +08:00
奇淼(piexlmax c7f4429b67 Merge pull request #638 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-08-24 20:00:08 +08:00
qimiao 920b89cf8f Merge branch 'gva_gormv2_dev' of github.com:flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-08-24 19:59:04 +08:00
qimiao f5717d0361 在线仓模式bug修复 2021-08-24 19:49:27 +08:00
奇淼(piexlmax deddd00d67 Merge pull request #637 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-08-24 19:46:53 +08:00
奇淼(piexlmax 3a98ebdbd4 Merge pull request #636 from supine-win/patch-3
Update user.vue
2021-08-24 19:45:31 +08:00
piexlmax a69eeaea15 提交2.4.5插件模式 a测版本 2021-08-24 19:41:12 +08:00
supine-win 5c034fd6b0 Update user.vue
新增用户本地存储路径不正确
2021-08-24 14:12:16 +08:00
蒋吉兆 7e4bfc4034 修复 v8下redis 验证码模式 存在的未传入context的bug
(cherry picked from commit 2342a47c62)
2021-08-24 10:38:54 +08:00
qimiao 14f869bf23 Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2021-08-24 10:23:38 +08:00
qimiao 548961870f Merge branch 'master' of github.com:flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-08-24 10:22:55 +08:00
蒋吉兆 65838a4a52 增加在线仓库模式插件示例 2021-08-23 23:35:16 +08:00
蒋吉兆 6afe848210 修改包名称定为至server为插件化提供便利 2021-08-23 23:13:24 +08:00
pixel 8294264f87 操作日志不再记录自己的操作 2021-08-23 18:34:22 +08:00
奇淼(piexlmax ae2fcbb19c Merge pull request #635 from fengchao/develop
[service.go.tpl] Fix typo in time.Time FieldType.
2021-08-23 14:51:30 +08:00
fengchao 3147c7fd74 [service.go.tpl] Fix typo in time.Time FieldType.
There is a typo in service.go.tpl time.Time FieldType code.
2021-08-23 14:15:03 +08:00
蒋吉兆 6638db45a5 email提为插件模式 2021-08-22 12:21:32 +08:00
奇淼(piexlmax fac6671841 Merge pull request #633 from SliverHorn/sliver_horn_develop
update: README.md and README-en.md
2021-08-22 10:26:07 +08:00
奇淼(piexlmax da89d4611a Merge pull request #632 from songzhibin97/gva_gormv2_dev
feat:插件注册&差分so
2021-08-22 10:22:58 +08:00
SliverHorn 86a84fe1c2 update: README.md and README-en.md 2021-08-22 00:11:02 +08:00
songzhibin97 faafe15629 fix:升级go mod 2021-08-21 18:35:30 +08:00
songzhibin97 d75b2ce7d6 fix:go version 2021-08-21 18:23:50 +08:00
songzhibin97 edb8f51fd0 fix:mod 2021-08-21 18:17:07 +08:00
songzhibin97 344dd74874 Revert "Revert "Merge remote-tracking branch 'upstream/gva_gormv2_dev' into gva_gormv2_dev""
This reverts commit 6f751209a5.
2021-08-21 18:07:11 +08:00
songzhibin97 71605850c2 Revert "Merge remote-tracking branch 'upstream/gva_gormv2_dev' into gva_gormv2_dev"
This reverts commit bb33c312b1, reversing
changes made to b9b4bc6b8b.
2021-08-21 17:55:06 +08:00
songzhibin97 ce67438ef0 Merge remote-tracking branch 'upstream/gva_gormv2_dev' into gva_gormv2_dev 2021-08-21 17:38:59 +08:00
songzhibin97 ac18cd6902 fix go mod version 2021-08-21 11:05:25 +08:00
songzhibin97 cbf73f24ae feat:fix go mod 2021-08-21 11:01:34 +08:00
songzhibin97 181b3a985e feat:插件注册&差分so 2021-08-21 10:48:44 +08:00
奇淼(piexlmax 60d8abf816 Merge pull request #631 from songzhibin97/gva_gormv2_dev
feat:插件模式尝鲜
2021-08-20 20:02:48 +08:00
qimiao 32c0fd50dd 提升基础包等级限制 通过action 2021-08-20 19:54:51 +08:00
songzhibin97 513003a8bb fix:main 2021-08-20 19:45:01 +08:00
songzhibin97 c5c8032975 feat:插件模式尝鲜 2021-08-20 19:32:25 +08:00
奇淼(piexlmax f00d1667b8 Merge pull request #629 from flipped-aurora/gva_gormv2_dev
解决360excel包无法下载的问题
2021-08-20 12:18:08 +08:00
qimiao e96f39c652 解决360excel包无法下载的问题 2021-08-19 16:50:28 +08:00
奇淼(piexlmax deccff5d46 Merge pull request #626 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-08-17 10:34:34 +08:00
奇淼(piexlmax b60b3ce4ee Merge pull request #625 from flipped-aurora/gva_gormv2_dev
fmt project
2021-08-17 10:33:47 +08:00
qimiao 2e2ad1350d fmt project 2021-08-17 10:23:30 +08:00
奇淼(piexlmax 3fd24d1931 Merge pull request #624 from flipped-aurora/gva_gormv2_dev
config提交错误
2021-08-16 22:51:24 +08:00
蒋吉兆 e747ac52c2 config提交错误 2021-08-16 22:50:59 +08:00
奇淼(piexlmax 6d034776eb Merge pull request #623 from flipped-aurora/gva_gormv2_dev
补充遗漏的json type
2021-08-16 22:47:59 +08:00
蒋吉兆 a85ae1a46a 补充遗漏的json type 2021-08-16 22:44:35 +08:00
奇淼(piexlmax b07de7632f Merge pull request #622 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-08-16 19:40:06 +08:00
qimiao 6ee60e3f95 Merge branch 'develop' of github.com:flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-08-16 19:38:47 +08:00
qimiao 122dcf0324 /menu/GetMenuAuthority -> /menu/getMenuAuthority 2021-08-16 19:37:22 +08:00
奇淼(piexlmax ba0313c54a Merge pull request #620 from fengchao/develop
Develop Fix eslint errors and warnings in auto generated code
2021-08-16 11:21:07 +08:00
fengchao 2a69372caa [web/.eslintrc.js] Change comma-dangle setting to only-multiline.
This change will fix comma-dangle jslint error in auto generated code.
2021-08-13 17:56:57 +08:00
fengchao db25af7ae9 Fix jslint error/warning in auto generated code.
Below errors are fixed in this commit:
* No new line at end of file
* Extra empty line
* Extra white space
* Wrong tab indent
* Use "" to quote string
2021-08-13 17:54:21 +08:00
奇淼(piexlmax 51779ecf80 Update README.md 2021-08-11 12:35:57 +08:00
奇淼(piexlmax 8118b901d7 Update README.md 2021-08-11 12:35:31 +08:00
奇淼(piexlmax 12772763ef Merge pull request #492 from zooqkl/master
新增支持入参正则校验。
2021-08-10 10:43:30 +08:00
奇淼(piexlmax 4aaa3079de Merge branch 'develop' into master 2021-08-10 10:43:19 +08:00
奇淼(piexlmax f0eca216ad Merge pull request #616 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-08-07 10:51:39 +08:00
奇淼(piexlmax 9698545b27 Merge pull request #615 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-08-07 10:50:34 +08:00
奇淼(piexlmax 70b6a410d4 Merge pull request #611 from rockwang465/master
Update changePassword swagger method
2021-08-07 10:46:58 +08:00
奇淼(piexlmax 9fa293c596 Merge branch 'master' into master 2021-08-07 10:46:13 +08:00
奇淼(piexlmax 197cf21210 Merge pull request #614 from flipped-aurora/gva_gormv2_dev
自动化代码 get类型接收参数修改为query
2021-08-07 10:36:30 +08:00
蒋吉兆 134534dc09 自动化代码 get类型接收参数修改为query 2021-08-07 10:35:27 +08:00
蒋吉兆 3d2c3b508c Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin 2021-08-07 10:20:54 +08:00
蒋吉兆 8bcd9e7f65 修复 v8下redis 验证码模式 存在的未传入context的bug 2021-08-07 10:16:11 +08:00
奇淼(piexlmax 3d822c525e Merge pull request #613 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-08-05 17:50:26 +08:00
piexlmax 1d11b9a0c0 Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-08-05 17:46:28 +08:00
奇淼(piexlmax 3e17357185 Merge pull request #610 from songzhibin97/gva_gormv2_dev
feat:回滚文件迁移到垃圾桶,并非直接删除
2021-08-05 17:45:09 +08:00
piexlmax e9786b53c9 redis-->redis/v8 2021-08-05 17:44:04 +08:00
范庆磊 2c5b9909a2 新增全局关闭当前页面函数 2021-08-05 17:04:31 +08:00
ipanghu b655ea27f9 Merge pull request #5 from flipped-aurora/master
拉取官方最新代码
2021-08-05 16:10:59 +08:00
wangyecheng@yaoyanshe.com 3ba262ac53 Update swagger for changePassword 2021-08-04 17:50:51 +08:00
wangyecheng@yaoyanshe.com 880e1d5c9f Update changePassword swagger method 2021-08-04 17:40:01 +08:00
songzhibin97 2175d2c53d feat:回滚文件迁移到垃圾桶,并非直接删除 2021-08-04 14:25:23 +08:00
奇淼(piexlmax 5d7bbcc034 正式发布V2.4.4版本
正式发布V2.4.4版本
2021-07-31 16:00:37 +08:00
奇淼(piexlmax 7085c6c7db 正式发布V2.4.4版本
正式发布V2.4.4版本
2021-07-31 16:00:08 +08:00
piexlmax 6fe19ab6ae 修改版本号为V2.4.4正式 2021-07-31 15:53:39 +08:00
奇淼(piexlmax 462bc8b5fb Merge pull request #597 from flipped-aurora/gva_gormv2_dev
修复分页器左侧border消失的bug
2021-07-26 21:45:29 +08:00
pixel 051b064f21 修复分页器active右侧左边框消失的bug 2021-07-26 20:05:26 +08:00
songzhibin97 0e8b66b183 fix:配置文件修复 2021-07-22 18:24:01 +08:00
songzhibin97 3c64b12e89 fix:配置文件修复 2021-07-22 18:23:39 +08:00
songzhibin97 444c47f678 fix:配置文件修改 2021-07-22 18:23:03 +08:00
奇淼(piexlmax b5a175b097 Merge pull request #595 from flipped-aurora/master
增加多角色功能和角色切换功能  调整前端获取用户信息方式
2021-07-22 16:55:13 +08:00
奇淼(piexlmax 7477c97b39 Merge pull request #594 from flipped-aurora/gva_gormv2_dev
增加多角色功能和角色切换功能  调整前端获取用户信息方式
2021-07-22 16:54:42 +08:00
pixel aadc3acdec Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-07-22 16:53:13 +08:00
pixel 8f9ecebf41 增加多角色功能和角色切换功能
调整前端获取用户信息方式
2021-07-22 16:46:09 +08:00
奇淼(piexlmax da40de9ad2 Merge pull request #592 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-07-20 23:43:16 +08:00
奇淼(piexlmax d02b71fe4f Merge pull request #591 from flipped-aurora/gva_gormv2_dev
swag调整适应当前模块化版本
2021-07-20 23:40:36 +08:00
蒋吉兆 4f306ffaab Merge branches 'gva_gormv2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-07-20 23:35:33 +08:00
蒋吉兆 69e9b153b8 调整swagger 2021-07-20 23:29:34 +08:00
奇淼(piexlmax 91d2c2f71e Update server.go 2021-07-20 19:42:43 +08:00
奇淼(piexlmax 957a138df8 Update gin-vue-admin.js 2021-07-20 19:42:15 +08:00
奇淼(piexlmax 60748b4843 Merge pull request #589 from flipped-aurora/gva_gormv2_dev
项目目录支持模块化
2021-07-20 19:38:35 +08:00
songzhibin97 152cb4ec01 Merge branch 'gva_gormv2_dev' into develop 2021-07-20 18:19:05 +08:00
songzhibin97 b758edb28e Merge branch 'master' into develop 2021-07-20 18:15:05 +08:00
songzhibin97 2e2d916b6f Merge branch 'master' into gva_gormv2_dev 2021-07-20 18:08:29 +08:00
奇淼(piexlmax 05983fcfb1 Merge pull request #583 from RickieL/master
新增验证码使用redis存储方式
2021-07-20 14:35:12 +08:00
蒋吉兆 a332527ad3 自动化代码模板bug调整 2021-07-18 19:57:37 +08:00
奇淼(piexlmax f383f025f2 Merge pull request #588 from songzhibin97/gva_gormv2_dev
feat:增加自动注入代码段
2021-07-18 19:11:05 +08:00
songzhibin97 cf4ecd5ff9 feat:优化自动代码段 2021-07-18 14:53:11 +08:00
songzhibin97 b83ad51dd7 fix:增加自动化代码插入点&修复路径配置 2021-07-18 14:16:26 +08:00
songzhibin97 ba05ef0e57 fix:修正mac情况下的文件冲突 2021-07-18 13:13:48 +08:00
pixel 7b6b610a74 代码移动默认配置 2021-07-17 17:07:09 +08:00
pixel 12ac8b6337 模板调整完成 TODO:自动代码移动 2021-07-17 14:45:10 +08:00
pixel c7de76b849 基础架构变更 增加模块化 2021-07-17 14:18:52 +08:00
pixel b5c1babec9 模块化变更 2021-07-16 20:08:11 +08:00
pixel 73a8052c08 模板优化 搜索功能优化 2021-07-15 19:53:30 +08:00
奇淼(piexlmax e69d79cdb8 增加自动化代码回滚功能
增加自动化代码回滚功能
2021-07-14 19:56:51 +08:00
pixel cb8f8ddb16 增加自动化代码回滚功能 2021-07-14 19:54:30 +08:00
pixel d9dde27aa0 增加自动化代码回滚功能 2021-07-14 19:53:23 +08:00
奇淼(piexlmax 2b1ea2947d Merge pull request #585 from flipped-aurora/gva_gormv2_dev
新增自动化代码回滚功能
2021-07-14 19:30:00 +08:00
pixel 065b0d711d 增加自动化代码回滚功能 2021-07-14 19:24:46 +08:00
奇淼(piexlmax f4275d9243 Merge pull request #584 from songzhibin97/gva_gormv2_dev
feat:增加删除历史记录api
2021-07-14 19:10:21 +08:00
songzhibin97 739e8bb06c feat:增加删除历史记录api 2021-07-14 18:25:18 +08:00
pixel 3434b2ba5e 增加自动化代码回滚功能 2021-07-14 14:37:04 +08:00
奇淼(piexlmax 2de1d42a30 Merge pull request #582 from songzhibin97/gva_gormv2_dev
feat:完善前后端回滚交互信息交换
2021-07-14 12:08:15 +08:00
liaoyongfu 83465f4b10 add captcha redis 2021-07-14 10:57:53 +08:00
liaoyongfu e82cfa6d26 add captcha redis 2021-07-14 10:52:36 +08:00
songzhibin97 607022bc08 fix:补充过滤 2021-07-13 20:07:21 +08:00
songzhibin97 b67e17d8ff feat:完善前后端回滚交互信息交换 2021-07-13 19:59:44 +08:00
pixel e0f314d862 增加自动化代码管理页面 2021-07-13 19:45:21 +08:00
ipanghu ced5b914d2 Merge pull request #4 from flipped-aurora/master
拉取最新仓库
2021-07-13 19:18:40 +08:00
pixel 982c4f4d67 Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-07-13 19:04:57 +08:00
奇淼(piexlmax df3c6be36c Merge pull request #581 from songzhibin97/gva_gormv2_dev
feat:新存储了meta信息,完善了记录逻辑
2021-07-13 17:38:17 +08:00
pixel 1a665f3c14 Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2021-07-13 17:30:42 +08:00
songzhibin97 7fcdaa523c feat:新存储了meta信息,完善了记录逻辑 2021-07-13 17:30:30 +08:00
奇淼(piexlmax beedef280c Merge pull request #579 from songzhibin97/gva_gormv2_dev
fix:修改redis包,使用推荐的v8
2021-07-13 17:22:30 +08:00
奇淼(piexlmax b841919e01 Merge pull request #580 from flipped-aurora/SliverHorn-patch-2
fix: web/Dockerfile cnpm install error
2021-07-13 17:20:55 +08:00
pixel ba77a808df 排除当dns为空时候的bug 2021-07-13 16:25:47 +08:00
SliverHorn e160920e53 fix: web/Dockerfile cnpm install error
update file
- web/Dockerfile

fixed:
- cnpm install error
2021-07-12 20:18:45 +08:00
pixel 43e4c76f83 Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2021-07-12 19:24:27 +08:00
songzhibin97 07ec0841c9 fix:修改redis包,使用推荐的v8 2021-07-12 19:23:56 +08:00
奇淼(piexlmax 2242f57627 Merge pull request #577 from songzhibin97/gva_gormv2_dev
feat:自动迁移代码回滚&对应历史记录查询
2021-07-12 19:21:26 +08:00
songzhibin97 ff506730de feat:完善回滚逻辑,如果勾选api也会创建对应信息 2021-07-12 14:53:25 +08:00
songzhibin97 e01a0aed49 fix:swagger 2021-07-12 11:37:33 +08:00
pixel 194c671ec0 Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev 2021-07-12 09:49:34 +08:00
songzhibin97 14371c0e45 feat:增加查询api 2021-07-10 19:01:56 +08:00
songzhibin97 686163808d feat:回滚删除对应api 2021-07-10 18:47:23 +08:00
songzhibin97 76d38c1108 feat:回滚自动化生产代码 2021-07-10 17:39:24 +08:00
奇淼(piexlmax bbf6549490 Merge pull request #576 from flipped-aurora/gva_gormv2_dev
修复了closeTab不生效的bug
2021-07-10 17:16:48 +08:00
蒋吉兆 e2d13aa238 修复了closeTab不生效的bug 2021-07-10 16:20:57 +08:00
奇淼(piexlmax 1f4b265dbc Merge pull request #575 from SliverHorn/master
fix: config.yaml, config.docker.yaml
2021-07-10 14:36:19 +08:00
SliverHorn d520f84ba1 fix: config.yaml, config.docker.yaml 2021-07-10 14:17:40 +08:00
奇淼(piexlmax 8ce6c76a7b Merge pull request #574 from flipped-aurora/gva_gormv2_dev
fix eslint
2021-07-10 12:37:29 +08:00
蒋吉兆 7431457ebe fix eslint 2021-07-10 12:36:33 +08:00
奇淼(piexlmax c13acf641d Merge pull request #573 from flipped-aurora/gva_gormv2_dev
自动化代码可选项优化
2021-07-10 12:30:11 +08:00
蒋吉兆 073994bca7 自动化代码可选项优化 2021-07-10 12:28:52 +08:00
奇淼(piexlmax 34494b00ff v2.4.3发版
v2.4.3发版
2021-07-10 12:13:44 +08:00
蒋吉兆 3d6c0d2a14 调整项目编号 2021-07-10 12:11:48 +08:00
蒋吉兆 3271542a9b 修改上传图片相关bug 2021-07-10 12:08:28 +08:00
奇淼(piexlmax 44e7b643f9 Merge pull request #571 from flipped-aurora/master
分支版本合并
2021-07-10 11:26:02 +08:00
ipanghu b87d9613f5 Merge pull request #3 from flipped-aurora/master
change web/init on method , update web README
2021-07-10 11:19:04 +08:00
bypanghu@163.com 0683c99f00 change web/init on method , update web README 2021-07-10 11:11:13 +08:00
奇淼(piexlmax 0298d1df76 Merge pull request #548 from neo-6/NeoSunDevelop
[修复阿里云OSS图片上传路径不一致错误]
2021-07-10 11:06:10 +08:00
奇淼(piexlmax 0c4ca3ecb0 Merge pull request #569 from SliverHorn/master
update: 自定义gorm的logger优化
2021-07-10 11:04:22 +08:00
奇淼(piexlmax d5e5088778 Merge pull request #570 from SliverHorn/sliver_horn_gva_gormv2_dev_develop
update: server/README.md
2021-07-10 11:04:09 +08:00
ipanghu e7a0bb473a Merge pull request #2 from flipped-aurora/master
拉取最新master
2021-07-10 10:54:11 +08:00
SliverHorn d239aa1f1d update: server/README.md 2021-07-10 10:22:25 +08:00
SliverHorn a4623373a7 update: 自定义gorm的logger优化 2021-07-09 21:52:17 +08:00
pixel af595f9cf0 清理无用debugger 2021-07-09 18:49:06 +08:00
奇淼(piexlmax 2ac327acea Merge pull request #568 from flipped-aurora/gva_gormv2_dev
添加版权信息
2021-07-09 17:29:44 +08:00
pixel f112a056be 添加版权信息 2021-07-09 17:26:43 +08:00
奇淼(piexlmax c05cfada13 Merge pull request #567 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-07-09 16:13:55 +08:00
pixel 8f3291e6da 更新sync库版本 2021-07-09 16:01:10 +08:00
奇淼(piexlmax 488332c74d Merge pull request #566 from songzhibin97/gva_gormv2_dev
feat:增加singleFlight并发控制jwt颁发
2021-07-08 17:40:08 +08:00
songzhibin97 6b487a4afd feat:增加singleFlight并发控制jwt颁发 2021-07-07 19:32:05 +08:00
奇淼(piexlmax 6869c9350b Merge pull request #565 from JamieSlome/patch-1
Create SECURITY.md
2021-07-06 16:54:45 +08:00
Jamie Slome b7485f1335 Create SECURITY.md 2021-07-06 09:53:20 +01:00
奇淼(piexlmax 39badd53b1 Merge pull request #560 from iiiusky/fix/commentStyle
修改模板中的注释格式为官方推荐的格式
2021-07-05 10:37:03 +08:00
奇淼(piexlmax e8beb157b9 Merge pull request #563 from flipped-aurora/SliverHorn-patch-1
Update sys_api.go
2021-07-05 10:32:58 +08:00
SliverHorn 0ac3b20736 Update sys_api.go
修改文件
- server/model/sys_api.go
修复问题
- gorm tag 编写错误,使用分号进行分割,而不是写两个gorm tag
2021-07-04 16:01:20 +08:00
奇淼(piexlmax 377501efcf Merge pull request #561 from iiiusky/fix/autoCodeDesc
修改web页面代码生成部分描述信息
2021-07-03 11:37:28 +08:00
奇淼(piexlmax fd4072155b Merge pull request #562 from SliverHorn/master
update: README.md and README-en.md
2021-07-03 10:18:36 +08:00
SliverHorn e31ecc6852 update: README.md and README-en.md 2021-07-03 08:08:39 +08:00
SliverHorn d78185cb64 Update Dockerfile 2021-07-03 00:29:16 +08:00
SliverHorn 4260a2eab9 Update service.go.tpl
回参与入参,我觉得可以去掉,基本调用的时候都知道是什么类型,就没必要写了
2021-07-02 17:18:51 +08:00
sky c7781be21d fix: 修复字段生成代码中文件名称相关的描述信息 2021-07-02 17:03:49 +08:00
sky 73edd03aa4 fix: 修复字段生成代码中API相关的描述信息 2021-07-02 17:01:30 +08:00
sky 6f7a7b7d4c fix: 修改模板中的注释格式为官方推荐的格式.https://github.com/golang/go/wiki/CodeReviewComments#comment-sentences 2021-07-02 15:22:13 +08:00
奇淼(piexlmax 110fb33c24 Merge pull request #558 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-07-01 19:02:51 +08:00
pixel 57c6ba3624 修复了标签页右键点击事件被覆盖的bug
调整了左侧默认高度
2021-07-01 18:06:27 +08:00
奇淼(piexlmax fee7165079 Merge pull request #557 from bypanghu/master
add
2021-07-01 17:53:10 +08:00
奇淼(piexlmax 1cc5f53324 Merge pull request #555 from bbqi/master
fix: css中小疏漏rgba
2021-07-01 17:52:45 +08:00
Devil 17a95c45cc add 2021-07-01 17:42:01 +08:00
ipanghu 35a3b3e372 Merge pull request #1 from flipped-aurora/master
拉取代码
2021-07-01 17:17:17 +08:00
bbqi 362f1a5311 fix: css中小疏漏rgba 2021-06-30 14:47:31 +08:00
奇淼(piexlmax eb5298a6bd 修复特殊符号下初始化数据库时报错的bug
修复特殊符号下初始化数据库时报错的bug
2021-06-30 12:42:23 +08:00
pixel c9c8a4ff7a 修复特殊符号下初始化数据库时报错的bug 2021-06-30 12:37:48 +08:00
奇淼(piexlmax 07d7a518c6 Merge pull request #553 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-06-29 19:56:35 +08:00
pixel 4b7b07cd57 规范化px 2021-06-29 19:41:08 +08:00
pixel 4d383d53fe 清理编译warning 2021-06-29 19:24:01 +08:00
pixel c0dd212b41 统一样式调整 2021-06-29 19:16:28 +08:00
pixel 37993f3246 统一样式调整 2021-06-29 19:15:04 +08:00
pixel 13ea198fcd 改变主题色配置标签位置 2021-06-29 16:35:47 +08:00
pixel 7a68c5c6cf 暂时屏蔽运行时sass警告 2021-06-29 15:42:37 +08:00
pixel df75dae39d 主题色功能bug修复 2021-06-29 15:28:39 +08:00
pixel 4a39a2f81c 增加自定义皮肤功能 清理无用文件 2021-06-29 14:46:47 +08:00
奇淼(piexlmax e253ee0970 Merge pull request #552 from bypanghu/master
新增侧边栏修改主题
2021-06-29 10:22:07 +08:00
Devil 5599eeb9c9 init 2021-06-28 10:55:37 +08:00
Devil c90d04dbbd 前端新增修改侧边栏主题风格 2021-06-28 10:53:46 +08:00
奇淼(piexlmax 567256160e Merge pull request #551 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-06-28 09:54:04 +08:00
奇淼(piexlmax d0ad41c935 Merge pull request #550 from flipped-aurora/revert-546-gva_gormv2_dev
Revert "Gva gormv2 dev"
2021-06-27 16:30:27 +08:00
奇淼(piexlmax cc535b7a0d Revert "Gva gormv2 dev" 2021-06-27 16:30:17 +08:00
奇淼(piexlmax 40d75ce42a Merge pull request #549 from flipped-aurora/revert-544-master
Revert "新增网页侧边栏颜色配置,新增网页主题色配置"
2021-06-27 16:30:02 +08:00
奇淼(piexlmax 16cbb7a03e Revert "新增网页侧边栏颜色配置,新增网页主题色配置" 2021-06-27 16:29:24 +08:00
奇淼(piexlmax 440e13a07b Merge pull request #544 from bypanghu/master
新增网页侧边栏颜色配置,新增网页主题色配置
2021-06-27 15:00:36 +08:00
奇淼(piexlmax 6f8810ec60 Merge pull request #546 from songzhibin97/gva_gormv2_dev
Gva gormv2 dev
2021-06-27 14:59:41 +08:00
csnero fad9733802 [修复阿里云OSS图片上传路径不一致错误] 2021-06-26 20:54:12 +08:00
songzhibin97 8c9170d365 fix:uuid package 2021-06-26 13:56:50 +08:00
songzhibin97 dc79c106e2 feat:适配前端风格存储 2021-06-26 13:53:32 +08:00
Devil 84c430c819 修改侧边栏logo处的bug 2021-06-26 13:44:54 +08:00
ipanghu ca45b3ee01 Merge pull request #3 from flipped-aurora/master
拉取信息
2021-06-26 13:38:51 +08:00
Devil be640251c5 修改readme 2021-06-26 13:37:52 +08:00
Devil 0535f8b55f 修复vue.config.js 2021-06-26 13:34:18 +08:00
Devil 67dcec4c9a 修复logo随着主题色变化的bug 2021-06-26 13:32:42 +08:00
ipanghu 5ed1292503 Merge branch 'master' into master 2021-06-26 12:02:59 +08:00
Devil 9f5b59c4b5 前端新增可配置侧边栏风格,可以配置网页主题色 2021-06-25 17:24:02 +08:00
奇淼(piexlmax dfcf1609ed Merge pull request #542 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-06-25 15:29:08 +08:00
奇淼(piexlmax eb6175b2d5 Merge pull request #541 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-06-25 15:28:36 +08:00
pixel 74cff901c8 增加空menu的兼容 2021-06-25 12:15:12 +08:00
奇淼(piexlmax 04b3125894 Merge pull request #540 from flipped-aurora/develop
Develop
2021-06-24 17:40:14 +08:00
ipanghu 7e1348cb41 Merge pull request #2 from flipped-aurora/master
拉取请求
2021-06-24 15:59:35 +08:00
奇淼(piexlmax 1772c1ccfc Merge pull request #538 from songzhibin97/gva_gormv2_dev
fix:创建用户初始化权限,确保用户可用
2021-06-24 14:27:33 +08:00
songzhibin97 a2737af68f fix:添加id避免tree重复添加 2021-06-23 12:53:41 +08:00
奇淼(piexlmax ebf7a11ffb Merge pull request #539 from bstdn/develop
modified 统一代码风格
2021-06-23 12:37:05 +08:00
何秀钢 3af12113b2 modified 统一代码风格 2021-06-23 11:36:22 +08:00
pixel c044fcd2dd 文案调整 2021-06-23 10:46:54 +08:00
songzhibin97 a2551e86f4 fix:创建用户初始化权限,确保用户可用
修改了:
- server/api/v1/sys_authority.go
- server/model/request/sys_casbin.go
- server/model/request/sys_menu.go
2021-06-22 12:39:26 +08:00
奇淼(piexlmax ed926452f0 Merge pull request #531 from hxcode/develop
directory.go: fix os.MkdirAll return error
2021-06-21 19:11:35 +08:00
VUCA d824a6b7b0 Merge branch 'flipped-aurora:develop' into develop 2021-06-18 18:51:50 +08:00
奇淼(piexlmax 4cdc9ed6cd Merge pull request #535 from flipped-aurora/master
前端模板eslit修改
2021-06-17 19:57:26 +08:00
奇淼(piexlmax 93b373d37a Merge pull request #534 from flipped-aurora/gva_gormv2_dev
前端模板eslit修改
2021-06-17 19:56:29 +08:00
pixel deee053883 前端模板eslit修改 2021-06-17 19:52:31 +08:00
奇淼(piexlmax 38a5da1cd0 Merge pull request #533 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-06-17 17:11:51 +08:00
奇淼(piexlmax d4268e1a54 Merge pull request #532 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-06-17 17:09:39 +08:00
黄笑 ac0158605c directory.go: fix os.MkdirAll return error 2021-06-17 16:47:22 +08:00
pixel 4b159fe5f4 初始化流程整体优化,前端报错锁死的情况提供登出操作 2021-06-17 16:02:12 +08:00
pixel b99fe53c6b 初始化流程整体优化,前端报错锁死的情况提供登出操作 2021-06-17 15:54:32 +08:00
pixel da0d5d2413 更改初始化模式 2021-06-17 15:42:09 +08:00
pixel cb85f1c78a Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-06-17 15:41:26 +08:00
奇淼(piexlmax 0371765357 Merge pull request #529 from flipped-aurora/develop
Develop
2021-06-17 15:33:22 +08:00
pixel 73ecd371df 初始化不再自动进行 2021-06-17 15:17:26 +08:00
奇淼(piexlmax 1907de840c Merge pull request #528 from hxcode/develop
aliyun_oss,qiniu,tencent_cos:  fix file open close
2021-06-17 15:15:48 +08:00
奇淼(piexlmax 2c29220645 Merge pull request #527 from songzhibin97/gva_gormv2_dev
perf:优化初始化流程
2021-06-17 15:14:08 +08:00
黄笑 04d7aa9ab4 aliyun_oss,qiniu,tencent_cos: fix file open close 2021-06-17 14:51:35 +08:00
pixel 2cffefcf1c 配置文件增加注释提示 2021-06-17 14:36:04 +08:00
pixel 74d6c237cd 自动生成文件名称修改为 前端为小驼峰 后端为下划线 2021-06-17 12:12:31 +08:00
songzhibin97 0cd3555904 perf:优化初始化流程
创建失败不更改config文件保持,前端保持在init界面
修改文件
- server/api/sys_initdb.go
- server/service/sys_initdb.go
2021-06-17 09:03:55 +08:00
奇淼(piexlmax 3eed60996e Merge pull request #525 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-06-16 17:00:07 +08:00
pixel f6865ba6ba 清理lock 2021-06-16 16:56:13 +08:00
pixel fc19b81104 前端环境变量文件规范化 2021-06-16 16:55:02 +08:00
奇淼(piexlmax 6b79d7c38d Merge pull request #521 from bypanghu/master
新增网站配置文件
2021-06-16 10:59:19 +08:00
奇淼(piexlmax 9364f2a24a Merge pull request #523 from hxcode/develop
exa_excel_parse.go: fix return err
2021-06-16 10:53:22 +08:00
黄笑 427294ec25 exa_excel_parse.go: fix return err 2021-06-15 15:05:04 +08:00
pixel 86bfa374bb 修复init初始化失败页面跳转到空白的错误
修复model模板string给予长度导致的初始化错误
2021-06-15 11:33:51 +08:00
bypanghu@163.com aac76dcd58 '添加gin-vue-admin的web配置文件,具体文件请看core/config文件' 2021-06-11 21:37:07 +08:00
ipanghu 5cc87c5b6c Merge pull request #1 from flipped-aurora/master
拉取master
2021-06-11 20:50:08 +08:00
奇淼(piexlmax c09533052d 修改node-sass为dart-sass
修改node-sass为dart-sass
2021-06-11 17:28:14 +08:00
奇淼(piexlmax e716a31880 Merge pull request #519 from flipped-aurora/gva_gormv2_dev
修改node-sass为dart-sass
2021-06-11 17:26:23 +08:00
pixel 7c3b0b9b8d Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev
# Conflicts:
#	web/package-lock.json
2021-06-11 17:17:35 +08:00
奇淼(piexlmax 44c65a6812 login页面init页面美化
login页面init页面美化
2021-06-11 16:49:14 +08:00
奇淼(piexlmax bea9b5d04d login页面init页面美化
login页面init页面美化
2021-06-11 16:47:15 +08:00
奇淼(piexlmax 3de30b45ed 新版本的login 和 init页面
船新版本的login 和 init页面
2021-06-11 16:27:11 +08:00
Devil ca9579fa6d 全新init页面,适配手机页面,login页面新增logo 2021-06-11 16:22:31 +08:00
Devil 2c9b228eb5 全新init页面,提升用户体验 2021-06-11 16:15:10 +08:00
Devil a2b6bb37bf 新增新的login页面,适配手机端,老的login页面依旧存在 2021-06-11 15:04:56 +08:00
Devil 6943ccb7db 新增新的login页面,适配手机端,老的login页面依旧存在 2021-06-11 15:04:27 +08:00
奇淼(piexlmax 3b563252ff 合并更新至主干
合并更新至主干
2021-06-11 12:12:36 +08:00
奇淼(piexlmax f4e0aa8575 合并更新至主干
合并更新至主干
2021-06-11 12:10:39 +08:00
pixel 34808cae7a Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into develop 2021-06-11 12:07:41 +08:00
pixel d9b7661946 格式化前端代码 2021-06-11 12:01:10 +08:00
奇淼(piexlmax f0369ecf18 整合gin-vue-admin前端框架引入组合,减少main.js代码
整合gin-vue-admin前端框架引入组合,减少main.js代码
2021-06-11 11:31:23 +08:00
奇淼(piexlmax 5a2fb90420 Merge pull request #512 from flipped-aurora/revert-508-master
Revert "增加sqlite数据库的初始化"
2021-06-11 11:14:37 +08:00
奇淼(piexlmax 6bf4a9943c Revert "增加sqlite数据库的初始化" 2021-06-11 11:14:17 +08:00
Devil b9e0a9e126 修复引入time_line的绝对路径错误 2021-06-11 11:04:49 +08:00
奇淼(piexlmax 8ec0eb5166 增加sqlite数据库的初始化
增加sqlite数据库的初始化
2021-06-11 10:56:38 +08:00
Devil f001b518f9 整合gin-vue-admin前端框架引入组合,减少main.js代码 2021-06-11 10:55:59 +08:00
奇淼(piexlmax 4c7c91a2d5 docker-compose 优化
docker-compose 优化
2021-06-11 10:52:20 +08:00
pixel ad785fb3e3 放弃node-sass 替换为 sass(dart-sass) 2021-06-11 10:41:20 +08:00
SliverHorn 8516dbbcaf update: docker-compose 优化 2021-06-10 22:05:14 +08:00
Arthur Liu 4902101cbe 增加sqlite数据库的初始化 2021-06-10 12:15:40 +08:00
奇淼(piexlmax 9b47c8f57c 依照eslint格式化
依照eslint格式化
2021-06-09 11:56:11 +08:00
pixel 1dbba19cac 依照eslint格式化 2021-06-08 12:22:46 +08:00
奇淼(piexlmax a9c9199bf4 规范化代码结构,提升系统使用便捷度。
规范化代码结构,提升系统使用便捷度。
2021-06-08 10:23:39 +08:00
奇淼(piexlmax a84433520d Merge pull request #504 from flipped-aurora/master
pr整理合并
2021-06-08 10:20:04 +08:00
奇淼(piexlmax 9aa34bff89 Merge pull request #503 from flipped-aurora/develop
pr合并
2021-06-08 10:15:14 +08:00
奇淼(piexlmax e4b177f5f7 Merge branch 'gva_gormv2_dev' into develop 2021-06-08 10:12:11 +08:00
奇淼(piexlmax a9946732a2 Merge pull request #497 from bstdn/master
modified 统一代码风格
2021-06-08 10:09:17 +08:00
奇淼(piexlmax 90f4c85034 Merge pull request #499 from bstdn/develop
added ESlint 语法检测
2021-06-08 10:08:35 +08:00
奇淼(piexlmax 72a6b2148f Merge pull request #501 from songzhibin97/gva_gormv2_dev
增加 go generate 懒人模式
2021-06-08 10:08:22 +08:00
奇淼(piexlmax ec393100d0 Merge pull request #500 from SliverHorn/master
fix: docker-compose windows 启动失败
2021-06-08 10:07:53 +08:00
奇淼(piexlmax f521e3fbc9 Merge pull request #502 from allinprogram/patch-1
Fix the inappropriate description
2021-06-08 10:07:41 +08:00
pixel 98a3e9abb2 增加预览代码全选和复制 2021-06-07 19:58:48 +08:00
allinprogram d83da1fa08 Fix the inappropriate description 2021-06-05 09:29:21 +08:00
songzhibin97 c082403868 增加 go generate 懒人模式 2021-06-03 14:44:28 +08:00
SliverHorn b708e70f8f fix: docker-compose 依赖sh命令启动 windows启动失败的bug 2021-06-03 11:44:26 +08:00
何秀钢 2f0465a1a1 added ESlint 语法检测 2021-06-02 14:11:45 +08:00
SliverHorn 3932a8fbf3 Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into develop 2021-06-01 16:32:50 +08:00
SliverHorn 1f4f5a9a2c Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into develop 2021-06-01 16:32:42 +08:00
何秀钢 3ffe0d89d8 modified 统一代码风格 2021-06-01 16:20:46 +08:00
奇淼(piexlmax d3fee1bf3e Merge pull request #496 from flipped-aurora/gva_gormv2_dev
修复casbin map占用问题
2021-05-29 11:26:45 +08:00
奇淼(piexlmax d1009704d8 Merge pull request #493 from qinmin328/master
定时任务配置问题
2021-05-29 11:25:07 +08:00
pixel 4d00bb9d21 2.4.2版本号发布 2021-05-28 19:18:48 +08:00
qinmin328 1dff8eb945 定时任务配置问题
定时任务文档跟使用版本不一致, 导致时间配置上有点差异
2021-05-25 09:50:54 +08:00
列里 f947b3fa60 validator.go : 新增支持正则校验。
verify.go : UUID的正则校验使用示例。
2021-05-24 20:31:39 +08:00
SliverHorn 8eef4717cc fix: Restore config.yaml File 2021-05-21 18:49:35 +08:00
SliverHorn 1de437dc5a fix: Enforcer => SyncedEnforcer Solve Map Preemption 2021-05-21 18:48:26 +08:00
SliverHorn 747ffc43d9 Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into develop 2021-05-20 16:58:30 +08:00
SliverHorn 8f1885f56e fix: remove casbin init single case 2021-05-20 16:54:56 +08:00
奇淼(piexlmax eeac49157f Merge pull request #484 from flipped-aurora/gva_gormv2_dev
修复map竞争问题
2021-05-20 11:29:51 +08:00
奇淼(piexlmax ffc19c7fbf Merge branch 'master' into gva_gormv2_dev 2021-05-20 11:26:24 +08:00
pixel e03f0cc4b0 修复map竞争问题 2021-05-20 11:23:30 +08:00
奇淼(piexlmax 70044a88a0 Merge pull request #483 from flipped-aurora/revert-482-gva_gormv2_dev
Revert "Gva gormv2 dev"
2021-05-20 11:05:53 +08:00
奇淼(piexlmax 4a279ffa29 Revert "Gva gormv2 dev" 2021-05-20 11:05:44 +08:00
奇淼(piexlmax 979c9c193f Merge pull request #482 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-05-20 10:56:48 +08:00
奇淼(piexlmax f603ebb09f Merge pull request #481 from songzhibin97/gva_gormv2_dev
fix casbin datarace
2021-05-20 10:56:24 +08:00
songzhibin97 7d93bc7256 fix casbin datarace 2021-05-20 10:49:00 +08:00
奇淼(piexlmax 89fa2c1061 Update README.md 2021-05-20 10:13:33 +08:00
奇淼(piexlmax aba0eeea80 Merge pull request #477 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-05-18 16:47:39 +08:00
奇淼(piexlmax 5a0aa6422f Merge pull request #476 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-05-18 16:47:17 +08:00
pixel b59f068c7d 媒体库样式优化 2021-05-18 16:38:20 +08:00
pixel ad6311d244 Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-05-18 16:30:27 +08:00
奇淼(piexlmax 645d6799b2 Merge pull request #469 from bstdn/master
modified 增加结构体描述,完善自动化文档
2021-05-18 16:30:07 +08:00
pixel 758c1f8306 Merge branch 'develop' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev
 Conflicts:
	server/service/sys_casbin.go
2021-05-18 16:26:53 +08:00
pixel 905297907a Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-05-18 16:25:45 +08:00
奇淼(piexlmax 6fb241af4b Merge pull request #475 from snowlyg/master
修复删除最后一个列表数据,重新加载数据报错
2021-05-18 16:23:55 +08:00
奇淼(piexlmax 0cf29d7488 Merge pull request #472 from closetool/develop
service/sys_casbin.go: fix casbin runs slowly
2021-05-18 13:58:10 +08:00
snowlyg 615aa3ad23 修复删除最后一个列表数据,重新加载数据报错 2021-05-17 15:38:31 +08:00
closetool c756d26592 service/sys_casbin.go: fix casbin runs slowly 2021-05-15 13:46:34 +08:00
何秀钢 0f45d3830a modified 增加结构体描述,完善自动化文档 2021-05-14 11:33:14 +08:00
奇淼(piexlmax c37ea861eb Merge pull request #463 from mlsjla/master
Update index.vue
2021-05-12 17:53:50 +08:00
奇淼(piexlmax aaa53d9a35 新增自动迁移创建路由后重启
新增自动迁移创建路由后重启
2021-05-12 17:39:15 +08:00
奇淼(piexlmax 3d59181d2a 修复后端重启前端白屏的bug
修复后端重启前端白屏的bug
2021-05-12 17:37:58 +08:00
奇淼(piexlmax ef11b6caa7 Merge pull request #465 from bstdn/master
modified 增加结构体描述,完善自动化文档
2021-05-12 17:37:16 +08:00
奇淼(piexlmax 563a1fc1a4 Merge pull request #466 from WangLeonard/fix-system-config
修复在线修改系统配置的bug
2021-05-12 17:36:12 +08:00
pixel 5625444fbc 修复重启后断后页面白屏问题 2021-05-12 17:13:53 +08:00
songzhibin97 169205f132 新增自动迁移创建路由后重启
修改
- server/api/v1/sys_system.go
- server/config.yaml
- server/config/auto_code.go
- server/service/sys_auto_code.go
新增
- server/utils/reload.go
2021-05-12 11:53:52 +08:00
Leonard Wang 447d824da6 修复在线修改系统配置的bug 2021-05-12 00:54:07 +08:00
何秀钢 c3ad90dde5 modified 增加结构体描述,完善自动化文档 2021-05-11 17:26:06 +08:00
mlsjla f218695bef Update index.vue
修复生产环境部署后,图片路径错误,错误细节: 图路径会变为 /apiuploads/file...  而实际需要的是 /api/uploads/file...
2021-05-10 14:17:57 +08:00
奇淼(piexlmax 9b758084bf 修复了已知bug casbin版本降级提升兼容性
Gva gormv2 dev
2021-05-09 19:29:49 +08:00
蒋吉兆 8159aa1a88 统一登录校验 误删用户登陆菜单后不再白屏 2021-05-09 19:26:08 +08:00
蒋吉兆 18cf39529e Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-05-09 18:49:15 +08:00
pixel a54e7a5654 修改casbin版本 防止用户报错 2021-05-07 17:48:19 +08:00
奇淼(piexlmax 4392f0ffac 优化配置 提升新手友好度
优化配置 提升新手友好度
2021-05-06 04:29:33 -05:00
pixel 732cd54578 Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev
 Conflicts:
	server/model/request/common.go
2021-05-06 13:21:51 +08:00
奇淼(piexlmax 0de1fe1132 增加结构体描述,完善自动化文档
modified 增加结构体描述,完善自动化文档
2021-04-30 01:19:00 -05:00
何秀钢 3e85645e44 modified 增加结构体描述,完善自动化文档 2021-04-30 14:14:00 +08:00
pixel 39fdc43ada 前端配置提取 让开发和上线更加简便 2021-04-26 14:33:47 +08:00
pixel acda4470bc 修复api.vue编辑未变化标题的bug 2021-04-26 11:39:00 +08:00
pixel 0fb3d16c49 修复main.js的包引用问题 2021-04-23 18:09:29 +08:00
pixel 228882d8c4 Merge branch 'develop' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev
 Conflicts:
	web/src/view/systemTools/formCreate/index.vue
2021-04-23 17:45:40 +08:00
pixel 186aa89476 将配置提取 2021-04-23 15:47:42 +08:00
奇淼(piexlmax f9296d90d4 Merge pull request #445 from flipped-aurora/gva_gormv2_dev
Gva gormv2 dev
2021-04-22 03:01:33 -05:00
奇淼(piexlmax 258c2afa32 Update config.yaml 2021-04-22 15:59:52 +08:00
奇淼(piexlmax 105adfe7e9 Merge pull request #442 from hzliangbin/patch-1
fix typo in README
2021-04-22 02:11:04 -05:00
pixel d2104fade2 修复casbin导致连接泄露问题 2021-04-22 14:54:52 +08:00
Bin Liang 739eed6a01 fix typo in README
fix some typo for better reading
2021-04-22 14:17:49 +08:00
奇淼(piexlmax bffe222e1b Merge pull request #396 from joewan/test_branch
端口统一配置
2021-04-20 04:20:12 -05:00
奇淼(piexlmax ceb5b9e4d6 Merge branch 'develop' into test_branch 2021-04-20 04:18:22 -05:00
奇淼(piexlmax e49bd514f7 Merge pull request #418 from RoseKissYou/develop
api/v1/sys_api.go api/v1/sys_menu.go api/v1/sys_user.go model/request…
2021-04-20 04:16:49 -05:00
奇淼(piexlmax 39fb8b7c5d Merge pull request #438 from songzhibin97/gva_gormv2_dev
新增定时任务封装以及配置自动清理数据库功能
2021-04-20 04:14:25 -05:00
songzhibin97 2b0a565120 新增定时任务封装以及配置自动清理数据库功能
新增
- server/config/timer.go
- server/initialize/timer.go
- server/utils/db_automation.go
- server/utils/timer/timed_task.go
修改
- server/config.yaml
- server/config/config/go
- server/global/global.go
- server/main.go
2021-04-17 14:50:44 +08:00
奇淼(piexlmax 2399c97c51 Update README.md 2021-04-16 19:08:08 +08:00
songzhibin97 eb1911232b Merge remote-tracking branch 'upstream/gva_gormv2_dev' into gva_gormv2_dev 2021-04-16 17:52:27 +08:00
pixel 0fe70c5e1c Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-04-16 10:47:18 +08:00
pixel 483da629e9 修复前端needInit报错导致的逻辑问题 2021-04-16 10:29:32 +08:00
蒋吉兆 129f4e6281 废弃七牛云配置 2021-04-14 23:19:25 +08:00
pixel 683355d773 版本号更改 2021-04-13 11:47:30 +08:00
奇淼(piexlmax cb28f6f438 Merge pull request #433 from A-Zee029/develop
fix:fail to start with docker-compose
2021-04-12 22:27:44 -05:00
奇淼(piexlmax c9f2301335 Merge pull request #432 from closetool/develop
fix: using official casbin gorm-adapter
2021-04-12 22:27:06 -05:00
huangjunwei 751a10d91e fix:fail to start with docker-compose 2021-04-12 16:03:49 +08:00
closetool 7c821bf673 fix: using official casbin gorm-adapter 2021-04-12 14:52:54 +08:00
pixel be2b584cee 修复指令绑定时效问题 修复Image组件未注册问题 2021-04-10 10:28:48 +08:00
pixel f39048fad0 清理 debugger 2021-04-10 09:51:22 +08:00
v_anxiong 4e9ce0de7e 前后端都加入了代码结构,方便学习和理解,也欢迎各位大佬进行补充,方便我这个菜鸟进行学习 2021-04-09 17:10:49 +08:00
SliverHorn 6e78abb34e Update sys_casbin.go 2021-04-08 18:14:21 +08:00
pixel ae5ec006ba 将gorm适配器调整至本地避免windows没有gcc的情况导致系统无法启动 2021-04-06 17:12:51 +08:00
pixel c9d1e424e9 更新表单生成器 2021-04-06 16:41:59 +08:00
pixel f48f39e024 Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into develop 2021-04-06 14:21:25 +08:00
奇淼(piexlmax 3dde9cfdc6 Merge pull request #426 from closetool/master
fix: casbin gorm-adapter has no sqlite3 support
2021-04-06 14:19:15 +08:00
pixel 85d6e954ae 同步swagger 2021-04-06 11:56:49 +08:00
closetool 146b0b2925 fix: casbin gorm-adapter has no sqlite3 support
Signed-off-by: closetool <c299999999@qq.com>
2021-04-04 21:42:22 +08:00
pixel 4faa807c53 增加批量删除功能 调节分页器样式 2021-04-01 17:15:24 +08:00
v_anxiong ea998db824 api/v1/sys_api.go api/v1/sys_menu.go api/v1/sys_user.go model/request/common.go 其中的参数校验代码Id改成ID,修复参数校验的bug 2021-04-01 16:45:18 +08:00
pixel 7334ad9f33 标签代码优化 字典历史bug修复 2021-03-30 14:42:22 +08:00
pixel f32d725773 Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-03-30 12:15:13 +08:00
songzhibin97 fb9bec8623 Merge remote-tracking branch 'upstream/gva_gormv2_dev' into gva_gormv2_dev 2021-03-29 16:49:32 +08:00
奇淼(piexlmax b7847e6198 Merge pull request #411 from songzhibin97/gva_gormv2_dev
#409 bug修复
2021-03-29 11:54:56 +08:00
奇淼(piexlmax 4307abf274 Merge pull request #413 from WangLeonard/gva_gormv2_dev-fix-automodelcode
修复代码生成中对gorm的重复检查
2021-03-29 11:54:21 +08:00
LeonardWang 8206e5cbad 修复代码生成中对gorm的重复检查 2021-03-25 23:35:35 +08:00
songzhibin97 73cc49448e #409 bug修复
- 修改
server/model/sys_auto_code.go
server/service/sys_auto_code.go
server/utils/file_operations.go
2021-03-24 14:12:07 +08:00
pixel a2f4d58648 紧急修复初始化会导致config配置文件错误的bug 2021-03-22 16:56:13 +08:00
蒋吉兆 5b290ef0b1 修复已知bug 2021-03-21 22:57:18 +08:00
蒋吉兆 b9a9c5d917 Merge branches 'gva_gormv2_dev' and 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-03-21 22:35:47 +08:00
奇淼(piexlmax 3112f0afe8 Merge pull request #404 from WangLeonard/gva_gormv2_dev-automodelcode
添加代码生成中route和gorm的自动注入
2021-03-21 22:33:16 +08:00
LeonardWang 0a3696ee01 添加代码生成中route和gorm的自动注入 2021-03-19 23:56:40 +08:00
joewan 03431dee58 Merge branch 'develop' into test_branch 2021-03-18 16:52:34 +08:00
奇淼(piexlmax 8f33b3de5e Update README.md 2021-03-18 14:31:28 +08:00
pixel 9e0f95ec48 清理工作流功能 2021-03-18 14:28:52 +08:00
pixel 7668e7fdde 清理工作流功能 2021-03-18 14:27:39 +08:00
pixel 0df2b3ea1c Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-03-18 12:21:30 +08:00
pixel 4f726f1eb8 修复 canshowBug 2021-03-18 12:20:20 +08:00
pixel 752e9f917e 前端优化减少体积 2021-03-18 12:19:27 +08:00
pixel a4493021e2 清理多余包 element按需加载 2021-03-18 12:19:27 +08:00
SliverHorn 13d823ec57 swagger 错误修复, swagger文档更新 2021-03-18 12:19:27 +08:00
SliverHorn a6736e6e30 修复v2.4.0的docker-compose的启动异常问题 2021-03-18 12:19:27 +08:00
蒋吉兆 9b26947849 修改form跳转出现的bug 2021-03-18 12:19:27 +08:00
奇淼(piexlmax 0af29cfcae Merge pull request #397 from songzhibin97/gva_gormv2_dev
代码自动迁移动态适配
2021-03-16 19:32:12 +08:00
songzhibin97 c63904aedf 修改动态迁移的一个小bug 2021-03-10 12:00:32 +08:00
pixel 076538a6b6 前端优化减少体积 2021-03-09 19:40:40 +08:00
pixel 8deefff08a 清理多余包 element按需加载 2021-03-09 19:40:40 +08:00
pixel 1cae92b119 修复检测是否初始化时的判断 2021-03-09 19:40:40 +08:00
songzhibin97 b5dbde8ad1 更新测试的mysql mysql配置 2021-03-09 15:17:57 +08:00
songzhibin97 45d552ac8c 代码自动迁移动态适配
修改
- server/config.yaml
- server/config/config.go
- server/config/viper.go
- server/service/sys_auto_code.go
新增
- server/config/auto_code.go
2021-03-09 14:59:20 +08:00
东邪黄药师 bdce16a582 fix error 2021-03-08 23:50:14 +08:00
东邪黄药师 7bf3294113 集中配置端口 2021-03-08 23:43:17 +08:00
SliverHorn 26dbd1446c Merge pull request #393 from SliverHorn/gva_gormv2_dev
修复v2.4.0的docker-compose的启动异常问题, swagger错误修复
2021-03-08 15:33:51 +08:00
SliverHorn 74796f3546 swagger 错误修复, swagger文档更新 2021-03-08 15:23:38 +08:00
pixel 48bb3b6452 修复检测是否初始化时的判断 2021-03-08 13:43:25 +08:00
SliverHorn c4ec7f562a 修复v2.4.0的docker-compose的启动异常问题 2021-03-08 12:53:48 +08:00
蒋吉兆 733874316a 修改form跳转出现的bug 2021-03-07 13:19:16 +08:00
pixel b5efcd251a Merge remote-tracking branch 'origin/master' 2021-03-05 20:33:58 +08:00
pixel b74ea58172 版本号更改提交 2021-03-05 20:30:02 +08:00
pixel 707dbac2ca 自动初始化中间件拦截 防止误操作无法进入初始化功能 2021-03-04 19:48:38 +08:00
pixel 184b1a903f 自动初始化整体调试完成 2021-03-04 19:38:07 +08:00
pixel 4a995a1c56 修复初始apibug 2021-03-04 16:02:17 +08:00
pixel e6768d5e17 cmd剔除 初始数据结构转移 修复初始携带apibug 2021-03-04 16:02:09 +08:00
pixel e3057c4bd9 自动初始化数据库功能后端部分完成 2021-03-04 15:57:07 +08:00
pixel 87f101a7bf 包位置调整 2021-03-02 19:53:26 +08:00
奇淼(piexlmax ab435d131c Merge pull request #387 from songzhibin97/gva_gormv2_dev
新增功能-api生成数据库并初始化回写配置
2021-03-02 19:29:34 +08:00
songzhibin97 674ae4c4a0 补充修改 2021-03-02 16:20:42 +08:00
songzhibin97 f3a84e2ca8 补充修改 2021-03-02 12:33:28 +08:00
songzhibin97 835dd15c47 订正了swagger
修改了
- server/api/v1/sys_initdb.go
- server/api/v1/sys_system.go
迁移了模型
- server/model/sys_init.go -> sysver/model/request/sys_init.go
2021-03-02 12:32:47 +08:00
pixel c983370162 Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-03-01 10:33:26 +08:00
songzhibin97 00b5024f20 新增功能-api生成数据库并初始化回写配置
修改gva initdb 判断是否已经创建的一些小问题
新增api生成数据库并初始化回写配置
修改文件:
server/cmd/gva/initdb.go
server/cmd/information/data_authorities.go
server/cmd/information/workflow.go
server/initialize/gorm
server/main.go

新增文件:
server/api/v1/sys.initdb.go
server/middleware/init.go
server/model/sys_init.go
server/service/sys_initdb.go
servcer/utils/init_db.go

迁移文件
server/cmd/gva/mysql.go->server/utils/mysql.go
2021-02-27 17:32:41 +08:00
pixel ae0af55d17 字典样式修改 2021-02-27 12:48:18 +08:00
奇淼(piexlmax f19b398c93 Merge pull request #386 from songzhibin97/gva_gormv2_dev
新增api 重启服务(非windows)
2021-02-27 12:11:36 +08:00
songzhibin97 8743b63869 Update sys_system.go 2021-02-27 12:05:24 +08:00
songzhibin97 4af1627116 新增api重启系统(支持非windows)
修改
- server/api/v1/sys_system.go
- server/router/sys_system.go
2021-02-27 12:03:28 +08:00
pixel 5d4c4d53fc 前端系统配置增加 tencent-cos aliyun-oss 配置 2021-02-27 10:59:53 +08:00
pixel 62bc8092e2 对合并代码进行微调 2021-02-27 10:48:51 +08:00
pixel 4cea6f9f5d 更新了某些文本 让提示更加友好
根据scuxiatian提供的方案 修改了workflow前端组件的一些bug
2021-02-27 10:29:28 +08:00
奇淼(piexlmax decee13bf1 Merge pull request #384 from lauyang/develop
增加阿里云OSS
2021-02-27 10:26:15 +08:00
奇淼(piexlmax 60bfe48307 Merge branch 'develop' into develop 2021-02-27 10:26:00 +08:00
奇淼(piexlmax bca54282c9 Merge pull request #381 from MUHM/develop
为OSS增加腾讯云对象存储支持
2021-02-27 10:23:09 +08:00
pixel db933cecb6 更新了某些文本 让提示更加友好
根据scuxiatian提供的方案 修改了workflow前端组件的一些bug
2021-02-26 12:14:28 +08:00
yang.liu06 3f06c8ba7d add aliyun oss support 2021-02-24 22:07:50 +08:00
pixel f7fb34ec16 Merge remote-tracking branch 'origin/master' 2021-02-24 09:54:03 +08:00
pixel b691d53523 增加快速设置父级菜单功能 修复本地上传文件用户使用头像存在问题的bug 2021-02-24 09:53:45 +08:00
奇淼(piexlmax 5396aa40cb Update FUNDING.yml 2021-02-23 15:50:10 +08:00
pixel 1a43b89674 Merge remote-tracking branch 'origin/master' 2021-02-23 15:00:22 +08:00
奇淼(piexlmax fb570acf7c Merge pull request #376 from xiaoweihong/patch-1
NavigationDuplicated error
2021-02-23 15:00:03 +08:00
pixel 8c5d0ad64b Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin 2021-02-23 14:48:47 +08:00
pixel 74a92b08d8 更改 捐赠地址 2021-02-23 14:47:39 +08:00
klausY 3e6a3d97bb 提供一二级路由模板 2021-02-23 14:43:12 +08:00
pixel b3e4666108 Merge remote-tracking branch 'origin/master' 2021-02-23 11:00:56 +08:00
pixel a344f2bdb7 github.com/shirou/gopsutil 包版本修改为 v3.21.1 2021-02-23 10:39:03 +08:00
MUHM 4b6eb80ddb add TencentCOS support to OSS 2021-02-22 16:37:00 +08:00
奇淼(piexlmax 5226a2a26f Update FUNDING.yml 2021-02-20 11:00:04 +08:00
奇淼(piexlmax e8bb532cdc Update FUNDING.yml 2021-02-20 10:59:11 +08:00
pixel 171be652eb excel导入导出功能合并并且细节修改完成 2021-02-19 15:45:55 +08:00
xiaowei c410125c8f NavigationDuplicated error
NavigationDuplicated: Avoided redundant navigation to current location
![](https://img-blog.csdnimg.cn/20200901093646588.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjQwMjg0NQ==,size_16,color_FFFFFF,t_70)
2021-02-19 13:00:07 +08:00
pixel 0f6613c4a1 Merge branch 'develop' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev
 Conflicts:
	web/package.json
2021-02-14 21:41:34 +08:00
奇淼(piexlmax d278344dd4 Merge pull request #370 from hwb2017/develop-feature-excel
增加Excel导入导出示例功能
2021-02-14 21:40:04 +08:00
pixel c47b3eee2c 修复预览代码和生成代码均成为预览的问题 2021-02-14 12:54:17 +08:00
pixel 162b8df569 修复路径分割不同系统分隔符不同导致的panic 2021-02-14 12:53:47 +08:00
pixel 55e2109091 代码自动化生成支持预览功能 2021-02-13 16:24:38 +08:00
pixel 11efbe7699 initdb默认string长度改为191 2021-02-13 16:22:50 +08:00
pixel 329d094e2a Merge branch 'master' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-02-13 14:52:33 +08:00
奇淼(piexlmax 414766001b Merge pull request #374 from songzhibin97/gva_gormv2_dev
提供自动化代码预览功能
2021-02-13 14:51:28 +08:00
songzhibin97 e05e16dce4 抽出重复的内容优化PreviewTemp和CreateTemp 2021-02-11 19:33:11 +08:00
songzhibin97 3549f4cf1f 自动生成代码新增预览接口 2021-02-11 19:00:06 +08:00
pixel bedbd3c872 修复了子路由模式下两个keepalive相互切换 keepalive失效的问题 2021-02-09 19:25:56 +08:00
pixel 296110f969 修复了子路由模式下两个keepalive相互切换 keepalive失效的问题 2021-02-09 19:25:14 +08:00
hwb2017 f60b0f1750 增加Excel导入导出示例功能 2021-01-28 00:48:47 +08:00
SliverHorn 6ad13c5930 添加基础路由 返回错误后,仍然执行创建创建代码bug, 修复bug, #367 2021-01-26 17:12:51 +08:00
SliverHorn 6a1b53e3d4 Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-01-26 17:10:07 +08:00
蒋吉兆 21ef7bdcc0 修改版本号 2021-01-24 17:44:00 +08:00
蒋吉兆 718574cdf3 修复了登陆时首页蓝点未点亮的bug 2021-01-24 17:36:38 +08:00
SliverHorn 7baa2c84a3 Merge branch 'gva_gormv2_dev' of https://github.com/flipped-aurora/gin-vue-admin into gva_gormv2_dev 2021-01-13 12:22:58 +08:00
755 changed files with 38645 additions and 44894 deletions
-88
View File
@@ -1,88 +0,0 @@
#! /bin/bash
rm -f ./config.yaml
# 生成config.yaml文件, 用于docker-compose的使用
touch ./config.yaml
filename="./config.yaml"
cat>"${filename}"<<EOF
# Gin-Vue-Admin Global Configuration
# jwt configuration
jwt:
signing-key: 'qmPlus'
expires-time: 604800
buffer-time: 86400
# zap logger configuration
zap:
level: 'info'
format: 'console'
prefix: '[GIN-VUE-ADMIN]'
director: 'log'
link-name: 'latest_log'
show-line: true
encode-level: 'LowercaseColorLevelEncoder'
stacktrace-key: 'stacktrace'
log-in-console: true
# redis configuration
redis:
db: 0
addr: '177.7.0.14:6379'
password: ''
# email configuration
email:
to: 'xxx@qq.com'
port: 465
from: 'xxx@163.com'
host: 'smtp.163.com'
is-ssl: true
secret: 'xxx'
nickname: 'test'
# casbin configuration
casbin:
model-path: './resource/rbac_model.conf'
# system configuration
system:
env: 'public' # Change to "develop" to skip authentication for development mode
addr: 8888
db-type: 'mysql'
oss-type: 'local'
use-multipoint: false
# captcha configuration
captcha:
key-long: 6
img-width: 240
img-height: 80
# mysql connect configuration
mysql:
path: '177.7.0.13:3306'
config: 'charset=utf8mb4&parseTime=True&loc=Local'
db-name: 'qmPlus'
username: 'root'
password: 'Aa@6447985'
max-idle-conns: 10
max-open-conns: 100
log-mode: false
log-zap: ""
# local configuration
local:
path: 'uploads/file'
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
qiniu:
zone: 'ZoneHuadong'
bucket: 'qm-plus-img'
img-path: 'http://qmplusimg.henrongyi.top'
use-https: false
access-key: '25j8dYBZ2wuiy0yhwShytjZDTX662b8xiFguwxzZ'
secret-key: 'pgdbqEsf7ooZh7W3xokP833h3dZ_VecFXPDeG5JY'
use-cdn-domains: false
EOF
-119
View File
@@ -1,119 +0,0 @@
# Created by .ignore support plugin (hsz.mobi)
### Node template
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
# Stores VSCode versions used for testing VSCode extensions
.vscode-test
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.pnp.*
**/node_modules
+1 -1
View File
@@ -2,7 +2,7 @@
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
open_collective: gin-vue-admin
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-70
View File
@@ -1,70 +0,0 @@
---
name: issues模板
about: 请严格按照要求进行提交issues! 如果未能按照要求,我们将会close您的issues,敬请谅解!
---
<!-- 在提交问题之前,请先回答这些问题。谢谢! -->
### 1. 您使用的是哪个版本的`Go`和系统类型/架构 ?
<!--
请从您的终端粘贴命令 `go version` 的输出。
期望看到像: `go version go1.14.4 darwin/amd64`
-->
### 2. 您使用的是哪个版本的 `Nodejs` 和 `npm` 或 `cnpm` ?
<!--
请从您的终端粘贴命令 `node -v` 的输出。
期望看到像: `v12.16.1`
-->
<!--
请从您的终端粘贴命令 `npm -v` 的输出。
期望看到像: `6.13.4`
-->
<!--
请从您的终端粘贴命令 `cnpm -v` 的输出。
期望看到的像: `
cnpm@6.1.1 (/usr/local/lib/node_modules/cnpm/lib/parse_argv.js)
npm@6.14.2 (/usr/local/lib/node_modules/cnpm/node_modules/npm/lib/npm.js)
node@12.16.1 (/usr/local/bin/node)
npminstall@3.27.0 (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/index.js)
prefix=/usr/local
darwin x64 19.6.0
registry=https://r.npm.taobao.org
`
-->
### 3. 您使用的是哪个版本的 `gin-vue-admin` ?
<!--
您如果克隆的是master就写master,
如果是在Releases中下载的zip/tar.gz对应的tag版本,
如:`v2.3.0`
-->
### 4. 可以在master版本中复现此问题吗 ?
### 5. 您做了什么 ?
<!--
如果可能,请提供最短代码的副本以重现该错误。
一个完整的可运行程序是最好的。
-->
### 6. 您期望看到什么 ?
### 7. 您看到了什么 ?
### 8. 错误堆栈或者SQL打印
+60
View File
@@ -0,0 +1,60 @@
name: 🐛 Bug report
description: Report a bug to help us improve Gin-Vue-Admin
title: "[Bug]: "
labels: [bug]
assignees:
- piexlmax
- songzhibin97
- SliverHorn
- bypanghu
body:
- type: input
id: gva
attributes:
label: gin-vue-admin 版本
description: 请输入您当前使用的项目版本?
placeholder: 2.4.5Beta
validations:
required: true
- type: input
id: node
attributes:
label: Node 版本
description: 请输入您当前使用的NODE版本?
placeholder: v14.16.0
validations:
required: true
- type: input
id: golang
attributes:
label: Golang 版本
description: 请输入您当前使用的GOLANG版本?
placeholder: go 1.16
validations:
required: true
- type: dropdown
id: reappearance
attributes:
label: 是否依旧存在
description: 是否可以在master分支复现此bug?
options:
- 可以
- 不可以
- 未测试
validations:
required: true
- type: textarea
id: desc
attributes:
label: bug描述
description: 请简要描述bug以及复现过程.
placeholder: |
1. 首先...
2. 然后...
validations:
required: true
- type: textarea
id: advise
attributes:
label: 修改建议
description: 您有好的建议或者修改方案可以提供给我们。
+5
View File
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Document
url: https://www.gin-vue-admin.com
about: If you have any questions about the use, you can check our official documents first
@@ -0,0 +1,22 @@
name: 🚀 Feature request
description: Suggest an idea for Gin-Vue-Admin
title: "[Feature]: "
labels: [feature]
assignees:
- piexlmax
body:
- type: textarea
id: desc
attributes:
label: 功能描述以及必要性描述
description: 您觉得此新功能会为框架带来什么便利.
placeholder: |
1. 首先...
2. 然后...
validations:
required: true
- type: textarea
id: advise
attributes:
label: 建议和方案
description: 您有好的建议或者修改方案可以提供给我们。
+3 -3
View File
@@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
node-version: [14.16.0]
steps:
- name: Check out branch
uses: actions/checkout@v2
@@ -40,10 +40,10 @@ jobs:
name: Backend build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.14
- name: Set up Go 1.6
uses: actions/setup-go@v1
with:
go-version: 1.14
go-version: 1.16
id: go
- name: Check out branch
+55
View File
@@ -0,0 +1,55 @@
name: devops-test
on:
push:
branches: [test]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16.x']
go-version: ['1.16']
steps:
- name: Check out branch
uses: actions/checkout@v2
- name: Sed Config
env:
PROD: ${{ secrets.PROD }}
TESTING: ${{ secrets.TESTING }}
shell: bash
run: |
git branch
ls -l
sed -i "s/${PROD}/${TESTING}/g" web/.env.production
sed -i 's/${basePath}:${basePort}/${basePath}/g' web/src/view/systemTools/formCreate/index.vue
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.1.2
with:
node-version: ${{ matrix.node-version }}
- name: Build-Node
run: |
cd web/ && yarn install && yarn run build
- name: Use Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Build-go
run: |
cd server/ && go mod tidy && go build && mkdir ../web/ser && mv server ../web/ser/ && cd ../web/ser/ && ls -s
- name: restart
env:
KEY: ${{ secrets.KEY }}
HOST: ${{ secrets.HOST }}
USER: ${{ secrets.USER }}
PROT: ${{ secrets.PROT }}
MKDIRTEST: ${{ secrets.MKDIRTEST }}
run: |
mkdir -p ~/.ssh/ && echo "$KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
scp -P ${PROT} -o StrictHostKeyChecking=no -r web/dist/* ${USER}@${HOST}:${MKDIRTEST}dist/
scp -P ${PROT} -o StrictHostKeyChecking=no -r web/ser/* ${USER}@${HOST}:${MKDIRTEST}
ssh -p ${PROT} -o StrictHostKeyChecking=no ${USER}@${HOST} "cd ${MKDIRTEST}resource/ && rm -rf ${MKDIRTEST}resource/*"
scp -P ${PROT} -o StrictHostKeyChecking=no -r server/resource/* ${USER}@${HOST}:${MKDIRTEST}resource/
ssh -p ${PROT} -o StrictHostKeyChecking=no ${USER}@${HOST} "cd ${MKDIRTEST} && bash restart.sh > /dev/null 2>&1 &"
+52
View File
@@ -0,0 +1,52 @@
name: devops
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16.x']
go-version: ['1.16']
steps:
- name: Check out branch
uses: actions/checkout@v2
- name: Sed Config
shell: bash
run: |
git branch
ls -l
sed -i 's/${basePath}:${basePort}/${basePath}/g' web/src/view/systemTools/formCreate/index.vue
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2.1.2
with:
node-version: ${{ matrix.node-version }}
- name: Build-Node
run: |
cd web/ && yarn install && yarn run build
- name: Use Go ${{ matrix.go-version }}
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Build-go
run: |
cd server/ && go mod tidy && go build && mkdir ../web/ser && mv server ../web/ser/ && cd ../web/ser/ && ls -s
- name: restart
env:
KEY: ${{ secrets.KEY }}
HOST: ${{ secrets.HOST }}
USER: ${{ secrets.USER }}
PROT: ${{ secrets.PROT }}
MKDIR: ${{ secrets.MKDIR }}
run: |
mkdir -p ~/.ssh/ && echo "$KEY" > ~/.ssh/id_rsa && chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
scp -P ${PROT} -o StrictHostKeyChecking=no -r web/dist/* ${USER}@${HOST}:${MKDIR}dist/
scp -P ${PROT} -o StrictHostKeyChecking=no -r web/ser/* ${USER}@${HOST}:${MKDIR}
ssh -p ${PROT} -o StrictHostKeyChecking=no ${USER}@${HOST} "cd ${MKDIR}resource/ && rm -rf ${MKDIR}resource/*"
scp -P ${PROT} -o StrictHostKeyChecking=no -r server/resource/* ${USER}@${HOST}:${MKDIR}resource/
ssh -p ${PROT} -o StrictHostKeyChecking=no ${USER}@${HOST} "cd ${MKDIR} && bash restart.sh > /dev/null 2>&1 &"
+29
View File
@@ -0,0 +1,29 @@
name: Docker-CICD
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out branch
uses: actions/checkout@v2
- name: Login to Aliyun Registry
uses: docker/login-action@v1
with:
registry: ${{ secrets.ALIYUN_REGISTRY }}
username: ${{ secrets.ALIYUN_DOCKERHUB_USER }}
password: ${{ secrets.ALIYUN_DOCKERHUB_PASSWORD }}
- name: Sed Config
shell: bash
run: |
sed -i 's#./entrypoint.sh"#./entrypoint.sh","actions"#g' Dockerfile
sed -i "s#COPY build/ /usr/share/nginx/html/#COPY . /opt/gva#g" Dockerfile
sed -i 16c"\ && cd /opt/gva/server/ && go mod tidy && cd /opt/gva/web/ && yarn" Dockerfile
sed -i "s#open: true#open: false#g" web/vite.config.js
make images TAGS_OPT="latest"
docker push registry.cn-hangzhou.aliyuncs.com/gva/web:latest
docker push registry.cn-hangzhou.aliyuncs.com/gva/server:latest
docker push registry.cn-hangzhou.aliyuncs.com/gva/all:latest
+114
View File
@@ -0,0 +1,114 @@
name: GIN-VUE-ADMIN Docker Build
on:
push:
branches: [stopstopstop]
#workflow_dispatch:
# inputs:
# webtag:
# description: 'Set web tag, Default latest'
# required: true
# default: "latest"
# servertag:
# description: 'Set server tag, Default latest'
# required: true
# default: "latest"
jobs:
GIN_VUE_ADMIN_WEB:
name: GIN VUE ADMIN WEB
runs-on: ubuntu-latest
steps:
- name: Private Actions Checkout
uses: actions/checkout@v2.3.4
- name: Docker Setup QEMU
uses: docker/setup-qemu-action@v1.2.0
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.6.0
- name: Docker Login
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Login in Aliyun
uses: docker/login-action@v1.10.0
with:
registry: ${{ secrets.DOCKERHUB_REGISTRY_ALIYUN }}
username: ${{ secrets.DOCKERHUB_ACCOUNT_ALIYUN }}
password: ${{ secrets.DOCKERHUB_PASSWORD_ALIYUN }}
- name: Build and push Docker images
uses: docker/build-push-action@v2.7.0
with:
context: .
# 这里是适配 arm64 ,主要看你们的程序是否支持 arm64
platforms: linux/amd64,linux/arm64
file: web/Dockerfile
push: true
# 这里是给docker 打标签,默认不上传 latest
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/web:${{ github.event.inputs.webtag }}
${{ secrets.DOCKERHUB_REGISTRY_ALIYUN }}/${{ secrets.DOCKERHUB_USERNAME_ALIYUN }}web:${{ github.event.inputs.webtag }}
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/web:${{ github.event.inputs.webtag }}.cache
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/web:${{ github.event.inputs.webtag }}.cache,mode=max
# 漏洞扫描
- name: Scan for vulnerabilities
uses: crazy-max/ghaction-container-scan@v1
with:
image: ${{ secrets.DOCKERHUB_USERNAME }}/web:${{ github.event.inputs.webtag }}
dockerfile: web/Dockerfile
# 更新 docker 描述页面
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ secrets.DOCKERHUB_USERNAME }}/web
GIN_VUE_ADMIN_SERVER:
name: GIN VUE ADMIN SERVER
runs-on: ubuntu-latest
steps:
- name: Private Actions Checkout
uses: actions/checkout@v2.3.4
- name: Docker Setup QEMU
uses: docker/setup-qemu-action@v1.2.0
- name: Docker Setup Buildx
uses: docker/setup-buildx-action@v1.6.0
- name: Docker Login
uses: docker/login-action@v1.10.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker Login in Aliyun
uses: docker/login-action@v1.10.0
with:
registry: ${{ secrets.DOCKERHUB_REGISTRY_ALIYUN }}
username: ${{ secrets.DOCKERHUB_ACCOUNT_ALIYUN }}
password: ${{ secrets.DOCKERHUB_PASSWORD_ALIYUN }}
- name: Build and push Docker images
uses: docker/build-push-action@v2.7.0
with:
context: .
# 这里是适配 arm64 ,主要看你们的程序是否支持 arm64
platforms: linux/amd64,linux/arm64
file: server/Dockerfile
push: true
# 这里是给docker 打标签,默认不上传 latest
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/server:${{ github.event.inputs.servertag }}
${{ secrets.DOCKERHUB_REGISTRY_ALIYUN }}/${{ secrets.DOCKERHUB_USERNAME_ALIYUN }}server:${{ github.event.inputs.servertag }}
cache-from: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/server:${{ github.event.inputs.servertag }}.cache
cache-to: type=registry,ref=${{ secrets.DOCKERHUB_USERNAME }}/server:${{ github.event.inputs.servertag }}.cache,mode=max
# 漏洞扫描
- name: Scan for vulnerabilities
uses: crazy-max/ghaction-container-scan@v1
with:
image: ${{ secrets.DOCKERHUB_USERNAME }}/server:${{ github.event.inputs.servertag }}
dockerfile: server/Dockerfile
# 更新 docker 描述页面
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
repository: ${{ secrets.DOCKERHUB_USERNAME }}/server
-1
View File
@@ -22,7 +22,6 @@ yarn-error.log*
*.sln
*.sw?
go.sum
/server/log/
/server/gva
/server/latest_log
+17 -40
View File
@@ -1,41 +1,18 @@
FROM golang:alpine as builder
RUN apk add --update --no-cache yarn make g++
RUN yarn global add cross-env node-sass
ENV GOPROXY=https://goproxy.cn,https://goproxy.io,direct \
GO111MODULE=on \
CGO_ENABLED=1
WORKDIR /go/src/gin-vue-admin
RUN go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct
COPY server/ ./
RUN go env && go list && go build -v -a -ldflags "-extldflags \"-static\" " -o gvadmin .
WORKDIR /web
COPY web/ ./
RUN yarn install && yarn run build
FROM nginx:alpine
LABEL MAINTAINER="rikugun"
RUN apk add --no-cache gettext tzdata && \
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
date && \
apk del tzdata
COPY docker/etc/nginx/nginx.conf.tpl /etc/nginx/nginx.conf.tpl
WORKDIR /app
#copy web
COPY --from=builder /web/dist/ /var/www/
#copy go app
COPY --from=builder /go/src/gin-vue-admin/gvadmin ./
COPY --from=builder /go/src/gin-vue-admin/db.db ./
COPY --from=builder /go/src/gin-vue-admin/config.yaml ./
COPY --from=builder /go/src/gin-vue-admin/resource ./resource
COPY docker/docker-start.sh ./
ENV API_SERVER="http://localhost:8888/"
FROM centos:7
WORKDIR /opt
ENV LANG=en_US.utf8
COPY entrypoint.sh .
COPY build/ /usr/share/nginx/html/
COPY server/config.yaml /usr/share/nginx/html/config.yaml
COPY web/.docker-compose/nginx/conf.d/nginx.conf /etc/nginx/conf.d/nginx.conf
RUN set -ex \
&& echo "LANG=en_US.utf8" > /etc/locale.conf \
&& echo "net.core.somaxconn = 1024" >> /etc/sysctl.conf \
&& echo "vm.overcommit_memory = 1" >> /etc/sysctl.conf \
&& yum -y install yum -y install *epel* \
&& yum -y localinstall http://mirrors.ustc.edu.cn/mysql-repo/mysql57-community-release-el7.rpm \
&& yum -y install mysql-community-server git redis nginx go npm --nogpgcheck && chmod +x ./entrypoint.sh \
&& npm install -g yarn && go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct \
&& echo "start" > /dev/null
EXPOSE 80
ENTRYPOINT ["./docker-start.sh"]
ENTRYPOINT ["./entrypoint.sh"]
+61
View File
@@ -0,0 +1,61 @@
SHELL = /bin/bash
CONFIG_FILE = config.yaml
PROJECT_NAME = github.com/flipped-aurora/gin-vue-admin/server
#SCRIPT_DIR = $(shell pwd)/etc/script
BUILD_IMAGE_SERVER = golang:1.16
BUILD_IMAGE_WEB = node:16
IMAGE_NAME = gva
REPOSITORY = registry.cn-hangzhou.aliyuncs.com/${IMAGE_NAME}
ifeq ($(TAGS_OPT),)
TAGS_OPT = 2.5.0b
else
endif
#容器环境前后端共同打包
build: build-web build-server
docker run --name build-local --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE_SERVER} make build-local
#容器环境打包前端
build-web:
docker run --name build-web-local --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE_WEB} make build-web-local
#容器环境打包后端
build-server:
docker run --name build-server-local --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE_SERVER} make build-server-local
#构建web镜像
build-image-web:
@cd web/ && docker build -t ${REPOSITORY}/web:${TAGS_OPT} .
#构建server镜像
build-image-server:
@cd server/ && docker build -t ${REPOSITORY}/server:${TAGS_OPT} .
#本地环境打包前后端
build-local:
if [ -d "build" ];then rm -rf build; else echo "OK!"; fi \
&& if [ -f "/.dockerenv" ];then echo "OK!"; else make build-web-local && make build-server-local; fi \
&& mkdir build && cp -r web/dist build/ && cp server/server build/ && cp -r server/resource build/resource
#本地环境打包前端
build-web-local:
@cd web/ && if [ -d "dist" ];then rm -rf dist; else echo "OK!"; fi \
&& yarn config set registry http://mirrors.cloud.tencent.com/npm/ \
&& yarn install && yarn build
#本地环境打包后端
build-server-local:
@cd server/ && if [ -f "server" ];then rm -rf server; else echo "OK!"; fi \
&& go env -w GO111MODULE=on && go env -w GOPROXY=https://goproxy.cn,direct \
&& go env -w CGO_ENABLED=0 && go env && go mod tidy \
&& go build -ldflags "-B 0x$(shell head -c20 /dev/urandom|od -An -tx1|tr -d ' \n') -X main.Version=${TAGS_OPT}" -v
#打包前后端二合一镜像
image: build
docker build -t ${REPOSITORY}/all-one:${TAGS_OPT} .
#尝鲜版
images: build build-image-web build-image-server
docker build -t ${REPOSITORY}/all:${TAGS_OPT} .
+114 -173
View File
@@ -3,36 +3,43 @@
<img src="http://qmplusimg.henrongyi.top/gvalogo.jpg" width=300" height="300" />
</div>
<div align=center>
<img src="https://img.shields.io/badge/golang-1.12-blue"/>
<img src="https://img.shields.io/badge/gin-1.4.0-lightBlue"/>
<img src="https://img.shields.io/badge/vue-2.6.10-brightgreen"/>
<img src="https://img.shields.io/badge/element--ui-2.12.0-green"/>
<img src="https://img.shields.io/badge/gorm-1.9.12-red"/>
<img src="https://img.shields.io/badge/golang-1.16-blue"/>
<img src="https://img.shields.io/badge/gin-1.7.0-lightBlue"/>
<img src="https://img.shields.io/badge/vue-3.2.25-brightgreen"/>
<img src="https://img.shields.io/badge/element--plus-2.0.1-green"/>
<img src="https://img.shields.io/badge/gorm-1.22.5-red"/>
</div>
English | [简体中文](./README.md)
[gitee](https://gitee.com/pixelmax/gin-vue-admin): https://gitee.com/pixelmax/gin-vue-admin
[github](https://github.com/flipped-aurora/gin-vue-admin): https://github.com/flipped-aurora/gin-vue-admin
[Vue3 version branch address](https://github.com/flipped-aurora/gin-vue-admin/tree/vue3Develop): https://github.com/flipped-aurora/gin-vue-admin/tree/vue3Develop
[Approval flow branch](https://github.com/flipped-aurora/gin-vue-admin/tree/gva_workflow): https://github.com/flipped-aurora/gin-vue-admin/tree/gva_workflow
# Project Guidelines
[Online Documentation](https://www.gin-vue-admin.com/) : https://www.gin-vue-admin.com/
[From the environment to the deployment of teaching videos](https://www.bilibili.com/video/BV1fV411y7dT)
[Development Steps](https://www.gin-vue-admin.com/docs/help) (Contributor: <a href="https://github.com/LLemonGreen">LLemonGreen</a> And <a href="https://github.com/fkk0509">Fann</a>)
- Web UI Framework:[element-ui](https://github.com/ElemeFE/element)
- Server Framework:[gin](https://github.com/gin-gonic/gin)
## 1. Basic Introduction
### 1.1 Project Introduction
[Online Demo](http://demo.gin-vue-admin.com/)
> Gin-vue-admin is a backstage management system based on [vue](https://vuejs.org) and [gin](https://gin-gonic.com), which separates the front and rear of the full stack. It integrates jwt authentication, dynamic routing, dynamic menu, casbin authentication, form generator, code generator and other functions. It provides a variety of sample files, allowing you to focus more time on business development.
[Online Demo](http://demo.gin-vue-admin.com): http://demo.gin-vue-admin.com
username:admin
password:123456
> Gin-vue-admin is a full-stack (frontend and backend separation) framework designed for management system.
> It integrates multiple functions, such as JWT authentication, dynamic routing, dynamic menu, casbin authentication, form generator, code generator, etc. So that you can focus more time on your business Requirements.
### 1.2 Contributing Guide
Hi! Thank you for choosing gin-vue-admin.
@@ -40,7 +47,6 @@ Gin-vue-admin is a full-stack (frontend and backend separation) framework for de
We are excited that you are interested in contributing to gin-vue-admin. Before submitting your contribution though, please make sure to take a moment and read through the following guidelines.
### 1.2 Contributing Guide
#### 1.2.1 Issue Guidelines
- Issues are exclusively for bug reports, feature requests and design-related topics. Other questions may be closed directly. If any questions come up when you are using Element, please hit [Gitter](https://gitter.im/element-en/Lobby) for help.
@@ -72,81 +78,34 @@ We are excited that you are interested in contributing to gin-vue-admin. Before
- node version > v8.6.0
- golang version >= v1.14
- IDE recommendation: Goland
- We recommend you to apply for your own cloud service in QINIU. Replace the public key, private key, warehouse name and default url address with your own, so as not to mess up the test database.
- initialization project: different versions of the database are not initialized. See synonyms at initialization https://www.gin-vue-admin.com/docs/first
- Replace the Qiniuyun public key, private key, warehouse name and default url address in the project to avoid data confusion in the test file.
```
> Use docker-compose to experience this project
- Installation docker-compose [Official document](https://docs.docker.com/compose/install/)
- ```shell script
# Install on Linux
# 1.1 Run this command to download the current stable version of Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# 1.2 Apply executable permissions to binary files
sudo chmod +x /usr/local/bin/docker-compose
```
- ```shell script
# Use Python's pip installation
pip3 install docker-compose -i https://pypi.tuna.tsinghua.edu.cn/simple
```
- Use Docker Desktop
- Windows: https://hub.docker.com/editions/community/docker-ce-desktop-windows
- Mac: https://hub.docker.com/editions/community/docker-ce-desktop-mac/
### 2.1 server project
- Use git to clone this project
- ```git
git clone https://github.com/flipped-aurora/gin-vue-admin.git
```
- Use docker-compose up to start the startup project with one click
- ```shell script
# Use docker-compose to start four containers
docker-compose up
# If you modify some configuration options, you can use this command to repackage the image
docker-compose up --build
# Use docker-compose to start in the background
docker-compose up -d
```
- Web project preview [http://127.0.0.1:8000](http://127.0.0.1:8000)
- swagger APIs [http://127.0.0.1:8888/swagger/index.html](http://127.0.0.1:8888/swagger/index.html)
- If the internal ip of the server's 177.7.0.12 container is occupied, the place to be modified is
- Replace 177.7.0.12 on line 39 of [docker-compose.yaml](./docker-compose.yaml) with the ip you want
- Replace 177.7.0.12 in line 20 of [.docker-compose/nginx/conf.d/my.conf](./.docker-compose/nginx/conf.d/my.conf) with the ip you want
- docker-compose uses a custom docker network
- ```dockerfile
networks:
network:
ipam:
driver: default
config:
- subnet: '177.7.0.0/16'
```
- Subnet address, the default gateway is 177.7.0.1 (docker-compose V2 needs to write, V3 does not need),For specific information, see the [official document](https://docs.docker.com/compose/compose-file/#ipv4_address-ipv6_address)
- The default network name is gin-vue-admin_network, and the default is bridge mode
- If the subnet is modified, the ipv4_address of each service needs to be modified, and the ip of the server on line 20 of [.docker-compose/nginx/conf.d/my.conf](.docker-compose/nginx/conf.d/my.conf) also needs to be modified
> <font color=red>**Use docker-compose to deploy this project need attention**</font>
- For mysql database, please use a local database installed on the server disk.
- Avoid using mysql in the docker container, there may be write problems, io is lower than the host machine, docker's persistence mechanism problem
- [init.sql](.docker-compose/docker-entrypoint-initdb.d/init.sql) is for docker-compose ==experience this project==, prohibit the use of [init.sql](.docker-compose/docker-entrypoint-initdb.d/init.sql) to initialize project data, Database initialization[Please use this method](https://www.gin-vue-admin.com/docs/help#step1%EF%BC%9A%E6%95%B0%E6%8D%AE%E5%BA%93%E5%88%9D%E5%A7%8B%E5%8C%96)
- Use [init.sql](.docker-compose/docker-entrypoint-initdb.d/init.sql) to initialize all problems, please bear it yourself, and have nothing to do with this project
- When deploying using docker-compose of this project,Please modify the [nginx configuration](.docker-compose/nginx/conf.d/my.conf), mysql configuration, networks configuration, redis configuration corresponding to [docker-compose.yaml](./docker-compose.yaml), and make changes as needed.
### 2.1 Web
use `Goland` And other editing tools,open server catalogue,You can't open it. `gin-vue-admin` root directory
```bash
# clone the project
git clone https://github.com/piexlmax/gin-vue-admin.git
git clone https://github.com/flipped-aurora/gin-vue-admin.git
# open server catalogue
cd server
# use go mod And install the go dependency package
go generate
# Compile
go build -o server main.go (windows the compile command is go build -o server.exe main.go )
# Run binary
./server (windows The run command is server.exe)
```
### 2.1 web project
```bash
# enter the project directory
cd web
@@ -169,47 +128,6 @@ go list (go mod tidy)
go build
```
> Zap log library usage guide && configuration guide
The configuration of the Zap log library selects zap under [config.yaml](./server/config.yaml)
```yaml
# zap logger configuration
zap:
level: 'debug'
format: 'console'
prefix: '[GIN-VUE-ADMIN]'
director: 'log'
link_name: 'latest_log'
show_line: true
encode_level: 'LowercaseColorLevelEncoder'
stacktrace_key: 'stacktrace'
log_in_console: true
```
| Configuration Name | Type Of Configuration | Description |
| ------------------ | --------------------- | ------------------------------------------------------------ |
| level | string | For a detailed description of the level mode, please see the official [zap documentation](https://pkg.go.dev/go.uber.org/zap?tab=doc#pkg-constants) <br />info: info mode, stack information without errors, only output information<br />debug: debug mode, stack details with errors<br />warn:warn mode<br />error: error mode, stack details with error<br />dpanic: dpanic mode<br />panic: panic mode<br />fatal: fatal mode<br /> |
| format | string | console: Output log in console format<br />json: json format output log |
| prefix | string | Log prefix |
| director | string | The folder to store the log can be modified, no need to create it manually |
| link_name | string | [A soft connection file](https://baike.baidu.com/item/%E8%BD%AF%E9%93%BE%E6%8E%A5) of link_name will be generated in the server directory, and the link is the latest log file of the director configuration item |
| show_line | bool | Display the line number, the default is true, it is not recommended to modify |
| encode_level | string | LowercaseLevelEncoder: lowercase<br /> LowercaseColorLevelEncoder: lowercase with color<br />CapitalLevelEncoder: uppercase<br />CapitalColorLevelEncoder: uppercase with color |
| stacktrace_key | string | The name of the stack, that is, the key of josn when outputting the log in json format |
| log_in_console | bool | Whether to output to the console, the default is true |
- Development environment || Debug environment configuration recommendations
- `level:debug`
- `format:console`
- `encode_level:LowercaseColorLevelEncoder`或者`encode_leve:CapitalColorLevelEncoder`
- Deployment environment configuration recommendations
- `level:error`
- `format:json`
- `encode_level: LowercaseLevelEncoder `或者 `encode_level:CapitalLevelEncoder`
- `log_in_console: false`
- <font color=red>Suggestions are only suggestions, you can proceed according to your own needs, and suggestions are for reference only</font>
### 2.3 API docs auto-generation using swagger
#### 2.3.1 install swagger
@@ -221,19 +139,20 @@ go get -u github.com/swaggo/swag/cmd/swag
##### (2) In mainland China
In mainland China, access to go.org/x is prohibited,we recommend [goproxy.io](https://goproxy.io/zh/)
In mainland China, access to go.org/x is prohibited,we recommend [goproxy.io](https://goproxy.io/zh/) or [goproxy.cn](https://goproxy.cn)
````bash
If you are using Go version 1.13 and above (recommended)
# Enable Go Modules function
# If you are using a version of Go 1.13 - 1.15 Need to set up manually GO111MODULE=on, The opening mode is as follows, If your Go version is 1.16 ~ Latest edition You can ignore the following step one
# Step one、Enable Go Modules Function
go env -w GO111MODULE=on
# Configure GOPROXY environment variables
go env -w GOPROXY=https://goproxy.io,direct
If you are using Go version 1.12 and below
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io
# Step two、Configuration GOPROXY Environment variable
go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct
# Use the following command to download swag
# If you dislike trouble,You can use the go generate Automatically execute code before compilation, But this can't be used command line terminal of `Goland` or `Vscode`
cd server
go generate -run "go env -w .*?"
# 使用如下命令下载swag
go get -u github.com/swaggo/swag/cmd/swag
````
@@ -243,18 +162,19 @@ go get -u github.com/swaggo/swag/cmd/swag
cd server
swag init
````
After executing the above command,`docs` will show in `server/`,then open your browser, jump into `http://localhost:8888/swagger/index.html` to see the swagger APIs.
> After executing the above command,server directory will appear in the docs folder `docs.go`, `swagger.json`, `swagger.yaml` Three file updates,After starting the go service, type in the browser [http://localhost:8888/swagger/index.html](http://localhost:8888/swagger/index.html) You can view swagger document
## 3. Technical selection
- Frontend: using `Element-UI` based on vue,to code the page.
- Backend: using `Gin` to quickly build basic RESTful API. `Gin` is a web framework written in Go (Golang).
- DB: `MySql`(5.6.44),using `gorm` to implement data manipulation, added support for SQLite databases.
- Frontend: using [Element](https://github.com/ElemeFE/element) based on [Vue](https://vuejs.org),to code the page.
- Backend: using [Gin](https://gin-gonic.com/) to quickly build basic RESTful API. [Gin](https://gin-gonic.com/)is a web framework written in Go (Golang).
- DB: `MySql`(5.6.44),using [gorm](http://gorm.io)` to implement data manipulation, added support for SQLite databases.
- Cache: using `Redis` to implement the recording of the JWT token of the currently active user and implement the multi-login restriction.
- API: using Swagger to auto generate APIs docs。
- Config: using `fsnotify` and `viper` to implement `yaml` config file。
- Log: using `go-logging` record logs。
- Config: using [fsnotify](https://github.com/fsnotify/fsnotify) and [viper](https://github.com/spf13/viper) to implement `yaml` config file。
- Log: using [zap](https://github.com/uber-go/zap) record logs。
## 4. Project Architecture
@@ -269,19 +189,31 @@ After executing the above command,`docs` will show in `server/`,then open yo
### 4.3 Project Layout
```
├─server (backend)
│ ├─api (API entrance)
│ ├─config (config file)
│ ├─core (core code)
│ ├─docs (swagger APIs docs)
│ ├─global (global objet)
│ ├─initialiaze (initialiazation)
│ ├─middleware (middle ware)
│ ├─model (model and services)
│ ├─resource (resources, such as static pages, templates)
│ ├─router (routers)
│ ├─service (services)
│ └─utils (common utilities)
├── server
├── api (api entrance)
│ └── v1 (v1 version interface)
├── config (configuration package)
├── core (core document)
├── docs (swagger document directory)
├── global (global object)
├── initialize (initialization)
│ └── internal (initialize internal function)
├── middleware (middleware layer)
├── model (model layer)
│ ├── request (input parameter structure)
│ └── response (out-of-parameter structure)
├── packfile (static file packaging)
├── resource (static resource folder)
│ ├── excel (excel import and export default path)
│ ├── page (form generator)
│ └── template (template)
├── router (routing layer)
├── service (service layer)
├── source (source layer)
└── utils (tool kit)
├── timer (timer interface encapsulation)
└── upload (oss interface encapsulation)
└─web (frontend)
├─public (deploy templates)
└─src (source code)
@@ -299,58 +231,59 @@ After executing the above command,`docs` will show in `server/`,then open yo
## 5. Features
- Authority management: Authority management based on `jwt` and `casbin`.
- File upload & download: File upload operation based on Qiniu Cloud (In order to make it easier for everyone to test, I have provided various important tokens of my Qiniu test number, and I urge you not to make things a mess).
- Pagination Encapsulation:The frontend uses mixins to encapsulate paging, and the paging method can call mixins
- File upload and download: implement file upload operations based on `Qiniuyun', `Aliyun 'and `Tencent Cloud` (please develop your own application for each platform corresponding to `token` or `key` ).
- Pagination Encapsulation:The frontend uses `mixins` to encapsulate paging, and the paging method can call `mixins` .
- User management: The system administrator assigns user roles and role permissions.
- Role management: Create the main object of permission control, and then assign different API permissions and menu permissions to the role.
- Menu management: User dynamic menu configuration implementation, assigning different menus to different roles.
- API management: Different users can call different API permissions.
- Configuration management: The configuration file can be modified in the web page (the test environment does not provide this function).
- Rich text editor: Embed MarkDown editor function.
- Configuration management: the configuration file can be modified in the foreground (this feature is not available in the online experience site).
- Conditional search: Add an example of conditional search.
- Restful example: You can see sample APIs in user management module.
```
fontend code file: src\view\superAdmin\api\api.vue
backend code file: model\dnModel\api.go
```
- Multi-login restriction: Change `userMultipoint` to true in `system` in `config.yaml` (You need to configure redis and redis parameters yourself. During the test period, please report in time if there is a bug).
- Front-end file reference: [web/src/view/superAdmin/api/api.vue](https://github.com/flipped-aurora/gin-vue-admin/blob/master/web/src/view/superAdmin/api/api.vue).
- Stage reference: [server/router/sys_api.go](https://github.com/flipped-aurora/gin-vue-admin/blob/master/server/router/sys_api.go).
- Multi-login restriction: Change `user-multipoint` to true in `system` in `config.yaml` (You need to configure redis and redis parameters yourself. During the test period, please report in time if there is a bug).
- Upload file by chunk:Provides examples of file upload and large file upload by chunk.
- Form Builder:With the help of [@form-generator](https://github.com/JakHuang/form-generator).
- Code generator: Providing backend with basic logic and simple curd code generator.
## 6. To-do list
## 6. Knowledge base
- [ ] upload & export Excel
- [ ] e-chart
- [ ] workflow, task transfer function
- [ ] frontend independent mode, mock
## 7. Knowledge base
### 7.1 Team blog
### 6.1 Team blog
> https://www.yuque.com/flipped-aurora
>
>There are video courses about frontend framework in our blo. If you think the project is helpful to you, you can add my personal WeChat:shouzi_1994,your comments is welcomed。
### 7.2 Video courses
### 6.2 Video courses
(1) Development environment course
> Bilibili:https://www.bilibili.com/video/BV1Fg4y187Bw/
(2) Template course
> Bilibili:https://www.bilibili.com/video/BV16K4y1r7BD/
(3)2.0 version introduction and development experience
(3) 2.0 version introduction and development experience
> Bilibili:https://www.bilibili.com/video/BV1aV411d7Gm#reply2831798461
(4) Golang basic course (coming soon)
(4) Golang basic course
> https://space.bilibili.com/322210472/channel/detail?cid=108884
## 8. Contacts
### 8.1 Groups
(5) gin frame basic teaching
> bilibili:https://space.bilibili.com/322210472/channel/detail?cid=126418&ctype=0
(6) gin-vue-admin version update introduction video
> bilibili:https://space.bilibili.com/322210472/channel/detail?cid=126418&ctype=0
## 7.Contacts
### 7.1 Groups
#### QQ group: 622360840
| QQ group |d
@@ -366,6 +299,14 @@ backend code file: model\dnModel\api.go
#### [About Us](https://www.gin-vue-admin.com/about/)
## 8. Contributors
Thank you for considering your contribution to gin-vue-admin!
<a href="https://github.com/flipped-aurora/gin-vue-admin/graphs/contributors">
<img src="https://contrib.rocks/image?repo=flipped-aurora/gin-vue-admin" />
</a>
## 9. Donate
If you find this project useful, you can buy author a glass of juice :tropical_drink: [here](https://www.gin-vue-admin.com/docs/coffee)
+228 -226
View File
@@ -3,46 +3,69 @@
<img src="http://qmplusimg.henrongyi.top/gvalogo.jpg" width=300" height="300" />
</div>
<div align=center>
<img src="https://img.shields.io/badge/golang-1.12-blue"/>
<img src="https://img.shields.io/badge/gin-1.4.0-lightBlue"/>
<img src="https://img.shields.io/badge/vue-2.6.10-brightgreen"/>
<img src="https://img.shields.io/badge/element--ui-2.12.0-green"/>
<img src="https://img.shields.io/badge/gorm-1.9.12-red"/>
<img src="https://img.shields.io/badge/golang-1.16-blue"/>
<img src="https://img.shields.io/badge/gin-1.7.0-lightBlue"/>
<img src="https://img.shields.io/badge/vue-3.2.25-brightgreen"/>
<img src="https://img.shields.io/badge/element--plus-2.0.1-green"/>
<img src="https://img.shields.io/badge/gorm-1.22.5-red"/>
</div>
[English](./README-en.md) | 简体中文
[gitee地址:https://gitee.com/pixelmax/gin-vue-admin](https://gitee.com/pixelmax/gin-vue-admin)
## 不同版本
[github地址:https://github.com/flipped-aurora/gin-vue-admin](https://github.com/flipped-aurora/gin-vue-admin)
我们会对以下四个版本持续维护,请选择适合自己的版本使用。最新技术栈为组合式api版本,已支持多语言(I18N)
[vue3版本分支地址:https://github.com/flipped-aurora/gin-vue-admin/tree/vue3Develop](https://github.com/flipped-aurora/gin-vue-admin/tree/vue3Develop)
[组合式API版(主)](https://github.com/flipped-aurora/gin-vue-admin) |
[组合式API多语言(i18n)版](https://github.com/flipped-aurora/gin-vue-admin/tree/i18n-dev-new) |
[声明式API版](https://github.com/flipped-aurora/gin-vue-admin/tree/v2.4.x) |
[声明式API多语言(i18n)版](https://github.com/flipped-aurora/gin-vue-admin/tree/i18n-dev)
# 项目文档
[在线文档](https://www.gin-vue-admin.com/) : https://www.gin-vue-admin.com/
[在线文档](https://www.gin-vue-admin.com) : https://www.gin-vue-admin.com
[从环境到部署教学视频](https://www.bilibili.com/video/BV1fV411y7dT)
[初始化](https://www.gin-vue-admin.com/docs/first_master)
[从环境到部署教学视频](https://www.bilibili.com/video/BV1Rg411u7xH)
[开发教学](https://www.gin-vue-admin.com/docs/help) (贡献者: <a href="https://github.com/LLemonGreen">LLemonGreen</a> And <a href="https://github.com/fkk0509">Fann</a>)
- 前端UI框架:[element-ui](https://github.com/ElemeFE/element)
- 后台框架:[gin](https://github.com/gin-gonic/gin)
[交流社区](https://support.qq.com/products/371961)
[插件市场](https://plugin.gin-vue-admin.com/)
# 重要提示
1.本项目从起步到开发到部署均有文档和详细视频教程
2.本项目需要您有一定的golang和vue基础
3.您完全可以通过我们的教程和文档完成一切操作,因此我们不再提供免费的技术服务,如需服务请进行[付费支持](https://www.gin-vue-admin.com/docs/payment)
4.如果您将此项目用于商业用途,请遵守Apache2.0协议并保留作者技术支持声明。您需保留如下版权声明信息,其余信息功能不做任何限制。如需剔除请联系微信:shouzi_1994
<img src="https://qmplusimg.henrongyi.top/%E6%8E%88%E6%9D%83.png" width="1000">
5.如果您需要服务器的话 2核2G腾讯云服务器45元/年 在这里购买:https://cloud.tencent.com/act/new?fromSource=gwzcw.4325959.4325959.4325959&utm_medium=cps&utm_id=gwzcw.4325959.4325959.4325959&cps_key=962a7fdaa930cda1c06e36a7608e95cc
阿里云服务器 1c2g1m 38一年 在这里购买:https://www.aliyun.com/minisite/goods?userCode=xqe01uob
## 1. 基本介绍
### 1.1 项目介绍
[在线预览](http://demo.gin-vue-admin.com/)
> Gin-vue-admin是一个基于 [vue](https://vuejs.org) 和 [gin](https://gin-gonic.com) 开发的全栈前后端分离的开发基础平台,集成jwt鉴权,动态路由,动态菜单,casbin鉴权,表单生成器,代码生成器等功能,提供多种示例文件,让您把更多时间专注在业务开发上。
[在线预览](http://demo.gin-vue-admin.com): http://demo.gin-vue-admin.com
测试用户名:admin
测试密码:123456
> Gin-vue-admin是一个基于vue和gin开发的全栈前后端分离的后台管理系统,集成jwt鉴权,动态路由,动态菜单,casbin鉴权,表单生成器,代码生成器等功能,提供多种示例文件,让您把更多时间专注在业务开发上。
### 1.2 贡献指南
Hi! 首先感谢你使用 gin-vue-admin。
Gin-vue-admin 是一套为后台管理平台准备的一整套前后端分离架构式的开源框架,旨在快速搭建后台管理系统。
Gin-vue-admin 是一套为快速研发准备的一整套前后端分离架构式的开源框架,旨在快速搭建中小型项目。
Gin-vue-admin 的成长离不开大家的支持,如果你愿意为 gin-vue-admin 贡献代码或提供建议,请阅读以下内容。
@@ -56,185 +79,78 @@ Gin-vue-admin 的成长离不开大家的支持,如果你愿意为 gin-vue-adm
- commit 信息要以`[文件名]: 描述信息` 的形式填写,例如 `README.md: fix xxx bug`。
- <font color=red>确保 PR 是提交到 `develop` 分支,而不是 `master` 分支。</font>
- 如果是修复 bug,请在 PR 中给出描述信息。
- 合并代码需要两名维护人员参与:一人进行 review 后 approve,另一人再次 review,通过后即可合并。
### 1.3 版本列表
- master: 2.0, 用于生产环境
- develop: 2.0, 用于测试环境
- [gin-vue-admin_v2_dev](https://github.com/flipped-aurora/gin-vue-admin/tree/gin-vue-admin_v2_dev) (v2.0 [GormV1版本](https://v1.gorm.io)稳定分支)
- [gva_gormv2_dev](https://github.com/flipped-aurora/gin-vue-admin/tree/gva_gormv2_dev) (v2.0 [GormV2版本](https://v2.gorm.io)开发分支)
## 2. 使用说明
```
- node版本 > v8.6.0
- golang版本 >= v1.14
- node版本 > v12.18.3
- golang版本 >= v1.16
- IDE推荐:Goland
- 初始化项目: 不同版本数据库初始化不通 参见https://www.gin-vue-admin.com/docs/server#1-%E5%88%9D%E5%A7%8B%E5%8C%96server%E9%A1%B9%E7%9B%AE
- 初始化项目: 不同版本数据库初始化不通 参见 https://www.gin-vue-admin.com/docs/first_master
- 替换掉项目中的七牛云公钥,私钥,仓名和默认url地址,以免发生测试文件数据错乱
```
> 使用docker-compose体验本项目
- 安装 docker-compose [官方文档](https://docs.docker.com/compose/install/)
- ```shell script
# 在Linux安装
# 1.1 运行此命令以下载Docker Compose的当前稳定版本
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# 1.2 将可执行权限应用于二进制文件
sudo chmod +x /usr/local/bin/docker-compose
```
- ```shell script
# 使用Python的pip安装
pip3 install docker-compose -i https://pypi.tuna.tsinghua.edu.cn/simple
```
- 使用 Docker Desktop
- Windows: https://hub.docker.com/editions/community/docker-ce-desktop-windows
- Mac: https://hub.docker.com/editions/community/docker-ce-desktop-mac/
### 2.1 server项目
- 使用git克隆本项目
- ```git
git clone https://github.com/flipped-aurora/gin-vue-admin.git
```
- 使用docker-compose up一键启动启动项目
- ```shell script
# 使用docker-compose启动四个容器
docker-compose up
# 如果您修改了某些配置选项,可以使用此命令重新打包镜像
docker-compose up --build
# 使用docker-compose 后台启动
docker-compose up -d
```
- web项目预览 [http://127.0.0.1:8000](http://127.0.0.1:8000)
- swagger文档 [http://127.0.0.1:8888/swagger/index.html](http://127.0.0.1:8888/swagger/index.html)
- 如果server的177.7.0.12这个容器内部ip被占用了,需要修改地方为
- [docker-compose.yaml](./docker-compose.yaml)的第39行的177.7.0.12更换为你想要的ip
- [.docker-compose/nginx/conf.d/my.conf](./.docker-compose/nginx/conf.d/my.conf)的第20行的177.7.0.12更换为你想要的ip
- docker-compose使用自定义的一个docker网络
- ```dockerfile
networks:
network:
ipam:
driver: default
config:
- subnet: '177.7.0.0/16'
```
- 子网地址, 默认网关是177.7.0.1(docker-compose V2需要写,V3则不需要),具体信息看[官方文档](https://docs.docker.com/compose/compose-file/#ipv4_address-ipv6_address)
- 默认的network名为gin-vue-admin_network,默认是bridge模式
- 如果修改了子网,对应的每个service的ipv4_address都需要修改,还有[.docker-compose/nginx/conf.d/my.conf](./.docker-compose/nginx/conf.d/my.conf)的第20行的server的ip也需要修改
> <font color=red>**使用docker-compose进行部署本项目需注意的问题**</font>
- mysql数据库请使用装在服务器磁盘的本地数据库.
- 避免使用docker容器内的mysql,可能会出现写入的问题, io比宿主机低 docker的持久化机制问题
- [init.sql](.docker-compose/docker-entrypoint-initdb.d/init.sql)是给docker-compose进行<font color=red>体验本项目</font>的, 禁止[init.sql](.docker-compose/docker-entrypoint-initdb.d/init.sql)使用进行项目数据的初始化, 数据库初始化[请使用此方法](https://www.gin-vue-admin.com/docs/help#step1%EF%BC%9A%E6%95%B0%E6%8D%AE%E5%BA%93%E5%88%9D%E5%A7%8B%E5%8C%96)
- 使用[init.sql](.docker-compose/docker-entrypoint-initdb.d/init.sql)进行初始化出现的所有问题,请自行承担,与本项目无关
- 使用本项目的docker-compose进行部署时,请修改[docker-compose.yaml](./docker-compose.yaml)对应的[nginx配置](.docker-compose/nginx/conf.d/my.conf),mysql配置,networks配置,redis配置,按需自行更改.
### 2.1 web端
使用 `Goland` 等编辑工具,打开server目录,不可以打开 gin-vue-admin 根目录
```bash
# clone the project
git clone https://github.com/piexlmax/gin-vue-admin.git
# enter the project directory
# 克隆项目
git clone https://github.com/flipped-aurora/gin-vue-admin.git
# 进入server文件夹
cd server
# 使用 go mod 并安装go依赖包
go generate
# 编译
go build -o server main.go (windows编译命令为go build -o server.exe main.go )
# 运行二进制
./server (windows运行命令为 server.exe)
```
### 2.2 web项目
```bash
# 进入web文件夹
cd web
# install dependency
npm install
# 安装依赖
cnpm install || npm install
# develop
# 启动web项目
npm run serve
```
### 2.2 server端
使用 goland等编辑工具,打开server目录,不可以打开 gin-vue-admin跟目录
```bash
# 使用 go.mod
# 安装go依赖包
go list (go mod tidy)
# 编译
go build
```
> Zap日志库使用指南&&配置指南
Zap日志库的配置选择在[config.yaml](./server/config.yaml)下的zap
```yaml
# zap logger configuration
zap:
level: 'debug'
format: 'console'
prefix: '[GIN-VUE-ADMIN]'
director: 'log'
link_name: 'latest_log'
show_line: true
encode_level: 'LowercaseColorLevelEncoder'
stacktrace_key: 'stacktrace'
log_in_console: true
```
| 配置名 | 配置的类型 | 说明 |
| -------------- | ---------- | ------------------------------------------------------------ |
| level | string | level的模式的详细说明,请看[zap官方文档](https://pkg.go.dev/go.uber.org/zap?tab=doc#pkg-constants) <br />info: info模式,无错误的堆栈信息,只输出信息<br />debug:debug模式,有错误的堆栈详细信息<br />warn:warn模式<br />error: error模式,有错误的堆栈详细信息<br />dpanic: dpanic模式<br />panic: panic模式<br />fatal: fatal模式<br /> |
| format | string | console: 控制台形式输出日志<br />json: json格式输出日志 |
| prefix | string | 日志的前缀 |
| director | string | 存放日志的文件夹,修改即可,不需要手动创建 |
| link_name | string | 在server目录下会生成一个link_name的[软连接文件](https://baike.baidu.com/item/%E8%BD%AF%E9%93%BE%E6%8E%A5),链接的是director配置项的最新日志文件 |
| show_line | bool | 显示行号, 默认为true,不建议修改 |
| encode_level | string | LowercaseLevelEncoder:小写<br /> LowercaseColorLevelEncoder:小写带颜色<br />CapitalLevelEncoder: 大写<br />CapitalColorLevelEncoder: 大写带颜色 |
| stacktrace_key | string | 堆栈的名称,即在json格式输出日志时的josn的key |
| log_in_console | bool | 是否输出到控制台,默认为true |
- 开发环境 || 调试环境配置建议
- `level:debug`
- `format:console`
- `encode_level:LowercaseColorLevelEncoder`或者`encode_leve:CapitalColorLevelEncoder`
- 部署环境配置建议
- `level:error`
- `format:json`
- `encode_level: LowercaseLevelEncoder `或者 `encode_level:CapitalLevelEncoder`
- `log_in_console: false`
- <font color=red>建议只是建议,按照自己的需求进行即可,给出建议仅供参考</font>
### 2.3 swagger自动化API文档
#### 2.3.1 安装 swagger
##### (1)可以翻墙
##### (1)可以访问外国网站
````
go get -u github.com/swaggo/swag/cmd/swag
````
##### (2)无法翻墙
##### (2)无法访问外国网站
由于国内没法安装 go.org/x 包下面的东西,推荐使用 [goproxy.io](https://goproxy.io/zh/)
由于国内没法安装 go.org/x 包下面的东西,推荐使用 [goproxy.cn](https://goproxy.cn) 或者 [goproxy.io](https://goproxy.io/zh/)
```bash
如果您使用的 Go 版本是 1.13 及以上(推荐)
# 启用 Go Modules 功能
# 如果您使用的 Go 版本是 1.13 - 1.15 需要手动设置GO111MODULE=on, 开启方式如下命令, 如果你的 Go 版本 是 1.16 ~ 最新版 可以忽略以下步骤一
# 步骤一、启用 Go Modules 功能
go env -w GO111MODULE=on
# 配置 GOPROXY 环境变量
go env -w GOPROXY=https://goproxy.io,direct
# 步骤二、配置 GOPROXY 环境变量
go env -w GOPROXY=https://goproxy.cn,https://goproxy.io,direct
# 如果嫌弃麻烦,可以使用go generate 编译前自动执行代码, 不过这个不能使用 `Goland` 或者 `Vscode` 的 命令行终端
cd server
go generate -run "go env -w .*?"
# 使用如下命令下载swag
go get -u github.com/swaggo/swag/cmd/swag
@@ -242,25 +158,26 @@ go get -u github.com/swaggo/swag/cmd/swag
#### 2.3.2 生成API文档
````
```` shell
cd server
swag init
````
执行上面的命令后,server目录下会出现docs文件夹,登录http://localhost:8888/swagger/index.html,即可查看swagger文档
> 执行上面的命令后,server目录下会出现docs文件夹里的 `docs.go`, `swagger.json`, `swagger.yaml` 三个文件更新,启动go服务之后, 在浏览器输入 [http://localhost:8888/swagger/index.html](http://localhost:8888/swagger/index.html) 即可查看swagger文档
## 3. 技术选型
- 前端:用基于`vue`的`Element-UI`构建基础页面。
- 后端:用`Gin`快速搭建基础restful风格API,`Gin`是一个go语言编写的Web框架。
- 数据库:采用`MySql`(5.6.44)版本,使用`gorm`实现对数据库的基本操作,已添加对sqlite数据库的支持。
- 前端:用基于 [Vue](https://vuejs.org) 的 [Element](https://github.com/ElemeFE/element) 构建基础页面。
- 后端:用 [Gin](https://gin-gonic.com/) 快速搭建基础restful风格API,[Gin](https://gin-gonic.com/) 是一个go语言编写的Web框架。
- 数据库:采用`MySql`(5.6.44)版本,使用 [gorm](http://gorm.cn) 实现对数据库的基本操作。
- 缓存:使用`Redis`实现记录当前活跃用户的`jwt`令牌并实现多点登录限制。
- API文档:使用`Swagger`构建自动化文档。
- 配置文件:使用`fsnotify`和`viper`实现`yaml`格式的配置文件。
- 日志:使用`go-logging`实现日志记录。
- 配置文件:使用 [fsnotify](https://github.com/fsnotify/fsnotify) 和 [viper](https://github.com/spf13/viper) 实现`yaml`格式的配置文件。
- 日志:使用 [zap](https://github.com/uber-go/zap) 实现日志记录。
## 4. 项目架构
### 4.1 系统架构图
![系统架构图](http://qmplusimg.henrongyi.top/gva/gin-vue-admin.png)
@@ -272,85 +189,156 @@ swag init
### 4.3 目录结构
```
├─server (后端文件夹)
│ ├─api (API)
│ ├─config (配置包)
│ ├─core (內核)
│ ├─docs (swagger文档目录)
│ ├─global (全局对象)
│ ├─initialiaze (初始化)
│ ├─middleware (中间件)
│ ├─model (结构体层)
│ ├─resource (资源)
│ ├─router (路由)
│ ├─service (服务)
│ └─utils (公共功能)
└─web (前端文件)
├─public (发布模板)
└─src (源码包)
├─api (向后台发送ajax的封装层)
├─assets (静态文件)
├─components(组件)
├─router (前端路由)
├─store (vuex 状态管理仓)
├─style (通用样式文件)
├─utils (前端工具库)
└─view (前端页面)
├── server
├── api (api层)
│ └── v1 (v1版本接口)
├── config (配置包)
├── core (核心文件)
├── docs (swagger文档目录)
├── global (全局对象)
├── initialize (初始化)
│ └── internal (初始化内部函数)
├── middleware (中间件层)
├── model (模型层)
│ ├── request (入参结构体)
│ └── response (出参结构体)
├── packfile (静态文件打包)
├── resource (静态资源文件夹)
│ ├── excel (excel导入导出默认路径)
│ ├── page (表单生成器)
│ └── template (模板)
├── router (路由层)
├── service (service层)
├── source (source层)
└── utils (工具包)
├── timer (定时器接口封装)
└── upload (oss接口封装)
web
├── babel.config.js
├── Dockerfile
├── favicon.ico
├── index.html -- 主页面
├── limit.js -- 助手代码
├── package.json -- 包管理器代码
├── src -- 源代码
│ ├── api -- api 组
│ ├── App.vue -- 主页面
│ ├── assets -- 静态资源
│ ├── components -- 全局组件
│ ├── core -- gva 组件包
│ │ ├── config.js -- gva网站配置文件
│ │ ├── gin-vue-admin.js -- 注册欢迎文件
│ │ └── global.js -- 统一导入文件
│ ├── directive -- v-auth 注册文件
│ ├── main.js -- 主文件
│ ├── permission.js -- 路由中间件
│ ├── pinia -- pinia 状态管理器,取代vuex
│ │ ├── index.js -- 入口文件
│ │ └── modules -- modules
│ │ ├── dictionary.js
│ │ ├── router.js
│ │ └── user.js
│ ├── router -- 路由声明文件
│ │ └── index.js
│ ├── style -- 全局样式
│ │ ├── base.scss
│ │ ├── basics.scss
│ │ ├── element_visiable.scss -- 此处可以全局覆盖 element-plus 样式
│ │ ├── iconfont.css -- 顶部几个icon的样式文件
│ │ ├── main.scss
│ │ ├── mobile.scss
│ │ └── newLogin.scss
│ ├── utils -- 方法包库
│ │ ├── asyncRouter.js -- 动态路由相关
│ │ ├── btnAuth.js -- 动态权限按钮相关
│ │ ├── bus.js -- 全局mitt声明文件
│ │ ├── date.js -- 日期相关
│ │ ├── dictionary.js -- 获取字典方法
│ │ ├── downloadImg.js -- 下载图片方法
│ │ ├── format.js -- 格式整理相关
│ │ ├── image.js -- 图片相关方法
│ │ ├── page.js -- 设置页面标题
│ │ ├── request.js -- 请求
│ │ └── stringFun.js -- 字符串文件
| ├── view -- 主要view代码
| | ├── about -- 关于我们
| | ├── dashboard -- 面板
| | ├── error -- 错误
| | ├── example --上传案例
| | ├── iconList -- icon列表
| | ├── init -- 初始化数据
| | | ├── index -- 新版本
| | | ├── init -- 旧版本
| | ├── layout -- layout约束页面
| | | ├── aside
| | | ├── bottomInfo -- bottomInfo
| | | ├── screenfull -- 全屏设置
| | | ├── setting -- 系统设置
| | | └── index.vue -- base 约束
| | ├── login --登录
| | ├── person --个人中心
| | ├── superAdmin -- 超级管理员操作
| | ├── system -- 系统检测页面
| | ├── systemTools -- 系统配置相关页面
| | └── routerHolder.vue -- page 入口页面
├── vite.config.js -- vite 配置文件
└── yarn.lock
```
## 5. 主要功能
- 权限管理:基于`jwt`和`casbin`实现的权限管理
- 文件上传下载:实现基于七牛云的文件上传操作(为了方便大家测试,我公开了自己的七牛测试号的各种重要token,恳请大家不要乱传东西)
- 分页封装:前端使用mixins封装分页,分页方法调用mixins即可
- 权限管理:基于`jwt`和`casbin`实现的权限管理。
- 文件上传下载:实现基于`七牛云`, `阿里云`, `腾讯云` 的文件上传操作(请开发自己去各个平台的申请对应 `token` 或者对应`key`)。
- 分页封装:前端使用 `mixins` 封装分页,分页方法调用 `mixins` 即可。
- 用户管理:系统管理员分配用户角色和角色权限。
- 角色管理:创建权限控制的主要对象,可以给角色分配不同api权限和菜单权限。
- 菜单管理:实现用户动态菜单配置,实现不同角色不同菜单。
- api管理:不同用户可调用的api接口的权限不同。
- 配置管理:配置文件可前台修改(测试环境不开放此功能)。
- 富文本编辑器:MarkDown编辑器功能嵌入。
- 配置管理:配置文件可前台修改(在线体验站点不开放此功能)。
- 条件搜索:增加条件搜索示例。
- restful示例:可以参考用户管理模块中的示例API。
```
前端文件参考: src\view\superAdmin\api\api.vue
后台文件参考: model\dnModel\api.go
```
- 多点登录限制:需要在`config.yaml`中把`system`中的`useMultipoint`修改为true(需要自行配置Redis和Config中的Redis参数,测试阶段,有bug请及时反馈)。
- restful示例:可以参考用户管理模块中的示例API。
- 前端文件参考: [web/src/view/superAdmin/api/api.vue](https://github.com/flipped-aurora/gin-vue-admin/blob/master/web/src/view/superAdmin/api/api.vue)
- 后台文件参考: [server/router/sys_api.go](https://github.com/flipped-aurora/gin-vue-admin/blob/master/server/router/sys_api.go)
- 多点登录限制:需要在`config.yaml`中把`system`中的`use-multipoint`修改为true(需要自行配置Redis和Config中的Redis参数,测试阶段,有bug请及时反馈)。
- 分片长传:提供文件分片上传和大文件分片上传功能示例。
- 表单生成器:表单生成器借助 [@form-generator](https://github.com/JakHuang/form-generator)。
- 代码生成器:后台基础逻辑以及简单curd的代码生成器。
- 表单生成器:表单生成器借助 [@form-generator](https://github.com/JakHuang/form-generator) 。
- 代码生成器:后台基础逻辑以及简单curd的代码生成器。
## 6. 计划任务
## 6. 知识库
- [ ] 导入,导出Excel
- [ ] Echart图表支持
- [ ] 单独前端使用模式以及数据模拟
## 7. 知识库
## 7.1 团队博客
## 6.1 团队博客
> https://www.yuque.com/flipped-aurora
>
>内有前端框架教学视频。如果觉得项目对您有所帮助可以添加我的个人微信:shouzi_1994,欢迎您提出宝贵的需求。
## 7.2 教学视频
## 6.2 教学视频
(1)环境搭建
> Bilibili:https://www.bilibili.com/video/BV1Fg4y187Bw/ (v1.0版本视频,v2.0操作相同目录不同)
(1)手把手教学视频
(2)模板使用
> Bilibili:https://www.bilibili.com/video/BV16K4y1r7BD/ (v1.0版本视频,v2.0操作相同目录不同)
> https://www.bilibili.com/video/BV1Rg411u7xH/
(3)2.0目录以及开发体验
> Bilibili:https://www.bilibili.com/video/BV1aV411d7Gm#reply2831798461
(2)后端目录结构调整介绍以及使用方法
(4)golang基础教学视频录制中...
> https://space.bilibili.com/322210472/channel/detail?cid=108884
> https://www.bilibili.com/video/BV1x44y117TT/
## 8. 联系方式
(3)golang基础教学视频
### 8.1 技术群
> bilibili:https://space.bilibili.com/322210472/channel/detail?cid=108884
(4)gin框架基础教学
> bilibili:https://space.bilibili.com/322210472/channel/detail?cid=126418&ctype=0
(5)gin-vue-admin 版本更新介绍视频
> bilibili:https://space.bilibili.com/322210472/channel/detail?cid=126418&ctype=0
## 7. 联系方式
### 7.1 技术群
### QQ交流群:622360840
| QQ 群 |
@@ -366,10 +354,24 @@ swag init
### [关于我们](https://www.gin-vue-admin.com/about/)
## 8. 贡献者
感谢您对gin-vue-admin的贡献!
<a href="https://github.com/flipped-aurora/gin-vue-admin/graphs/contributors">
<img src="https://contrib.rocks/image?repo=flipped-aurora/gin-vue-admin" />
</a>
## 9. 捐赠
如果你觉得这个项目对你有帮助,你可以请作者喝饮料 :tropical_drink: [点我](https://www.gin-vue-admin.com/docs/coffee)
## 10. 商用注意事项
## 10. 友情链接
[H5-Dooring | H5页面制作神器](https://github.com/MrXujiang/h5-Dooring)
[go-zero 微服务框架|缩短从需求到上线的距离](https://github.com/zeromicro/go-zero)
## 11. 商用注意事项
如果您将此项目用于商业用途,请遵守Apache2.0协议并保留作者技术支持声明。
+5
View File
@@ -0,0 +1,5 @@
# Security Policy
## Reporting a Vulnerability
Please report security issues to qimiaojiangjizhao@gmail.com
+148
View File
@@ -0,0 +1,148 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: config.yaml
annotations:
flipped-aurora/gin-vue-admin: backend
github: "https://github.com/flipped-aurora/gin-vue-admin.git"
app.kubernetes.io/version: 0.0.1
labels:
app: gva-server
version: gva-vue3
data:
config.yaml: |
# github.com/flipped-aurora/gin-vue-admin/server Global Configuration
# jwt configuration
jwt:
signing-key: 'qmPlus'
expires-time: 604800
buffer-time: 86400
# zap logger configuration
zap:
level: 'info'
format: 'console'
prefix: '[github.com/flipped-aurora/gin-vue-admin/server]'
director: 'log'
link-name: 'latest_log'
show-line: true
encode-level: 'LowercaseColorLevelEncoder'
stacktrace-key: 'stacktrace'
log-in-console: true
# redis configuration
redis:
db: 0
addr: '127.0.0.1:6379'
password: ''
# email configuration
email:
to: 'xxx@qq.com'
port: 465
from: 'xxx@163.com'
host: 'smtp.163.com'
is-ssl: true
secret: 'xxx'
nickname: 'test'
# casbin configuration
casbin:
model-path: './resource/rbac_model.conf'
# system configuration
system:
env: 'develop' # Change to "develop" to skip authentication for development mode
addr: 8888
db-type: 'mysql'
oss-type: 'local' # 控制oss选择走本期还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
use-multipoint: false
# captcha configuration
captcha:
key-long: 6
img-width: 240
img-height: 80
# mysql connect configuration
# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://www.github.com/flipped-aurora/gin-vue-admin/server.com/docs/first)
mysql:
path: ''
config: ''
db-name: ''
username: ''
password: ''
max-idle-conns: 10
max-open-conns: 100
log-mode: false
log-zap: ""
# local configuration
local:
path: 'uploads/file'
# autocode configuration
autocode:
transfer-restart: true
root: ""
server: /server
server-api: /api/v1/autocode
server-initialize: /initialize
server-model: /model/autocode
server-request: /model/autocode/request/
server-router: /router/autocode
server-service: /service/autocode
web: /web/src
web-api: /api
web-flow: /view
web-form: /view
web-table: /view
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
qiniu:
zone: 'ZoneHuaDong'
bucket: ''
img-path: ''
use-https: false
access-key: ''
secret-key: ''
use-cdn-domains: false
# aliyun oss configuration
aliyun-oss:
endpoint: 'yourEndpoint'
access-key-id: 'yourAccessKeyId'
access-key-secret: 'yourAccessKeySecret'
bucket-name: 'yourBucketName'
bucket-url: 'yourBucketUrl'
base-path: 'yourBasePath'
# tencent cos configuration
tencent-cos:
bucket: 'xxxxx-10005608'
region: 'ap-shanghai'
secret-id: 'xxxxxxxx'
secret-key: 'xxxxxxxx'
base-url: 'https://gin.vue.admin'
path-prefix: 'github.com/flipped-aurora/gin-vue-admin/server'
# excel configuration
excel:
dir: './resource/excel/'
# timer task db clear table
Timer:
start: true
spec: "@daily" # 定时任务详细配置参考 https://pkg.go.dev/github.com/robfig/cron/v3
detail: [
# tableName: 需要清理的表名
# compareField: 需要比较时间的字段
# interval: 时间间隔, 具体配置详看 time.ParseDuration() 中字符串表示 且不能为负数
# 2160h = 24 * 30 * 3 -> 三个月
{ tableName: "sys_operation_records" , compareField: "created_at", interval: "2160h" },
{ tableName: "jwt_blacklists" , compareField: "created_at", interval: "168h" }
#{ tableName: "log2" , compareField: "created_at", interval: "2160h" }
]
@@ -0,0 +1,68 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: gva-server
annotations:
flipped-aurora/gin-vue-admin: backend
github: "https://github.com/flipped-aurora/gin-vue-admin.git"
app.kubernetes.io/version: 0.0.1
labels:
app: gva-server
version: gva-vue3
spec:
replicas: 1
selector:
matchLabels:
app: gva-server
version: gva-vue3
template:
metadata:
labels:
app: gva-server
version: gva-vue3
spec:
containers:
- name: gin-vue-admin-container
image: registry.cn-hangzhou.aliyuncs.com/gin-vue-admin/server:40fc3aa6
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8888
name: http
volumeMounts:
- mountPath: /go/src/github.com/flipped-aurora/gin-vue-admin/server/config.yaml
name: config
subPath: config.yaml
- mountPath: /etc/localtime
name: localtime
resources:
limits:
cpu: 1000m
memory: 2000Mi
requests:
cpu: 100m
memory: 200Mi
# readinessProbe:
# httpGet:
# path: /ready
# port: http
# initialDelaySeconds: 20
# periodSeconds: 10
# successThreshold: 1
# failureThreshold: 3
# livenessProbe:
# httpGet:
# path: /health
# port: http
# initialDelaySeconds: 20
# periodSeconds: 10
# successThreshold: 1
# failureThreshold: 3
#imagePullSecrets:
# - name: docker-registry
volumes:
- name: localtime
hostPath:
path: /etc/localtime
- name: config
configMap:
name: config.yaml
+21
View File
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: gva-server
annotations:
flipped-aurora/gin-vue-admin: backend
github: "https://github.com/flipped-aurora/gin-vue-admin.git"
app.kubernetes.io/version: 0.0.1
labels:
app: gva-server
version: gva-vue3
spec:
selector:
app: gva-server
version: gva-vue3
ports:
- port: 8888
name: http
targetPort: 8888
type: ClusterIP
# type: NodePort
+32
View File
@@ -0,0 +1,32 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: my.conf
data:
my.conf: |
server {
listen 8080;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root /usr/share/nginx/html;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
try_files $uri $uri/ /index.html;
}
location /api {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
rewrite ^/api/(.*)$ /$1 break; #重写
proxy_pass http://gva-server:8888; # 设置代理服务器的协议和地址
}
location /api/swagger/index.html {
proxy_pass http://gva-server:8888/swagger/index.html;
}
}
+51
View File
@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: gva-web
annotations:
flipped-aurora/gin-vue-admin: ui
github: "https://github.com/flipped-aurora/gin-vue-admin.git"
app.kubernetes.io/version: 0.0.1
labels:
app: gva-web
version: gva-vue3
spec:
replicas: 1
selector:
matchLabels:
app: gva-web
version: gva-vue3
template:
metadata:
labels:
app: gva-web
version: gva-vue3
spec:
containers:
- name: gin-vue-admin-nginx-container
image: registry.cn-hangzhou.aliyuncs.com/gin-vue-admin/web:40fc3aa6
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
name: http
readinessProbe:
tcpSocket:
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
resources:
limits:
cpu: 500m
memory: 1000Mi
requests:
cpu: 100m
memory: 100Mi
volumeMounts:
- mountPath: /etc/nginx/conf.d/
name: nginx-config
volumes:
- name: nginx-config
configMap:
name: my.conf
+21
View File
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: gva-web
annotations:
flipped-aurora/gin-vue-admin: ui
github: "https://github.com/flipped-aurora/gin-vue-admin.git"
app.kubernetes.io/version: 0.0.1
labels:
app: gva-web
version: gva-vue3
spec:
type: NodePort
# type: ClusterIP
ports:
- name: http
port: 8080
targetPort: 8080
selector:
app: gva-web
version: gva-vue3
+85
View File
@@ -0,0 +1,85 @@
version: "3"
# 声明一个名为network的networks,subnet为network的子网地址,默认网关是177.7.0.1
networks:
network:
ipam:
driver: default
config:
- subnet: '177.7.0.0/16'
# 设置mysql,redis持久化保存
volumes:
mysql:
redis:
services:
web:
image: node:16
container_name: gva-web
hostname: gva-web #可以通过容器名访问
restart: always
ports:
- '8080:8080'
depends_on:
- server
working_dir: /web # 如果docker 设置了workdir 则此处不需要设置
#若网络不太好,请自行换源,如下
#command: bash -c "yarn config set registry https://registry.npm.taobao.org --global && yarn install && yarn serve"
command: bash -c "yarn install && yarn serve"
volumes:
- ./web:/web
networks:
network:
ipv4_address: 177.7.0.11
server:
image: golang:1.16
container_name: gva-server
hostname: gva-server
restart: always
ports:
- '8888:8888'
depends_on:
- mysql
- redis
volumes:
- ./server:/server
working_dir: /server # 如果docker 设置了workdir 则此处不需要设置
command: bash -c "go env -w GOPROXY=https://goproxy.cn,direct && go mod tidy && go run main.go"
links:
- mysql
- redis
networks:
network:
ipv4_address: 177.7.0.12
mysql:
image: mysql:8.0.21 # 如果您是 arm64 架构:如 MacOS 的 M1,请修改镜像为 image: mysql/mysql-server:8.0.21
container_name: gva-mysql
hostname: gva-mysql
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci #设置utf8字符集
restart: always
ports:
- "13306:3306" # host物理直接映射端口为13306
environment:
MYSQL_DATABASE: 'qmPlus' # 初始化启动时要创建的数据库的名称
MYSQL_ROOT_PASSWORD: 'Aa@6447985' # root管理员用户密码
volumes:
- mysql:/var/lib/mysql
networks:
network:
ipv4_address: 177.7.0.13
redis:
image: redis:6.0.6
container_name: gva-redis # 容器名
hostname: gva-redis
restart: always
ports:
- '16379:6379'
volumes:
- redis:/data
networks:
network:
ipv4_address: 177.7.0.14
+18 -8
View File
@@ -1,17 +1,23 @@
version: "3.8"
version: "3"
# 声明一个名为network的networks,subnet为network的子网地址,默认网关是177.7.0.1
networks:
network:
ipam:
driver: default
config:
- subnet: '177.7.0.0/16'
# 设置mysql,redis持久化保存
volumes:
mysql:
redis:
services:
web:
build:
context: ./
dockerfile: ./dockerfile_web
context: ./web
dockerfile: ./Dockerfile
container_name: gva-web
restart: always
ports:
@@ -25,8 +31,8 @@ services:
server:
build:
context: ./
dockerfile: ./dockerfile_server
context: ./server
dockerfile: ./Dockerfile
container_name: gva-server
restart: always
ports:
@@ -42,7 +48,7 @@ services:
ipv4_address: 177.7.0.12
mysql:
image: mysql:8.0.21
image: mysql:8.0.21 # 如果您是 arm64 架构:如 MacOS 的 M1,请修改镜像为 image: mysql/mysql-server:8.0.21
container_name: gva-mysql
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci #设置utf8字符集
restart: always
@@ -51,6 +57,8 @@ services:
environment:
MYSQL_DATABASE: 'qmPlus' # 初始化启动时要创建的数据库的名称
MYSQL_ROOT_PASSWORD: 'Aa@6447985' # root管理员用户密码
volumes:
- mysql:/var/lib/mysql
networks:
network:
ipv4_address: 177.7.0.13
@@ -61,6 +69,8 @@ services:
restart: always
ports:
- '16379:6379'
volumes:
- redis:/data
networks:
network:
ipv4_address: 177.7.0.14
ipv4_address: 177.7.0.14
-4
View File
@@ -1,4 +0,0 @@
#!/bin/sh
envsubst '$API_SERVER' < /etc/nginx/nginx.conf.tpl > /etc/nginx/nginx.conf
env nginx
./gvadmin
-56
View File
@@ -1,56 +0,0 @@
daemon on;
worker_processes 50;
#error_log /dev/stdout warn;
error_log /var/log/nginx/error.log error;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
# See http://licson.net/post/optimizing-nginx-for-large-file-delivery/ for more detail
# This optimizes the server for HLS fragment delivery
sendfile off;
#tcp_nopush on;
keepalive_timeout 65;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log /dev/stdout combined;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
# ssl_session_cache shared:SSL:10m;
# ssl_session_timeout 10m;
server {
listen 80;
# Uncomment these lines to enable SSL.
# Update the ssl paths with your own certificate and private key.
# listen 443 ssl;
# ssl_certificate /opt/certs/example.com.crt;
# ssl_certificate_key /opt/certs/example.com.key;
location / {
root /var/www;
try_files $uri $uri/ /index.html;
index index.html;
}
location /v1/ {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_pass ${API_SERVER} ;
}
}
}
-31
View File
@@ -1,31 +0,0 @@
FROM golang:alpine
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.io,direct
WORKDIR /go/src/gin-vue-admin
COPY server/ ./
RUN cat ./config.yaml
COPY .docker-compose/shell/server-handle.sh .
RUN ls -al
RUN sh ./server-handle.sh
RUN rm -f server-handle.sh
RUN cat ./config.yaml
RUN go build -o gva cmd/main.go
RUN go env && go build -o server .
FROM alpine:latest
LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com"
WORKDIR /go/src/gin-vue-admin
COPY --from=0 /go/src/gin-vue-admin/gva ./
COPY --from=0 /go/src/gin-vue-admin/server ./
COPY --from=0 /go/src/gin-vue-admin/config.yaml ./
COPY --from=0 /go/src/gin-vue-admin/resource ./resource
EXPOSE 8888
ENTRYPOINT ./gva initdb && ./server
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
if [ ! -d "/var/lib/mysql/gva" ]; then
mysqld --initialize-insecure --user=mysql --datadir=/var/lib/mysql
mysqld --daemonize --user=mysql
sleep 5s
mysql -uroot -e "create database gva default charset 'utf8' collate 'utf8_bin'; grant all on gva.* to 'root'@'127.0.0.1' identified by '123456'; flush privileges;"
else
mysqld --daemonize --user=mysql
fi
redis-server &
if [ "$1" = "actions" ]; then
cd /opt/gva/server && go run main.go &
cd /opt/gva/web/ && yarn serve &
else
/usr/sbin/nginx &
cd /usr/share/nginx/html/ && ./server &
fi
echo "gva ALL start!!!"
tail -f /dev/null
-3
View File
@@ -1,3 +0,0 @@
{
"lockfileVersion": 1
}
+16 -12
View File
@@ -1,20 +1,24 @@
FROM golang:alpine
FROM golang:alpine as builder
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.io,direct
WORKDIR /go/src/gin-vue-admin
WORKDIR /go/src/github.com/flipped-aurora/gin-vue-admin/server
COPY . .
RUN go env && go build -o server .
RUN go env -w GO111MODULE=on \
&& go env -w GOPROXY=https://goproxy.cn,direct \
&& go env -w CGO_ENABLED=0 \
&& go env \
&& go mod tidy \
&& go build -o server .
FROM alpine:latest
LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com"
WORKDIR /go/src/gin-vue-admin
COPY --from=0 /go/src/gin-vue-admin/server ./
COPY --from=0 /go/src/gin-vue-admin/config.yaml ./
COPY --from=0 /go/src/gin-vue-admin/resource ./resource
WORKDIR /go/src/github.com/flipped-aurora/gin-vue-admin/server
COPY --from=0 /go/src/github.com/flipped-aurora/gin-vue-admin/server/server ./
COPY --from=0 /go/src/github.com/flipped-aurora/gin-vue-admin/server/resource ./resource/
COPY --from=0 /go/src/github.com/flipped-aurora/gin-vue-admin/server/config.docker.yaml ./
EXPOSE 8888
ENTRYPOINT ./server
ENTRYPOINT ./server -c config.docker.yaml
-45
View File
@@ -1,45 +0,0 @@
.PHONY: all build run gotool clean help
BINARY="gin-vue-admin"
GVA = "gva"
all: check gva initdb run
gva:
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct
go build -o ${GVA} cmd/main.go
initdb:
@if [ -f ${GVA} ] ; then ./gva initdb && rm ${GVA} ; fi
linux-build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build
windows-build:
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o ${BINARY}.exe
mac-build:
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o ${BINARY}
run:
@go run main.go
check:
go fmt ./
go vet ./
clean:
@if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
@if [ -f ${GVA} ] ; then rm ${GVA} ; fi
help:
@echo "make - 构建gva终端工具并初始化数据,初始化数据后删除gva终端工具,启动server项目"
@echo "make gva - 构建gva终端工具"
@echo "make initdb - 如果有gva终端工具就初始化数据,初始化数据后删除gva终端工具,没有则不会执行"
@echo "make linux-build - 编译 Go 代码, 生成Linux系统的二进制文件"
@echo "make windows-build - 编译 Go 代码, 生成Windows系统的exe文件"
@echo "make mac-build - 编译 Go 代码, 生成Mac系统的二进制文件"
@echo "make run - 直接运行 main.go"
@echo "make clean - 移除二进制文件"
@echo "make check - 运行 Go 工具 'fmt' and 'vet'"
+54
View File
@@ -0,0 +1,54 @@
## server项目结构
```shell
├── api
│   └── v1
├── config
├── core
├── docs
├── global
├── initialize
│   └── internal
├── middleware
├── model
│   ├── request
│   └── response
├── packfile
├── resource
│   ├── excel
│   ├── page
│   └── template
├── router
├── service
├── source
└── utils
├── timer
└── upload
```
| 文件夹 | 说明 | 描述 |
| ------------ | ----------------------- | --------------------------- |
| `api` | api层 | api层 |
| `--v1` | v1版本接口 | v1版本接口 |
| `config` | 配置包 | config.yaml对应的配置结构体 |
| `core` | 核心文件 | 核心组件(zap, viper, server)的初始化 |
| `docs` | swagger文档目录 | swagger文档目录 |
| `global` | 全局对象 | 全局对象 |
| `initialize` | 初始化 | router,redis,gorm,validator, timer的初始化 |
| `--internal` | 初始化内部函数 | gorm 的 longger 自定义,在此文件夹的函数只能由 `initialize` 层进行调用 |
| `middleware` | 中间件层 | 用于存放 `gin` 中间件代码 |
| `model` | 模型层 | 模型对应数据表 |
| `--request` | 入参结构体 | 接收前端发送到后端的数据。 |
| `--response` | 出参结构体 | 返回给前端的数据结构体 |
| `packfile` | 静态文件打包 | 静态文件打包 |
| `resource` | 静态资源文件夹 | 负责存放静态文件 |
| `--excel` | excel导入导出默认路径 | excel导入导出默认路径 |
| `--page` | 表单生成器 | 表单生成器 打包后的dist |
| `--template` | 模板 | 模板文件夹,存放的是代码生成器的模板 |
| `router` | 路由层 | 路由层 |
| `service` | service层 | 存放业务逻辑问题 |
| `source` | source层 | 存放初始化数据的函数 |
| `utils` | 工具包 | 工具函数封装 |
| `--timer` | timer | 定时器接口封装 |
| `--upload` | oss | oss接口封装 |
+13
View File
@@ -0,0 +1,13 @@
package v1
import (
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/example"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/system"
)
type ApiGroup struct {
SystemApiGroup system.ApiGroup
ExampleApiGroup example.ApiGroup
}
var ApiGroupApp = new(ApiGroup)
-129
View File
@@ -1,129 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"io/ioutil"
"strconv"
)
// @Tags ExaFileUploadAndDownload
// @Summary 断点续传到服务器
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "an example for breakpoint resume, 断点续传示例"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"切片创建成功"}"
// @Router /fileUploadAndDownload/breakpointContinue [post]
func BreakpointContinue(c *gin.Context) {
fileMd5 := c.Request.FormValue("fileMd5")
fileName := c.Request.FormValue("fileName")
chunkMd5 := c.Request.FormValue("chunkMd5")
chunkNumber, _ := strconv.Atoi(c.Request.FormValue("chunkNumber"))
chunkTotal, _ := strconv.Atoi(c.Request.FormValue("chunkTotal"))
_, FileHeader, err := c.Request.FormFile("file")
if err != nil {
global.GVA_LOG.Error("接收文件失败!", zap.Any("err", err))
response.FailWithMessage("接收文件失败", c)
return
}
f, err := FileHeader.Open()
if err != nil {
global.GVA_LOG.Error("文件读取失败!", zap.Any("err", err))
response.FailWithMessage("文件读取失败", c)
return
}
defer f.Close()
cen, _ := ioutil.ReadAll(f)
if !utils.CheckMd5(cen, chunkMd5) {
global.GVA_LOG.Error("检查md5失败!", zap.Any("err", err))
response.FailWithMessage("检查md5失败", c)
return
}
err, file := service.FindOrCreateFile(fileMd5, fileName, chunkTotal)
if err != nil {
global.GVA_LOG.Error("查找或创建记录失败!", zap.Any("err", err))
response.FailWithMessage("查找或创建记录失败", c)
return
}
err, pathc := utils.BreakPointContinue(cen, fileName, chunkNumber, chunkTotal, fileMd5)
if err != nil {
global.GVA_LOG.Error("断点续传失败!", zap.Any("err", err))
response.FailWithMessage("断点续传失败", c)
return
}
if err = service.CreateFileChunk(file.ID, pathc, chunkNumber); err != nil {
global.GVA_LOG.Error("创建文件记录失败!", zap.Any("err", err))
response.FailWithMessage("创建文件记录失败", c)
return
}
response.OkWithMessage("切片创建成功", c)
}
// @Tags ExaFileUploadAndDownload
// @Summary 查找文件
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "Find the file, 查找文件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查找成功"}"
// @Router /fileUploadAndDownload/findFile [post]
func FindFile(c *gin.Context) {
fileMd5 := c.Query("fileMd5")
fileName := c.Query("fileName")
chunkTotal, _ := strconv.Atoi(c.Query("chunkTotal"))
err, file := service.FindOrCreateFile(fileMd5, fileName, chunkTotal)
if err != nil {
global.GVA_LOG.Error("查找失败!", zap.Any("err", err))
response.FailWithMessage("查找失败", c)
} else {
response.OkWithDetailed(response.FileResponse{File: file},"查找成功", c)
}
}
// @Tags ExaFileUploadAndDownload
// @Summary 创建文件
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "上传文件完成"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"file uploaded, 文件创建成功"}"
// @Router /fileUploadAndDownload/findFile [post]
func BreakpointContinueFinish(c *gin.Context) {
fileMd5 := c.Query("fileMd5")
fileName := c.Query("fileName")
err, filePath := utils.MakeFile(fileName, fileMd5)
if err != nil {
global.GVA_LOG.Error("文件创建失败!", zap.Any("err", err))
response.FailWithDetailed(response.FilePathResponse{FilePath: filePath}, "文件创建失败", c)
} else {
response.OkWithDetailed(response.FilePathResponse{FilePath: filePath}, "文件创建成功", c)
}
}
// @Tags ExaFileUploadAndDownload
// @Summary 删除切片
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "删除缓存切片"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"缓存切片删除成功"}"
// @Router /fileUploadAndDownload/removeChunk [post]
func RemoveChunk(c *gin.Context) {
fileMd5 := c.Query("fileMd5")
fileName := c.Query("fileName")
filePath := c.Query("filePath")
err := utils.RemoveChunk(fileMd5)
err = service.DeleteFileChunk(fileMd5, fileName, filePath)
if err != nil {
global.GVA_LOG.Error("缓存切片删除失败!", zap.Any("err", err))
response.FailWithDetailed(response.FilePathResponse{FilePath: filePath},"缓存切片删除失败", c)
} else {
response.OkWithDetailed(response.FilePathResponse{FilePath: filePath}, "缓存切片删除成功", c)
}
}
-141
View File
@@ -1,141 +0,0 @@
package v1
import (
"fmt"
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags ExaCustomer
// @Summary 创建客户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.ExaCustomer true "客户用户名, 客户手机号码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /customer/customer [post]
func CreateExaCustomer(c *gin.Context) {
var customer model.ExaCustomer
_ = c.ShouldBindJSON(&customer)
if err := utils.Verify(customer, utils.CustomerVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
customer.SysUserID = getUserID(c)
customer.SysUserAuthorityID = getUserAuthorityId(c)
if err := service.CreateExaCustomer(customer); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags ExaCustomer
// @Summary 删除客户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.ExaCustomer true "客户ID"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /customer/customer [delete]
func DeleteExaCustomer(c *gin.Context) {
var customer model.ExaCustomer
_ = c.ShouldBindJSON(&customer)
if err := utils.Verify(customer.GVA_MODEL, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.DeleteExaCustomer(customer); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags ExaCustomer
// @Summary 更新客户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.ExaCustomer true "客户ID, 客户信息"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /customer/customer [put]
func UpdateExaCustomer(c *gin.Context) {
var customer model.ExaCustomer
_ = c.ShouldBindJSON(&customer)
if err := utils.Verify(customer.GVA_MODEL, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := utils.Verify(customer, utils.CustomerVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.UpdateExaCustomer(&customer); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
response.FailWithMessage("更新失败!", c)
} else {
response.OkWithMessage("更新成功", c)
}
}
// @Tags ExaCustomer
// @Summary 获取单一客户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.ExaCustomer true "客户ID"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customer/customer [get]
func GetExaCustomer(c *gin.Context) {
var customer model.ExaCustomer
_ = c.ShouldBindQuery(&customer)
if err := utils.Verify(customer.GVA_MODEL, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
err, data := service.GetExaCustomer(customer.ID)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.ExaCustomerResponse{Customer: data}, "获取成功", c)
}
}
// @Tags ExaCustomer
// @Summary 分页获取权限客户列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "页码, 每页大小"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /customer/customerList [get]
func GetExaCustomerList(c *gin.Context) {
var pageInfo request.PageInfo
_ = c.ShouldBindQuery(&pageInfo)
if err := utils.Verify(pageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
err, customerList, total := service.GetCustomerInfoList(getUserAuthorityId(c), pageInfo)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
response.FailWithMessage(fmt.Sprintf("获取失败:%v", err), c)
} else {
response.OkWithDetailed(response.PageResult{
List: customerList,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
-80
View File
@@ -1,80 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags ExaFileUploadAndDownload
// @Summary 上传文件示例
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "上传文件示例"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"上传成功"}"
// @Router /fileUploadAndDownload/upload [post]
func UploadFile(c *gin.Context) {
var file model.ExaFileUploadAndDownload
noSave := c.DefaultQuery("noSave", "0")
_, header, err := c.Request.FormFile("file")
if err != nil {
global.GVA_LOG.Error("接收文件失败!", zap.Any("err", err))
response.FailWithMessage("接收文件失败", c)
return
}
err, file = service.UploadFile(header, noSave) // 文件上传后拿到文件路径
if err != nil {
global.GVA_LOG.Error("修改数据库链接失败!", zap.Any("err", err))
response.FailWithMessage("修改数据库链接失败", c)
return
}
response.OkWithDetailed(response.ExaFileResponse{File: file}, "上传成功", c)
}
// @Tags ExaFileUploadAndDownload
// @Summary 删除文件
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body model.ExaFileUploadAndDownload true "传入文件里面id即可"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /fileUploadAndDownload/deleteFile [post]
func DeleteFile(c *gin.Context) {
var file model.ExaFileUploadAndDownload
_ = c.ShouldBindJSON(&file)
if err := service.DeleteFile(file); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
response.FailWithMessage("删除失败", c)
return
}
response.OkWithMessage("删除成功", c)
}
// @Tags ExaFileUploadAndDownload
// @Summary 分页文件列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "页码, 每页大小"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /fileUploadAndDownload/getFileList [post]
func GetFileList(c *gin.Context) {
var pageInfo request.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
err, list, total := service.GetFileRecordInfoList(pageInfo)
if 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)
}
}
-93
View File
@@ -1,93 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags SimpleUploader
// @Summary 断点续传插件版示例
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "断点续传插件版示例"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"切片创建成功"}"
// @Router /simpleUploader/upload [post]
func SimpleUploaderUpload(c *gin.Context) {
var chunk model.ExaSimpleUploader
_, header, err := c.Request.FormFile("file")
chunk.Filename = c.PostForm("filename")
chunk.ChunkNumber = c.PostForm("chunkNumber")
chunk.CurrentChunkSize = c.PostForm("currentChunkSize")
chunk.Identifier = c.PostForm("identifier")
chunk.TotalSize = c.PostForm("totalSize")
chunk.TotalChunks = c.PostForm("totalChunks")
var chunkDir = "./chunk/" + chunk.Identifier + "/"
hasDir, _ := utils.PathExists(chunkDir)
if !hasDir {
if err := utils.CreateDir(chunkDir); err != nil {
global.GVA_LOG.Error("创建目录失败!", zap.Any("err", err))
}
}
chunkPath := chunkDir + chunk.Filename + chunk.ChunkNumber
err = c.SaveUploadedFile(header, chunkPath)
if err != nil {
global.GVA_LOG.Error("切片创建失败!", zap.Any("err", err))
response.FailWithMessage("切片创建失败", c)
return
}
chunk.CurrentChunkPath = chunkPath
err = service.SaveChunk(chunk)
if err != nil {
global.GVA_LOG.Error("切片创建失败!", zap.Any("err", err))
response.FailWithMessage("切片创建失败", c)
return
} else {
response.OkWithMessage("切片创建成功", c)
}
}
// @Tags SimpleUploader
// @Summary 断点续传插件版示例
// @Security ApiKeyAuth
// @Produce application/json
// @Param md5 query string true "md5"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /simpleUploader/checkFileMd5 [get]
func CheckFileMd5(c *gin.Context) {
md5 := c.Query("md5")
err, chunks, isDone := service.CheckFileMd5(md5)
if err != nil {
global.GVA_LOG.Error("md5读取失败!", zap.Any("err", err))
response.FailWithMessage("md5读取失败", c)
} else {
response.OkWithDetailed(gin.H{
"chunks": chunks,
"isDone": isDone,
},"查询成功", c)
}
}
// @Tags SimpleUploader
// @Summary 合并文件
// @Security ApiKeyAuth
// @Produce application/json
// @Param md5 query string true "md5"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"合并成功"}"
// @Router /simpleUploader/mergeFileMd5 [get]
func MergeFileMd5(c *gin.Context) {
md5 := c.Query("md5")
fileName := c.Query("fileName")
err := service.MergeFileMd5(md5, fileName)
if err != nil {
global.GVA_LOG.Error("md5读取失败!", zap.Any("err", err))
response.FailWithMessage("md5读取失败", c)
} else {
response.OkWithMessage("合并成功", c)
}
}
+15
View File
@@ -0,0 +1,15 @@
package example
import "github.com/flipped-aurora/gin-vue-admin/server/service"
type ApiGroup struct {
ExcelApi
CustomerApi
FileUploadAndDownloadApi
}
var (
excelService = service.ServiceGroupApp.ExampleServiceGroup.ExcelService
customerService = service.ServiceGroupApp.ExampleServiceGroup.CustomerService
fileUploadAndDownloadService = service.ServiceGroupApp.ExampleServiceGroup.FileUploadAndDownloadService
)
@@ -0,0 +1,142 @@
package example
import (
"fmt"
"io/ioutil"
"mime/multipart"
"strconv"
"github.com/flipped-aurora/gin-vue-admin/server/model/example"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
exampleRes "github.com/flipped-aurora/gin-vue-admin/server/model/example/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags ExaFileUploadAndDownload
// @Summary 断点续传到服务器
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "an example for breakpoint resume, 断点续传示例"
// @Success 200 {object} response.Response{msg=string} "断点续传到服务器"
// @Router /fileUploadAndDownload/breakpointContinue [post]
func (b *FileUploadAndDownloadApi) BreakpointContinue(c *gin.Context) {
fileMd5 := c.Request.FormValue("fileMd5")
fileName := c.Request.FormValue("fileName")
chunkMd5 := c.Request.FormValue("chunkMd5")
chunkNumber, _ := strconv.Atoi(c.Request.FormValue("chunkNumber"))
chunkTotal, _ := strconv.Atoi(c.Request.FormValue("chunkTotal"))
_, FileHeader, err := c.Request.FormFile("file")
if err != nil {
global.GVA_LOG.Error("接收文件失败!", zap.Error(err))
response.FailWithMessage("接收文件失败", c)
return
}
f, err := FileHeader.Open()
if err != nil {
global.GVA_LOG.Error("文件读取失败!", zap.Error(err))
response.FailWithMessage("文件读取失败", c)
return
}
defer func(f multipart.File) {
err := f.Close()
if err != nil {
fmt.Println(err)
}
}(f)
cen, _ := ioutil.ReadAll(f)
if !utils.CheckMd5(cen, chunkMd5) {
global.GVA_LOG.Error("检查md5失败!", zap.Error(err))
response.FailWithMessage("检查md5失败", c)
return
}
file, err := fileUploadAndDownloadService.FindOrCreateFile(fileMd5, fileName, chunkTotal)
if err != nil {
global.GVA_LOG.Error("查找或创建记录失败!", zap.Error(err))
response.FailWithMessage("查找或创建记录失败", c)
return
}
pathC, err := utils.BreakPointContinue(cen, fileName, chunkNumber, chunkTotal, fileMd5)
if err != nil {
global.GVA_LOG.Error("断点续传失败!", zap.Error(err))
response.FailWithMessage("断点续传失败", c)
return
}
if err = fileUploadAndDownloadService.CreateFileChunk(file.ID, pathC, chunkNumber); err != nil {
global.GVA_LOG.Error("创建文件记录失败!", zap.Error(err))
response.FailWithMessage("创建文件记录失败", c)
return
}
response.OkWithMessage("切片创建成功", c)
}
// @Tags ExaFileUploadAndDownload
// @Summary 查找文件
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "Find the file, 查找文件"
// @Success 200 {object} response.Response{data=exampleRes.FileResponse,msg=string} "查找文件,返回包括文件详情"
// @Router /fileUploadAndDownload/findFile [post]
func (b *FileUploadAndDownloadApi) FindFile(c *gin.Context) {
fileMd5 := c.Query("fileMd5")
fileName := c.Query("fileName")
chunkTotal, _ := strconv.Atoi(c.Query("chunkTotal"))
file, err := fileUploadAndDownloadService.FindOrCreateFile(fileMd5, fileName, chunkTotal)
if err != nil {
global.GVA_LOG.Error("查找失败!", zap.Error(err))
response.FailWithMessage("查找失败", c)
} else {
response.OkWithDetailed(exampleRes.FileResponse{File: file}, "查找成功", c)
}
}
// @Tags ExaFileUploadAndDownload
// @Summary 创建文件
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "上传文件完成"
// @Success 200 {object} response.Response{data=exampleRes.FilePathResponse,msg=string} "创建文件,返回包括文件路径"
// @Router /fileUploadAndDownload/findFile [post]
func (b *FileUploadAndDownloadApi) BreakpointContinueFinish(c *gin.Context) {
fileMd5 := c.Query("fileMd5")
fileName := c.Query("fileName")
filePath, err := utils.MakeFile(fileName, fileMd5)
if err != nil {
global.GVA_LOG.Error("文件创建失败!", zap.Error(err))
response.FailWithDetailed(exampleRes.FilePathResponse{FilePath: filePath}, "文件创建失败", c)
} else {
response.OkWithDetailed(exampleRes.FilePathResponse{FilePath: filePath}, "文件创建成功", c)
}
}
// @Tags ExaFileUploadAndDownload
// @Summary 删除切片
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "删除缓存切片"
// @Success 200 {object} response.Response{msg=string} "删除切片"
// @Router /fileUploadAndDownload/removeChunk [post]
func (b *FileUploadAndDownloadApi) RemoveChunk(c *gin.Context) {
var file example.ExaFile
_ = c.ShouldBindJSON(&file)
err := utils.RemoveChunk(file.FileMd5)
if err != nil {
global.GVA_LOG.Error("缓存切片删除失败!", zap.Error(err))
return
}
err = fileUploadAndDownloadService.DeleteFileChunk(file.FileMd5, file.FilePath)
if err != nil {
global.GVA_LOG.Error(err.Error(), zap.Error(err))
response.FailWithMessage(err.Error(), c)
} else {
response.OkWithMessage("缓存切片删除成功", c)
}
}
+142
View File
@@ -0,0 +1,142 @@
package example
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/example"
exampleRes "github.com/flipped-aurora/gin-vue-admin/server/model/example/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type CustomerApi struct{}
// @Tags ExaCustomer
// @Summary 创建客户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body example.ExaCustomer true "客户用户名, 客户手机号码"
// @Success 200 {object} response.Response{msg=string} "创建客户"
// @Router /customer/customer [post]
func (e *CustomerApi) CreateExaCustomer(c *gin.Context) {
var customer example.ExaCustomer
_ = c.ShouldBindJSON(&customer)
if err := utils.Verify(customer, utils.CustomerVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
customer.SysUserID = utils.GetUserID(c)
customer.SysUserAuthorityID = utils.GetUserAuthorityId(c)
if err := customerService.CreateExaCustomer(customer); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Error(err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags ExaCustomer
// @Summary 删除客户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body example.ExaCustomer true "客户ID"
// @Success 200 {object} response.Response{msg=string} "删除客户"
// @Router /customer/customer [delete]
func (e *CustomerApi) DeleteExaCustomer(c *gin.Context) {
var customer example.ExaCustomer
_ = c.ShouldBindJSON(&customer)
if err := utils.Verify(customer.GVA_MODEL, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := customerService.DeleteExaCustomer(customer); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags ExaCustomer
// @Summary 更新客户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body example.ExaCustomer true "客户ID, 客户信息"
// @Success 200 {object} response.Response{msg=string} "更新客户信息"
// @Router /customer/customer [put]
func (e *CustomerApi) UpdateExaCustomer(c *gin.Context) {
var customer example.ExaCustomer
_ = c.ShouldBindJSON(&customer)
if err := utils.Verify(customer.GVA_MODEL, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := utils.Verify(customer, utils.CustomerVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := customerService.UpdateExaCustomer(&customer); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Error(err))
response.FailWithMessage("更新失败", c)
} else {
response.OkWithMessage("更新成功", c)
}
}
// @Tags ExaCustomer
// @Summary 获取单一客户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query example.ExaCustomer true "客户ID"
// @Success 200 {object} response.Response{data=exampleRes.ExaCustomerResponse,msg=string} "获取单一客户信息,返回包括客户详情"
// @Router /customer/customer [get]
func (e *CustomerApi) GetExaCustomer(c *gin.Context) {
var customer example.ExaCustomer
_ = c.ShouldBindQuery(&customer)
if err := utils.Verify(customer.GVA_MODEL, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
data, err := customerService.GetExaCustomer(customer.ID)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(exampleRes.ExaCustomerResponse{Customer: data}, "获取成功", c)
}
}
// @Tags ExaCustomer
// @Summary 分页获取权限客户列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "页码, 每页大小"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取权限客户列表,返回包括列表,总数,页码,每页数量"
// @Router /customer/customerList [get]
func (e *CustomerApi) GetExaCustomerList(c *gin.Context) {
var pageInfo request.PageInfo
_ = c.ShouldBindQuery(&pageInfo)
if err := utils.Verify(pageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
customerList, total, err := customerService.GetCustomerInfoList(utils.GetUserAuthorityId(c), pageInfo)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败"+err.Error(), c)
} else {
response.OkWithDetailed(response.PageResult{
List: customerList,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
+111
View File
@@ -0,0 +1,111 @@
package example
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/example"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
"os"
"strings"
)
type ExcelApi struct{}
// /excel/importExcel 接口,与upload接口作用类似,只是把文件存到resource/excel目录下,用于导入Excel时存放Excel文件(ExcelImport.xlsx)
// /excel/loadExcel接口,用于读取resource/excel目录下的文件((ExcelImport.xlsx)并加载为[]model.SysBaseMenu类型的示例数据
// /excel/exportExcel 接口,用于读取前端传来的tableData,生成Excel文件并返回
// /excel/downloadTemplate 接口,用于下载resource/excel目录下的 ExcelTemplate.xlsx 文件,作为导入的模板
// @Tags excel
// @Summary 导出Excel
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/octet-stream
// @Param data body example.ExcelInfo true "导出Excel文件信息"
// @Success 200
// @Router /excel/exportExcel [post]
func (e *ExcelApi) ExportExcel(c *gin.Context) {
var excelInfo example.ExcelInfo
_ = c.ShouldBindJSON(&excelInfo)
if strings.Index(excelInfo.FileName, "..") > -1 {
response.FailWithMessage("包含非法字符", c)
return
}
filePath := global.GVA_CONFIG.Excel.Dir + excelInfo.FileName
err := excelService.ParseInfoList2Excel(excelInfo.InfoList, filePath)
if err != nil {
global.GVA_LOG.Error("转换Excel失败!", zap.Error(err))
response.FailWithMessage("转换Excel失败", c)
return
}
c.Writer.Header().Add("success", "true")
c.File(filePath)
}
// @Tags excel
// @Summary 导入Excel文件
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "导入Excel文件"
// @Success 200 {object} response.Response{msg=string} "导入Excel文件"
// @Router /excel/importExcel [post]
func (e *ExcelApi) ImportExcel(c *gin.Context) {
_, header, err := c.Request.FormFile("file")
if err != nil {
global.GVA_LOG.Error("接收文件失败!", zap.Error(err))
response.FailWithMessage("接收文件失败", c)
return
}
_ = c.SaveUploadedFile(header, global.GVA_CONFIG.Excel.Dir+"ExcelImport.xlsx")
response.OkWithMessage("导入成功", c)
}
// @Tags excel
// @Summary 加载Excel数据
// @Security ApiKeyAuth
// @Produce application/json
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "加载Excel数据,返回包括列表,总数,页码,每页数量"
// @Router /excel/loadExcel [get]
func (e *ExcelApi) LoadExcel(c *gin.Context) {
menus, err := excelService.ParseExcel2InfoList()
if err != nil {
global.GVA_LOG.Error("加载数据失败!", zap.Error(err))
response.FailWithMessage("加载数据失败", c)
return
}
response.OkWithDetailed(response.PageResult{
List: menus,
Total: int64(len(menus)),
Page: 1,
PageSize: 999,
}, "加载数据成功", c)
}
// @Tags excel
// @Summary 下载模板
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param fileName query string true "模板名称"
// @Success 200
// @Router /excel/downloadTemplate [get]
func (e *ExcelApi) DownloadTemplate(c *gin.Context) {
fileName := c.Query("fileName")
filePath := global.GVA_CONFIG.Excel.Dir + fileName
fi, err := os.Stat(filePath)
if err != nil {
global.GVA_LOG.Error("文件不存在!", zap.Error(err))
response.FailWithMessage("文件不存在", c)
return
}
if fi.IsDir() {
global.GVA_LOG.Error("不支持下载文件夹!", zap.Error(err))
response.FailWithMessage("不支持下载文件夹", c)
return
}
c.Writer.Header().Add("success", "true")
c.File(filePath)
}
@@ -0,0 +1,94 @@
package example
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/example"
exampleRes "github.com/flipped-aurora/gin-vue-admin/server/model/example/response"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type FileUploadAndDownloadApi struct{}
// @Tags ExaFileUploadAndDownload
// @Summary 上传文件示例
// @Security ApiKeyAuth
// @accept multipart/form-data
// @Produce application/json
// @Param file formData file true "上传文件示例"
// @Success 200 {object} response.Response{data=exampleRes.ExaFileResponse,msg=string} "上传文件示例,返回包括文件详情"
// @Router /fileUploadAndDownload/upload [post]
func (b *FileUploadAndDownloadApi) UploadFile(c *gin.Context) {
var file example.ExaFileUploadAndDownload
noSave := c.DefaultQuery("noSave", "0")
_, header, err := c.Request.FormFile("file")
if err != nil {
global.GVA_LOG.Error("接收文件失败!", zap.Error(err))
response.FailWithMessage("接收文件失败", c)
return
}
file, err = fileUploadAndDownloadService.UploadFile(header, noSave) // 文件上传后拿到文件路径
if err != nil {
global.GVA_LOG.Error("修改数据库链接失败!", zap.Error(err))
response.FailWithMessage("修改数据库链接失败", c)
return
}
response.OkWithDetailed(exampleRes.ExaFileResponse{File: file}, "上传成功", c)
}
// EditFileName 编辑文件名或者备注
func (b *FileUploadAndDownloadApi) EditFileName(c *gin.Context) {
var file example.ExaFileUploadAndDownload
_ = c.ShouldBindJSON(&file)
if err := fileUploadAndDownloadService.EditFileName(file); err != nil {
global.GVA_LOG.Error("编辑失败!", zap.Error(err))
response.FailWithMessage("编辑失败", c)
return
}
response.OkWithMessage("编辑成功", c)
}
// @Tags ExaFileUploadAndDownload
// @Summary 删除文件
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body example.ExaFileUploadAndDownload true "传入文件里面id即可"
// @Success 200 {object} response.Response{msg=string} "删除文件"
// @Router /fileUploadAndDownload/deleteFile [post]
func (b *FileUploadAndDownloadApi) DeleteFile(c *gin.Context) {
var file example.ExaFileUploadAndDownload
_ = c.ShouldBindJSON(&file)
if err := fileUploadAndDownloadService.DeleteFile(file); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
return
}
response.OkWithMessage("删除成功", c)
}
// @Tags ExaFileUploadAndDownload
// @Summary 分页文件列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "页码, 每页大小"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页文件列表,返回包括列表,总数,页码,每页数量"
// @Router /fileUploadAndDownload/getFileList [post]
func (b *FileUploadAndDownloadApi) GetFileList(c *gin.Context) {
var pageInfo request.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
list, total, err := fileUploadAndDownloadService.GetFileRecordInfoList(pageInfo)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
-149
View File
@@ -1,149 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags SysApi
// @Summary 创建基础api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysApi true "api路径, api中文描述, api组, 方法"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /api/createApi [post]
func CreateApi(c *gin.Context) {
var api model.SysApi
_ = c.ShouldBindJSON(&api)
if err := utils.Verify(api, utils.ApiVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.CreateApi(api); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags SysApi
// @Summary 删除api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysApi true "ID"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /api/deleteApi [post]
func DeleteApi(c *gin.Context) {
var api model.SysApi
_ = c.ShouldBindJSON(&api)
if err := utils.Verify(api.GVA_MODEL, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.DeleteApi(api); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags SysApi
// @Summary 分页获取API列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SearchApiParams true "分页获取API列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/getApiList [post]
func GetApiList(c *gin.Context) {
var pageInfo request.SearchApiParams
_ = c.ShouldBindJSON(&pageInfo)
if err := utils.Verify(pageInfo.PageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, list, total := service.GetAPIInfoList(pageInfo.SysApi, pageInfo.PageInfo, pageInfo.OrderKey, pageInfo.Desc); 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)
}
}
// @Tags SysApi
// @Summary 根据id获取api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.GetById true "根据id获取api"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/getApiById [post]
func GetApiById(c *gin.Context) {
var idInfo request.GetById
_ = c.ShouldBindJSON(&idInfo)
if err := utils.Verify(idInfo, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
err, api := service.GetApiById(idInfo.Id)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithData(response.SysAPIResponse{Api: api}, c)
}
}
// @Tags SysApi
// @Summary 创建基础api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysApi true "api路径, api中文描述, api组, 方法"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /api/updateApi [post]
func UpdateApi(c *gin.Context) {
var api model.SysApi
_ = c.ShouldBindJSON(&api)
if err := utils.Verify(api, utils.ApiVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.UpdateApi(api); err != nil {
global.GVA_LOG.Error("修改失败!", zap.Any("err", err))
response.FailWithMessage("修改失败", c)
} else {
response.OkWithMessage("修改成功", c)
}
}
// @Tags SysApi
// @Summary 获取所有的Api 不分页
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /api/getAllApis [post]
func GetAllApis(c *gin.Context) {
if err, apis := service.GetAllApis(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.SysAPIListResponse{Apis: apis}, "获取成功", c)
}
}
-159
View File
@@ -1,159 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags Authority
// @Summary 创建角色
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysAuthority true "权限id, 权限名, 父角色id"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /authority/createAuthority [post]
func CreateAuthority(c *gin.Context) {
var authority model.SysAuthority
_ = c.ShouldBindJSON(&authority)
if err := utils.Verify(authority, utils.AuthorityVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, authBack := service.CreateAuthority(authority); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
response.FailWithMessage("创建失败"+err.Error(), c)
} else {
response.OkWithDetailed(response.SysAuthorityResponse{Authority: authBack}, "创建成功", c)
}
}
// @Tags Authority
// @Summary 拷贝角色
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body response.SysAuthorityCopyResponse true "旧角色id, 新权限id, 新权限名, 新父角色id"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"拷贝成功"}"
// @Router /authority/copyAuthority [post]
func CopyAuthority(c *gin.Context) {
var copyInfo response.SysAuthorityCopyResponse
_ = c.ShouldBindJSON(&copyInfo)
if err := utils.Verify(copyInfo, utils.OldAuthorityVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := utils.Verify(copyInfo.Authority, utils.AuthorityVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, authBack := service.CopyAuthority(copyInfo); err != nil {
global.GVA_LOG.Error("拷贝失败!", zap.Any("err", err))
response.FailWithMessage("拷贝失败"+err.Error(), c)
} else {
response.OkWithDetailed(response.SysAuthorityResponse{Authority: authBack}, "拷贝成功", c)
}
}
// @Tags Authority
// @Summary 删除角色
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysAuthority true "删除角色"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /authority/deleteAuthority [post]
func DeleteAuthority(c *gin.Context) {
var authority model.SysAuthority
_ = c.ShouldBindJSON(&authority)
if err := utils.Verify(authority, utils.AuthorityIdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.DeleteAuthority(&authority); err != nil { // 删除角色之前需要判断是否有用户正在使用此角色
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
response.FailWithMessage("删除失败"+err.Error(), c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags Authority
// @Summary 更新角色信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysAuthority true "权限id, 权限名, 父角色id"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /authority/updateAuthority [post]
func UpdateAuthority(c *gin.Context) {
var auth model.SysAuthority
_ = c.ShouldBindJSON(&auth)
if err := utils.Verify(auth, utils.AuthorityVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, authority := service.UpdateAuthority(auth); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
response.FailWithMessage("更新失败"+err.Error(), c)
} else {
response.OkWithDetailed(response.SysAuthorityResponse{Authority: authority}, "更新成功", c)
}
}
// @Tags Authority
// @Summary 分页获取角色列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "页码, 每页大小"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /authority/getAuthorityList [post]
func GetAuthorityList(c *gin.Context) {
var pageInfo request.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
if err := utils.Verify(pageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, list, total := service.GetAuthorityInfoList(pageInfo); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
response.FailWithMessage("获取失败"+err.Error(), c)
} else {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
// @Tags Authority
// @Summary 设置角色资源权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysAuthority true "设置角色资源权限"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
// @Router /authority/setDataAuthority [post]
func SetDataAuthority(c *gin.Context) {
var auth model.SysAuthority
_ = c.ShouldBindJSON(&auth)
if err := utils.Verify(auth, utils.AuthorityIdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.SetDataAuthority(auth); err != nil {
global.GVA_LOG.Error("设置失败!", zap.Any("err", err))
response.FailWithMessage("设置失败"+err.Error(), c)
} else {
response.OkWithMessage("设置成功", c)
}
}
-111
View File
@@ -1,111 +0,0 @@
package v1
import (
"fmt"
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"github.com/pkg/errors"
"go.uber.org/zap"
"net/url"
"os"
)
// @Tags AutoCode
// @Summary 自动代码模板
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.AutoCodeStruct true "创建自动代码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /autoCode/createTemp [post]
func CreateTemp(c *gin.Context) {
var a model.AutoCodeStruct
_ = c.ShouldBindJSON(&a)
if err := utils.Verify(a, utils.AutoCodeVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if a.AutoCreateApiToSql {
if err := service.AutoCreateApi(&a); err != nil {
global.GVA_LOG.Error("自动化创建失败!请自行清空垃圾数据!", zap.Any("err", err))
c.Writer.Header().Add("success", "false")
c.Writer.Header().Add("msg", url.QueryEscape("自动化创建失败!请自行清空垃圾数据!"))
return
}
}
err := service.CreateTemp(a)
if err != nil {
if errors.Is(err, model.AutoMoveErr) {
c.Writer.Header().Add("success", "false")
c.Writer.Header().Add("msgtype", "success")
c.Writer.Header().Add("msg", url.QueryEscape(err.Error()))
} else {
c.Writer.Header().Add("success", "false")
c.Writer.Header().Add("msg", url.QueryEscape(err.Error()))
_ = os.Remove("./ginvueadmin.zip")
}
} else {
c.Writer.Header().Add("Content-Disposition", fmt.Sprintf("attachment; filename=%s", "ginvueadmin.zip")) // fmt.Sprintf("attachment; filename=%s", filename)对下载的文件重命名
c.Writer.Header().Add("Content-Type", "application/json")
c.Writer.Header().Add("success", "true")
c.File("./ginvueadmin.zip")
_ = os.Remove("./ginvueadmin.zip")
}
}
// @Tags AutoCode
// @Summary 获取当前数据库所有表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /autoCode/getTables [get]
func GetTables(c *gin.Context) {
dbName := c.DefaultQuery("dbName", global.GVA_CONFIG.Mysql.Dbname)
err, tables := service.GetTables(dbName)
if err != nil {
global.GVA_LOG.Error("查询table失败!", zap.Any("err", err))
response.FailWithMessage("查询table失败", c)
} else {
response.OkWithDetailed(gin.H{"tables": tables}, "获取成功", c)
}
}
// @Tags AutoCode
// @Summary 获取当前所有数据库
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /autoCode/getDatabase [get]
func GetDB(c *gin.Context) {
if err, dbs := service.GetDB(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(gin.H{"dbs": dbs}, "获取成功", c)
}
}
// @Tags AutoCode
// @Summary 获取当前表所有字段
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /autoCode/getColumn [get]
func GetColumn(c *gin.Context) {
dbName := c.DefaultQuery("dbName", global.GVA_CONFIG.Mysql.Dbname)
tableName := c.Query("tableName")
if err, columns := service.GetColumn(tableName, dbName); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(gin.H{"columns": columns}, "获取成功", c)
}
}
-34
View File
@@ -1,34 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model/response"
"github.com/gin-gonic/gin"
"github.com/mojocn/base64Captcha"
"go.uber.org/zap"
)
var store = base64Captcha.DefaultMemStore
// @Tags Base
// @Summary 生成验证码
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"验证码获取成功"}"
// @Router /base/captcha [post]
func Captcha(c *gin.Context) {
//字符,公式,验证码配置
// 生成默认数字的driver
driver := base64Captcha.NewDriverDigit(global.GVA_CONFIG.Captcha.ImgHeight, global.GVA_CONFIG.Captcha.ImgWidth, global.GVA_CONFIG.Captcha.KeyLong, 0.7, 80)
cp := base64Captcha.NewCaptcha(driver, store)
if id, b64s, err := cp.Generate(); err != nil {
global.GVA_LOG.Error("验证码获取失败!", zap.Any("err", err))
response.FailWithMessage("验证码获取失败", c)
} else {
response.OkWithDetailed(response.SysCaptchaResponse{
CaptchaId: id,
PicPath: b64s,
}, "验证码获取成功", c)
}
}
-116
View File
@@ -1,116 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags SysDictionary
// @Summary 创建SysDictionary
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysDictionary true "SysDictionary模型"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /sysDictionary/createSysDictionary [post]
func CreateSysDictionary(c *gin.Context) {
var dictionary model.SysDictionary
_ = c.ShouldBindJSON(&dictionary)
if err := service.CreateSysDictionary(dictionary); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags SysDictionary
// @Summary 删除SysDictionary
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysDictionary true "SysDictionary模型"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /sysDictionary/deleteSysDictionary [delete]
func DeleteSysDictionary(c *gin.Context) {
var dictionary model.SysDictionary
_ = c.ShouldBindJSON(&dictionary)
if err := service.DeleteSysDictionary(dictionary); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags SysDictionary
// @Summary 更新SysDictionary
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysDictionary true "SysDictionary模型"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /sysDictionary/updateSysDictionary [put]
func UpdateSysDictionary(c *gin.Context) {
var dictionary model.SysDictionary
_ = c.ShouldBindJSON(&dictionary)
if err := service.UpdateSysDictionary(&dictionary); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
response.FailWithMessage("更新失败", c)
} else {
response.OkWithMessage("更新成功", c)
}
}
// @Tags SysDictionary
// @Summary 用id查询SysDictionary
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysDictionary true "ID或字典英名"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /sysDictionary/findSysDictionary [get]
func FindSysDictionary(c *gin.Context) {
var dictionary model.SysDictionary
_ = c.ShouldBindQuery(&dictionary)
if err, sysDictionary := service.GetSysDictionary(dictionary.Type, dictionary.ID); err != nil {
global.GVA_LOG.Error("查询失败!", zap.Any("err", err))
response.FailWithMessage("查询失败", c)
} else {
response.OkWithDetailed(gin.H{"resysDictionary": sysDictionary}, "查询成功", c)
}
}
// @Tags SysDictionary
// @Summary 分页获取SysDictionary列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SysDictionarySearch true "页码, 每页大小, 搜索条件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /sysDictionary/getSysDictionaryList [get]
func GetSysDictionaryList(c *gin.Context) {
var pageInfo request.SysDictionarySearch
_ = c.ShouldBindQuery(&pageInfo)
if err := utils.Verify(pageInfo.PageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, list, total := service.GetSysDictionaryInfoList(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)
}
}
-116
View File
@@ -1,116 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags SysDictionaryDetail
// @Summary 创建SysDictionaryDetail
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysDictionaryDetail true "SysDictionaryDetail模型"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /sysDictionaryDetail/createSysDictionaryDetail [post]
func CreateSysDictionaryDetail(c *gin.Context) {
var detail model.SysDictionaryDetail
_ = c.ShouldBindJSON(&detail)
if err := service.CreateSysDictionaryDetail(detail); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags SysDictionaryDetail
// @Summary 删除SysDictionaryDetail
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysDictionaryDetail true "SysDictionaryDetail模型"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /sysDictionaryDetail/deleteSysDictionaryDetail [delete]
func DeleteSysDictionaryDetail(c *gin.Context) {
var detail model.SysDictionaryDetail
_ = c.ShouldBindJSON(&detail)
if err := service.DeleteSysDictionaryDetail(detail); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags SysDictionaryDetail
// @Summary 更新SysDictionaryDetail
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysDictionaryDetail true "更新SysDictionaryDetail"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /sysDictionaryDetail/updateSysDictionaryDetail [put]
func UpdateSysDictionaryDetail(c *gin.Context) {
var detail model.SysDictionaryDetail
_ = c.ShouldBindJSON(&detail)
if err := service.UpdateSysDictionaryDetail(&detail); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
response.FailWithMessage("更新失败", c)
} else {
response.OkWithMessage("更新成功", c)
}
}
// @Tags SysDictionaryDetail
// @Summary 用id查询SysDictionaryDetail
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysDictionaryDetail true "用id查询SysDictionaryDetail"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /sysDictionaryDetail/findSysDictionaryDetail [get]
func FindSysDictionaryDetail(c *gin.Context) {
var detail model.SysDictionaryDetail
_ = c.ShouldBindQuery(&detail)
if err := utils.Verify(detail, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, resysDictionaryDetail := service.GetSysDictionaryDetail(detail.ID); err != nil {
global.GVA_LOG.Error("查询失败!", zap.Any("err", err))
response.FailWithMessage("查询失败", c)
} else {
response.OkWithDetailed(gin.H{"resysDictionaryDetail": resysDictionaryDetail}, "查询成功", c)
}
}
// @Tags SysDictionaryDetail
// @Summary 分页获取SysDictionaryDetail列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SysDictionaryDetailSearch true "页码, 每页大小, 搜索条件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /sysDictionaryDetail/getSysDictionaryDetailList [get]
func GetSysDictionaryDetailList(c *gin.Context) {
var pageInfo request.SysDictionaryDetailSearch
_ = c.ShouldBindQuery(&pageInfo)
if err, list, total := service.GetSysDictionaryDetailInfoList(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)
}
}
-24
View File
@@ -1,24 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags System
// @Summary 发送测试邮件
// @Security ApiKeyAuth
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"发送成功"}"
// @Router /email/emailTest [post]
func EmailTest(c *gin.Context) {
if err := service.EmailTest(); err != nil {
global.GVA_LOG.Error("发送失败!", zap.Any("err", err))
response.FailWithMessage("发送失败", c)
} else {
response.OkWithData("发送成功", c)
}
}
-28
View File
@@ -1,28 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags Jwt
// @Summary jwt加入黑名单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"拉黑成功"}"
// @Router /jwt/jsonInBlacklist [post]
func JsonInBlacklist(c *gin.Context) {
token := c.Request.Header.Get("x-token")
jwt := model.JwtBlacklist{Jwt: token}
if err := service.JsonInBlacklist(jwt); err != nil {
global.GVA_LOG.Error("jwt作废失败!", zap.Any("err", err))
response.FailWithMessage("jwt作废失败", c)
} else {
response.OkWithMessage("jwt作废成功", c)
}
}
-116
View File
@@ -1,116 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags SysOperationRecord
// @Summary 创建SysOperationRecord
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysOperationRecord true "创建SysOperationRecord"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /sysOperationRecord/createSysOperationRecord [post]
func CreateSysOperationRecord(c *gin.Context) {
var sysOperationRecord model.SysOperationRecord
_ = c.ShouldBindJSON(&sysOperationRecord)
if err := service.CreateSysOperationRecord(sysOperationRecord); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Any("err", err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags SysOperationRecord
// @Summary 删除SysOperationRecord
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysOperationRecord true "SysOperationRecord模型"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /sysOperationRecord/deleteSysOperationRecord [delete]
func DeleteSysOperationRecord(c *gin.Context) {
var sysOperationRecord model.SysOperationRecord
_ = c.ShouldBindJSON(&sysOperationRecord)
if err := service.DeleteSysOperationRecord(sysOperationRecord); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags SysOperationRecord
// @Summary 批量删除SysOperationRecord
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除SysOperationRecord"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"批量删除成功"}"
// @Router /sysOperationRecord/deleteSysOperationRecordByIds [delete]
func DeleteSysOperationRecordByIds(c *gin.Context) {
var IDS request.IdsReq
_ = c.ShouldBindJSON(&IDS)
if err := service.DeleteSysOperationRecordByIds(IDS); err != nil {
global.GVA_LOG.Error("批量删除失败!", zap.Any("err", err))
response.FailWithMessage("批量删除失败", c)
} else {
response.OkWithMessage("批量删除成功", c)
}
}
// @Tags SysOperationRecord
// @Summary 用id查询SysOperationRecord
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysOperationRecord true "Id"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /sysOperationRecord/findSysOperationRecord [get]
func FindSysOperationRecord(c *gin.Context) {
var sysOperationRecord model.SysOperationRecord
_ = c.ShouldBindQuery(&sysOperationRecord)
if err := utils.Verify(sysOperationRecord, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, resysOperationRecord := service.GetSysOperationRecord(sysOperationRecord.ID); err != nil {
global.GVA_LOG.Error("查询失败!", zap.Any("err", err))
response.FailWithMessage("查询失败", c)
} else {
response.OkWithDetailed(gin.H{"resysOperationRecord": resysOperationRecord}, "查询成功", c)
}
}
// @Tags SysOperationRecord
// @Summary 分页获取SysOperationRecord列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SysOperationRecordSearch true "页码, 每页大小, 搜索条件"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /sysOperationRecord/getSysOperationRecordList [get]
func GetSysOperationRecordList(c *gin.Context) {
var pageInfo request.SysOperationRecordSearch
_ = c.ShouldBindQuery(&pageInfo)
if err, list, total := service.GetSysOperationRecordInfoList(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)
}
}
-79
View File
@@ -1,79 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
// @Tags System
// @Summary 获取配置文件内容
// @Security ApiKeyAuth
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /system/getSystemConfig [post]
func GetSystemConfig(c *gin.Context) {
if err, config := service.GetSystemConfig(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.SysConfigResponse{Config: config}, "获取成功", c)
}
}
// @Tags System
// @Summary 设置配置文件内容
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body model.System true "设置配置文件内容"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
// @Router /system/setSystemConfig [post]
func SetSystemConfig(c *gin.Context) {
var sys model.System
_ = c.ShouldBindJSON(&sys)
if err := service.SetSystemConfig(sys); err != nil {
global.GVA_LOG.Error("设置失败!", zap.Any("err", err))
response.FailWithMessage("设置失败", c)
} else {
response.OkWithData("设置成功", c)
}
}
// 本方法开发中 开发者windows系统 缺少linux系统所需的包 因此搁置
// @Tags System
// @Summary 重启系统
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body model.System true "重启系统"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"重启系统成功"}"
// @Router /system/ReloadSystem [post]
func ReloadSystem(c *gin.Context) {
var sys model.System
_ = c.ShouldBindJSON(&sys)
if err := service.SetSystemConfig(sys); err != nil {
global.GVA_LOG.Error("重启系统失败!", zap.Any("err", err))
response.FailWithMessage("重启系统失败", c)
} else {
response.OkWithMessage("重启系统成功", c)
}
}
// @Tags System
// @Summary 获取服务器信息
// @Security ApiKeyAuth
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /system/getServerInfo [post]
func GetServerInfo(c *gin.Context) {
if server, err := service.GetServerInfo(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
response.FailWithMessage("获取失败", c)
return
} else {
response.OkWithDetailed(gin.H{"server": server}, "获取成功", c)
}
}
-286
View File
@@ -1,286 +0,0 @@
package v1
import (
"gin-vue-admin/global"
"gin-vue-admin/middleware"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/dgrijalva/jwt-go"
"github.com/gin-gonic/gin"
"github.com/go-redis/redis"
"go.uber.org/zap"
"time"
)
// @Tags Base
// @Summary 用户登录
// @Produce application/json
// @Param data body request.Login true "用户名, 密码, 验证码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"登陆成功"}"
// @Router /base/login [post]
func Login(c *gin.Context) {
var L request.Login
_ = c.ShouldBindJSON(&L)
if err := utils.Verify(L, utils.LoginVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if store.Verify(L.CaptchaId, L.Captcha, true) {
U := &model.SysUser{Username: L.Username, Password: L.Password}
if err, user := service.Login(U); err != nil {
global.GVA_LOG.Error("登陆失败! 用户名不存在或者密码错误", zap.Any("err", err))
response.FailWithMessage("用户名不存在或者密码错误", c)
} else {
tokenNext(c, *user)
}
} else {
response.FailWithMessage("验证码错误", c)
}
}
// 登录以后签发jwt
func tokenNext(c *gin.Context, user model.SysUser) {
j := &middleware.JWT{SigningKey: []byte(global.GVA_CONFIG.JWT.SigningKey)} // 唯一签名
claims := request.CustomClaims{
UUID: user.UUID,
ID: user.ID,
NickName: user.NickName,
Username: user.Username,
AuthorityId: user.AuthorityId,
BufferTime: global.GVA_CONFIG.JWT.BufferTime, // 缓冲时间1天 缓冲时间内会获得新的token刷新令牌 此时一个用户会存在两个有效令牌 但是前端只留一个 另一个会丢失
StandardClaims: jwt.StandardClaims{
NotBefore: time.Now().Unix() - 1000, // 签名生效时间
ExpiresAt: time.Now().Unix() + global.GVA_CONFIG.JWT.ExpiresTime, // 过期时间 7天 配置文件
Issuer: "qmPlus", // 签名的发行者
},
}
token, err := j.CreateToken(claims)
if err != nil {
global.GVA_LOG.Error("获取token失败", zap.Any("err", err))
response.FailWithMessage("获取token失败", c)
return
}
if !global.GVA_CONFIG.System.UseMultipoint {
response.OkWithDetailed(response.LoginResponse{
User: user,
Token: token,
ExpiresAt: claims.StandardClaims.ExpiresAt * 1000,
}, "登录成功", c)
return
}
if err, jwtStr := service.GetRedisJWT(user.Username); err == redis.Nil {
if err := service.SetRedisJWT(token, user.Username); err != nil {
global.GVA_LOG.Error("设置登录状态失败", zap.Any("err", err))
response.FailWithMessage("设置登录状态失败", c)
return
}
response.OkWithDetailed(response.LoginResponse{
User: user,
Token: token,
ExpiresAt: claims.StandardClaims.ExpiresAt * 1000,
}, "登录成功", c)
} else if err != nil {
global.GVA_LOG.Error("设置登录状态失败", zap.Any("err", err))
response.FailWithMessage("设置登录状态失败", c)
} else {
var blackJWT model.JwtBlacklist
blackJWT.Jwt = jwtStr
if err := service.JsonInBlacklist(blackJWT); err != nil {
response.FailWithMessage("jwt作废失败", c)
return
}
if err := service.SetRedisJWT(token, user.Username); err != nil {
response.FailWithMessage("设置登录状态失败", c)
return
}
response.OkWithDetailed(response.LoginResponse{
User: user,
Token: token,
ExpiresAt: claims.StandardClaims.ExpiresAt * 1000,
}, "登录成功", c)
}
}
// @Tags SysUser
// @Summary 用户注册账号
// @Produce application/json
// @Param data body model.SysUser true "用户名, 昵称, 密码, 角色ID"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"注册成功"}"
// @Router /user/register [post]
func Register(c *gin.Context) {
var R request.Register
_ = c.ShouldBindJSON(&R)
if err := utils.Verify(R, utils.RegisterVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
user := &model.SysUser{Username: R.Username, NickName: R.NickName, Password: R.Password, HeaderImg: R.HeaderImg, AuthorityId: R.AuthorityId}
err, userReturn := service.Register(*user)
if err != nil {
global.GVA_LOG.Error("注册失败", zap.Any("err", err))
response.FailWithDetailed(response.SysUserResponse{User: userReturn}, "注册失败", c)
} else {
response.OkWithDetailed(response.SysUserResponse{User: userReturn}, "注册成功", c)
}
}
// @Tags SysUser
// @Summary 用户修改密码
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body request.ChangePasswordStruct true "用户名, 原密码, 新密码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/changePassword [put]
func ChangePassword(c *gin.Context) {
var user request.ChangePasswordStruct
_ = c.ShouldBindJSON(&user)
if err := utils.Verify(user, utils.ChangePasswordVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
U := &model.SysUser{Username: user.Username, Password: user.Password}
if err, _ := service.ChangePassword(U, user.NewPassword); err != nil {
global.GVA_LOG.Error("修改失败", zap.Any("err", err))
response.FailWithMessage("修改失败,原密码与当前账户不符", c)
} else {
response.OkWithMessage("修改成功", c)
}
}
// @Tags SysUser
// @Summary 分页获取用户列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "页码, 每页大小"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /user/getUserList [post]
func GetUserList(c *gin.Context) {
var pageInfo request.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
if err := utils.Verify(pageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, list, total := service.GetUserInfoList(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)
}
}
// @Tags SysUser
// @Summary 设置用户权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SetUserAuth true "用户UUID, 角色ID"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}"
// @Router /user/setUserAuthority [post]
func SetUserAuthority(c *gin.Context) {
var sua request.SetUserAuth
_ = c.ShouldBindJSON(&sua)
if UserVerifyErr := utils.Verify(sua, utils.SetUserAuthorityVerify); UserVerifyErr != nil {
response.FailWithMessage(UserVerifyErr.Error(), c)
return
}
if err := service.SetUserAuthority(sua.UUID, sua.AuthorityId); err != nil {
global.GVA_LOG.Error("修改失败", zap.Any("err", err))
response.FailWithMessage("修改失败", c)
} else {
response.OkWithMessage("修改成功", c)
}
}
// @Tags SysUser
// @Summary 删除用户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.GetById true "用户ID"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /user/deleteUser [delete]
func DeleteUser(c *gin.Context) {
var reqId request.GetById
_ = c.ShouldBindJSON(&reqId)
if err := utils.Verify(reqId, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
jwtId := getUserID(c)
if jwtId == uint(reqId.Id) {
response.FailWithMessage("删除失败, 自杀失败", c)
return
}
if err := service.DeleteUser(reqId.Id); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags SysUser
// @Summary 设置用户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysUser true "ID, 用户名, 昵称, 头像链接"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"设置成功"}"
// @Router /user/setUserInfo [put]
func SetUserInfo(c *gin.Context) {
var user model.SysUser
_ = c.ShouldBindJSON(&user)
if err := utils.Verify(user, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, ReqUser := service.SetUserInfo(user); err != nil {
global.GVA_LOG.Error("设置失败", zap.Any("err", err))
response.FailWithMessage("设置失败", c)
} else {
response.OkWithDetailed(gin.H{"userInfo": ReqUser}, "设置成功", c)
}
}
// 从Gin的Context中获取从jwt解析出来的用户ID
func getUserID(c *gin.Context) uint {
if claims, exists := c.Get("claims"); !exists {
global.GVA_LOG.Error("从Gin的Context中获取从jwt解析出来的用户ID失败, 请检查路由是否使用jwt中间件")
return 0
} else {
waitUse := claims.(*request.CustomClaims)
return waitUse.ID
}
}
// 从Gin的Context中获取从jwt解析出来的用户UUID
func getUserUuid(c *gin.Context) string {
if claims, exists := c.Get("claims"); !exists {
global.GVA_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件")
return ""
} else {
waitUse := claims.(*request.CustomClaims)
return waitUse.UUID.String()
}
}
// 从Gin的Context中获取从jwt解析出来的用户角色id
func getUserAuthorityId(c *gin.Context) string {
if claims, exists := c.Get("claims"); !exists {
global.GVA_LOG.Error("从Gin的Context中获取从jwt解析出来的用户UUID失败, 请检查路由是否使用jwt中间件")
return ""
} else {
waitUse := claims.(*request.CustomClaims)
return waitUse.AuthorityId
}
}
+38
View File
@@ -0,0 +1,38 @@
package system
import "github.com/flipped-aurora/gin-vue-admin/server/service"
type ApiGroup struct {
DBApi
JwtApi
BaseApi
SystemApi
CasbinApi
AutoCodeApi
SystemApiApi
AuthorityApi
DictionaryApi
AuthorityMenuApi
OperationRecordApi
AutoCodeHistoryApi
DictionaryDetailApi
AuthorityBtnApi
}
var (
apiService = service.ServiceGroupApp.SystemServiceGroup.ApiService
jwtService = service.ServiceGroupApp.SystemServiceGroup.JwtService
menuService = service.ServiceGroupApp.SystemServiceGroup.MenuService
userService = service.ServiceGroupApp.SystemServiceGroup.UserService
initDBService = service.ServiceGroupApp.SystemServiceGroup.InitDBService
casbinService = service.ServiceGroupApp.SystemServiceGroup.CasbinService
autoCodeService = service.ServiceGroupApp.SystemServiceGroup.AutoCodeService
baseMenuService = service.ServiceGroupApp.SystemServiceGroup.BaseMenuService
authorityService = service.ServiceGroupApp.SystemServiceGroup.AuthorityService
dictionaryService = service.ServiceGroupApp.SystemServiceGroup.DictionaryService
systemConfigService = service.ServiceGroupApp.SystemServiceGroup.SystemConfigService
operationRecordService = service.ServiceGroupApp.SystemServiceGroup.OperationRecordService
autoCodeHistoryService = service.ServiceGroupApp.SystemServiceGroup.AutoCodeHistoryService
dictionaryDetailService = service.ServiceGroupApp.SystemServiceGroup.DictionaryDetailService
authorityBtnService = service.ServiceGroupApp.SystemServiceGroup.AuthorityBtnService
)
+172
View File
@@ -0,0 +1,172 @@
package system
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type SystemApiApi struct{}
// @Tags SysApi
// @Summary 创建基础api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysApi true "api路径, api中文描述, api组, 方法"
// @Success 200 {object} response.Response{msg=string} "创建基础api"
// @Router /api/createApi [post]
func (s *SystemApiApi) CreateApi(c *gin.Context) {
var api system.SysApi
_ = c.ShouldBindJSON(&api)
if err := utils.Verify(api, utils.ApiVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := apiService.CreateApi(api); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Error(err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags SysApi
// @Summary 删除api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysApi true "ID"
// @Success 200 {object} response.Response{msg=string} "删除api"
// @Router /api/deleteApi [post]
func (s *SystemApiApi) DeleteApi(c *gin.Context) {
var api system.SysApi
_ = c.ShouldBindJSON(&api)
if err := utils.Verify(api.GVA_MODEL, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := apiService.DeleteApi(api); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags SysApi
// @Summary 分页获取API列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body systemReq.SearchApiParams true "分页获取API列表"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取API列表,返回包括列表,总数,页码,每页数量"
// @Router /api/getApiList [post]
func (s *SystemApiApi) GetApiList(c *gin.Context) {
var pageInfo systemReq.SearchApiParams
_ = c.ShouldBindJSON(&pageInfo)
if err := utils.Verify(pageInfo.PageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if list, total, err := apiService.GetAPIInfoList(pageInfo.SysApi, pageInfo.PageInfo, pageInfo.OrderKey, pageInfo.Desc); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
// @Tags SysApi
// @Summary 根据id获取api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.GetById true "根据id获取api"
// @Success 200 {object} response.Response{data=systemRes.SysAPIResponse} "根据id获取api,返回包括api详情"
// @Router /api/getApiById [post]
func (s *SystemApiApi) GetApiById(c *gin.Context) {
var idInfo request.GetById
_ = c.ShouldBindJSON(&idInfo)
if err := utils.Verify(idInfo, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
api, err := apiService.GetApiById(idInfo.ID)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(systemRes.SysAPIResponse{Api: api}, "获取成功", c)
}
}
// @Tags SysApi
// @Summary 修改基础api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysApi true "api路径, api中文描述, api组, 方法"
// @Success 200 {object} response.Response{msg=string} "修改基础api"
// @Router /api/updateApi [post]
func (s *SystemApiApi) UpdateApi(c *gin.Context) {
var api system.SysApi
_ = c.ShouldBindJSON(&api)
if err := utils.Verify(api, utils.ApiVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := apiService.UpdateApi(api); err != nil {
global.GVA_LOG.Error("修改失败!", zap.Error(err))
response.FailWithMessage("修改失败", c)
} else {
response.OkWithMessage("修改成功", c)
}
}
// @Tags SysApi
// @Summary 获取所有的Api 不分页
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=systemRes.SysAPIListResponse,msg=string} "获取所有的Api 不分页,返回包括api列表"
// @Router /api/getAllApis [post]
func (s *SystemApiApi) GetAllApis(c *gin.Context) {
if apis, err := apiService.GetAllApis(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(systemRes.SysAPIListResponse{Apis: apis}, "获取成功", c)
}
}
// @Tags SysApi
// @Summary 删除选中Api
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "ID"
// @Success 200 {object} response.Response{msg=string} "删除选中Api"
// @Router /api/deleteApisByIds [delete]
func (s *SystemApiApi) DeleteApisByIds(c *gin.Context) {
var ids request.IdsReq
_ = c.ShouldBindJSON(&ids)
if err := apiService.DeleteApisByIds(ids); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
+165
View File
@@ -0,0 +1,165 @@
package system
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type AuthorityApi struct{}
// @Tags Authority
// @Summary 创建角色
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysAuthority true "权限id, 权限名, 父角色id"
// @Success 200 {object} response.Response{data=systemRes.SysAuthorityResponse,msg=string} "创建角色,返回包括系统角色详情"
// @Router /authority/createAuthority [post]
func (a *AuthorityApi) CreateAuthority(c *gin.Context) {
var authority system.SysAuthority
_ = c.ShouldBindJSON(&authority)
if err := utils.Verify(authority, utils.AuthorityVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if authBack, err := authorityService.CreateAuthority(authority); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Error(err))
response.FailWithMessage("创建失败"+err.Error(), c)
} else {
_ = menuService.AddMenuAuthority(systemReq.DefaultMenu(), authority.AuthorityId)
_ = casbinService.UpdateCasbin(authority.AuthorityId, systemReq.DefaultCasbin())
response.OkWithDetailed(systemRes.SysAuthorityResponse{Authority: authBack}, "创建成功", c)
}
}
// @Tags Authority
// @Summary 拷贝角色
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body response.SysAuthorityCopyResponse true "旧角色id, 新权限id, 新权限名, 新父角色id"
// @Success 200 {object} response.Response{data=systemRes.SysAuthorityResponse,msg=string} "拷贝角色,返回包括系统角色详情"
// @Router /authority/copyAuthority [post]
func (a *AuthorityApi) CopyAuthority(c *gin.Context) {
var copyInfo systemRes.SysAuthorityCopyResponse
_ = c.ShouldBindJSON(&copyInfo)
if err := utils.Verify(copyInfo, utils.OldAuthorityVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := utils.Verify(copyInfo.Authority, utils.AuthorityVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if authBack, err := authorityService.CopyAuthority(copyInfo); err != nil {
global.GVA_LOG.Error("拷贝失败!", zap.Error(err))
response.FailWithMessage("拷贝失败"+err.Error(), c)
} else {
response.OkWithDetailed(systemRes.SysAuthorityResponse{Authority: authBack}, "拷贝成功", c)
}
}
// @Tags Authority
// @Summary 删除角色
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysAuthority true "删除角色"
// @Success 200 {object} response.Response{msg=string} "删除角色"
// @Router /authority/deleteAuthority [post]
func (a *AuthorityApi) DeleteAuthority(c *gin.Context) {
var authority system.SysAuthority
_ = c.ShouldBindJSON(&authority)
if err := utils.Verify(authority, utils.AuthorityIdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := authorityService.DeleteAuthority(&authority); err != nil { // 删除角色之前需要判断是否有用户正在使用此角色
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败"+err.Error(), c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags Authority
// @Summary 更新角色信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysAuthority true "权限id, 权限名, 父角色id"
// @Success 200 {object} response.Response{data=systemRes.SysAuthorityResponse,msg=string} "更新角色信息,返回包括系统角色详情"
// @Router /authority/updateAuthority [post]
func (a *AuthorityApi) UpdateAuthority(c *gin.Context) {
var auth system.SysAuthority
_ = c.ShouldBindJSON(&auth)
if err := utils.Verify(auth, utils.AuthorityVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if authority, err := authorityService.UpdateAuthority(auth); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Error(err))
response.FailWithMessage("更新失败"+err.Error(), c)
} else {
response.OkWithDetailed(systemRes.SysAuthorityResponse{Authority: authority}, "更新成功", c)
}
}
// @Tags Authority
// @Summary 分页获取角色列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "页码, 每页大小"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取角色列表,返回包括列表,总数,页码,每页数量"
// @Router /authority/getAuthorityList [post]
func (a *AuthorityApi) GetAuthorityList(c *gin.Context) {
var pageInfo request.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
if err := utils.Verify(pageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if list, total, err := authorityService.GetAuthorityInfoList(pageInfo); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败"+err.Error(), c)
} else {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
// @Tags Authority
// @Summary 设置角色资源权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysAuthority true "设置角色资源权限"
// @Success 200 {object} response.Response{msg=string} "设置角色资源权限"
// @Router /authority/setDataAuthority [post]
func (a *AuthorityApi) SetDataAuthority(c *gin.Context) {
var auth system.SysAuthority
_ = c.ShouldBindJSON(&auth)
if err := utils.Verify(auth, utils.AuthorityIdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := authorityService.SetDataAuthority(auth); err != nil {
global.GVA_LOG.Error("设置失败!", zap.Error(err))
response.FailWithMessage("设置失败"+err.Error(), c)
} else {
response.OkWithMessage("设置成功", c)
}
}
+66
View File
@@ -0,0 +1,66 @@
package system
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/request"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type AuthorityBtnApi struct{}
// @Tags AuthorityBtn
// @Summary 获取权限按钮
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SysAuthorityBtnReq true "菜单id, 角色id, 选中的按钮id"
// @Success 200 {object} response.Response{data=response.SysAuthorityBtnRes,msg=string} "返回列表成功"
// @Router /authorityBtn/getAuthorityBtn [post]
func (a *AuthorityBtnApi) GetAuthorityBtn(c *gin.Context) {
var req request.SysAuthorityBtnReq
_ = c.ShouldBindJSON(&req)
if res, err := authorityBtnService.GetAuthorityBtn(req); err != nil {
global.GVA_LOG.Error("查询失败!", zap.Error(err))
response.FailWithMessage("查询失败", c)
} else {
response.OkWithDetailed(res, "查询成功", c)
}
}
// @Tags AuthorityBtn
// @Summary 设置权限按钮
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.SysAuthorityBtnReq true "菜单id, 角色id, 选中的按钮id"
// @Success 200 {object} response.Response{msg=string} "返回列表成功"
// @Router /authorityBtn/setAuthorityBtn [post]
func (a *AuthorityBtnApi) SetAuthorityBtn(c *gin.Context) {
var req request.SysAuthorityBtnReq
_ = c.ShouldBindJSON(&req)
if err := authorityBtnService.SetAuthorityBtn(req); err != nil {
global.GVA_LOG.Error("分配失败!", zap.Error(err))
response.FailWithMessage("分配失败", c)
} else {
response.OkWithMessage("分配成功", c)
}
}
// @Tags AuthorityBtn
// @Summary 设置权限按钮
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{msg=string} "删除成功"
// @Router /authorityBtn/canRemoveAuthorityBtn [post]
func (a *AuthorityBtnApi) CanRemoveAuthorityBtn(c *gin.Context) {
id := c.Query("id")
if err := authorityBtnService.CanRemoveAuthorityBtn(id); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage(err.Error(), c)
} else {
response.OkWithMessage("删除成功", c)
}
}
+242
View File
@@ -0,0 +1,242 @@
package system
import (
"errors"
"fmt"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"net/url"
"os"
"strings"
"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/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type AutoCodeApi struct{}
var caser = cases.Title(language.English)
// PreviewTemp
// @Tags AutoCode
// @Summary 预览创建后的代码
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.AutoCodeStruct true "预览创建代码"
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "预览创建后的代码"
// @Router /autoCode/preview [post]
func (autoApi *AutoCodeApi) PreviewTemp(c *gin.Context) {
var a system.AutoCodeStruct
_ = c.ShouldBindJSON(&a)
if err := utils.Verify(a, utils.AutoCodeVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
a.KeyWord() // 处理go关键字
a.PackageT = caser.String(a.Package)
autoCode, err := autoCodeService.PreviewTemp(a)
if err != nil {
global.GVA_LOG.Error("预览失败!", zap.Error(err))
response.FailWithMessage("预览失败", c)
} else {
response.OkWithDetailed(gin.H{"autoCode": autoCode}, "预览成功", c)
}
}
// CreateTemp
// @Tags AutoCode
// @Summary 自动代码模板
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.AutoCodeStruct true "创建自动代码"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /autoCode/createTemp [post]
func (autoApi *AutoCodeApi) CreateTemp(c *gin.Context) {
var a system.AutoCodeStruct
_ = c.ShouldBindJSON(&a)
if err := utils.Verify(a, utils.AutoCodeVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
a.KeyWord() // 处理go关键字
var apiIds []uint
if a.AutoCreateApiToSql {
if ids, err := autoCodeService.AutoCreateApi(&a); err != nil {
global.GVA_LOG.Error("自动化创建失败!请自行清空垃圾数据!", zap.Error(err))
c.Writer.Header().Add("success", "false")
c.Writer.Header().Add("msg", url.QueryEscape("自动化创建失败!请自行清空垃圾数据!"))
return
} else {
apiIds = ids
}
}
a.PackageT = caser.String(a.Package)
err := autoCodeService.CreateTemp(a, apiIds...)
if err != nil {
if errors.Is(err, system.AutoMoveErr) {
c.Writer.Header().Add("success", "true")
c.Writer.Header().Add("msg", url.QueryEscape(err.Error()))
} else {
c.Writer.Header().Add("success", "false")
c.Writer.Header().Add("msg", url.QueryEscape(err.Error()))
_ = os.Remove("./ginvueadmin.zip")
}
} else {
c.Writer.Header().Add("Content-Disposition", fmt.Sprintf("attachment; filename=%s", "ginvueadmin.zip")) // fmt.Sprintf("attachment; filename=%s", filename)对下载的文件重命名
c.Writer.Header().Add("Content-Type", "application/json")
c.Writer.Header().Add("success", "true")
c.File("./ginvueadmin.zip")
_ = os.Remove("./ginvueadmin.zip")
}
}
// GetDB
// @Tags AutoCode
// @Summary 获取当前所有数据库
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取当前所有数据库"
// @Router /autoCode/getDatabase [get]
func (autoApi *AutoCodeApi) GetDB(c *gin.Context) {
dbs, err := autoCodeService.Database().GetDB()
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(gin.H{"dbs": dbs}, "获取成功", c)
}
}
// GetTables
// @Tags AutoCode
// @Summary 获取当前数据库所有表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取当前数据库所有表"
// @Router /autoCode/getTables [get]
func (autoApi *AutoCodeApi) GetTables(c *gin.Context) {
dbName := c.DefaultQuery("dbName", global.GVA_CONFIG.Mysql.Dbname)
tables, err := autoCodeService.Database().GetTables(dbName)
if err != nil {
global.GVA_LOG.Error("查询table失败!", zap.Error(err))
response.FailWithMessage("查询table失败", c)
} else {
response.OkWithDetailed(gin.H{"tables": tables}, "获取成功", c)
}
}
// GetColumn
// @Tags AutoCode
// @Summary 获取当前表所有字段
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取当前表所有字段"
// @Router /autoCode/getColumn [get]
func (autoApi *AutoCodeApi) GetColumn(c *gin.Context) {
dbName := c.DefaultQuery("dbName", global.GVA_CONFIG.Mysql.Dbname)
tableName := c.Query("tableName")
columns, err := autoCodeService.Database().GetColumn(tableName, dbName)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(gin.H{"columns": columns}, "获取成功", c)
}
}
// CreatePackage
// @Tags AutoCode
// @Summary 创建package
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysAutoCode true "创建package"
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建package成功"
// @Router /autoCode/createPackage [post]
func (autoApi *AutoCodeApi) CreatePackage(c *gin.Context) {
var a system.SysAutoCode
_ = c.ShouldBindJSON(&a)
if err := utils.Verify(a, utils.AutoPackageVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
err := autoCodeService.CreateAutoCode(&a)
if err != nil {
global.GVA_LOG.Error("创建成功!", zap.Error(err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// GetPackage
// @Tags AutoCode
// @Summary 获取package
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建package成功"
// @Router /autoCode/getPackage [post]
func (autoApi *AutoCodeApi) GetPackage(c *gin.Context) {
pkgs, err := autoCodeService.GetPackage()
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(gin.H{"pkgs": pkgs}, "获取成功", c)
}
}
// DelPackage
// @Tags AutoCode
// @Summary 删除package
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysAutoCode true "创建package"
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "删除package成功"
// @Router /autoCode/delPackage [post]
func (autoApi *AutoCodeApi) DelPackage(c *gin.Context) {
var a system.SysAutoCode
_ = c.ShouldBindJSON(&a)
err := autoCodeService.DelPackage(a)
if err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// AutoPlug
// @Tags AutoCode
// @Summary 创建插件模板
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysAutoCode true "创建插件模板"
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "创建插件模板成功"
// @Router /autoCode/createPlug [post]
func (autoApi *AutoCodeApi) AutoPlug(c *gin.Context) {
var a system.AutoPlugReq
_ = c.ShouldBindJSON(&a)
a.Snake = strings.ToLower(a.PlugName)
a.NeedModel = a.HasRequest || a.HasResponse
err := autoCodeService.CreatePlug(a)
if err != nil {
global.GVA_LOG.Error("预览失败!", zap.Error(err))
response.FailWithMessage("预览失败", c)
} else {
response.Ok(c)
}
}
@@ -0,0 +1,98 @@
package system
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type AutoCodeHistoryApi struct{}
// First
// @Tags AutoCode
// @Summary 获取meta信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.GetById true "请求参数"
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取meta信息"
// @Router /autoCode/getMeta [post]
func (a *AutoCodeHistoryApi) First(c *gin.Context) {
var info request.GetById
_ = c.ShouldBindJSON(&info)
data, err := autoCodeHistoryService.First(&info)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
response.OkWithDetailed(gin.H{"meta": data}, "获取成功", c)
}
// Delete
// @Tags AutoCode
// @Summary 删除回滚记录
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.GetById true "请求参数"
// @Success 200 {object} response.Response{msg=string} "删除回滚记录"
// @Router /autoCode/delSysHistory [post]
func (a *AutoCodeHistoryApi) Delete(c *gin.Context) {
var info request.GetById
_ = c.ShouldBindJSON(&info)
err := autoCodeHistoryService.Delete(&info)
if err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
return
}
response.OkWithMessage("删除成功", c)
}
// RollBack
// @Tags AutoCode
// @Summary 回滚自动生成代码
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body systemReq.RollBack true "请求参数"
// @Success 200 {object} response.Response{msg=string} "回滚自动生成代码"
// @Router /autoCode/rollback [post]
func (a *AutoCodeHistoryApi) RollBack(c *gin.Context) {
var info systemReq.RollBack
_ = c.ShouldBindJSON(&info)
if err := autoCodeHistoryService.RollBack(&info); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
response.OkWithMessage("回滚成功", c)
}
// GetList
// @Tags AutoCode
// @Summary 查询回滚记录
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body systemReq.SysAutoHistory true "请求参数"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "查询回滚记录,返回包括列表,总数,页码,每页数量"
// @Router /autoCode/getSysHistory [post]
func (a *AutoCodeHistoryApi) GetList(c *gin.Context) {
var search systemReq.SysAutoHistory
_ = c.ShouldBindJSON(&search)
list, total, err := autoCodeHistoryService.GetList(search.PageInfo)
if err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
return
}
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: search.Page,
PageSize: search.PageSize,
}, "获取成功", c)
}
+42
View File
@@ -0,0 +1,42 @@
package system
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
"github.com/gin-gonic/gin"
"github.com/mojocn/base64Captcha"
"go.uber.org/zap"
)
// 当开启多服务器部署时,替换下面的配置,使用redis共享存储验证码
// var store = captcha.NewDefaultRedisStore()
var store = base64Captcha.DefaultMemStore
type BaseApi struct{}
// Captcha
// @Tags Base
// @Summary 生成验证码
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=systemRes.SysCaptchaResponse,msg=string} "生成验证码,返回包括随机数id,base64,验证码长度"
// @Router /base/captcha [post]
func (b *BaseApi) Captcha(c *gin.Context) {
// 字符,公式,验证码配置
// 生成默认数字的driver
driver := base64Captcha.NewDriverDigit(global.GVA_CONFIG.Captcha.ImgHeight, global.GVA_CONFIG.Captcha.ImgWidth, global.GVA_CONFIG.Captcha.KeyLong, 0.7, 80)
// cp := base64Captcha.NewCaptcha(driver, store.UseWithCtx(c)) // v8下使用redis
cp := base64Captcha.NewCaptcha(driver, store)
if id, b64s, err := cp.Generate(); err != nil {
global.GVA_LOG.Error("验证码获取失败!", zap.Error(err))
response.FailWithMessage("验证码获取失败", c)
} else {
response.OkWithDetailed(systemRes.SysCaptchaResponse{
CaptchaId: id,
PicPath: b64s,
CaptchaLength: global.GVA_CONFIG.Captcha.KeyLong,
}, "验证码获取成功", c)
}
}
@@ -1,32 +1,34 @@
package v1
package system
import (
"gin-vue-admin/global"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"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/request"
systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type CasbinApi struct{}
// @Tags Casbin
// @Summary 更新角色api权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.CasbinInReceive true "权限id, 权限模型列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Success 200 {object} response.Response{msg=string} "更新角色api权限"
// @Router /casbin/UpdateCasbin [post]
func UpdateCasbin(c *gin.Context) {
func (cas *CasbinApi) UpdateCasbin(c *gin.Context) {
var cmr request.CasbinInReceive
_ = c.ShouldBindJSON(&cmr)
if err := utils.Verify(cmr, utils.AuthorityIdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.UpdateCasbin(cmr.AuthorityId, cmr.CasbinInfos); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
if err := casbinService.UpdateCasbin(cmr.AuthorityId, cmr.CasbinInfos); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Error(err))
response.FailWithMessage("更新失败", c)
} else {
response.OkWithMessage("更新成功", c)
@@ -39,16 +41,15 @@ func UpdateCasbin(c *gin.Context) {
// @accept application/json
// @Produce application/json
// @Param data body request.CasbinInReceive true "权限id, 权限模型列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Success 200 {object} response.Response{data=systemRes.PolicyPathResponse,msg=string} "获取权限列表,返回包括casbin详情列表"
// @Router /casbin/getPolicyPathByAuthorityId [post]
func GetPolicyPathByAuthorityId(c *gin.Context) {
func (cas *CasbinApi) GetPolicyPathByAuthorityId(c *gin.Context) {
var casbin request.CasbinInReceive
_ = c.ShouldBindJSON(&casbin)
if err := utils.Verify(casbin, utils.AuthorityIdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
paths := service.GetPolicyPathByAuthorityId(casbin.AuthorityId)
response.OkWithDetailed(response.PolicyPathResponse{Paths: paths}, "获取成功", c)
paths := casbinService.GetPolicyPathByAuthorityId(casbin.AuthorityId)
response.OkWithDetailed(systemRes.PolicyPathResponse{Paths: paths}, "获取成功", c)
}
+117
View File
@@ -0,0 +1,117 @@
package system
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/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type DictionaryApi struct{}
// @Tags SysDictionary
// @Summary 创建SysDictionary
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysDictionary true "SysDictionary模型"
// @Success 200 {object} response.Response{msg=string} "创建SysDictionary"
// @Router /sysDictionary/createSysDictionary [post]
func (s *DictionaryApi) CreateSysDictionary(c *gin.Context) {
var dictionary system.SysDictionary
_ = c.ShouldBindJSON(&dictionary)
if err := dictionaryService.CreateSysDictionary(dictionary); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Error(err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags SysDictionary
// @Summary 删除SysDictionary
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysDictionary true "SysDictionary模型"
// @Success 200 {object} response.Response{msg=string} "删除SysDictionary"
// @Router /sysDictionary/deleteSysDictionary [delete]
func (s *DictionaryApi) DeleteSysDictionary(c *gin.Context) {
var dictionary system.SysDictionary
_ = c.ShouldBindJSON(&dictionary)
if err := dictionaryService.DeleteSysDictionary(dictionary); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags SysDictionary
// @Summary 更新SysDictionary
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysDictionary true "SysDictionary模型"
// @Success 200 {object} response.Response{msg=string} "更新SysDictionary"
// @Router /sysDictionary/updateSysDictionary [put]
func (s *DictionaryApi) UpdateSysDictionary(c *gin.Context) {
var dictionary system.SysDictionary
_ = c.ShouldBindJSON(&dictionary)
if err := dictionaryService.UpdateSysDictionary(&dictionary); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Error(err))
response.FailWithMessage("更新失败", c)
} else {
response.OkWithMessage("更新成功", c)
}
}
// @Tags SysDictionary
// @Summary 用id查询SysDictionary
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query system.SysDictionary true "ID或字典英名"
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "用id查询SysDictionary"
// @Router /sysDictionary/findSysDictionary [get]
func (s *DictionaryApi) FindSysDictionary(c *gin.Context) {
var dictionary system.SysDictionary
_ = c.ShouldBindQuery(&dictionary)
if sysDictionary, err := dictionaryService.GetSysDictionary(dictionary.Type, dictionary.ID); err != nil {
global.GVA_LOG.Error("查询失败!", zap.Error(err))
response.FailWithMessage("查询失败", c)
} else {
response.OkWithDetailed(gin.H{"resysDictionary": sysDictionary}, "查询成功", c)
}
}
// @Tags SysDictionary
// @Summary 分页获取SysDictionary列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.SysDictionarySearch true "页码, 每页大小, 搜索条件"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取SysDictionary列表,返回包括列表,总数,页码,每页数量"
// @Router /sysDictionary/getSysDictionaryList [get]
func (s *DictionaryApi) GetSysDictionaryList(c *gin.Context) {
var pageInfo request.SysDictionarySearch
_ = c.ShouldBindQuery(&pageInfo)
if err := utils.Verify(pageInfo.PageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if list, total, err := dictionaryService.GetSysDictionaryInfoList(pageInfo); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
@@ -0,0 +1,117 @@
package system
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/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type DictionaryDetailApi struct{}
// @Tags SysDictionaryDetail
// @Summary 创建SysDictionaryDetail
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysDictionaryDetail true "SysDictionaryDetail模型"
// @Success 200 {object} response.Response{msg=string} "创建SysDictionaryDetail"
// @Router /sysDictionaryDetail/createSysDictionaryDetail [post]
func (s *DictionaryDetailApi) CreateSysDictionaryDetail(c *gin.Context) {
var detail system.SysDictionaryDetail
_ = c.ShouldBindJSON(&detail)
if err := dictionaryDetailService.CreateSysDictionaryDetail(detail); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Error(err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags SysDictionaryDetail
// @Summary 删除SysDictionaryDetail
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysDictionaryDetail true "SysDictionaryDetail模型"
// @Success 200 {object} response.Response{msg=string} "删除SysDictionaryDetail"
// @Router /sysDictionaryDetail/deleteSysDictionaryDetail [delete]
func (s *DictionaryDetailApi) DeleteSysDictionaryDetail(c *gin.Context) {
var detail system.SysDictionaryDetail
_ = c.ShouldBindJSON(&detail)
if err := dictionaryDetailService.DeleteSysDictionaryDetail(detail); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags SysDictionaryDetail
// @Summary 更新SysDictionaryDetail
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysDictionaryDetail true "更新SysDictionaryDetail"
// @Success 200 {object} response.Response{msg=string} "更新SysDictionaryDetail"
// @Router /sysDictionaryDetail/updateSysDictionaryDetail [put]
func (s *DictionaryDetailApi) UpdateSysDictionaryDetail(c *gin.Context) {
var detail system.SysDictionaryDetail
_ = c.ShouldBindJSON(&detail)
if err := dictionaryDetailService.UpdateSysDictionaryDetail(&detail); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Error(err))
response.FailWithMessage("更新失败", c)
} else {
response.OkWithMessage("更新成功", c)
}
}
// @Tags SysDictionaryDetail
// @Summary 用id查询SysDictionaryDetail
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query system.SysDictionaryDetail true "用id查询SysDictionaryDetail"
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "用id查询SysDictionaryDetail"
// @Router /sysDictionaryDetail/findSysDictionaryDetail [get]
func (s *DictionaryDetailApi) FindSysDictionaryDetail(c *gin.Context) {
var detail system.SysDictionaryDetail
_ = c.ShouldBindQuery(&detail)
if err := utils.Verify(detail, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if reSysDictionaryDetail, err := dictionaryDetailService.GetSysDictionaryDetail(detail.ID); err != nil {
global.GVA_LOG.Error("查询失败!", zap.Error(err))
response.FailWithMessage("查询失败", c)
} else {
response.OkWithDetailed(gin.H{"reSysDictionaryDetail": reSysDictionaryDetail}, "查询成功", c)
}
}
// @Tags SysDictionaryDetail
// @Summary 分页获取SysDictionaryDetail列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.SysDictionaryDetailSearch true "页码, 每页大小, 搜索条件"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取SysDictionaryDetail列表,返回包括列表,总数,页码,每页数量"
// @Router /sysDictionaryDetail/getSysDictionaryDetailList [get]
func (s *DictionaryDetailApi) GetSysDictionaryDetailList(c *gin.Context) {
var pageInfo request.SysDictionaryDetailSearch
_ = c.ShouldBindQuery(&pageInfo)
if list, total, err := dictionaryDetailService.GetSysDictionaryDetailInfoList(pageInfo); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
+60
View File
@@ -0,0 +1,60 @@
package system
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/request"
"go.uber.org/zap"
"github.com/gin-gonic/gin"
)
type DBApi struct{}
// InitDB
// @Tags InitDB
// @Summary 初始化用户数据库
// @Produce application/json
// @Param data body request.InitDB true "初始化数据库参数"
// @Success 200 {object} response.Response{data=string} "初始化用户数据库"
// @Router /init/initdb [post]
func (i *DBApi) InitDB(c *gin.Context) {
if global.GVA_DB != nil {
global.GVA_LOG.Error("已存在数据库配置!")
response.FailWithMessage("已存在数据库配置", c)
return
}
var dbInfo request.InitDB
if err := c.ShouldBindJSON(&dbInfo); err != nil {
global.GVA_LOG.Error("参数校验不通过!", zap.Error(err))
response.FailWithMessage("参数校验不通过", c)
return
}
if err := initDBService.InitDB(dbInfo); err != nil {
global.GVA_LOG.Error("自动创建数据库失败!", zap.Error(err))
response.FailWithMessage("自动创建数据库失败,请查看后台日志,检查后在进行初始化", c)
return
}
response.OkWithMessage("自动创建数据库成功", c)
}
// CheckDB
// @Tags CheckDB
// @Summary 初始化用户数据库
// @Produce application/json
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "初始化用户数据库"
// @Router /init/checkdb [post]
func (i *DBApi) CheckDB(c *gin.Context) {
var (
message = "前往初始化数据库"
needInit = true
)
if global.GVA_DB != nil {
message = "数据库无需初始化"
needInit = false
}
global.GVA_LOG.Info(message)
response.OkWithDetailed(gin.H{"needInit": needInit}, message, c)
return
}
+29
View File
@@ -0,0 +1,29 @@
package system
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/gin-gonic/gin"
"go.uber.org/zap"
)
type JwtApi struct{}
// @Tags Jwt
// @Summary jwt加入黑名单
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{msg=string} "jwt加入黑名单"
// @Router /jwt/jsonInBlacklist [post]
func (j *JwtApi) JsonInBlacklist(c *gin.Context) {
token := c.Request.Header.Get("x-token")
jwt := system.JwtBlacklist{Jwt: token}
if err := jwtService.JsonInBlacklist(jwt); err != nil {
global.GVA_LOG.Error("jwt作废失败!", zap.Error(err))
response.FailWithMessage("jwt作废失败", c)
} else {
response.OkWithMessage("jwt作废成功", c)
}
}
@@ -1,29 +1,36 @@
package v1
package system
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"gin-vue-admin/utils"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type AuthorityMenuApi struct{}
// @Tags AuthorityMenu
// @Summary 获取用户动态路由
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body request.Empty true "空"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Success 200 {object} response.Response{data=systemRes.SysMenusResponse,msg=string} "获取用户动态路由,返回包括系统菜单详情列表"
// @Router /menu/getMenu [post]
func GetMenu(c *gin.Context) {
if err, menus := service.GetMenuTree(getUserAuthorityId(c)); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
func (a *AuthorityMenuApi) GetMenu(c *gin.Context) {
if menus, err := menuService.GetMenuTree(utils.GetUserAuthorityId(c)); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.SysMenusResponse{Menus: menus}, "获取成功", c)
if menus == nil {
menus = []system.SysMenu{}
}
response.OkWithDetailed(systemRes.SysMenusResponse{Menus: menus}, "获取成功", c)
}
}
@@ -32,14 +39,14 @@ func GetMenu(c *gin.Context) {
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body request.Empty true "空"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Success 200 {object} response.Response{data=systemRes.SysBaseMenusResponse,msg=string} "获取用户动态路由,返回包括系统菜单列表"
// @Router /menu/getBaseMenuTree [post]
func GetBaseMenuTree(c *gin.Context) {
if err, menus := service.GetBaseMenuTree(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
func (a *AuthorityMenuApi) GetBaseMenuTree(c *gin.Context) {
if menus, err := menuService.GetBaseMenuTree(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.SysBaseMenusResponse{Menus: menus}, "获取成功", c)
response.OkWithDetailed(systemRes.SysBaseMenusResponse{Menus: menus}, "获取成功", c)
}
}
@@ -48,18 +55,18 @@ func GetBaseMenuTree(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.AddMenuAuthorityInfo true "角色ID"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"添加成功"}"
// @Param data body systemReq.AddMenuAuthorityInfo true "角色ID"
// @Success 200 {object} response.Response{msg=string} "增加menu和角色关联关系"
// @Router /menu/addMenuAuthority [post]
func AddMenuAuthority(c *gin.Context) {
var authorityMenu request.AddMenuAuthorityInfo
func (a *AuthorityMenuApi) AddMenuAuthority(c *gin.Context) {
var authorityMenu systemReq.AddMenuAuthorityInfo
_ = c.ShouldBindJSON(&authorityMenu)
if err := utils.Verify(authorityMenu, utils.AuthorityIdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.AddMenuAuthority(authorityMenu.Menus, authorityMenu.AuthorityId); err != nil {
global.GVA_LOG.Error("添加失败!", zap.Any("err", err))
if err := menuService.AddMenuAuthority(authorityMenu.Menus, authorityMenu.AuthorityId); err != nil {
global.GVA_LOG.Error("添加失败!", zap.Error(err))
response.FailWithMessage("添加失败", c)
} else {
response.OkWithMessage("添加成功", c)
@@ -72,18 +79,18 @@ func AddMenuAuthority(c *gin.Context) {
// @accept application/json
// @Produce application/json
// @Param data body request.GetAuthorityId true "角色ID"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /menu/GetMenuAuthority [post]
func GetMenuAuthority(c *gin.Context) {
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取指定角色menu"
// @Router /menu/getMenuAuthority [post]
func (a *AuthorityMenuApi) GetMenuAuthority(c *gin.Context) {
var param request.GetAuthorityId
_ = c.ShouldBindJSON(&param)
if err := utils.Verify(param, utils.AuthorityIdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, menus := service.GetMenuAuthority(&param); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
response.FailWithDetailed(response.SysMenusResponse{Menus: menus}, "获取失败", c)
if menus, err := menuService.GetMenuAuthority(&param); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithDetailed(systemRes.SysMenusResponse{Menus: menus}, "获取失败", c)
} else {
response.OkWithDetailed(gin.H{"menus": menus}, "获取成功", c)
}
@@ -94,11 +101,11 @@ func GetMenuAuthority(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysBaseMenu true "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"添加成功"}"
// @Param data body system.SysBaseMenu true "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记"
// @Success 200 {object} response.Response{msg=string} "新增菜单"
// @Router /menu/addBaseMenu [post]
func AddBaseMenu(c *gin.Context) {
var menu model.SysBaseMenu
func (a *AuthorityMenuApi) AddBaseMenu(c *gin.Context) {
var menu system.SysBaseMenu
_ = c.ShouldBindJSON(&menu)
if err := utils.Verify(menu, utils.MenuVerify); err != nil {
response.FailWithMessage(err.Error(), c)
@@ -108,8 +115,8 @@ func AddBaseMenu(c *gin.Context) {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.AddBaseMenu(menu); err != nil {
global.GVA_LOG.Error("添加失败!", zap.Any("err", err))
if err := menuService.AddBaseMenu(menu); err != nil {
global.GVA_LOG.Error("添加失败!", zap.Error(err))
response.FailWithMessage("添加失败", c)
} else {
@@ -123,17 +130,17 @@ func AddBaseMenu(c *gin.Context) {
// @accept application/json
// @Produce application/json
// @Param data body request.GetById true "菜单id"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Success 200 {object} response.Response{msg=string} "删除菜单"
// @Router /menu/deleteBaseMenu [post]
func DeleteBaseMenu(c *gin.Context) {
func (a *AuthorityMenuApi) DeleteBaseMenu(c *gin.Context) {
var menu request.GetById
_ = c.ShouldBindJSON(&menu)
if err := utils.Verify(menu, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.DeleteBaseMenu(menu.Id); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Any("err", err))
if err := baseMenuService.DeleteBaseMenu(menu.ID); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
@@ -145,11 +152,11 @@ func DeleteBaseMenu(c *gin.Context) {
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.SysBaseMenu true "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Param data body system.SysBaseMenu true "路由path, 父菜单ID, 路由name, 对应前端文件路径, 排序标记"
// @Success 200 {object} response.Response{msg=string} "更新菜单"
// @Router /menu/updateBaseMenu [post]
func UpdateBaseMenu(c *gin.Context) {
var menu model.SysBaseMenu
func (a *AuthorityMenuApi) UpdateBaseMenu(c *gin.Context) {
var menu system.SysBaseMenu
_ = c.ShouldBindJSON(&menu)
if err := utils.Verify(menu, utils.MenuVerify); err != nil {
response.FailWithMessage(err.Error(), c)
@@ -159,8 +166,8 @@ func UpdateBaseMenu(c *gin.Context) {
response.FailWithMessage(err.Error(), c)
return
}
if err := service.UpdateBaseMenu(menu); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Any("err", err))
if err := baseMenuService.UpdateBaseMenu(menu); err != nil {
global.GVA_LOG.Error("更新失败!", zap.Error(err))
response.FailWithMessage("更新失败", c)
} else {
response.OkWithMessage("更新成功", c)
@@ -173,20 +180,20 @@ func UpdateBaseMenu(c *gin.Context) {
// @accept application/json
// @Produce application/json
// @Param data body request.GetById true "菜单id"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Success 200 {object} response.Response{data=systemRes.SysBaseMenuResponse,msg=string} "根据id获取菜单,返回包括系统菜单列表"
// @Router /menu/getBaseMenuById [post]
func GetBaseMenuById(c *gin.Context) {
func (a *AuthorityMenuApi) GetBaseMenuById(c *gin.Context) {
var idInfo request.GetById
_ = c.ShouldBindJSON(&idInfo)
if err := utils.Verify(idInfo, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, menu := service.GetBaseMenuById(idInfo.Id); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
if menu, err := baseMenuService.GetBaseMenuById(idInfo.ID); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.SysBaseMenuResponse{Menu: menu}, "获取成功", c)
response.OkWithDetailed(systemRes.SysBaseMenuResponse{Menu: menu}, "获取成功", c)
}
}
@@ -196,17 +203,17 @@ func GetBaseMenuById(c *gin.Context) {
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "页码, 每页大小"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取基础menu列表,返回包括列表,总数,页码,每页数量"
// @Router /menu/getMenuList [post]
func GetMenuList(c *gin.Context) {
func (a *AuthorityMenuApi) GetMenuList(c *gin.Context) {
var pageInfo request.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
if err := utils.Verify(pageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if err, menuList, total := service.GetInfoList(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Any("err", err))
if menuList, total, err := menuService.GetInfoList(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.PageResult{
@@ -214,6 +221,6 @@ func GetMenuList(c *gin.Context) {
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
},"获取成功", c)
}, "获取成功", c)
}
}
}
@@ -0,0 +1,118 @@
package system
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type OperationRecordApi struct{}
// @Tags SysOperationRecord
// @Summary 创建SysOperationRecord
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysOperationRecord true "创建SysOperationRecord"
// @Success 200 {object} response.Response{msg=string} "创建SysOperationRecord"
// @Router /sysOperationRecord/createSysOperationRecord [post]
func (s *OperationRecordApi) CreateSysOperationRecord(c *gin.Context) {
var sysOperationRecord system.SysOperationRecord
_ = c.ShouldBindJSON(&sysOperationRecord)
if err := operationRecordService.CreateSysOperationRecord(sysOperationRecord); err != nil {
global.GVA_LOG.Error("创建失败!", zap.Error(err))
response.FailWithMessage("创建失败", c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags SysOperationRecord
// @Summary 删除SysOperationRecord
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysOperationRecord true "SysOperationRecord模型"
// @Success 200 {object} response.Response{msg=string} "删除SysOperationRecord"
// @Router /sysOperationRecord/deleteSysOperationRecord [delete]
func (s *OperationRecordApi) DeleteSysOperationRecord(c *gin.Context) {
var sysOperationRecord system.SysOperationRecord
_ = c.ShouldBindJSON(&sysOperationRecord)
if err := operationRecordService.DeleteSysOperationRecord(sysOperationRecord); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags SysOperationRecord
// @Summary 批量删除SysOperationRecord
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除SysOperationRecord"
// @Success 200 {object} response.Response{msg=string} "批量删除SysOperationRecord"
// @Router /sysOperationRecord/deleteSysOperationRecordByIds [delete]
func (s *OperationRecordApi) DeleteSysOperationRecordByIds(c *gin.Context) {
var IDS request.IdsReq
_ = c.ShouldBindJSON(&IDS)
if err := operationRecordService.DeleteSysOperationRecordByIds(IDS); err != nil {
global.GVA_LOG.Error("批量删除失败!", zap.Error(err))
response.FailWithMessage("批量删除失败", c)
} else {
response.OkWithMessage("批量删除成功", c)
}
}
// @Tags SysOperationRecord
// @Summary 用id查询SysOperationRecord
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query system.SysOperationRecord true "Id"
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "用id查询SysOperationRecord"
// @Router /sysOperationRecord/findSysOperationRecord [get]
func (s *OperationRecordApi) FindSysOperationRecord(c *gin.Context) {
var sysOperationRecord system.SysOperationRecord
_ = c.ShouldBindQuery(&sysOperationRecord)
if err := utils.Verify(sysOperationRecord, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if reSysOperationRecord, err := operationRecordService.GetSysOperationRecord(sysOperationRecord.ID); err != nil {
global.GVA_LOG.Error("查询失败!", zap.Error(err))
response.FailWithMessage("查询失败", c)
} else {
response.OkWithDetailed(gin.H{"reSysOperationRecord": reSysOperationRecord}, "查询成功", c)
}
}
// @Tags SysOperationRecord
// @Summary 分页获取SysOperationRecord列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.SysOperationRecordSearch true "页码, 每页大小, 搜索条件"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取SysOperationRecord列表,返回包括列表,总数,页码,每页数量"
// @Router /sysOperationRecord/getSysOperationRecordList [get]
func (s *OperationRecordApi) GetSysOperationRecordList(c *gin.Context) {
var pageInfo systemReq.SysOperationRecordSearch
_ = c.ShouldBindQuery(&pageInfo)
if list, total, err := operationRecordService.GetSysOperationRecordInfoList(pageInfo); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
+78
View File
@@ -0,0 +1,78 @@
package system
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"
systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"go.uber.org/zap"
)
type SystemApi struct{}
// @Tags System
// @Summary 获取配置文件内容
// @Security ApiKeyAuth
// @Produce application/json
// @Success 200 {object} response.Response{data=systemRes.SysConfigResponse,msg=string} "获取配置文件内容,返回包括系统配置"
// @Router /system/getSystemConfig [post]
func (s *SystemApi) GetSystemConfig(c *gin.Context) {
if config, err := systemConfigService.GetSystemConfig(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(systemRes.SysConfigResponse{Config: config}, "获取成功", c)
}
}
// @Tags System
// @Summary 设置配置文件内容
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body system.System true "设置配置文件内容"
// @Success 200 {object} response.Response{data=string} "设置配置文件内容"
// @Router /system/setSystemConfig [post]
func (s *SystemApi) SetSystemConfig(c *gin.Context) {
var sys system.System
_ = c.ShouldBindJSON(&sys)
if err := systemConfigService.SetSystemConfig(sys); err != nil {
global.GVA_LOG.Error("设置失败!", zap.Error(err))
response.FailWithMessage("设置失败", c)
} else {
response.OkWithMessage("设置成功", c)
}
}
// @Tags System
// @Summary 重启系统
// @Security ApiKeyAuth
// @Produce application/json
// @Success 200 {object} response.Response{msg=string} "重启系统"
// @Router /system/reloadSystem [post]
func (s *SystemApi) ReloadSystem(c *gin.Context) {
err := utils.Reload()
if err != nil {
global.GVA_LOG.Error("重启系统失败!", zap.Error(err))
response.FailWithMessage("重启系统失败", c)
} else {
response.OkWithMessage("重启系统成功", c)
}
}
// @Tags System
// @Summary 获取服务器信息
// @Security ApiKeyAuth
// @Produce application/json
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取服务器信息"
// @Router /system/getServerInfo [post]
func (s *SystemApi) GetServerInfo(c *gin.Context) {
if server, err := systemConfigService.GetServerInfo(); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(gin.H{"server": server}, "获取成功", c)
}
}
+369
View File
@@ -0,0 +1,369 @@
package system
import (
"strconv"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/request"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/system"
systemReq "github.com/flipped-aurora/gin-vue-admin/server/model/system/request"
systemRes "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
"github.com/flipped-aurora/gin-vue-admin/server/utils"
"github.com/gin-gonic/gin"
"github.com/go-redis/redis/v8"
"go.uber.org/zap"
)
// @Tags Base
// @Summary 用户登录
// @Produce application/json
// @Param data body systemReq.Login true "用户名, 密码, 验证码"
// @Success 200 {object} response.Response{data=systemRes.LoginResponse,msg=string} "返回包括用户信息,token,过期时间"
// @Router /base/login [post]
func (b *BaseApi) Login(c *gin.Context) {
var l systemReq.Login
_ = c.ShouldBindJSON(&l)
if err := utils.Verify(l, utils.LoginVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if store.Verify(l.CaptchaId, l.Captcha, true) {
u := &system.SysUser{Username: l.Username, Password: l.Password}
if user, err := userService.Login(u); err != nil {
global.GVA_LOG.Error("登陆失败! 用户名不存在或者密码错误!", zap.Error(err))
response.FailWithMessage("用户名不存在或者密码错误", c)
} else {
b.tokenNext(c, *user)
}
} else {
response.FailWithMessage("验证码错误", c)
}
}
// 登录以后签发jwt
func (b *BaseApi) tokenNext(c *gin.Context, user system.SysUser) {
j := &utils.JWT{SigningKey: []byte(global.GVA_CONFIG.JWT.SigningKey)} // 唯一签名
claims := j.CreateClaims(systemReq.BaseClaims{
UUID: user.UUID,
ID: user.ID,
NickName: user.NickName,
Username: user.Username,
AuthorityId: user.AuthorityId,
})
token, err := j.CreateToken(claims)
if err != nil {
global.GVA_LOG.Error("获取token失败!", zap.Error(err))
response.FailWithMessage("获取token失败", c)
return
}
if !global.GVA_CONFIG.System.UseMultipoint {
response.OkWithDetailed(systemRes.LoginResponse{
User: user,
Token: token,
ExpiresAt: claims.StandardClaims.ExpiresAt * 1000,
}, "登录成功", c)
return
}
if jwtStr, err := jwtService.GetRedisJWT(user.Username); err == redis.Nil {
if err := jwtService.SetRedisJWT(token, user.Username); err != nil {
global.GVA_LOG.Error("设置登录状态失败!", zap.Error(err))
response.FailWithMessage("设置登录状态失败", c)
return
}
response.OkWithDetailed(systemRes.LoginResponse{
User: user,
Token: token,
ExpiresAt: claims.StandardClaims.ExpiresAt * 1000,
}, "登录成功", c)
} else if err != nil {
global.GVA_LOG.Error("设置登录状态失败!", zap.Error(err))
response.FailWithMessage("设置登录状态失败", c)
} else {
var blackJWT system.JwtBlacklist
blackJWT.Jwt = jwtStr
if err := jwtService.JsonInBlacklist(blackJWT); err != nil {
response.FailWithMessage("jwt作废失败", c)
return
}
if err := jwtService.SetRedisJWT(token, user.Username); err != nil {
response.FailWithMessage("设置登录状态失败", c)
return
}
response.OkWithDetailed(systemRes.LoginResponse{
User: user,
Token: token,
ExpiresAt: claims.StandardClaims.ExpiresAt * 1000,
}, "登录成功", c)
}
}
// @Tags SysUser
// @Summary 用户注册账号
// @Produce application/json
// @Param data body systemReq.Register true "用户名, 昵称, 密码, 角色ID"
// @Success 200 {object} response.Response{data=systemRes.SysUserResponse,msg=string} "用户注册账号,返回包括用户信息"
// @Router /user/admin_register [post]
func (b *BaseApi) Register(c *gin.Context) {
var r systemReq.Register
_ = c.ShouldBindJSON(&r)
if err := utils.Verify(r, utils.RegisterVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
var authorities []system.SysAuthority
for _, v := range r.AuthorityIds {
authorities = append(authorities, system.SysAuthority{
AuthorityId: v,
})
}
user := &system.SysUser{Username: r.Username, NickName: r.NickName, Password: r.Password, HeaderImg: r.HeaderImg, AuthorityId: r.AuthorityId, Authorities: authorities}
userReturn, err := userService.Register(*user)
if err != nil {
global.GVA_LOG.Error("注册失败!", zap.Error(err))
response.FailWithDetailed(systemRes.SysUserResponse{User: userReturn}, "注册失败", c)
} else {
response.OkWithDetailed(systemRes.SysUserResponse{User: userReturn}, "注册成功", c)
}
}
// @Tags SysUser
// @Summary 用户修改密码
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body systemReq.ChangePasswordStruct true "用户名, 原密码, 新密码"
// @Success 200 {object} response.Response{msg=string} "用户修改密码"
// @Router /user/changePassword [post]
func (b *BaseApi) ChangePassword(c *gin.Context) {
var user systemReq.ChangePasswordStruct
_ = c.ShouldBindJSON(&user)
if err := utils.Verify(user, utils.ChangePasswordVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
u := &system.SysUser{Username: user.Username, Password: user.Password}
if _, err := userService.ChangePassword(u, user.NewPassword); err != nil {
global.GVA_LOG.Error("修改失败!", zap.Error(err))
response.FailWithMessage("修改失败,原密码与当前账户不符", c)
} else {
response.OkWithMessage("修改成功", c)
}
}
// @Tags SysUser
// @Summary 分页获取用户列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.PageInfo true "页码, 每页大小"
// @Success 200 {object} response.Response{data=response.PageResult,msg=string} "分页获取用户列表,返回包括列表,总数,页码,每页数量"
// @Router /user/getUserList [post]
func (b *BaseApi) GetUserList(c *gin.Context) {
var pageInfo request.PageInfo
_ = c.ShouldBindJSON(&pageInfo)
if err := utils.Verify(pageInfo, utils.PageInfoVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if list, total, err := userService.GetUserInfoList(pageInfo); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, "获取成功", c)
}
}
// @Tags SysUser
// @Summary 更改用户权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body systemReq.SetUserAuth true "用户UUID, 角色ID"
// @Success 200 {object} response.Response{msg=string} "设置用户权限"
// @Router /user/setUserAuthority [post]
func (b *BaseApi) SetUserAuthority(c *gin.Context) {
var sua systemReq.SetUserAuth
_ = c.ShouldBindJSON(&sua)
if UserVerifyErr := utils.Verify(sua, utils.SetUserAuthorityVerify); UserVerifyErr != nil {
response.FailWithMessage(UserVerifyErr.Error(), c)
return
}
userID := utils.GetUserID(c)
uuid := utils.GetUserUuid(c)
if err := userService.SetUserAuthority(userID, uuid, sua.AuthorityId); err != nil {
global.GVA_LOG.Error("修改失败!", zap.Error(err))
response.FailWithMessage(err.Error(), c)
} else {
claims := utils.GetUserInfo(c)
j := &utils.JWT{SigningKey: []byte(global.GVA_CONFIG.JWT.SigningKey)} // 唯一签名
claims.AuthorityId = sua.AuthorityId
if token, err := j.CreateToken(*claims); err != nil {
global.GVA_LOG.Error("修改失败!", zap.Error(err))
response.FailWithMessage(err.Error(), c)
} else {
c.Header("new-token", token)
c.Header("new-expires-at", strconv.FormatInt(claims.ExpiresAt, 10))
response.OkWithMessage("修改成功", c)
}
}
}
// @Tags SysUser
// @Summary 设置用户权限
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body systemReq.SetUserAuthorities true "用户UUID, 角色ID"
// @Success 200 {object} response.Response{msg=string} "设置用户权限"
// @Router /user/setUserAuthorities [post]
func (b *BaseApi) SetUserAuthorities(c *gin.Context) {
var sua systemReq.SetUserAuthorities
_ = c.ShouldBindJSON(&sua)
if err := userService.SetUserAuthorities(sua.ID, sua.AuthorityIds); err != nil {
global.GVA_LOG.Error("修改失败!", zap.Error(err))
response.FailWithMessage("修改失败", c)
} else {
response.OkWithMessage("修改成功", c)
}
}
// @Tags SysUser
// @Summary 删除用户
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.GetById true "用户ID"
// @Success 200 {object} response.Response{msg=string} "删除用户"
// @Router /user/deleteUser [delete]
func (b *BaseApi) DeleteUser(c *gin.Context) {
var reqId request.GetById
_ = c.ShouldBindJSON(&reqId)
if err := utils.Verify(reqId, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
jwtId := utils.GetUserID(c)
if jwtId == uint(reqId.ID) {
response.FailWithMessage("删除失败, 自杀失败", c)
return
}
if err := userService.DeleteUser(reqId.ID); err != nil {
global.GVA_LOG.Error("删除失败!", zap.Error(err))
response.FailWithMessage("删除失败", c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags SysUser
// @Summary 设置用户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysUser true "ID, 用户名, 昵称, 头像链接"
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "设置用户信息"
// @Router /user/setUserInfo [put]
func (b *BaseApi) SetUserInfo(c *gin.Context) {
var user systemReq.ChangeUserInfo
_ = c.ShouldBindJSON(&user)
if err := utils.Verify(user, utils.IdVerify); err != nil {
response.FailWithMessage(err.Error(), c)
return
}
if len(user.AuthorityIds) != 0 {
err := userService.SetUserAuthorities(user.ID, user.AuthorityIds)
if err != nil {
global.GVA_LOG.Error("设置失败!", zap.Error(err))
response.FailWithMessage("设置失败", c)
}
}
if err := userService.SetUserInfo(system.SysUser{
GVA_MODEL: global.GVA_MODEL{
ID: user.ID,
},
NickName: user.NickName,
HeaderImg: user.HeaderImg,
Phone: user.Phone,
Email: user.Email,
SideMode: user.SideMode,
}); err != nil {
global.GVA_LOG.Error("设置失败!", zap.Error(err))
response.FailWithMessage("设置失败", c)
} else {
response.OkWithMessage("设置成功", c)
}
}
// @Tags SysUser
// @Summary 设置用户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body system.SysUser true "ID, 用户名, 昵称, 头像链接"
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "设置用户信息"
// @Router /user/SetSelfInfo [put]
func (b *BaseApi) SetSelfInfo(c *gin.Context) {
var user systemReq.ChangeUserInfo
_ = c.ShouldBindJSON(&user)
user.ID = utils.GetUserID(c)
if err := userService.SetUserInfo(system.SysUser{
GVA_MODEL: global.GVA_MODEL{
ID: user.ID,
},
NickName: user.NickName,
HeaderImg: user.HeaderImg,
Phone: user.Phone,
Email: user.Email,
SideMode: user.SideMode,
}); err != nil {
global.GVA_LOG.Error("设置失败!", zap.Error(err))
response.FailWithMessage("设置失败", c)
} else {
response.OkWithMessage("设置成功", c)
}
}
// @Tags SysUser
// @Summary 获取用户信息
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {object} response.Response{data=map[string]interface{},msg=string} "获取用户信息"
// @Router /user/getUserInfo [get]
func (b *BaseApi) GetUserInfo(c *gin.Context) {
uuid := utils.GetUserUuid(c)
if ReqUser, err := userService.GetUserInfo(uuid); err != nil {
global.GVA_LOG.Error("获取失败!", zap.Error(err))
response.FailWithMessage("获取失败", c)
} else {
response.OkWithDetailed(gin.H{"userInfo": ReqUser}, "获取成功", c)
}
}
// @Tags SysUser
// @Summary 重置用户密码
// @Security ApiKeyAuth
// @Produce application/json
// @Param data body system.SysUser true "ID"
// @Success 200 {object} response.Response{msg=string} "重置用户密码"
// @Router /user/resetPassword [post]
func (b *BaseApi) ResetPassword(c *gin.Context) {
var user system.SysUser
_ = c.ShouldBindJSON(&user)
if err := userService.ResetPassword(user.ID); err != nil {
global.GVA_LOG.Error("重置失败!", zap.Error(err))
response.FailWithMessage("重置失败"+err.Error(), c)
} else {
response.OkWithMessage("重置成功", c)
}
}
-258
View File
@@ -1,258 +0,0 @@
package v1
import (
"fmt"
"gin-vue-admin/global"
"gin-vue-admin/model"
"gin-vue-admin/model/request"
"gin-vue-admin/model/response"
"gin-vue-admin/service"
"github.com/gin-gonic/gin"
)
// @Tags WorkflowProcess
// @Summary 创建WorkflowProcess
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.WorkflowProcess true "创建WorkflowProcess"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/createWorkflowProcess [post]
func CreateWorkflowProcess(c *gin.Context) {
var workflowProcess model.WorkflowProcess
_ = c.ShouldBindJSON(&workflowProcess)
err := service.CreateWorkflowProcess(workflowProcess)
if err != nil {
response.FailWithMessage(fmt.Sprintf("创建失败,%v", err), c)
} else {
response.OkWithMessage("创建成功", c)
}
}
// @Tags WorkflowProcess
// @Summary 删除WorkflowProcess
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.WorkflowProcess true "删除WorkflowProcess"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /workflowProcess/deleteWorkflowProcess [delete]
func DeleteWorkflowProcess(c *gin.Context) {
var workflowProcess model.WorkflowProcess
_ = c.ShouldBindJSON(&workflowProcess)
err := service.DeleteWorkflowProcess(workflowProcess)
if err != nil {
response.FailWithMessage(fmt.Sprintf("删除失败,%v", err), c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags WorkflowProcess
// @Summary 批量删除WorkflowProcess
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除WorkflowProcess"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /workflowProcess/deleteWorkflowProcessByIds [delete]
func DeleteWorkflowProcessByIds(c *gin.Context) {
var IDS request.IdsReq
_ = c.ShouldBindJSON(&IDS)
err := service.DeleteWorkflowProcessByIds(IDS)
if err != nil {
response.FailWithMessage(fmt.Sprintf("删除失败,%v", err), c)
} else {
response.OkWithMessage("删除成功", c)
}
}
// @Tags WorkflowProcess
// @Summary 更新WorkflowProcess
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.WorkflowProcess true "更新WorkflowProcess"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /workflowProcess/updateWorkflowProcess [put]
func UpdateWorkflowProcess(c *gin.Context) {
var workflowProcess model.WorkflowProcess
_ = c.ShouldBindJSON(&workflowProcess)
err := service.UpdateWorkflowProcess(&workflowProcess)
if err != nil {
response.FailWithMessage(fmt.Sprintf("更新失败,%v", err), c)
} else {
response.OkWithMessage("更新成功", c)
}
}
// @Tags WorkflowProcess
// @Summary 用id查询WorkflowProcess
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.WorkflowProcess true "用id查询WorkflowProcess"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /workflowProcess/findWorkflowProcess [get]
func FindWorkflowProcess(c *gin.Context) {
var workflowProcess model.WorkflowProcess
_ = c.ShouldBindQuery(&workflowProcess)
err, reworkflowProcess := service.GetWorkflowProcess(workflowProcess.ID)
if err != nil {
response.FailWithMessage(fmt.Sprintf("查询失败,%v", err), c)
} else {
response.OkWithData(gin.H{"reworkflowProcess": reworkflowProcess}, c)
}
}
// @Tags WorkflowProcess
// @Summary 用id查询工作流步骤
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.WorkflowProcess true "用id查询WorkflowProcess"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /workflowProcess/findWorkflowStep [get]
func FindWorkflowStep(c *gin.Context) {
var workflowProcess model.WorkflowProcess
_ = c.ShouldBindQuery(&workflowProcess)
err, workflow := service.FindWorkflowStep(workflowProcess.ID)
if err != nil {
response.FailWithMessage(fmt.Sprintf("查询失败,%v", err), c)
} else {
response.OkWithData(gin.H{"workflow": workflow}, c)
}
}
// @Tags WorkflowProcess
// @Summary 分页获取WorkflowProcess列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.WorkflowProcessSearch true "分页获取WorkflowProcess列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/getWorkflowProcessList [get]
func GetWorkflowProcessList(c *gin.Context) {
var pageInfo request.WorkflowProcessSearch
_ = c.ShouldBindQuery(&pageInfo)
err, list, total := service.GetWorkflowProcessInfoList(pageInfo)
if err != nil {
response.FailWithMessage(fmt.Sprintf("获取数据失败,%v", err), c)
} else {
response.OkWithData(response.PageResult{
List: list,
Total: total,
Page: pageInfo.Page,
PageSize: pageInfo.PageSize,
}, c)
}
}
// @Tags WorkflowProcess
// @Summary 开启工作流
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/startWorkflow [post]
func StartWorkflow(c *gin.Context) {
business := c.Query("businessType")
wfInfo := model.WorkflowBusinessStruct[business]()
c.ShouldBindJSON(wfInfo)
err := service.StartWorkflow(wfInfo)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
response.OkWithMessage("启动成功", c)
}
// @Tags WorkflowProcess
// @Summary 提交工作流
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/completeWorkflowMove [post]
func CompleteWorkflowMove(c *gin.Context) {
business := c.Query("businessType")
wfInfo := model.WorkflowBusinessStruct[business]()
c.ShouldBindJSON(wfInfo)
err := service.CompleteWorkflowMove(wfInfo)
if err != nil {
response.FailWithMessage(err.Error(), c)
return
}
response.OkWithMessage("启动成功", c)
}
// @Tags WorkflowProcess
// @Summary 我发起的工作流
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/getMyStated [get]
func GetMyStated(c *gin.Context) {
if claims, exists := c.Get("claims"); !exists {
errStr := "从Gin的Context中获取从jwt解析出来的用户ID失败, 请检查路由是否使用jwt中间件"
global.GVA_LOG.Error(errStr)
response.FailWithMessage(errStr, c)
} else {
waitUse := claims.(*request.CustomClaims)
err, wfms := service.GetMyStated(waitUse.ID)
if err != nil {
errStr := err.Error()
global.GVA_LOG.Error(errStr)
response.FailWithMessage(errStr, c)
return
}
response.OkWithData(gin.H{"wfms": wfms}, c)
}
}
// @Tags WorkflowProcess
// @Summary 我的待办
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/getMyNeed [get]
func GetMyNeed(c *gin.Context) {
if claims, exists := c.Get("claims"); !exists {
errStr := "从Gin的Context中获取从jwt解析出来的用户ID失败, 请检查路由是否使用jwt中间件"
global.GVA_LOG.Error(errStr)
response.FailWithMessage(errStr, c)
} else {
waitUse := claims.(*request.CustomClaims)
err, wfms := service.GetMyNeed(waitUse.ID, waitUse.AuthorityId)
if err != nil {
errStr := err.Error()
global.GVA_LOG.Error(errStr)
response.FailWithMessage(errStr, c)
return
}
response.OkWithData(gin.H{"wfms": wfms}, c)
}
}
// @Tags WorkflowProcess
// @Summary 根据id获取当前节点详情和历史
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.GetById true "根据id获取当前节点详情和过往"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /workflowProcess/getWorkflowMoveByID [get]
func GetWorkflowMoveByID(c *gin.Context) {
var req request.GetById
_ = c.ShouldBindQuery(&req)
err, move, moves, business := service.GetWorkflowMoveByID(req.Id)
if err != nil {
errStr := err.Error()
global.GVA_LOG.Error(errStr)
response.FailWithMessage(errStr, c)
return
}
response.OkWithData(gin.H{"move": move, "moves": moves, "business": business}, c)
}
-63
View File
@@ -1,63 +0,0 @@
/*
Copyright © 2020 SliverHorn
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package gva
import (
"gin-vue-admin/core"
"github.com/gookit/color"
_ "gin-vue-admin/core"
"gin-vue-admin/global"
"github.com/spf13/cobra"
)
// initdbCmd represents the initdb command
var initdbCmd = &cobra.Command{
Use: "initdb",
Short: "gin-vue-admin初始化数据",
Long: `gin-vue-admin初始化数据适配数据库情况:
1. mysql完美适配,
2. postgresql不能保证完美适配,
3. sqlite未适配,
4. sqlserver未适配`,
Run: func(cmd *cobra.Command, args []string) {
frame, _ := cmd.Flags().GetString("frame")
path, _ := cmd.Flags().GetString("path")
global.GVA_VP = core.Viper(path)
global.GVA_LOG = core.Zap() // 初始化zap日志库
Mysql.CheckDatabase()
Mysql.CheckUtf8mb4()
Mysql.Info()
Mysql.Init()
switch frame {
case "gin":
if global.GVA_CONFIG.System.DbType == "mysql" {
Mysql.AutoMigrateTables()
Mysql.InitData()
}
case "gf":
color.Info.Println("gf功能开发中")
}
},
}
func init() {
rootCmd.AddCommand(initdbCmd)
initdbCmd.Flags().StringP("path", "p", "./config.yaml", "自定配置文件路径(绝对路径)")
initdbCmd.Flags().StringP("frame", "f", "gin", "可选参数为gin,gf")
initdbCmd.Flags().StringP("type", "t", "mysql", "可选参数为mysql,postgresql,sqlite,sqlserver")
}
-316
View File
@@ -1,316 +0,0 @@
package gva
import (
"fmt"
information "gin-vue-admin/cmd/information/extra"
data "gin-vue-admin/cmd/information/system"
"gin-vue-admin/global"
"gin-vue-admin/model"
gormadapter "github.com/casbin/gorm-adapter/v3"
"github.com/gookit/color"
"gorm.io/driver/mysql"
"gorm.io/gorm"
"gorm.io/gorm/logger"
"os"
"strings"
)
type DatabaseInfo struct {
Value string `gorm:"column:Value"`
VariableName string `gorm:"column:Variable_name"`
}
var Mysql = &_mysql{_config: &gorm.Config{}}
type _mysql struct {
db *gorm.DB
err error
_config *gorm.Config
old string // 配置文件第一次读取数据库数据
input string
version string
character string
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: gorm连接mysql数据库
func (m *_mysql) Init() {
if global.GVA_CONFIG.Mysql.LogMode {
m._config.Logger = logger.Default.LogMode(logger.Info)
} else {
m._config.Logger = logger.Default.LogMode(logger.Silent)
}
m._config.DisableForeignKeyConstraintWhenMigrating = true
m.db, m.err = gorm.Open(mysql.New(mysql.Config{
DSN: global.GVA_CONFIG.Mysql.Dsn(), // DSN data source name
DefaultStringSize: 256, // string 类型字段的默认长度
DisableDatetimePrecision: true, // 禁用 datetime 精度,MySQL 5.6 之前的数据库不支持
DontSupportRenameIndex: true, // 重命名索引时采用删除并新建的方式,MySQL 5.7 之前的数据库和 MariaDB 不支持重命名索引
DontSupportRenameColumn: true, // 用 `change` 重命名列,MySQL 8 之前的数据库和 MariaDB 不支持重命名列
SkipInitializeWithVersion: false, // 根据当前 MySQL 版本自动配置
}), m._config)
global.GVA_DB = m.db
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: gorm 同步模型 生成mysql表
func (m *_mysql) AutoMigrateTables() {
if !global.GVA_DB.Migrator().HasTable("casbin_rule") {
m.err = global.GVA_DB.Migrator().CreateTable(&gormadapter.CasbinRule{})
}
m.err = m.db.AutoMigrate(
new(model.SysApi),
new(model.SysUser),
new(model.SysBaseMenu),
new(model.SysAuthority),
new(model.SysDictionary),
new(model.JwtBlacklist),
new(model.SysOperationRecord),
new(model.SysDictionaryDetail),
new(model.SysBaseMenuParameter),
new(model.WorkflowNode),
new(model.WorkflowEdge),
new(model.WorkflowProcess),
new(model.WorkflowEndPoint),
new(model.WorkflowStartPoint),
new(model.ExaFileUploadAndDownload),
new(model.ExaFile),
new(model.ExaFileChunk),
)
if m.err != nil {
color.Warn.Printf("[Mysql] --> 初始化数据表失败, err: %v\n", m.err)
os.Exit(0)
}
color.Info.Println("[Mysql] --> 初始化数据表成功! ")
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: 初始化数据
func (m *_mysql) InitData() {
if m.err = data.Api.Init(); m.err != nil {
color.Warn.Println("\n[Mysql] --> sys_apis 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
if m.err = data.Admin.Init(); m.err != nil {
color.Warn.Println("\n[Mysql] --> sys_users 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
if m.err = data.Casbin.Init(); m.err != nil {
color.Error.Println("\n[Mysql] --> casbin_rule 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
if m.err = data.BaseMenu.Init(); m.err != nil {
color.Error.Println("\n[Mysql] --> sys_base_menus 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
if m.err = data.Authority.Init(); m.err != nil {
color.Error.Println("\n[Mysql] --> sys_authorities 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
if m.err = data.AuthorityMenu.Init(); m.err != nil {
color.Error.Println("\n[Mysql] --> authority_menu 视图创建失败!, err:%v", m.err)
os.Exit(0)
}
if m.err = data.Dictionary.Init(); m.err != nil {
color.Warn.Println("\n[Mysql] --> dictionaries 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
if m.err = data.AuthoritiesMenus.Init(); m.err != nil {
color.Warn.Println("\n[Mysql] --> sys_authority_menus 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
if m.err = data.DataAuthorities.Init(); m.err != nil {
color.Warn.Println("\n[Mysql] --> sys_data_authority_id 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
if m.err = data.DictionaryDetail.Init(); m.err != nil {
color.Warn.Println("\n[Mysql] --> sys_dictionary_details 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
if m.err = data.Workflow.Init(); m.err != nil {
color.Warn.Println("\n[Mysql] --> 工作流相关 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
if m.err = information.File.Init(); m.err != nil {
color.Warn.Println("\n[Mysql] --> exa_file_upload_and_downloads 表初始数据失败, err: %v", m.err)
os.Exit(0)
}
color.Info.Println("\n[Mysql] --> 初始化数据成功!\n")
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: 检查数据库是否存在
func (m *_mysql) CheckDatabase() {
var unknownDatabase = fmt.Sprintf("Unknown database '%v'", global.GVA_CONFIG.Mysql.Dbname)
m.Init()
if m.err != nil {
if strings.Split(m.err.Error(), ": ")[1] == unknownDatabase {
color.Debug.Print("\n[Mysql] -->配置文件的数据库名为:")
color.LightGreen.Printf(" {%v} ", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Println("不存在!\n")
color.Debug.Println("您的配置文件所配置的数据库不存在,请选择:")
color.Debug.Print("0:请自行创建配置文件所配置的数据库名为:")
color.LightGreen.Printf(" {%v} \n", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Print("1:尝试使用sql为您创建配置文件所配置的数据库名为:")
color.LightGreen.Printf(" {%v} \n", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Println("2:忽略错误! 注意: 如果不修复, 将会退出初始化数据的进程!")
color.Warn.Println("\n注意!!!!!!!")
color.Warn.Println("输入1之后,如果配置文件的mysql用户名为root才会有百分百的权限去创建数据库,不是root的话就会跳过创建数据库步骤!\n")
color.Debug.Println("请输入指令:")
if n, _ := fmt.Scanln(&m.input); n != 0 {
if m.input == "1" {
if global.GVA_CONFIG.Mysql.Username == "root" {
m.database()
} else {
color.Debug.Print("\n很抱歉,您的配置文件的mysql用户名配置不是root,不确定你有无权限创建数据库,为您跳过创建数据库操作,请自行创建配置文件所配置的数据库名为:")
color.LightGreen.Printf(" {%v} \n", global.GVA_CONFIG.Mysql.Dbname)
}
} else if m.input == "2" {
os.Exit(0)
} else {
color.Warn.Println("[Mysql] --> 请自行创建数据库!")
os.Exit(0)
}
}
}
}
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: 检查数据库编码是不是utf8mb4
func (m *_mysql) CheckUtf8mb4() {
m.Character()
if m.character != "utf8mb4" {
color.Info.Println("您当前的数据库编码不是utf8mb4,请选择:")
color.Info.Println("0:请自行修改数据的编码为utf8mb4!")
color.Info.Println("1:尝试使用sql为您修改编码为utf8mb4!")
color.Info.Println("2:忽略错误! 注意如果不修复,生成初始数据的时候也许或许可能有几率报错的喔!")
color.Info.Println("请输入指令:")
if n, _ := fmt.Scanln(&m.input); n != 0 {
if m.input == "1" {
m.utf8mb4()
} else if m.input == "2" {
return
} else {
color.Warn.Println("[Mysql] --> 请自行修改数据的编码为utf8mb4!")
os.Exit(0)
}
}
}
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: 打印数据库基本信息
func (m *_mysql) Info() {
m.Version()
color.Debug.Print("\n您当前的数据库版本: ")
color.LightGreen.Printf(" {%v} ", m.version)
color.Debug.Print(", 使用的数据库是: ")
color.LightGreen.Printf(" {%v} ", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Print(", 数据库编码是: ")
color.LightGreen.Printf(" {%v} \n\n", m.character)
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: 获取数据库版本
func (m *_mysql) Version() {
color.Debug.Println("[Mysql] -->获取数据库版本中.......")
if err := global.GVA_DB.Raw("SELECT VERSION() AS version;").Scan(&m.version).Error; err != nil {
color.Info.Printf("[Mysql] -->获取数据库版本失败! err: %v", err)
m.version = "未知版本~~~"
}
color.Debug.Printf("\n[Mysql] -->获取数据库版本成功!\n")
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: 获取数据库编码
func (m *_mysql) Character() {
var info DatabaseInfo
color.Debug.Println("\n[Mysql] -->获取数据库编码中.......")
if err := global.GVA_DB.Raw("show variables like 'character_set_database' ").Scan(&info).Error; err != nil {
color.Error.Printf("[Mysql] -->获取数据库编码失败! err:%v\n", err)
m.character = "未知编码~~~"
}
color.Debug.Println("\n[Mysql] -->获取数据库编码成功!\n")
m.character = info.Value
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: 设置配置文件的数据库编码为utf8mb4
func (m *_mysql) utf8mb4() {
color.Debug.Print("\n[Mysql] --> 设置数据库名为:")
color.LightGreen.Printf(" {%v} ", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Print("数据库的编码为utf8mb4中.......\n")
if err := global.GVA_DB.Debug().Exec("ALTER DATABASE " + global.GVA_CONFIG.Mysql.Dbname + " CHARACTER SET `utf8mb4` COLLATE `utf8mb4_general_ci`").Error; err != nil {
color.Debug.Print("\n[Mysql] --> 设置数据库名为:")
color.LightGreen.Printf(" {%v} ", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Print("数据库的编码为utf8mb4失败!请手动修改数据库名为:")
color.LightGreen.Printf(" {%v} ", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Println("的编码为utf8mb4\n")
return
}
color.Info.Print("\n[Mysql] --> 设置数据库名为:")
color.LightGreen.Printf(" {%v} ", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Print("的编码为utf8mb4成功!\n")
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: 创建配置文件的数据库
func (m *_mysql) database() {
m.old = global.GVA_CONFIG.Mysql.Dbname
global.GVA_CONFIG.Mysql.Dbname = "mysql"
color.Debug.Printf("\n[Mysql] --> 正在连接 mysql 数据库中.......\n")
m.Init()
if m.err != nil {
color.Error.Printf("\n[Mysql] --> 链接 mysql 数据库失败!, err: %v\n", m.err)
color.Error.Printf("[Mysql] --> 请自行创建配置文件所需的数据库!\n")
os.Exit(0)
}
color.Debug.Printf("\n[Mysql] --> 连接 mysql 数据库成功\n")
global.GVA_CONFIG.Mysql.Dbname = m.old
color.Debug.Print("\n[Mysql] --> 正在为您创建数据库名为:")
color.LightGreen.Printf(" {%v} ", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Print("中.......\n")
if m.err = global.GVA_DB.Exec("CREATE DATABASE IF NOT EXISTS " + global.GVA_CONFIG.Mysql.Dbname + " DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_general_ci;").Error; m.err != nil {
color.Debug.Print("\n[Mysql] --> 创建数据库名为:")
color.LightGreen.Printf(" {%v} ", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Print("失败!请手动修改数据库名为")
color.LightGreen.Printf(" {%v} \n", global.GVA_CONFIG.Mysql.Dbname)
os.Exit(0)
return
}
color.Debug.Print("\n[Mysql] --> 正在为您创建数据库名为:")
color.LightGreen.Printf(" {%v} ", global.GVA_CONFIG.Mysql.Dbname)
color.Debug.Print("成功!\n")
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: 处理零值
func (m *_mysql) zero() {
var info DatabaseInfo
color.Info.Println("\n[Mysql]--> 获取数据库数据中.......")
if err := global.GVA_DB.Raw("show variables like 'sql_mode';").Scan(&info).Error; err != nil {
color.Error.Printf("\n[Mysql]-->获取数据库数据失败! err:%v\n", err)
}
color.Info.Println("\n[Mysql]--> 处理数据库返回数据.......")
var values = strings.Split(info.Value, ",")
info.Value = ""
for i, value := range values {
if value == "NO_ZERO_IN_DATE" || value == "NO_ZERO_DATE" {
} else {
if i == len(values)-1 {
info.Value += value
} else {
info.Value += value + ","
}
}
}
if err := global.GVA_DB.Exec("set global sql_mode='" + info.Value + "';").Error; err != nil {
color.Error.Printf("\n[Mysql]--> 设置数据库的零值失效失败! err:%v\n", err)
return
}
color.Info.Println("\n[Mysql]--> 设置数据库零值失效成功")
}
-94
View File
@@ -1,94 +0,0 @@
/*
Copyright © 2020 SliverHorn
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package gva
import (
"github.com/mitchellh/go-homedir"
"os"
"github.com/gookit/color"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var cfgFile string
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "gva",
Short: "这是一款amazing的终端工具",
Long: `欢迎使用gva终端工具
________ ____ ____ _____
/ _____/ \ \ / / / _ \
/ \ ___ \ Y / / /_\ \
\ \_\ \ \ / / | \
\______ / \___/ \____|__ /
\/ \/
`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
}
// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
if err := rootCmd.Execute(); err != nil {
color.Warn.Println(err)
os.Exit(1)
}
}
func init() {
cobra.OnInitialize(initConfig)
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.gva.yaml)")
// Cobra also supports local flags, which will only run
// when this action is called directly.
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
// initConfig reads in config file and ENV variables if set.
func initConfig() {
if cfgFile != "" {
// Use config file from the flag.
viper.SetConfigFile(cfgFile)
} else {
// Find home directory.
home, err := homedir.Dir()
if err != nil {
color.Warn.Println(err)
os.Exit(1)
}
// Search config in home directory with name ".gva" (without extension).
viper.AddConfigPath(home)
viper.SetConfigName(".gva")
}
viper.AutomaticEnv() // read in environment variables that match
// If a config file is found, read it in.
if err := viper.ReadInConfig(); err == nil {
color.Warn.Println("Using config file:", viper.ConfigFileUsed())
}
}
-53
View File
@@ -1,53 +0,0 @@
/*
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package gva
import (
"gin-vue-admin/utils"
"github.com/spf13/cobra"
"os"
)
// runCmd represents the run command
var runCmd = &cobra.Command{
Use: "run",
Short: "running go codes with hot-compiled-like feature",
Long: `
The "run" command is used for running go codes with hot-compiled-like feature,
which compiles and runs the go codes asynchronously when codes change.
`,
Run: func(cmd *cobra.Command, args []string) {
w := utils.NewWatch()
t := utils.NewT()
path, _ := os.Getwd()
go w.Watch(path, t)
t.RunTask()
},
}
func init() {
rootCmd.AddCommand(runCmd)
// Here you will define your flags and configuration settings.
// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// runCmd.PersistentFlags().String("foo", "", "A help for foo")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// runCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
-36
View File
@@ -1,36 +0,0 @@
/*
Copyright © 2020 SliverHorn
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package gva
import (
"github.com/gookit/color"
"github.com/spf13/cobra"
)
// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Short: "版本信息",
Long: `版本的长信息`,
Run: func(cmd *cobra.Command, args []string) {
color.Green.Println("v0.0.4")
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}
-34
View File
@@ -1,34 +0,0 @@
package information
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"github.com/gookit/color"
"gorm.io/gorm"
"time"
)
var File = new(file)
type file struct{}
var files = []model.ExaFileUploadAndDownload{
{global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "10.png", "http://qmplusimg.henrongyi.top/gvalogo.png", "png", "158787308910.png"},
{global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "logo.png", "http://qmplusimg.henrongyi.top/1576554439myAvatar.png", "png", "1587973709logo.png"},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: exa_file_upload_and_downloads 表初始化数据
func (f *file) Init() error {
return global.GVA_DB.Transaction(func(tx *gorm.DB) error {
if tx.Where("id IN ?", []int{1, 2}).Find(&[]model.ExaFileUploadAndDownload{}).RowsAffected == 2 {
color.Danger.Println("\n[Mysql] --> exa_file_upload_and_downloads 表初始数据已存在!")
return nil
}
if err := tx.Create(&files).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> exa_file_upload_and_downloads 表初始数据成功!")
return nil
})
}
-36
View File
@@ -1,36 +0,0 @@
package information
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"github.com/gookit/color"
"time"
uuid "github.com/satori/go.uuid"
"gorm.io/gorm"
)
var Admin = new(admin)
type admin struct{}
var admins = []model.SysUser{
{GVA_MODEL: global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, UUID: uuid.NewV4(), Username: "admin", Password: "e10adc3949ba59abbe56e057f20f883e", NickName: "超级管理员", HeaderImg: "http://qmplusimg.henrongyi.top/gva_header.jpg", AuthorityId: "888"},
{GVA_MODEL: global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, UUID: uuid.NewV4(), Username: "a303176530", Password: "3ec063004a6f31642261936a379fde3d", NickName: "QMPlusUser", HeaderImg: "http://qmplusimg.henrongyi.top/1572075907logo.png", AuthorityId: "9528"},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: sys_users 表数据初始化
func (a *admin) Init() error {
return global.GVA_DB.Transaction(func(tx *gorm.DB) error {
if tx.Where("id IN ?", []int{1, 2}).Find(&[]model.SysUser{}).RowsAffected == 2 {
color.Danger.Println("\n[Mysql] --> sys_users 表的初始数据已存在!")
return nil
}
if err := tx.Create(&admins).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> sys_users 表初始数据成功!")
return nil
})
}
-111
View File
@@ -1,111 +0,0 @@
package information
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"github.com/gookit/color"
"time"
"gorm.io/gorm"
)
var Api = new(api)
type api struct{}
var apis = []model.SysApi{
{global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/base/login", "用户登录", "base", "POST"},
{global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/register", "用户注册", "user", "POST"},
{global.GVA_MODEL{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/api/createApi", "创建api", "api", "POST"},
{global.GVA_MODEL{ID: 4, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/api/getApiList", "获取api列表", "api", "POST"},
{global.GVA_MODEL{ID: 5, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/api/getApiById", "获取api详细信息", "api", "POST"},
{global.GVA_MODEL{ID: 6, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/api/deleteApi", "删除Api", "api", "POST"},
{global.GVA_MODEL{ID: 7, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/api/updateApi", "更新Api", "api", "POST"},
{global.GVA_MODEL{ID: 8, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/api/getAllApis", "获取所有api", "api", "POST"},
{global.GVA_MODEL{ID: 9, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/authority/createAuthority", "创建角色", "authority", "POST"},
{global.GVA_MODEL{ID: 10, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/authority/deleteAuthority", "删除角色", "authority", "POST"},
{global.GVA_MODEL{ID: 11, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/authority/getAuthorityList", "获取角色列表", "authority", "POST"},
{global.GVA_MODEL{ID: 12, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/getMenu", "获取菜单树", "menu", "POST"},
{global.GVA_MODEL{ID: 13, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/getMenuList", "分页获取基础menu列表", "menu", "POST"},
{global.GVA_MODEL{ID: 14, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/addBaseMenu", "新增菜单", "menu", "POST"},
{global.GVA_MODEL{ID: 15, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/getBaseMenuTree", "获取用户动态路由", "menu", "POST"},
{global.GVA_MODEL{ID: 16, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/addMenuAuthority", "增加menu和角色关联关系", "menu", "POST"},
{global.GVA_MODEL{ID: 17, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/getMenuAuthority", "获取指定角色menu", "menu", "POST"},
{global.GVA_MODEL{ID: 18, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/deleteBaseMenu", "删除菜单", "menu", "POST"},
{global.GVA_MODEL{ID: 19, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/updateBaseMenu", "更新菜单", "menu", "POST"},
{global.GVA_MODEL{ID: 20, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/menu/getBaseMenuById", "根据id获取菜单", "menu", "POST"},
{global.GVA_MODEL{ID: 21, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/changePassword", "修改密码", "user", "POST"},
{global.GVA_MODEL{ID: 23, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/getUserList", "获取用户列表", "user", "POST"},
{global.GVA_MODEL{ID: 24, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/setUserAuthority", "修改用户角色", "user", "POST"},
{global.GVA_MODEL{ID: 25, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/fileUploadAndDownload/upload", "文件上传示例", "fileUploadAndDownload", "POST"},
{global.GVA_MODEL{ID: 26, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/fileUploadAndDownload/getFileList", "获取上传文件列表", "fileUploadAndDownload", "POST"},
{global.GVA_MODEL{ID: 27, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/casbin/updateCasbin", "更改角色api权限", "casbin", "POST"},
{global.GVA_MODEL{ID: 28, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/casbin/getPolicyPathByAuthorityId", "获取权限列表", "casbin", "POST"},
{global.GVA_MODEL{ID: 29, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/fileUploadAndDownload/deleteFile", "删除文件", "fileUploadAndDownload", "POST"},
{global.GVA_MODEL{ID: 30, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/jwt/jsonInBlacklist", "jwt加入黑名单", "jwt", "POST"},
{global.GVA_MODEL{ID: 31, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/authority/setDataAuthority", "设置角色资源权限", "authority", "POST"},
{global.GVA_MODEL{ID: 32, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/system/getSystemConfig", "获取配置文件内容", "system", "POST"},
{global.GVA_MODEL{ID: 33, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/system/setSystemConfig", "设置配置文件内容", "system", "POST"},
{global.GVA_MODEL{ID: 34, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/customer/customer", "创建客户", "customer", "POST"},
{global.GVA_MODEL{ID: 35, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/customer/customer", "更新客户", "customer", "PUT"},
{global.GVA_MODEL{ID: 36, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/customer/customer", "删除客户", "customer", "DELETE"},
{global.GVA_MODEL{ID: 37, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/customer/customer", "获取单一客户", "customer", "GET"},
{global.GVA_MODEL{ID: 38, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/customer/customerList", "获取客户列表", "customer", "GET"},
{global.GVA_MODEL{ID: 39, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/casbin/casbinTest/:pathParam", "RESTFUL模式测试", "casbin", "GET"},
{global.GVA_MODEL{ID: 40, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/autoCode/createTemp", "自动化代码", "autoCode", "POST"},
{global.GVA_MODEL{ID: 41, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/authority/updateAuthority", "更新角色信息", "authority", "PUT"},
{global.GVA_MODEL{ID: 42, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/authority/copyAuthority", "拷贝角色", "authority", "POST"},
{global.GVA_MODEL{ID: 43, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/deleteUser", "删除用户", "user", "DELETE"},
{global.GVA_MODEL{ID: 44, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysDictionaryDetail/createSysDictionaryDetail", "新增字典内容", "sysDictionaryDetail", "POST"},
{global.GVA_MODEL{ID: 45, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysDictionaryDetail/deleteSysDictionaryDetail", "删除字典内容", "sysDictionaryDetail", "DELETE"},
{global.GVA_MODEL{ID: 46, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysDictionaryDetail/updateSysDictionaryDetail", "更新字典内容", "sysDictionaryDetail", "PUT"},
{global.GVA_MODEL{ID: 47, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysDictionaryDetail/findSysDictionaryDetail", "根据ID获取字典内容", "sysDictionaryDetail", "GET"},
{global.GVA_MODEL{ID: 48, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysDictionaryDetail/getSysDictionaryDetailList", "获取字典内容列表", "sysDictionaryDetail", "GET"},
{global.GVA_MODEL{ID: 49, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysDictionary/createSysDictionary", "新增字典", "sysDictionary", "POST"},
{global.GVA_MODEL{ID: 50, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysDictionary/deleteSysDictionary", "删除字典", "sysDictionary", "DELETE"},
{global.GVA_MODEL{ID: 51, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysDictionary/updateSysDictionary", "更新字典", "sysDictionary", "PUT"},
{global.GVA_MODEL{ID: 52, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysDictionary/findSysDictionary", "根据ID获取字典", "sysDictionary", "GET"},
{global.GVA_MODEL{ID: 53, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysDictionary/getSysDictionaryList", "获取字典列表", "sysDictionary", "GET"},
{global.GVA_MODEL{ID: 54, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysOperationRecord/createSysOperationRecord", "新增操作记录", "sysOperationRecord", "POST"},
{global.GVA_MODEL{ID: 55, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysOperationRecord/deleteSysOperationRecord", "删除操作记录", "sysOperationRecord", "DELETE"},
{global.GVA_MODEL{ID: 56, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysOperationRecord/findSysOperationRecord", "根据ID获取操作记录", "sysOperationRecord", "GET"},
{global.GVA_MODEL{ID: 57, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysOperationRecord/getSysOperationRecordList", "获取操作记录列表", "sysOperationRecord", "GET"},
{global.GVA_MODEL{ID: 58, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/autoCode/getTables", "获取数据库表", "autoCode", "GET"},
{global.GVA_MODEL{ID: 59, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/autoCode/getDB", "获取所有数据库", "autoCode", "GET"},
{global.GVA_MODEL{ID: 60, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/autoCode/getColumn", "获取所选table的所有字段", "autoCode", "GET"},
{global.GVA_MODEL{ID: 61, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/sysOperationRecord/deleteSysOperationRecordByIds", "批量删除操作历史", "sysOperationRecord", "DELETE"},
{global.GVA_MODEL{ID: 62, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/simpleUploader/upload", "插件版分片上传", "simpleUploader", "POST"},
{global.GVA_MODEL{ID: 63, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/simpleUploader/checkFileMd5", "文件完整度验证", "simpleUploader", "GET"},
{global.GVA_MODEL{ID: 64, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/simpleUploader/mergeFileMd5", "上传完成合并文件", "simpleUploader", "GET"},
{global.GVA_MODEL{ID: 65, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/user/setUserInfo", "设置用户信息", "user", "PUT"},
{global.GVA_MODEL{ID: 66, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/system/getServerInfo", "获取服务器信息", "system", "POST"},
{global.GVA_MODEL{ID: 67, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/email/emailTest", "发送测试邮件", "email", "POST"},
{global.GVA_MODEL{ID: 68, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/createWorkflowProcess", "新建工作流", "workflowProcess", "POST"},
{global.GVA_MODEL{ID: 69, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/deleteWorkflowProcess", "删除工作流", "workflowProcess", "DELETE"},
{global.GVA_MODEL{ID: 70, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/deleteWorkflowProcessByIds", "批量删除工作流", "workflowProcess", "DELETE"},
{global.GVA_MODEL{ID: 71, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/updateWorkflowProcess", "更新工作流", "workflowProcess", "PUT"},
{global.GVA_MODEL{ID: 72, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/findWorkflowProcess", "根据ID获取工作流", "workflowProcess", "GET"},
{global.GVA_MODEL{ID: 73, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/getWorkflowProcessList", "获取工作流", "workflowProcess", "GET"},
{global.GVA_MODEL{ID: 74, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/findWorkflowStep", "获取工作流步骤", "workflowProcess", "GET"},
{global.GVA_MODEL{ID: 75, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/startWorkflow", "启动工作流", "workflowProcess", "POST"},
{global.GVA_MODEL{ID: 76, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/getMyStated", "获取我发起的工作流", "workflowProcess", "GET"},
{global.GVA_MODEL{ID: 77, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/getMyNeed", "获取我的待办", "workflowProcess", "GET"},
{global.GVA_MODEL{ID: 78, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/getWorkflowMoveByID", "根据id获取当前节点详情和历史", "workflowProcess", "GET"},
{global.GVA_MODEL{ID: 79, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "/workflowProcess/completeWorkflowMove", "提交工作流", "workflowProcess", "POST"},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: sys_apis 表数据初始化
func (a *api) Init() error {
return global.GVA_DB.Transaction(func(tx *gorm.DB) error {
if tx.Where("id IN ?", []int{1, 67}).Find(&[]model.SysApi{}).RowsAffected == 2 {
color.Danger.Println("\n[Mysql] --> sys_apis 表的初始数据已存在!")
return nil
}
if err := tx.Create(&apis).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> sys_apis 表初始数据成功!")
return nil
})
}
@@ -1,83 +0,0 @@
package information
import (
"gin-vue-admin/global"
"github.com/gookit/color"
"gorm.io/gorm"
)
var AuthoritiesMenus = new(authoritiesMenus)
type authoritiesMenus struct{}
type AuthorityMenus struct {
AuthorityId string `gorm:"column:sys_authority_authority_id"`
BaseMenuId uint `gorm:"column:sys_base_menu_id"`
}
var authorityMenus = []AuthorityMenus{
{"888", 1},
{"888", 2},
{"888", 3},
{"888", 4},
{"888", 5},
{"888", 6},
{"888", 7},
{"888", 8},
{"888", 9},
{"888", 10},
{"888", 11},
{"888", 12},
{"888", 13},
{"888", 14},
{"888", 15},
{"888", 16},
{"888", 17},
{"888", 18},
{"888", 19},
{"888", 20},
{"888", 21},
{"888", 22},
{"888", 23},
{"888", 24},
{"888", 25},
{"888", 26},
{"888", 27},
{"888", 28},
{"888", 29},
{"8881", 1},
{"8881", 2},
{"8881", 8},
{"9528", 1},
{"9528", 2},
{"9528", 3},
{"9528", 4},
{"9528", 5},
{"9528", 6},
{"9528", 7},
{"9528", 8},
{"9528", 9},
{"9528", 10},
{"9528", 11},
{"9528", 12},
{"9528", 14},
{"9528", 15},
{"9528", 16},
{"9528", 17},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: sys_authority_menus 表数据初始化
func (a *authoritiesMenus) Init() error {
return global.GVA_DB.Table("sys_authority_menus").Transaction(func(tx *gorm.DB) error {
if tx.Where("sys_authority_authority_id IN ('888', '8881', '9528')").Find(&[]AuthorityMenus{}).RowsAffected == 48 {
color.Danger.Println("\n[Mysql] --> sys_authority_menus 表的初始数据已存在!")
return nil
}
if err := tx.Create(&authorityMenus).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> sys_authority_menus 表初始数据成功!")
return nil
})
}
@@ -1,36 +0,0 @@
package information
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"github.com/gookit/color"
"time"
"gorm.io/gorm"
)
var Authority = new(authority)
type authority struct{}
var authorities = []model.SysAuthority{
{CreatedAt: time.Now(), UpdatedAt: time.Now(), AuthorityId: "888", AuthorityName: "普通用户", ParentId: "0", DefaultRouter: "dashboard"},
{CreatedAt: time.Now(), UpdatedAt: time.Now(), AuthorityId: "8881", AuthorityName: "普通用户子角色", ParentId: "888", DefaultRouter: "dashboard"},
{CreatedAt: time.Now(), UpdatedAt: time.Now(), AuthorityId: "9528", AuthorityName: "测试角色", ParentId: "0", DefaultRouter: "dashboard"},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: sys_authorities 表数据初始化
func (a *authority) Init() error {
return global.GVA_DB.Transaction(func(tx *gorm.DB) error {
if tx.Where("authority_id IN ? ", []string{"888", "9528"}).Find(&[]model.SysAuthority{}).RowsAffected == 2 {
color.Danger.Println("\n[Mysql] --> sys_authorities 表的初始数据已存在!")
return nil
}
if err := tx.Create(&authorities).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> sys_authorities 表初始数据成功!")
return nil
})
}
@@ -1,25 +0,0 @@
package information
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"github.com/gookit/color"
)
var AuthorityMenu = new(authorityMenu)
type authorityMenu struct{}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: authority_menu 视图数据初始化
func (a *authorityMenu) Init() error {
if global.GVA_DB.Find(&[]model.SysMenu{}).RowsAffected > 0 {
color.Danger.Println("\n[Mysql] --> authority_menu 视图已存在!")
return nil
}
if err := global.GVA_DB.Exec("CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `authority_menu` AS select `sys_base_menus`.`id` AS `id`,`sys_base_menus`.`created_at` AS `created_at`, `sys_base_menus`.`updated_at` AS `updated_at`, `sys_base_menus`.`deleted_at` AS `deleted_at`, `sys_base_menus`.`menu_level` AS `menu_level`,`sys_base_menus`.`parent_id` AS `parent_id`,`sys_base_menus`.`path` AS `path`,`sys_base_menus`.`name` AS `name`,`sys_base_menus`.`hidden` AS `hidden`,`sys_base_menus`.`component` AS `component`, `sys_base_menus`.`title` AS `title`,`sys_base_menus`.`icon` AS `icon`,`sys_base_menus`.`sort` AS `sort`,`sys_authority_menus`.`sys_authority_authority_id` AS `authority_id`,`sys_authority_menus`.`sys_base_menu_id` AS `menu_id`,`sys_base_menus`.`keep_alive` AS `keep_alive`,`sys_base_menus`.`default_menu` AS `default_menu` from (`sys_authority_menus` join `sys_base_menus` on ((`sys_authority_menus`.`sys_base_menu_id` = `sys_base_menus`.`id`)))").Error; err != nil {
return err
}
color.Info.Println("\n[Mysql] --> authority_menu 视图创建成功!")
return nil
}
-185
View File
@@ -1,185 +0,0 @@
package information
import (
"gin-vue-admin/global"
gormadapter "github.com/casbin/gorm-adapter/v3"
"github.com/gookit/color"
"gorm.io/gorm"
)
var Casbin = new(casbin)
type casbin struct{}
var carbines = []gormadapter.CasbinRule{
{PType: "p", V0: "888", V1: "/base/login", V2: "POST"},
{PType: "p", V0: "888", V1: "/user/register", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/createApi", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/getApiList", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/getApiById", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/deleteApi", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/updateApi", V2: "POST"},
{PType: "p", V0: "888", V1: "/api/getAllApis", V2: "POST"},
{PType: "p", V0: "888", V1: "/authority/createAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/authority/deleteAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/authority/getAuthorityList", V2: "POST"},
{PType: "p", V0: "888", V1: "/authority/setDataAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/authority/updateAuthority", V2: "PUT"},
{PType: "p", V0: "888", V1: "/authority/copyAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/getMenu", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/getMenuList", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/addBaseMenu", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/getBaseMenuTree", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/addMenuAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/getMenuAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/deleteBaseMenu", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/updateBaseMenu", V2: "POST"},
{PType: "p", V0: "888", V1: "/menu/getBaseMenuById", V2: "POST"},
{PType: "p", V0: "888", V1: "/user/changePassword", V2: "POST"},
{PType: "p", V0: "888", V1: "/user/getUserList", V2: "POST"},
{PType: "p", V0: "888", V1: "/user/setUserAuthority", V2: "POST"},
{PType: "p", V0: "888", V1: "/user/deleteUser", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/upload", V2: "POST"},
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/getFileList", V2: "POST"},
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"},
{PType: "p", V0: "888", V1: "/casbin/updateCasbin", V2: "POST"},
{PType: "p", V0: "888", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"},
{PType: "p", V0: "888", V1: "/casbin/casbinTest/:pathParam", V2: "GET"},
{PType: "p", V0: "888", V1: "/jwt/jsonInBlacklist", V2: "POST"},
{PType: "p", V0: "888", V1: "/system/getSystemConfig", V2: "POST"},
{PType: "p", V0: "888", V1: "/system/setSystemConfig", V2: "POST"},
{PType: "p", V0: "888", V1: "/system/getServerInfo", V2: "POST"},
{PType: "p", V0: "888", V1: "/customer/customer", V2: "POST"},
{PType: "p", V0: "888", V1: "/customer/customer", V2: "PUT"},
{PType: "p", V0: "888", V1: "/customer/customer", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/customer/customer", V2: "GET"},
{PType: "p", V0: "888", V1: "/customer/customerList", V2: "GET"},
{PType: "p", V0: "888", V1: "/autoCode/createTemp", V2: "POST"},
{PType: "p", V0: "888", V1: "/autoCode/getTables", V2: "GET"},
{PType: "p", V0: "888", V1: "/autoCode/getDB", V2: "GET"},
{PType: "p", V0: "888", V1: "/autoCode/getColumn", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/createSysDictionaryDetail", V2: "POST"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/deleteSysDictionaryDetail", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/updateSysDictionaryDetail", V2: "PUT"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/findSysDictionaryDetail", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysDictionaryDetail/getSysDictionaryDetailList", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysDictionary/createSysDictionary", V2: "POST"},
{PType: "p", V0: "888", V1: "/sysDictionary/deleteSysDictionary", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/sysDictionary/updateSysDictionary", V2: "PUT"},
{PType: "p", V0: "888", V1: "/sysDictionary/findSysDictionary", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysDictionary/getSysDictionaryList", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/createSysOperationRecord", V2: "POST"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/deleteSysOperationRecord", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/updateSysOperationRecord", V2: "PUT"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/findSysOperationRecord", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/getSysOperationRecordList", V2: "GET"},
{PType: "p", V0: "888", V1: "/sysOperationRecord/deleteSysOperationRecordByIds", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/user/setUserInfo", V2: "PUT"},
{PType: "p", V0: "888", V1: "/email/emailTest", V2: "POST"},
{PType: "p", V0: "888", V1: "/simpleUploader/upload", V2: "POST"},
{PType: "p", V0: "888", V1: "/simpleUploader/checkFileMd5", V2: "GET"},
{PType: "p", V0: "888", V1: "/simpleUploader/mergeFileMd5", V2: "GET"},
{PType: "p", V0: "888", V1: "/workflowProcess/createWorkflowProcess", V2: "POST"},
{PType: "p", V0: "888", V1: "/workflowProcess/deleteWorkflowProcess", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/workflowProcess/deleteWorkflowProcessByIds", V2: "DELETE"},
{PType: "p", V0: "888", V1: "/workflowProcess/updateWorkflowProcess", V2: "PUT"},
{PType: "p", V0: "888", V1: "/workflowProcess/findWorkflowProcess", V2: "GET"},
{PType: "p", V0: "888", V1: "/workflowProcess/getWorkflowProcessList", V2: "GET"},
{PType: "p", V0: "888", V1: "/workflowProcess/findWorkflowStep", V2: "GET"},
{PType: "p", V0: "888", V1: "/workflowProcess/startWorkflow", V2: "POST"},
{PType: "p", V0: "888", V1: "/workflowProcess/completeWorkflowMove", V2: "POST"},
{PType: "p", V0: "888", V1: "/workflowProcess/getMyStated", V2: "GET"},
{PType: "p", V0: "888", V1: "/workflowProcess/getMyNeed", V2: "GET"},
{PType: "p", V0: "888", V1: "/workflowProcess/getWorkflowMoveByID", V2: "GET"},
{PType: "p", V0: "8881", V1: "/base/login", V2: "POST"},
{PType: "p", V0: "8881", V1: "/user/register", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/createApi", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/getApiList", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/getApiById", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/deleteApi", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/updateApi", V2: "POST"},
{PType: "p", V0: "8881", V1: "/api/getAllApis", V2: "POST"},
{PType: "p", V0: "8881", V1: "/authority/createAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/authority/deleteAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/authority/getAuthorityList", V2: "POST"},
{PType: "p", V0: "8881", V1: "/authority/setDataAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/getMenu", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/getMenuList", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/addBaseMenu", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/getBaseMenuTree", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/addMenuAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/getMenuAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/deleteBaseMenu", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/updateBaseMenu", V2: "POST"},
{PType: "p", V0: "8881", V1: "/menu/getBaseMenuById", V2: "POST"},
{PType: "p", V0: "8881", V1: "/user/changePassword", V2: "POST"},
{PType: "p", V0: "8881", V1: "/user/getUserList", V2: "POST"},
{PType: "p", V0: "8881", V1: "/user/setUserAuthority", V2: "POST"},
{PType: "p", V0: "8881", V1: "/fileUploadAndDownload/upload", V2: "POST"},
{PType: "p", V0: "8881", V1: "/fileUploadAndDownload/getFileList", V2: "POST"},
{PType: "p", V0: "8881", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"},
{PType: "p", V0: "8881", V1: "/casbin/updateCasbin", V2: "POST"},
{PType: "p", V0: "8881", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"},
{PType: "p", V0: "8881", V1: "/jwt/jsonInBlacklist", V2: "POST"},
{PType: "p", V0: "8881", V1: "/system/getSystemConfig", V2: "POST"},
{PType: "p", V0: "8881", V1: "/system/setSystemConfig", V2: "POST"},
{PType: "p", V0: "8881", V1: "/customer/customer", V2: "POST"},
{PType: "p", V0: "8881", V1: "/customer/customer", V2: "PUT"},
{PType: "p", V0: "8881", V1: "/customer/customer", V2: "DELETE"},
{PType: "p", V0: "8881", V1: "/customer/customer", V2: "GET"},
{PType: "p", V0: "8881", V1: "/customer/customerList", V2: "GET"},
{PType: "p", V0: "9528", V1: "/base/login", V2: "POST"},
{PType: "p", V0: "9528", V1: "/user/register", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/createApi", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/getApiList", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/getApiById", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/deleteApi", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/updateApi", V2: "POST"},
{PType: "p", V0: "9528", V1: "/api/getAllApis", V2: "POST"},
{PType: "p", V0: "9528", V1: "/authority/createAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/authority/deleteAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/authority/getAuthorityList", V2: "POST"},
{PType: "p", V0: "9528", V1: "/authority/setDataAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/getMenu", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/getMenuList", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/addBaseMenu", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/getBaseMenuTree", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/addMenuAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/getMenuAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/deleteBaseMenu", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/updateBaseMenu", V2: "POST"},
{PType: "p", V0: "9528", V1: "/menu/getBaseMenuById", V2: "POST"},
{PType: "p", V0: "9528", V1: "/user/changePassword", V2: "POST"},
{PType: "p", V0: "9528", V1: "/user/getUserList", V2: "POST"},
{PType: "p", V0: "9528", V1: "/user/setUserAuthority", V2: "POST"},
{PType: "p", V0: "9528", V1: "/fileUploadAndDownload/upload", V2: "POST"},
{PType: "p", V0: "9528", V1: "/fileUploadAndDownload/getFileList", V2: "POST"},
{PType: "p", V0: "9528", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"},
{PType: "p", V0: "9528", V1: "/casbin/updateCasbin", V2: "POST"},
{PType: "p", V0: "9528", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"},
{PType: "p", V0: "9528", V1: "/jwt/jsonInBlacklist", V2: "POST"},
{PType: "p", V0: "9528", V1: "/system/getSystemConfig", V2: "POST"},
{PType: "p", V0: "9528", V1: "/system/setSystemConfig", V2: "POST"},
{PType: "p", V0: "9528", V1: "/customer/customer", V2: "POST"},
{PType: "p", V0: "9528", V1: "/customer/customer", V2: "PUT"},
{PType: "p", V0: "9528", V1: "/customer/customer", V2: "DELETE"},
{PType: "p", V0: "9528", V1: "/customer/customer", V2: "GET"},
{PType: "p", V0: "9528", V1: "/customer/customerList", V2: "GET"},
{PType: "p", V0: "9528", V1: "/autoCode/createTemp", V2: "POST"},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: casbin_rule 表数据初始化
func (c *casbin) Init() error {
return global.GVA_DB.Transaction(func(tx *gorm.DB) error {
if tx.Find(&[]gormadapter.CasbinRule{}).RowsAffected == 154 {
color.Danger.Println("\n[Mysql] --> casbin_rule 表的初始数据已存在!")
return nil
}
if err := tx.Create(&carbines).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> casbin_rule 表初始数据成功!")
return nil
})
}
@@ -1,40 +0,0 @@
package information
import (
"gin-vue-admin/global"
"github.com/gookit/color"
"gorm.io/gorm"
)
var DataAuthorities = new(dataAuthorities)
type dataAuthorities struct{}
type DataAuthority struct {
AuthorityId string `gorm:"column:sys_authority_authority_id"`
DataAuthority string `gorm:"column:data_authority_id_authority_id"`
}
var infos = []DataAuthority{
{"888", "888"},
{"888", "8881"},
{"888", "9528"},
{"9528", "8881"},
{"9528", "9528"},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: sys_data_authority_id 表数据初始化
func (d *dataAuthorities) Init() error {
return global.GVA_DB.Table("sys_data_authority_id").Transaction(func(tx *gorm.DB) error {
if tx.Where("authority_id IN ('888', '9528') ").Find(&[]DataAuthority{}).RowsAffected == 5 {
color.Danger.Println("\n[Mysql] --> sys_data_authority_id 表初始数据已存在!")
return nil
}
if err := tx.Create(&infos).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> sys_data_authority_id 表初始数据成功!")
return nil
})
}
@@ -1,41 +0,0 @@
package information
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"github.com/gookit/color"
"time"
"gorm.io/gorm"
)
var Dictionary = new(dictionary)
type dictionary struct{}
var status = new(bool)
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: sys_dictionaries 表数据初始化
func (d *dictionary) Init() error {
*status = true
var dictionaries = []model.SysDictionary{
{GVA_MODEL: global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "性别", Type: "sex", Status: status, Desc: "性别字典"},
{GVA_MODEL: global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "数据库int类型", Type: "int", Status: status, Desc: "int类型对应的数据库类型"},
{GVA_MODEL: global.GVA_MODEL{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "数据库时间日期类型", Type: "time.Time", Status: status, Desc: "数据库时间日期类型"},
{GVA_MODEL: global.GVA_MODEL{ID: 4, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "数据库浮点型", Type: "float64", Status: status, Desc: "数据库浮点型"},
{GVA_MODEL: global.GVA_MODEL{ID: 5, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "数据库字符串", Type: "string", Status: status, Desc: "数据库字符串"},
{GVA_MODEL: global.GVA_MODEL{ID: 6, CreatedAt: time.Now(), UpdatedAt: time.Now()}, Name: "数据库bool类型", Type: "bool", Status: status, Desc: "数据库bool类型"},
}
return global.GVA_DB.Transaction(func(tx *gorm.DB) error {
if tx.Where("id IN ?", []int{1, 6}).Find(&[]model.SysDictionary{}).RowsAffected == 2 {
color.Danger.Println("\n[Mysql] --> sys_dictionaries 表初始数据已存在!")
return nil
}
if err := tx.Create(&dictionaries).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> sys_dictionaries 表初始数据成功!")
return nil
})
}
@@ -1,55 +0,0 @@
package information
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"github.com/gookit/color"
"time"
"gorm.io/gorm"
)
var DictionaryDetail = new(dictionaryDetail)
type dictionaryDetail struct{}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: dictionary_details 表数据初始化
func (d *dictionaryDetail) Init() error {
var details = []model.SysDictionaryDetail{
{global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "smallint", 1, status, 1, 2},
{global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "mediumint", 2, status, 2, 2},
{global.GVA_MODEL{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "int", 3, status, 3, 2},
{global.GVA_MODEL{ID: 4, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "bigint", 4, status, 4, 2},
{global.GVA_MODEL{ID: 5, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "date", 0, status, 0, 3},
{global.GVA_MODEL{ID: 6, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "time", 1, status, 1, 3},
{global.GVA_MODEL{ID: 7, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "year", 2, status, 2, 3},
{global.GVA_MODEL{ID: 8, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "datetime", 3, status, 3, 3},
{global.GVA_MODEL{ID: 9, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "timestamp", 5, status, 5, 3},
{global.GVA_MODEL{ID: 10, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "float", 0, status, 0, 4},
{global.GVA_MODEL{ID: 11, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "double", 1, status, 1, 4},
{global.GVA_MODEL{ID: 12, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "decimal", 2, status, 2, 4},
{global.GVA_MODEL{ID: 13, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "char", 0, status, 0, 5},
{global.GVA_MODEL{ID: 14, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "varchar", 1, status, 1, 5},
{global.GVA_MODEL{ID: 15, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "tinyblob", 2, status, 2, 5},
{global.GVA_MODEL{ID: 16, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "tinytext", 3, status, 3, 5},
{global.GVA_MODEL{ID: 17, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "text", 4, status, 4, 5},
{global.GVA_MODEL{ID: 18, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "blob", 5, status, 5, 5},
{global.GVA_MODEL{ID: 19, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "mediumblob", 6, status, 6, 5},
{global.GVA_MODEL{ID: 20, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "mediumtext", 7, status, 7, 5},
{global.GVA_MODEL{ID: 21, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "longblob", 8, status, 8, 5},
{global.GVA_MODEL{ID: 22, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "longtext", 9, status, 9, 5},
{global.GVA_MODEL{ID: 23, CreatedAt: time.Now(), UpdatedAt: time.Now()}, "tinyint", 0, status, 0, 6},
}
return global.GVA_DB.Transaction(func(tx *gorm.DB) error {
if tx.Where("id IN ?", []int{1, 23}).Find(&[]model.SysDictionaryDetail{}).RowsAffected == 2 {
color.Danger.Println("\n[Mysql] --> sys_dictionary_details 表的初始数据已存在!")
return nil
}
if err := tx.Create(&details).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> sys_dictionary_details 表初始数据成功!")
return nil
})
}
-62
View File
@@ -1,62 +0,0 @@
package information
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"github.com/gookit/color"
"time"
"gorm.io/gorm"
)
var BaseMenu = new(menu)
type menu struct{}
var menus = []model.SysBaseMenu{
{GVA_MODEL: global.GVA_MODEL{ID: 1, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "dashboard", Name: "dashboard", Hidden: false, Component: "view/dashboard/index.vue", Sort: 1, Meta: model.Meta{Title: "仪表盘", Icon: "setting"}},
{GVA_MODEL: global.GVA_MODEL{ID: 2, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "0", Path: "about", Name: "about", Component: "view/about/index.vue", Sort: 7, Meta: model.Meta{Title: "关于我们", Icon: "info"}},
{GVA_MODEL: global.GVA_MODEL{ID: 3, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "0", Path: "admin", Name: "superAdmin", Component: "view/superAdmin/index.vue", Sort: 3, Meta: model.Meta{Title: "超级管理员", Icon: "user-solid"}},
{GVA_MODEL: global.GVA_MODEL{ID: 4, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "authority", Name: "authority", Component: "view/superAdmin/authority/authority.vue", Sort: 1, Meta: model.Meta{Title: "角色管理", Icon: "s-custom"}},
{GVA_MODEL: global.GVA_MODEL{ID: 5, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "menu", Name: "menu", Component: "view/superAdmin/menu/menu.vue", Sort: 2, Meta: model.Meta{Title: "菜单管理", Icon: "s-order", KeepAlive: true}},
{GVA_MODEL: global.GVA_MODEL{ID: 6, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "api", Name: "api", Component: "view/superAdmin/api/api.vue", Sort: 3, Meta: model.Meta{Title: "api管理", Icon: "s-platform", KeepAlive: true}},
{GVA_MODEL: global.GVA_MODEL{ID: 7, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "user", Name: "user", Component: "view/superAdmin/user/user.vue", Sort: 4, Meta: model.Meta{Title: "用户管理", Icon: "coordinate"}},
{GVA_MODEL: global.GVA_MODEL{ID: 8, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: true, ParentId: "0", Path: "person", Name: "person", Component: "view/person/person.vue", Sort: 4, Meta: model.Meta{Title: "个人信息", Icon: "message-solid"}},
{GVA_MODEL: global.GVA_MODEL{ID: 9, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "0", Path: "example", Name: "example", Component: "view/example/index.vue", Sort: 6, Meta: model.Meta{Title: "示例文件", Icon: "s-management"}},
{GVA_MODEL: global.GVA_MODEL{ID: 10, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "excel", Name: "excel", Component: "view/example/excel/excel.vue", Sort: 4, Meta: model.Meta{Title: "excel导入导出", Icon: "s-marketing"}},
{GVA_MODEL: global.GVA_MODEL{ID: 11, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "upload", Name: "upload", Component: "view/example/upload/upload.vue", Sort: 5, Meta: model.Meta{Title: "上传下载", Icon: "upload"}},
{GVA_MODEL: global.GVA_MODEL{ID: 12, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "breakpoint", Name: "breakpoint", Component: "view/example/breakpoint/breakpoint.vue", Sort: 6, Meta: model.Meta{Title: "断点续传", Icon: "upload"}},
{GVA_MODEL: global.GVA_MODEL{ID: 13, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "customer", Name: "customer", Component: "view/example/customer/customer.vue", Sort: 7, Meta: model.Meta{Title: "客户列表(资源示例)", Icon: "s-custom"}},
{GVA_MODEL: global.GVA_MODEL{ID: 14, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "0", Path: "systemTools", Name: "systemTools", Component: "view/systemTools/index.vue", Sort: 5, Meta: model.Meta{Title: "系统工具", Icon: "s-cooperation"}},
{GVA_MODEL: global.GVA_MODEL{ID: 15, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "14", Path: "autoCode", Name: "autoCode", Component: "view/systemTools/autoCode/index.vue", Sort: 1, Meta: model.Meta{Title: "代码生成器", Icon: "cpu", KeepAlive: true}},
{GVA_MODEL: global.GVA_MODEL{ID: 16, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "14", Path: "formCreate", Name: "formCreate", Component: "view/systemTools/formCreate/index.vue", Sort: 2, Meta: model.Meta{Title: "表单生成器", Icon: "magic-stick", KeepAlive: true}},
{GVA_MODEL: global.GVA_MODEL{ID: 17, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "14", Path: "system", Name: "system", Component: "view/systemTools/system/system.vue", Sort: 3, Meta: model.Meta{Title: "系统配置", Icon: "s-operation"}},
{GVA_MODEL: global.GVA_MODEL{ID: 18, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "dictionary", Name: "dictionary", Component: "view/superAdmin/dictionary/sysDictionary.vue", Sort: 5, Meta: model.Meta{Title: "字典管理", Icon: "notebook-2"}},
{GVA_MODEL: global.GVA_MODEL{ID: 19, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: true, ParentId: "3", Path: "dictionaryDetail/:id", Name: "dictionaryDetail", Component: "view/superAdmin/dictionary/sysDictionaryDetail.vue", Sort: 1, Meta: model.Meta{Title: "字典详情", Icon: "s-order"}},
{GVA_MODEL: global.GVA_MODEL{ID: 20, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "3", Path: "operation", Name: "operation", Component: "view/superAdmin/operation/sysOperationRecord.vue", Sort: 6, Meta: model.Meta{Title: "操作历史", Icon: "time"}},
{GVA_MODEL: global.GVA_MODEL{ID: 21, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, Hidden: false, ParentId: "9", Path: "simpleUploader", Name: "simpleUploader", Component: "view/example/simpleUploader/simpleUploader", Sort: 6, Meta: model.Meta{Title: "断点续传(插件版)", Icon: "upload"}},
{GVA_MODEL: global.GVA_MODEL{ID: 22, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "https://www.gin-vue-admin.com", Name: "https://www.gin-vue-admin.com", Hidden: false, Component: "/", Sort: 0, Meta: model.Meta{Title: "官方网站", Icon: "s-home"}},
{GVA_MODEL: global.GVA_MODEL{ID: 23, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "state", Name: "state", Hidden: false, Component: "view/system/state.vue", Sort: 6, Meta: model.Meta{Title: "服务器状态", Icon: "cloudy"}},
{GVA_MODEL: global.GVA_MODEL{ID: 24, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "0", Path: "workflow", Name: "workflow", Hidden: false, Component: "view/workflow/index.vue", Sort: 5, Meta: model.Meta{Title: "工作流功能", Icon: "phone"}},
{GVA_MODEL: global.GVA_MODEL{ID: 25, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "24", Path: "workflowCreate", Name: "workflowCreate", Hidden: false, Component: "view/workflow/workflowCreate/workflowCreate.vue", Sort: 0, Meta: model.Meta{Title: "工作流绘制", Icon: "circle-plus"}},
{GVA_MODEL: global.GVA_MODEL{ID: 26, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "24", Path: "workflowProcess", Name: "workflowProcess", Hidden: false, Component: "view/workflow/workflowProcess/workflowProcess.vue", Sort: 0, Meta: model.Meta{Title: "工作流列表", Icon: "s-cooperation"}},
{GVA_MODEL: global.GVA_MODEL{ID: 27, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "24", Path: "workflowUse", Name: "workflowUse", Hidden: true, Component: "view/workflow/workflowUse/workflowUse.vue", Sort: 0, Meta: model.Meta{Title: "使用工作流", Icon: "video-play"}},
{GVA_MODEL: global.GVA_MODEL{ID: 28, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "24", Path: "started", Name: "started", Hidden: false, Component: "view/workflow/userList/started.vue", Sort: 0, Meta: model.Meta{Title: "我发起的", Icon: "s-order"}},
{GVA_MODEL: global.GVA_MODEL{ID: 29, CreatedAt: time.Now(), UpdatedAt: time.Now()}, MenuLevel: 0, ParentId: "24", Path: "need", Name: "need", Hidden: false, Component: "view/workflow/userList/need.vue", Sort: 0, Meta: model.Meta{Title: "我的待办", Icon: "s-platform"}},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: sys_base_menus 表数据初始化
func (m *menu) Init() error {
return global.GVA_DB.Transaction(func(tx *gorm.DB) error {
if tx.Where("id IN ?", []int{1, 29}).Find(&[]model.SysBaseMenu{}).RowsAffected == 2 {
color.Danger.Println("\n[Mysql] --> sys_base_menus 表的初始数据已存在!")
return nil
}
if err := tx.Create(&menus).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> sys_base_menus 表初始数据成功!")
return nil
})
}
-64
View File
@@ -1,64 +0,0 @@
package information
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"github.com/gookit/color"
"gorm.io/gorm"
"time"
)
var Workflow = new(workflow)
type workflow struct{}
var WorkflowProcess = []model.WorkflowProcess{
{ID: "leaveFlow", CreatedAt: time.Now(), UpdatedAt: time.Now(), Name: "leaveFlow", Clazz: "process", Label: "请假流程(演示)", HideIcon: false, Description: "请假流程演示", View: "view/iconList/index.vue"},
}
var WorkflowNodes = []model.WorkflowNode{
{ID: "end1603681358043", CreatedAt: time.Now(), UpdatedAt: time.Now(), WorkflowProcessID: "leaveFlow", Clazz: "end", Label: "请假失败", Type: "end-node", Shape: "end-node", Description: "", View: "view/exa_wf_leave/exa_wf_leaveFrom.vue", X: 302, Y: 545.5, HideIcon: false, AssignType: "", AssignValue: "", Success: false},
{ID: "end1603681360882", CreatedAt: time.Now(), UpdatedAt: time.Now(), WorkflowProcessID: "leaveFlow", Clazz: "end", Label: "请假成功", Type: "end-node", Shape: "end-node", Description: "请假完成,具体结果等待提交", View: "view/exa_wf_leave/exa_wf_leaveFrom.vue", X: 83.5, Y: 546, HideIcon: false, AssignType: "", AssignValue: "", Success: true},
{ID: "start1603681292875", CreatedAt: time.Now(), UpdatedAt: time.Now(), WorkflowProcessID: "leaveFlow", Clazz: "start", Label: "发起请假", Type: "start-node", Shape: "start-node", Description: "发起一个请假流程", View: "view/exa_wf_leave/exa_wf_leaveFrom.vue", X: 201, Y: 109, HideIcon: false, AssignType: "", AssignValue: "", Success: false},
{ID: "userTask1603681299962", CreatedAt: time.Now(), UpdatedAt: time.Now(), WorkflowProcessID: "leaveFlow", Clazz: "userTask", Label: "审批", Type: "user-task-node", Shape: "user-task-node", Description: "审批会签", View: "view/exa_wf_leave/exa_wf_leaveFrom.vue", X: 202, Y: 320.5, HideIcon: false, AssignType: "user", AssignValue: ",1,2,", Success: false},
}
var WorkflowEdge = []model.WorkflowEdge{
{ID: "flow1604985849039", CreatedAt: time.Now(), UpdatedAt: time.Now(), WorkflowProcessID: "leaveFlow", Clazz: "flow", Source: "start1603681292875", Target: "userTask1603681299962", SourceAnchor: 1, TargetAnchor: 3, Shape: "flow-polyline-round", Label: "", HideIcon: false, ConditionExpression: "", Reverse: false},
{ID: "flow1604985879574", CreatedAt: time.Now(), UpdatedAt: time.Now(), WorkflowProcessID: "leaveFlow", Clazz: "flow", Source: "userTask1603681299962", Target: "end1603681360882", SourceAnchor: 0, TargetAnchor: 2, Shape: "flow-polyline-round", Label: "同意", HideIcon: false, ConditionExpression: "yes", Reverse: false},
{ID: "flow1604985881207", CreatedAt: time.Now(), UpdatedAt: time.Now(), WorkflowProcessID: "leaveFlow", Clazz: "flow", Source: "userTask1603681299962", Target: "end1603681358043", SourceAnchor: 2, TargetAnchor: 2, Shape: "flow-polyline-round", Label: "不同意", HideIcon: false, ConditionExpression: "no", Reverse: false},
}
var WorkflowStartPoint = []model.WorkflowStartPoint{
{WorkflowEdgeID: "flow1604985849039", GVA_MODEL: global.GVA_MODEL{ID: 31, CreatedAt: time.Now(), UpdatedAt: time.Now()}, X: 137, Y: 201, Index: 1},
{WorkflowEdgeID: "flow1604985879574", GVA_MODEL: global.GVA_MODEL{ID: 32, CreatedAt: time.Now(), UpdatedAt: time.Now()}, X: 320.5, Y: 174, Index: 0},
{WorkflowEdgeID: "flow1604985881207", GVA_MODEL: global.GVA_MODEL{ID: 33, CreatedAt: time.Now(), UpdatedAt: time.Now()}, X: 320.5, Y: 230, Index: 2},
}
var WorkflowEndPoint = []model.WorkflowEndPoint{
{WorkflowEdgeID: "flow1604985849039", GVA_MODEL: global.GVA_MODEL{ID: 31, CreatedAt: time.Now(), UpdatedAt: time.Now()}, X: 270, Y: 202, Index: 3},
{WorkflowEdgeID: "flow1604985879574", GVA_MODEL: global.GVA_MODEL{ID: 32, CreatedAt: time.Now(), UpdatedAt: time.Now()}, X: 518, Y: 83.5, Index: 2},
{WorkflowEdgeID: "flow1604985881207", GVA_MODEL: global.GVA_MODEL{ID: 33, CreatedAt: time.Now(), UpdatedAt: time.Now()}, X: 517.5, Y: 302, Index: 2},
}
//@author: [SliverHorn](https://github.com/SliverHorn)
//@description: 工作流相关 表数据初始化
func (w *workflow) Init() error {
return global.GVA_DB.Transaction(func(tx *gorm.DB) error {
if err := tx.Create(&WorkflowProcess).Error; err != nil { // 遇到错误时回滚事务
return err
}
if err := tx.Create(&WorkflowNodes).Error; err != nil { // 遇到错误时回滚事务
return err
}
if err := tx.Create(&WorkflowEdge).Error; err != nil { // 遇到错误时回滚事务
return err
}
if err := tx.Create(&WorkflowStartPoint).Error; err != nil { // 遇到错误时回滚事务
return err
}
if err := tx.Create(&WorkflowEndPoint).Error; err != nil { // 遇到错误时回滚事务
return err
}
color.Info.Println("\n[Mysql] --> 工作流相关 表初始数据成功!")
return nil
})
}
-22
View File
@@ -1,22 +0,0 @@
/*
Copyright © 2020 SliverHorn
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import "gin-vue-admin/cmd/gva"
func main() {
gva.Execute()
}
+207
View File
@@ -0,0 +1,207 @@
# github.com/flipped-aurora/gin-vue-admin/server Global Configuration
# jwt configuration
jwt:
signing-key: 'qmPlus'
expires-time: 604800
buffer-time: 86400
issuer: 'qmPlus'
# zap logger configuration
zap:
level: 'info'
prefix: '[github.com/flipped-aurora/gin-vue-admin/server]'
format: 'console'
director: 'log'
encode-level: 'LowercaseColorLevelEncoder'
stacktrace-key: 'stacktrace'
max-age: 30 # 默认日志留存默认以天为单位
show-line: true
log-in-console: true
# redis configuration
redis:
db: 0
addr: '177.7.0.14:6379'
password: ''
# email configuration
email:
to: 'xxx@qq.com'
port: 465
from: 'xxx@163.com'
host: 'smtp.163.com'
is-ssl: true
secret: 'xxx'
nickname: 'test'
# casbin configuration
casbin:
model-path: './resource/rbac_model.conf'
# system configuration
system:
env: 'public' # Change to "develop" to skip authentication for development mode
addr: 8888
db-type: 'mysql'
oss-type: 'local' # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
use-redis: false # 使用redis
use-multipoint: false
# IP限制次数 一个小时15000次
iplimit-count: 15000
# IP限制一个小时
iplimit-time: 3600
# captcha configuration
captcha:
key-long: 6
img-width: 240
img-height: 80
# mysql connect configuration
# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://gin-vue-admin.com/docs/first_master)
mysql:
path: ''
port: ''
config: ''
db-name: ''
username: ''
password: ''
max-idle-conns: 10
max-open-conns: 100
log-mode: ""
log-zap: false
# pgsql connect configuration
# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://gin-vue-admin.com/docs/first_master)
pgsql:
path: ''
port: ''
config: ''
db-name: ''
username: ''
password: ''
max-idle-conns: 10
max-open-conns: 100
log-mode: ""
log-zap: false
db-list:
- disabled: true # 是否启用
type: "" # 数据库的类型,目前支持mysql、pgsql
alias-name: "" # 数据库的名称,注意: alias-name 需要在db-list中唯一
path: ''
port: ''
config: ''
db-name: ''
username: ''
password: ''
max-idle-conns: 10
max-open-conns: 100
log-mode: ""
log-zap: false
# local configuration
local:
path: 'uploads/file' # 访问路径
store-path: 'uploads/file' # 存储路径
# autocode configuration
autocode:
transfer-restart: true
# root 自动适配项目根目录
# 请不要手动配置,他会在项目加载的时候识别出根路径
root: ""
server: /server
server-plug: /plugin/%s
server-api: /api/v1/%s
server-initialize: /initialize
server-model: /model/%s
server-request: /model/%s/request/
server-router: /router/%s
server-service: /service/%s
web: /web/src
web-api: /api
web-form: /view
web-table: /view
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
qiniu:
zone: 'ZoneHuaDong'
bucket: ''
img-path: ''
use-https: false
access-key: ''
secret-key: ''
use-cdn-domains: false
# aliyun oss configuration
aliyun-oss:
endpoint: 'yourEndpoint'
access-key-id: 'yourAccessKeyId'
access-key-secret: 'yourAccessKeySecret'
bucket-name: 'yourBucketName'
bucket-url: 'yourBucketUrl'
base-path: 'yourBasePath'
# tencent cos configuration
tencent-cos:
bucket: 'xxxxx-10005608'
region: 'ap-shanghai'
secret-id: 'xxxxxxxx'
secret-key: 'xxxxxxxx'
base-url: 'https://gin.vue.admin'
path-prefix: 'github.com/flipped-aurora/gin-vue-admin/server'
# aws s3 configuration (minio compatible)
aws-s3:
bucket: xxxxx-10005608
region: ap-shanghai
endpoint: ''
s3-force-path-style: false
disable-ssl: false
secret-id: xxxxxxxx
secret-key: xxxxxxxx
base-url: https://gin.vue.admin
path-prefix: github.com/flipped-aurora/gin-vue-admin/server
# huawei obs configuration
hua-wei-obs:
path: 'you-path'
bucket: 'you-bucket'
endpoint: 'you-endpoint'
access-key: 'you-access-key'
secret-key: 'you-secret-key'
# excel configuration
excel:
dir: './resource/excel/'
# timer task db clear table
Timer:
start: true
spec: "@daily" # 定时任务详细配置参考 https://pkg.go.dev/github.com/robfig/cron/v3
detail:
- tableName: "sys_operation_records"
compareField: "created_at"
interval: "2160h"
- tableName: "jwt_blacklists"
compareField: "created_at"
interval: "168h"
# 跨域配置
# 需要配合 server/initialize/router.go#L32 使用
cors:
mode: whitelist # 放行模式: allow-all, 放行全部; whitelist, 白名单模式, 来自白名单内域名的请求添加 cors 头; strict-whitelist 严格白名单模式, 白名单外的请求一律拒绝
whitelist:
- allow-origin: example1.com
allow-headers: content-type
allow-methods: GET, POST
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
allow-methods: GET, POST
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
allow-credentials: true # 布尔值
+148 -20
View File
@@ -1,21 +1,22 @@
# Gin-Vue-Admin Global Configuration
# github.com/flipped-aurora/gin-vue-admin/server Global Configuration
# jwt configuration
jwt:
signing-key: 'qmPlus'
expires-time: 604800
buffer-time: 86400
issuer: 'qmPlus'
# zap logger configuration
zap:
level: 'info'
prefix: '[github.com/flipped-aurora/gin-vue-admin/server]'
format: 'console'
prefix: '[GIN-VUE-ADMIN]'
director: 'log'
link-name: 'latest_log'
show-line: true
encode-level: 'LowercaseColorLevelEncoder'
stacktrace-key: 'stacktrace'
max-age: 30 # 默认日志留存默认以天为单位
show-line: true
log-in-console: true
# redis configuration
@@ -43,8 +44,13 @@ system:
env: 'public' # Change to "develop" to skip authentication for development mode
addr: 8888
db-type: 'mysql'
oss-type: 'local' # 控制oss选择走本期还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
oss-type: 'local' # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
use-redis: false # 使用redis
use-multipoint: false
# IP限制次数 一个小时15000次
iplimit-count: 15000
# IP限制一个小时
iplimit-time: 3600
# captcha configuration
captcha:
@@ -53,27 +59,149 @@ captcha:
img-height: 80
# mysql connect configuration
# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://gin-vue-admin.com/docs/first_master)
mysql:
path: '127.0.0.1:3306'
config: 'charset=utf8mb4&parseTime=True&loc=Local'
db-name: 'qmPlus'
username: 'root'
password: 'Aa@6447985'
path: ''
port: ''
config: ''
db-name: ''
username: ''
password: ''
max-idle-conns: 10
max-open-conns: 100
log-mode: false
log-zap: ""
log-mode: ""
log-zap: false
# pgsql connect configuration
# 未初始化之前请勿手动修改数据库信息!!!如果一定要手动初始化请看(https://gin-vue-admin.com/docs/first_master)
pgsql:
path: ''
port: ''
config: ''
db-name: ''
username: ''
password: ''
max-idle-conns: 10
max-open-conns: 100
log-mode: ""
log-zap: false
db-list:
- disabled: true # 是否启用
type: "" # 数据库的类型,目前支持mysql、pgsql
alias-name: "" # 数据库的名称,注意: alias-name 需要在db-list中唯一
path: ''
port: ''
config: ''
db-name: ''
username: ''
password: ''
max-idle-conns: 10
max-open-conns: 100
log-mode: ""
log-zap: false
# local configuration
local:
path: 'uploads/file'
path: 'uploads/file' # 访问路径
store-path: 'uploads/file' # 存储路径
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket �?域名地址)
# autocode configuration
autocode:
transfer-restart: true
# root 自动适配项目根目录
# 请不要手动配置,他会在项目加载的时候识别出根路径
root: ""
server: /server
server-plug: /plugin/%s
server-api: /api/v1/%s
server-initialize: /initialize
server-model: /model/%s
server-request: /model/%s/request/
server-router: /router/%s
server-service: /service/%s
web: /web/src
web-api: /api
web-form: /view
web-table: /view
# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址)
qiniu:
zone: 'ZoneHuadong'
bucket: 'qm-plus-img'
img-path: 'http://qmplusimg.henrongyi.top'
zone: 'ZoneHuaDong'
bucket: ''
img-path: ''
use-https: false
access-key: '25j8dYBZ2wuiy0yhwShytjZDTX662b8xiFguwxzZ'
secret-key: 'pgdbqEsf7ooZh7W3xokP833h3dZ_VecFXPDeG5JY'
use-cdn-domains: false
access-key: ''
secret-key: ''
use-cdn-domains: false
# aliyun oss configuration
aliyun-oss:
endpoint: 'yourEndpoint'
access-key-id: 'yourAccessKeyId'
access-key-secret: 'yourAccessKeySecret'
bucket-name: 'yourBucketName'
bucket-url: 'yourBucketUrl'
base-path: 'yourBasePath'
# tencent cos configuration
tencent-cos:
bucket: 'xxxxx-10005608'
region: 'ap-shanghai'
secret-id: 'xxxxxxxx'
secret-key: 'xxxxxxxx'
base-url: 'https://gin.vue.admin'
path-prefix: 'github.com/flipped-aurora/gin-vue-admin/server'
# aws s3 configuration (minio compatible)
aws-s3:
bucket: xxxxx-10005608
region: ap-shanghai
endpoint: ''
s3-force-path-style: false
disable-ssl: false
secret-id: xxxxxxxx
secret-key: xxxxxxxx
base-url: https://gin.vue.admin
path-prefix: github.com/flipped-aurora/gin-vue-admin/server
# huawei obs configuration
hua-wei-obs:
path: 'you-path'
bucket: 'you-bucket'
endpoint: 'you-endpoint'
access-key: 'you-access-key'
secret-key: 'you-secret-key'
# excel configuration
excel:
dir: './resource/excel/'
# timer task db clear table
Timer:
start: true
spec: "@daily" # 定时任务详细配置参考 https://pkg.go.dev/github.com/robfig/cron/v3
detail:
- tableName: "sys_operation_records"
compareField: "created_at"
interval: "2160h"
- tableName: "jwt_blacklists"
compareField: "created_at"
interval: "168h"
# 跨域配置
# 需要配合 server/initialize/router.go#L32 使用
cors:
mode: whitelist # 放行模式: allow-all, 放行全部; whitelist, 白名单模式, 来自白名单内域名的请求添加 cors 头; strict-whitelist 严格白名单模式, 白名单外的请求一律拒绝
whitelist:
- allow-origin: example1.com
allow-headers: content-type
allow-methods: GET, POST
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
allow-methods: GET, POST
expose-headers: Content-Length, Access-Control-Allow-Origin, Access-Control-Allow-Headers, Content-Type
allow-credentials: true # 布尔值
+18
View File
@@ -0,0 +1,18 @@
package config
type Autocode struct {
TransferRestart bool `mapstructure:"transfer-restart" json:"transfer-restart" yaml:"transfer-restart"`
Root string `mapstructure:"root" json:"root" yaml:"root"`
Server string `mapstructure:"server" json:"server" yaml:"server"`
SApi string `mapstructure:"server-api" json:"server-api" yaml:"server-api"`
SPlug string `mapstructure:"server-plug" json:"server-plug" yaml:"server-plug"`
SInitialize string `mapstructure:"server-initialize" json:"server-initialize" yaml:"server-initialize"`
SModel string `mapstructure:"server-model" json:"server-model" yaml:"server-model"`
SRequest string `mapstructure:"server-request" json:"server-request" yaml:"server-request"`
SRouter string `mapstructure:"server-router" json:"server-router" yaml:"server-router"`
SService string `mapstructure:"server-service" json:"server-service" yaml:"server-service"`
Web string `mapstructure:"web" json:"web" yaml:"web"`
WApi string `mapstructure:"web-api" json:"web-api" yaml:"web-api"`
WForm string `mapstructure:"web-form" json:"web-form" yaml:"web-form"`
WTable string `mapstructure:"web-table" json:"web-table" yaml:"web-table"`
}
+3 -3
View File
@@ -1,7 +1,7 @@
package config
type Captcha struct {
KeyLong int `mapstructure:"key-long" json:"keyLong" yaml:"key-long"`
ImgWidth int `mapstructure:"img-width" json:"imgWidth" yaml:"img-width"`
ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"`
KeyLong int `mapstructure:"key-long" json:"key-long" yaml:"key-long"` // 验证码长度
ImgWidth int `mapstructure:"img-width" json:"img-width" yaml:"img-width"` // 验证码宽度
ImgHeight int `mapstructure:"img-height" json:"img-height" yaml:"img-height"` // 验证码高度
}
+1 -1
View File
@@ -1,5 +1,5 @@
package config
type Casbin struct {
ModelPath string `mapstructure:"model-path" json:"modelPath" yaml:"model-path"`
ModelPath string `mapstructure:"model-path" json:"model-path" yaml:"model-path"` // 存放casbin模型的相对路径
}
+17 -3
View File
@@ -8,9 +8,23 @@ type Server struct {
Casbin Casbin `mapstructure:"casbin" json:"casbin" yaml:"casbin"`
System System `mapstructure:"system" json:"system" yaml:"system"`
Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"`
// auto
AutoCode Autocode `mapstructure:"autocode" json:"autocode" yaml:"autocode"`
// gorm
Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
Pgsql Pgsql `mapstructure:"pgsql" json:"pgsql" yaml:"pgsql"`
DBList []SpecializedDB `mapstructure:"db-list" json:"db-list" yaml:"db-list"`
// oss
Local Local `mapstructure:"local" json:"local" yaml:"local"`
Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
Local Local `mapstructure:"local" json:"local" yaml:"local"`
Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
AliyunOSS AliyunOSS `mapstructure:"aliyun-oss" json:"aliyun-oss" yaml:"aliyun-oss"`
HuaWeiObs HuaWeiObs `mapstructure:"hua-wei-obs" json:"hua-wei-obs" yaml:"hua-wei-obs"`
TencentCOS TencentCOS `mapstructure:"tencent-cos" json:"tencent-cos" yaml:"tencent-cos"`
AwsS3 AwsS3 `mapstructure:"aws-s3" json:"aws-s3" yaml:"aws-s3"`
Excel Excel `mapstructure:"excel" json:"excel" yaml:"excel"`
Timer Timer `mapstructure:"timer" json:"timer" yaml:"timer"`
// 跨域配置
Cors CORS `mapstructure:"cors" json:"cors" yaml:"cors"`
}
+14
View File
@@ -0,0 +1,14 @@
package config
type CORS struct {
Mode string `mapstructure:"mode" json:"mode" yaml:"mode"`
Whitelist []CORSWhitelist `mapstructure:"whitelist" json:"whitelist" yaml:"whitelist"`
}
type CORSWhitelist struct {
AllowOrigin string `mapstructure:"allow-origin" json:"allow-origin" yaml:"allow-origin"`
AllowMethods string `mapstructure:"allow-methods" json:"allow-methods" yaml:"allow-methods"`
AllowHeaders string `mapstructure:"allow-headers" json:"allow-headers" yaml:"allow-headers"`
ExposeHeaders string `mapstructure:"expose-headers" json:"expose-headers" yaml:"expose-headers"`
AllowCredentials bool `mapstructure:"allow-credentials" json:"allow-credentials" yaml:"allow-credentials"`
}
+29
View File
@@ -0,0 +1,29 @@
package config
type DsnProvider interface {
Dsn() string
}
// Embeded 结构体可以压平到上一层,从而保持 config 文件的结构和原来一样
// 见 playground: https://go.dev/play/p/KIcuhqEoxmY
// GeneralDB 也被 Pgsql 和 Mysql 原样使用
type GeneralDB struct {
Path string `mapstructure:"path" json:"path" yaml:"path"` // 服务器地址:端口
Port string `mapstructure:"port" json:"port" yaml:"port"` //:端口
Config string `mapstructure:"config" json:"config" yaml:"config"` // 高级配置
Dbname string `mapstructure:"db-name" json:"db-name" yaml:"db-name"` // 数据库名
Username string `mapstructure:"username" json:"username" yaml:"username"` // 数据库用户名
Password string `mapstructure:"password" json:"password" yaml:"password"` // 数据库密码
MaxIdleConns int `mapstructure:"max-idle-conns" json:"max-idle-conns" yaml:"max-idle-conns"` // 空闲中的最大连接数
MaxOpenConns int `mapstructure:"max-open-conns" json:"max-open-conns" yaml:"max-open-conns"` // 打开到数据库的最大连接数
LogMode string `mapstructure:"log-mode" json:"log-mode" yaml:"log-mode"` // 是否开启Gorm全局日志
LogZap bool `mapstructure:"log-zap" json:"log-zap" yaml:"log-zap"` // 是否通过zap写入日志文件
}
type SpecializedDB struct {
Disable bool `mapstructure:"disable" json:"disable" yaml:"disable"`
Type string `mapstructure:"type" json:"type" yaml:"type"`
AliasName string `mapstructure:"alias-name" json:"alias-name" yaml:"alias-name"`
GeneralDB `yaml:",inline" mapstructure:",squash"`
}
+7 -7
View File
@@ -1,11 +1,11 @@
package config
type Email struct {
To string `mapstructure:"to" json:"to" yaml:"to"`
Port int `mapstructure:"port" json:"port" yaml:"port"`
From string `mapstructure:"from" json:"from" yaml:"from"`
Host string `mapstructure:"host" json:"host" yaml:"host"`
IsSSL bool `mapstructure:"is-ssl" json:"isSSL" yaml:"is-ssl"`
Secret string `mapstructure:"secret" json:"secret" yaml:"secret"`
Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"`
To string `mapstructure:"to" json:"to" yaml:"to"` // 收件人:多个以英文逗号分隔
Port int `mapstructure:"port" json:"port" yaml:"port"` // 端口
From string `mapstructure:"from" json:"from" yaml:"from"` // 收件人
Host string `mapstructure:"host" json:"host" yaml:"host"` // 服务器地址
IsSSL bool `mapstructure:"is-ssl" json:"is-ssl" yaml:"is-ssl"` // 是否SSL
Secret string `mapstructure:"secret" json:"secret" yaml:"secret"` // 密钥
Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` // 昵称
}
+5
View File
@@ -0,0 +1,5 @@
package config
type Excel struct {
Dir string `mapstructure:"dir" json:"dir" yaml:"dir"`
}

Some files were not shown because too many files have changed in this diff Show More