Compare commits

...
161 Commits
Author SHA1 Message Date
wenjianzhang c2f593de48 releases 1.1.5
releases 1.1.5
2020-08-18 16:49:54 +08:00
zhangwenjian 7140ff8a3a upgrade:ver 1.1.5 2020-08-18 16:45:50 +08:00
zhangwenjian cc6c333372 Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev 2020-08-18 00:03:28 +08:00
zhangwenjian 77bfc07826 fix: job nil bug 2020-08-18 00:03:02 +08:00
wenjianzhang a33b0d036a Merge pull request #200 from hqcchina/master
fix: Serve static javascript file with mime-type error
2020-08-16 19:35:00 +08:00
云景(Neil) 729154212f fix: Serve static javascript file mime-type error 2020-08-15 09:38:11 +08:00
wenjianzhang e345ffe9af releases 1.1.4
releases 1.1.4
2020-08-14 00:01:45 +08:00
zhangwenjian afb98f5e81 feat:update vue template & sql 2020-08-13 23:47:37 +08:00
zhangwenjian 826eef40a3 sql:update sql 2020-08-13 11:53:53 +08:00
zhangwenjian 589a9b7d9c version:update version No. 2020-08-13 11:33:35 +08:00
zhangwenjian 7889e49633 fix:Modify SQL and new business initialization bug 2020-08-13 11:21:54 +08:00
wenjianzhang ed238f0143 releases 1.1.3
releases 1.1.3
2020-08-12 21:31:57 +08:00
zhangwenjian 8ebcd772b2 fix:job list status invalid 2020-08-12 20:00:13 +08:00
zhangwenjian e9ef8a2d12 feat:update auto job 2020-08-12 19:59:04 +08:00
zhangwenjian 509709f3fb feat: update auto job (#191) 2020-08-12 18:21:04 +08:00
wenjianzhang 4dbacc7a16 Merge pull request #192 from matchstalk/master
修改job为接口类型
2020-08-11 23:36:32 +08:00
linwenxiang ee9f823bdd 修改job为接口类型 2020-08-11 23:30:20 +08:00
zhangwenjian 68eb8f1d51 feat : added func sql 2020-08-11 22:03:42 +08:00
zhangwenjian fcd91d3f18 Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev 2020-08-11 21:58:34 +08:00
zhangwenjian ec4bb6ee3a feat:auto job (#191) 2020-08-11 21:57:36 +08:00
wenjianzhang 938c865089 feat: Support cache + queue
支持缓存+队列
2020-08-10 21:12:52 +08:00
linwenxiang 2b794c03cc 支持缓存+队列,支持驱动:redis、memory 2020-08-10 20:57:17 +08:00
zhangwenjian 94aed14389 feat:added settings data 2020-08-09 02:49:31 +08:00
zhangwenjian 70e0141f64 feat: update system setting 2020-08-09 02:45:05 +08:00
zhangwenjian 6f8ad4efe4 feat : added auto task 2020-08-09 02:44:42 +08:00
zhangwenjian 5d88273910 feat:added job db & data 2020-08-09 02:43:49 +08:00
wenjianzhang 45bc92eb46 feat:added system baseInfo api
Dev
2020-08-08 09:26:35 +08:00
wenjianzhang 65fd96b481 feat: added dockerfile
添加Dockerfile
2020-08-08 09:24:48 +08:00
jalins e37aaee861 添加Dockerfile 2020-08-07 22:01:46 +08:00
wxb dca1919c69 新增系统设置接口 2020-08-07 10:51:01 +08:00
wxb 389d2970c0 新增系统设置接口 2020-08-07 10:22:52 +08:00
zhangwenjian c396f318ef Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev 2020-08-06 22:32:15 +08:00
zhangwenjian 54f48377f0 feat:added auto job 2020-08-06 22:30:57 +08:00
linwenxiang bdde879238 修改connect函数定义 2020-08-06 00:25:21 +08:00
linwenxiang d2639ccf22 修改方法名称 2020-08-06 00:20:04 +08:00
wenjianzhang e0c8c8de6a Merge pull request #186 from matchstalk/master
定义缓存和队列接口
2020-08-05 23:32:28 +08:00
linwenxiang b57af6c542 定义缓存和队列接口 2020-08-05 23:31:01 +08:00
linwenxiang b9d30eee88 定义缓存和队列接口 2020-08-05 23:30:05 +08:00
linwenxiang 18a2aeadaa 定义缓存和队列接口 2020-08-05 23:22:09 +08:00
wenjianzhang 2ed4869c8b Merge pull request #185 from matchstalk/master
开放三方依赖使用模式
2020-08-05 21:12:18 +08:00
linwenxiang 980d0977fc 开放对象,项目可以作为第三方依赖 2020-08-05 21:05:43 +08:00
wenjianzhang 055a68de7f Merge pull request #183 from wenjianzhang/dev
fix: Use NewSyncedEnforcer instead NewEnforcer to solve the thread safe
2020-08-03 14:25:59 +08:00
zhangwenjian 328f7d4f4f Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev 2020-08-03 14:25:30 +08:00
wenjianzhang 40492e56a0 ver : update version 1.1.2 2020-08-03 14:23:47 +08:00
zhangwenjian e709ee6209 Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev 2020-08-03 14:19:09 +08:00
zhangwenjian 80ecefb9f7 feat : added job 2020-08-03 14:18:33 +08:00
wenjianzhang e51b72d2e4 Merge pull request #182 from nodece/patch-1
fix: Use NewSyncedEnforcer instead NewEnforcer
2020-08-03 14:16:33 +08:00
Zixuan Liu cb9ae9b8ec fix: Use NewSyncedEnforcer instead NewEnforcer to solve the thread safe
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
2020-08-03 14:12:07 +08:00
wenjianzhang 3316433f13 Merge pull request #178 from wenjianzhang/dev
1. 代码生成添加操作按钮确认提示;
2. 代码生成添加时间类型支持;
3. 代码生成添加时间控件、下拉控件、文本域的支持;
4. 修复代码生成无需权限的问题;
5. 修改了部分格式问题;
6. 默认开启log;
7. 修复了已知bug;
2020-08-01 14:52:29 +08:00
zhangwenjian c98f38cab4 gen :update import 2020-08-01 14:43:38 +08:00
zhangwenjian 88a458a003 gen : remove value-format 2020-08-01 14:07:06 +08:00
zhangwenjian 89fe63c915 gen : upgrade gen 2020-08-01 12:56:19 +08:00
zhangwenjian 80ef9e46ab Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev 2020-08-01 11:11:44 +08:00
zhangwenjian 259b77dc08 fix : fix no auth code gen router 2020-08-01 11:08:40 +08:00
zhangwenjian 55b055b9a0 version : update version 2020-08-01 11:00:36 +08:00
zhangwenjian 309be41b05 feat : added version & config 2020-08-01 11:00:06 +08:00
zhangwenjian 1a580366fc feat : enabledbus status to true 2020-08-01 10:52:49 +08:00
zhangwenjian 93ac874312 feat : logger type error to fatal 2020-08-01 10:52:17 +08:00
zhangwenjian e5d22c78c8 doc : update readme 2020-08-01 10:50:19 +08:00
zhangwenjian 8d7a6ef3bb feat : update log format 2020-08-01 10:49:36 +08:00
zhangwenjian f050924234 sql : remove no used sql 2020-07-29 23:32:34 +08:00
zhangwenjian 061cb61aa7 remove : Prot default value removal 2020-07-29 23:31:51 +08:00
zhangwenjian 59e966ede6 feat : Adjust the length of the title field from the original 64 to 128 2020-07-29 15:08:44 +08:00
wenjianzhang 697ec9fcd5 doc : update readme 2020-07-28 00:07:41 +08:00
wenjianzhang afc09f4ef4 Merge pull request #176 from wenjianzhang/dev
v1.1.0
2020-07-27 23:46:55 +08:00
wenjianzhang e95bdf03f6 Merge branch 'master' into dev 2020-07-27 23:46:35 +08:00
zhangwenjian 3d631d0fec doc : update version 2020-07-27 23:35:38 +08:00
zhangwenjian 88b680aeee feat : update config & time format adjustment 2020-07-27 22:46:37 +08:00
zhangwenjian f693ff60b2 doc : add notes 2020-07-27 22:45:47 +08:00
zhangwenjian 1a50570f6c doc : add notes 2020-07-27 22:45:12 +08:00
zhangwenjian ccb140d1d1 feat : added textcolor 2020-07-27 22:44:26 +08:00
zhangwenjian 8fbfaa6d1f config : update config 2020-07-27 22:44:01 +08:00
zhangwenjian 22124b236a feat : Log optimization 2020-07-27 22:43:17 +08:00
zhangwenjian f3a425a82b feat : Function name modification 2020-07-27 22:41:01 +08:00
zhangwenjian be19638a59 log : Log middleware modification 2020-07-27 22:40:12 +08:00
zhangwenjian f3104a2d28 feat : added global config items 2020-07-27 22:39:16 +08:00
zhangwenjian b64dfe9aa4 config : update config 2020-07-27 22:38:37 +08:00
zhangwenjian 20c3e528b0 config : added new full config 2020-07-27 22:38:21 +08:00
zhangwenjian 012a82821e log : update log import 2020-07-27 22:37:50 +08:00
zhangwenjian 61d3e7c080 remove : remove no used code 2020-07-27 22:36:00 +08:00
zhangwenjian 7e12e55b56 feat : update config 2020-07-27 22:34:01 +08:00
zhangwenjian 2b92b100e3 feat : update log import 2020-07-27 22:33:00 +08:00
zhangwenjian caab6097b8 feat:update template 2020-07-25 14:59:30 +08:00
zhangwenjian 485110f214 feat:remove db log 2020-07-25 11:27:57 +08:00
zhangwenjian d3276e3b41 Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev 2020-07-25 10:21:27 +08:00
zhangwenjian 9b6de9ee79 doc:update readme.md 2020-07-25 10:20:00 +08:00
wenjianzhang f3adadd6ef feat:update log 2020-07-24 18:10:25 +08:00
wenjianzhang 0768efbcb3 doc:update README.md 2020-07-24 11:04:36 +08:00
zhangwenjian 2549f26147 upgrade:Template upgrade 2020-07-23 21:06:30 +08:00
zhangwenjian 791d07d09b fix:fix parameter setting 2020-07-23 18:11:10 +08:00
zhangwenjian ca62b4ef1d feat:Code generation upgrade(#173) 2020-07-23 14:07:57 +08:00
zhangwenjian 8c554d7ee7 clear:formatting code 2020-07-23 12:03:17 +08:00
zhangwenjian 426cec1b62 fix: Fix spelling errors 2020-07-23 11:59:47 +08:00
zhangwenjian f250ed1dc9 doc: Unified naming method of source file name(#171) 2020-07-23 11:58:38 +08:00
wenjianzhang bad111a633 feat:Routes are added directly to the structure 2020-07-22 18:08:39 +08:00
wenjianzhang 563b7ea10c feat : Add code generation to front-end directory 2020-07-22 17:23:40 +08:00
wenjianzhang 6f111ce9f1 feat:Code generation configuration item 2020-07-22 17:22:55 +08:00
wenjianzhang f95aba8345 feat:Add version information 2020-07-22 17:22:20 +08:00
wenjianzhang 3846a95f12 feat:Code generation configuration item 2020-07-22 17:21:47 +08:00
wenjianzhang 0ac2c2a423 fix:template list not define 2020-07-22 15:39:27 +08:00
wenjianzhang 51e0134fb8 feat:Upgrade the permission field length of menu table to 255 2020-07-22 15:38:15 +08:00
zhangwenjian 1483b63447 feat:In the development mode, the token timeout is adjusted to infinity 2020-07-18 15:25:55 +08:00
zhangwenjian 3af05af603 feat:In the development mode, the token timeout is adjusted to infinity(#169) 2020-07-18 14:59:21 +08:00
zhangwenjian d4d4c9f574 clean:Clean up SQL files 2020-07-18 14:44:55 +08:00
zhangwenjian eb36167baf feat:Optimizing SQL execution logic 2020-07-18 14:43:51 +08:00
zhangwenjian b9d0318b45 doc: swagger add auth tag 2020-07-18 14:24:59 +08:00
zhangwenjian ea3408de84 feat: Upgrade form build(#47 、#167)
Upgrade form build
2020-07-18 14:24:13 +08:00
zhangwenjian fe1ceb4332 fix:Fix the previous page components '/' 2020-07-18 14:22:14 +08:00
wenjianzhang 62a05daa5a fix:template list not define 2020-07-17 19:02:01 +08:00
zhangwenjian a49cb327fd feat:
The login interface verification code in the newly developed mode does not do mandatory verification(#164)
2020-07-15 22:12:04 +08:00
zhangwenjian f045515fc2 fix:Backend verification code is empty Verification error message description is inaccurate(#163) 2020-07-15 22:10:11 +08:00
zhangwenjian 22dc5f3407 doc: upgrade doc 2020-07-15 22:07:23 +08:00
zhangwenjian 7a48cd0084 feat:Basic functions add, delete, modify, check menu and api configuration data, support the system to write to the database with one click(#162) 2020-07-15 22:06:44 +08:00
zhangwenjian 073ef02c05 fix:Model doc information in api document is wrong(#161) 2020-07-15 22:02:40 +08:00
zhangwenjian 18d116bc0c clear: Mark a method that is about to expire 2020-07-15 21:57:27 +08:00
zhangwenjian 73f8572727 fix:The second menu time is displayed incorrectly(#160) 2020-07-15 21:55:36 +08:00
zhangwenjian 209339a1fa Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev 2020-07-14 20:52:40 +08:00
wenjianzhang c3fedf35aa Merge pull request #155 from appleboy/patch
chore(gin): upgrade to v1.6.3
2020-07-14 20:34:48 +08:00
Bo-Yi Wu d3d8e76d03 chore(gin): upgrade to v1.6.3
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2020-07-13 12:21:42 +08:00
zhangwenjian 56163f9a81 doc:update readme img height 2020-07-12 09:53:49 +08:00
wenjianzhang 451f6f9e78 doc:update readme img hight 2020-07-12 09:49:55 +08:00
zhangwenjian aa75242c1a doc:update readme 2020-07-12 09:19:52 +08:00
zhangwenjian 2280ce2b57 fix:Invalid post search criteria 2020-07-11 06:34:51 +08:00
wenjianzhang 4d32d94f23 Merge pull request #154 from wenjianzhang/v1
fix: Invalid job search criteria
2020-07-11 06:31:44 +08:00
zhangwenjian 2195c7a944 fix:Invalid post search criteria 2020-07-11 06:29:07 +08:00
zhangwenjian 494ee18b9f doc:Specification interface document description 2020-07-11 06:15:42 +08:00
zhangwenjian 6673e0aa37 fix:Fix data table name error 2020-07-11 06:14:54 +08:00
zhangwenjian 4f7e22a6f2 fix: fix User management Invalid search box search (#149) 2020-07-10 00:42:34 +08:00
wenjianzhang 4884f31550 Merge pull request #150 from wenjianzhang/fix-bug
Fix bug
2020-07-10 00:36:59 +08:00
zhangwenjian 82b78a728c fix: fix User management Invalid search box search (#149) 2020-07-10 00:33:10 +08:00
zhangwenjian 777ef212c8 fix: fix User management Invalid search box search 2020-07-10 00:31:55 +08:00
zhangwenjian 1f416cc8fd fear: Support sqlite and pgsql 2020-07-10 00:21:26 +08:00
zhangwenjian 8662209181 feat: update demo rotuter 2020-07-10 00:20:37 +08:00
zhangwenjian 00959406aa feat: update router template 2020-07-10 00:19:32 +08:00
zhangwenjian 02cc68daea feat: model type change 2020-07-10 00:17:01 +08:00
zhangwenjian 84a78d7b4f fix: fix name error 2020-07-10 00:16:33 +08:00
zhangwenjian 16d6aebbc2 feat: Interception of sqlite and pgsql database types in code generation 2020-07-10 00:15:09 +08:00
zhangwenjian 9aa9cf5d0e feat: add log 2020-07-10 00:12:41 +08:00
zhangwenjian 144b29ae2c feat: add pgsql sql file 2020-07-10 00:12:07 +08:00
zhangwenjian 4ec3a3016b fix:
fix: Fix current spelling error
2020-07-09 22:38:59 +08:00
wenjianzhang 916e30005f feat: update system 2020-07-06 18:13:29 +08:00
wenjianzhang 8a1614f64d feat:Extraction of configuration parameters 2020-07-06 13:53:15 +08:00
zhangwenjian bfbc5081ea feat:Extract global configuration 2020-07-06 07:53:34 +08:00
zhangwenjian a6970e9c67 feat: Database type support 2020-07-03 00:34:54 +08:00
wenjianzhang ab34ba8aad feat: add dbtype 2020-07-02 18:23:14 +08:00
zhangwenjian 75eec8eebe feat:gen code to path 2020-07-02 00:03:57 +08:00
zhangwenjian cd60410ac0 readme:update readme 2020-07-01 23:03:39 +08:00
zhangwenjian 985a6618a0 Merge branch 'v1-fixbug' into dev
# Conflicts:
#	models/dept.go
2020-07-01 22:57:44 +08:00
wenjianzhang 513f45ab75 Merge pull request #140 from wenjianzhang/v1-fixbug
V1 fixbug
2020-07-01 22:34:56 +08:00
zhangwenjian 8b68e98ebf fix: return value 2020-07-01 20:49:19 +08:00
zhangwenjian 58999ef1a4 feat:add CustomMigrate 2020-06-28 22:49:42 +08:00
zhangwenjian 4ce39764bc feat:update db file name to gorm 2020-06-28 22:49:17 +08:00
zhangwenjian 2eb5803432 fix:Correct typos 2020-06-28 22:48:32 +08:00
zhangwenjian ba3f4b7c23 docs: update init 2020-06-28 22:47:49 +08:00
zhangwenjian e05c5e8a8b feat: Add transaction (#124) 2020-06-28 22:14:53 +08:00
zhangwenjian 8407b1ad31 Merge branch 'dev' of https://github.com/wenjianzhang/go-admin into dev 2020-06-21 13:02:35 +08:00
zhangwenjian 9c0941cd37 feat:code gen to dir 2020-06-21 13:02:20 +08:00
wenjianzhang f150f3b10f Merge pull request #131 from wenjianzhang/v1-fixbug
fix: fix update password invalid
2020-06-21 13:00:58 +08:00
wenjianzhang 40127ac43c Merge pull request #129 from wenjianzhang/v1-fixbug
fix: fix update password invalid
2020-06-21 12:59:27 +08:00
zhangwenjian d73dbbf73c feat:Add file handling method 2020-06-19 22:47:56 +08:00
wenjianzhang 852333c56c Merge pull request #127 from wenjianzhang/v1-fixbug
feat: add global & logger
2020-06-19 22:21:03 +08:00
150 changed files with 5720 additions and 3042 deletions
+5
View File
@@ -7,3 +7,8 @@ temp/
vendor
config/settings.dev.yml
go-admin
middleware/demo.go
config/settings.dev.b.yml
temp/logs
config/settings.dev.yml.log
config/settings.b.dev.yml
+29
View File
@@ -0,0 +1,29 @@
FROM golang:alpine as builder
MAINTAINER xxx
ENV GOPROXY https://goproxy.cn/
WORKDIR /go/release
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update && apk add tzdata
COPY ./go.mod ./go.mod
RUN go mod download
COPY . .
RUN pwd && ls
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -a -installsuffix cgo -o go-admin .
FROM alpine
COPY --from=builder /go/release/go-admin /
COPY --from=builder /go/release/config/ /config/
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
EXPOSE 8000
CMD ["/go-admin","server","-c", "/config/settings.yml"]
+78 -11
View File
@@ -17,13 +17,17 @@
[English](https://github.com/wenjianzhang/go-admin/blob/master/README.en.md) | 简体中文
##### 基于Gin + Vue + Element UI的前后端分离权限管理系统
系统初始化极度简单,只需要配置文件中,修改数据库连接,系统启动后会自动初始化数据库信息以及必须的基础数据
[在线文档](https://wenjianzhang.github.io/go-admin-site)
[在线文档国际](https://wenjianzhang.github.io/go-admin-site)
[在线文档国内](http://mydearzwj.gitee.io/go-admin-site/)
[前端项目](https://github.com/wenjianzhang/go-admin-ui)
[视频教程](https://space.bilibili.com/565616721/channel/detail?cid=125737)
@@ -86,21 +90,58 @@
[使用生成工具轻松实现业务](https://www.bilibili.com/video/BV1Dg4y1i79D)
[go-admin菜单的配置说明](https://www.bilibili.com/video/BV1Wp4y1D715)
[v1.1.0版本代码生成工具-释放双手](https://www.bilibili.com/video/BV1N54y1i71P) [进阶]
[多命令启动方式讲解以及IDE配置](https://www.bilibili.com/video/BV1Fg4y1q7ph)
[go-admin菜单的配置说明](https://www.bilibili.com/video/BV1Wp4y1D715) [必看]
[如何配置菜单信息以及接口信息](https://www.bilibili.com/video/BV1zv411B7nG) [必看]
[go-admin权限配置使用说明](https://www.bilibili.com/video/BV1rt4y197d3) [必看]
[go-admin数据权限使用说明](https://www.bilibili.com/video/BV1LK4y1s71e) [必看]
**如有问题请先看上述使用文档和文章,若不能满足,欢迎 issue 和 pr ,视频教程和文档持续更新中**
## 🗞 系统架构
<p align="center">
<img src="https://gitee.com/mydearzwj/image/raw/d9f59ea603e3c8a3977491a1bfa8f122e1a80824/img/go-admin-system.png" width="936px" height="491px">
</p>
## 📦 本地开发
### 首次启动说明
### 开发目录创建
```bash
# 获取代码
# 创建开发目录
mkdir goadmin
cd goadmin
```
### 获取代码
> 重点注意:两个项目必须放在同一文件夹下;
```bash
# 获取后端代码
git clone https://github.com/wenjianzhang/go-admin.git
# 进入工作路径
# 获取前端代码
git clone https://github.com/wenjianzhang/go-admin-ui.git
```
### 启动说明
#### 服务端启动说明
```bash
# 进入 go-admin 后端项目
cd ./go-admin
# 编译项目
@@ -113,10 +154,9 @@ vi ./config/setting.yml
# 1. 配置文件中修改数据库信息
# 注意: settings.database 下对应的配置数据
# 2. 确认log路径
```
### 初始化数据库,以及服务启动
#### 初始化数据库,以及服务启动
```
# 首次配置需要初始化数据库资源信息
./go-admin init -c config/settings.yml -m dev
@@ -127,7 +167,20 @@ vi ./config/setting.yml
```
### 文档生成
#### 使用docker 编译启动
```shell
# 编译镜像
docker build -t go-admin .
# 启动容器,第一个go-admin是容器名字,第二个go-admin是镜像名称
docker run --name go-admin -p 8000:8000 -d go-admin
```
#### 文档生成
```bash
swag init
@@ -135,7 +188,7 @@ swag init
go get -u github.com/swaggo/swag/cmd/swag
```
### 交叉编译
#### 交叉编译
```bash
env GOOS=windows GOARCH=amd64 go build main.go
@@ -144,6 +197,18 @@ env GOOS=windows GOARCH=amd64 go build main.go
env GOOS=linux GOARCH=amd64 go build main.go
```
### UI交互端启动说明
```bash
# 安装依赖
npm install
# 建议不要直接使用 cnpm 安装依赖,会有各种诡异的 bug。可以通过如下操作解决 npm 下载速度慢的问题
npm install --registry=https://registry.npm.taobao.org
# 启动服务
npm run dev
```
## 🎬 在线体验
> admin / 123456
@@ -187,7 +252,9 @@ env GOOS=linux GOARCH=amd64 go build main.go
## ❤️ 赞助者
zhuqiyun LLL狐
> 有部分是微信名称
zhuqiyun LLL狐 星星之火 cjj770 Sam 唐*i 晓聪 aLong *渊 海马 魏镇坪 + 111 *哥 我的宇哥哥 *声 *节
## 🔑 License
@@ -19,7 +19,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/loginloglist [get]
// @Security
// @Security Bearer
func GetLoginLogList(c *gin.Context) {
var data models.LoginLog
var err error
@@ -59,7 +59,7 @@ func GetLoginLogList(c *gin.Context) {
// @Param infoId path int true "infoId"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/loginlog/{infoId} [get]
// @Security
// @Security Bearer
func GetLoginLog(c *gin.Context) {
var LoginLog models.LoginLog
LoginLog.InfoId, _ = tools.StringToInt(c.Param("infoId"))
+2 -2
View File
@@ -19,7 +19,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/operloglist [get]
// @Security
// @Security Bearer
func GetOperLogList(c *gin.Context) {
var data models.SysOperLog
var err error
@@ -60,7 +60,7 @@ func GetOperLogList(c *gin.Context) {
// @Param infoId path int true "infoId"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/operlog/{infoId} [get]
// @Security
// @Security Bearer
func GetOperLog(c *gin.Context) {
var OperLog models.SysOperLog
OperLog.OperId, _ = tools.StringToInt(c.Param("operId"))
+12 -1
View File
@@ -1,10 +1,12 @@
package monitor
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/disk"
"github.com/shirou/gopsutil/mem"
"go-admin/tools"
"go-admin/tools/app"
"runtime"
)
@@ -16,6 +18,11 @@ const (
GB = 1024 * MB
)
// @Summary 系统信息
// @Description 获取JSON
// @Tags 系统信息
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/settings/serverInfo [get]
func ServerInfo(c *gin.Context) {
osDic := make(map[string]interface{}, 0)
@@ -25,6 +32,8 @@ func ServerInfo(c *gin.Context) {
osDic["compiler"] = runtime.Compiler
osDic["version"] = runtime.Version()
osDic["numGoroutine"] = runtime.NumGoroutine()
osDic["ip"] = tools.GetLocaHonst()
osDic["projectDir"] = tools.GetCurrentPath()
dis, _ := disk.Usage("/")
diskTotalGB := int(dis.Total) / GB
@@ -45,9 +54,11 @@ func ServerInfo(c *gin.Context) {
memDic["usage"] = memUsedPercent
cpuDic := make(map[string]interface{}, 0)
cpuDic["cpuInfo"],_ = cpu.Info()
percent,_ := cpu.Percent(0,false)
cpuDic["Percent"] = fmt.Sprintf("%.2f",percent[0])
cpuDic["cpuNum"], _ = cpu.Counts(false)
app.Custum(c, gin.H{
"code": 200,
"os": osDic,
+66
View File
@@ -0,0 +1,66 @@
package public
import (
"encoding/base64"
"errors"
"github.com/gin-gonic/gin"
"github.com/google/uuid"
"go-admin/pkg/utils"
"go-admin/tools/app"
"io/ioutil"
"fmt"
)
// @Summary 上传图片
// @Description 获取JSON
// @Tags 公共接口
// @Accept multipart/form-data
// @Param type query string true "type" (1:单图,2:多图, 3:base64图片)
// @Param file formData file true "file"
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /api/v1/public/uploadFile [post]
func UploadFile(c *gin.Context) {
tag,_ := c.GetPostForm("type")
urlPerfix := fmt.Sprintf("http://%s/",c.Request.Host)
if tag == ""{
app.Error(c,200,errors.New(""),"缺少标识")
return
} else {
switch tag {
case "1": // 单图
files,err := c.FormFile("file")
if err != nil {
app.Error(c,200,errors.New(""),"图片不能为空")
return
}
// 上传文件至指定目录
guid := uuid.New().String()
singleFile := "static/uploadfile/" + guid + utils.GetExt(files.Filename)
_ = c.SaveUploadedFile(files, singleFile)
app.OK(c, urlPerfix + singleFile, "上传成功")
return
case "2": // 多图
files := c.Request.MultipartForm.File["file"]
multipartFile := make([]string, len(files))
for _, f := range files {
guid := uuid.New().String()
multipartFileName := "static/uploadfile/" + guid + utils.GetExt(f.Filename)
_ = c.SaveUploadedFile(f, multipartFileName)
multipartFile = append(multipartFile, urlPerfix + multipartFileName)
}
app.OK(c, multipartFile, "上传成功")
return
case "3": // base64
files,_ := c.GetPostForm("file")
ddd, _ := base64.StdEncoding.DecodeString(files)
guid := uuid.New().String()
_ = ioutil.WriteFile("static/uploadfile/" + guid+ ".jpg", ddd, 0666)
app.OK(c, urlPerfix + "static/uploadfile/" + guid+ ".jpg", "上传成功")
}
}
}
+124
View File
@@ -0,0 +1,124 @@
package sysjob
import (
"github.com/gin-gonic/gin"
"go-admin/jobs"
"go-admin/models"
"go-admin/tools"
"go-admin/tools/app"
"go-admin/tools/app/msg"
"time"
)
func GetSysJobList(c *gin.Context) {
var data models.SysJob
var err error
var pageSize = 10
var pageIndex = 1
if size := c.Request.FormValue("pageSize"); size != "" {
pageSize = tools.StrToInt(err, size)
}
if index := c.Request.FormValue("pageIndex"); index != "" {
pageIndex = tools.StrToInt(err, index)
}
data.JobId, _ = tools.StringToInt(c.Request.FormValue("jobId"))
data.JobName = c.Request.FormValue("jobName")
data.JobGroup = c.Request.FormValue("jobGroup")
data.CronExpression = c.Request.FormValue("cronExpression")
data.InvokeTarget = c.Request.FormValue("invokeTarget")
data.Status, _ = tools.StringToInt(c.Request.FormValue("status"))
data.DataScope = tools.GetUserIdStr(c)
result, count, err := data.GetPage(pageSize, pageIndex)
tools.HasError(err, "", -1)
app.PageOK(c, result, count, pageIndex, pageSize, "")
}
func GetSysJob(c *gin.Context) {
var data models.SysJob
data.JobId, _ = tools.StringToInt(c.Param("jobId"))
result, err := data.Get()
tools.HasError(err, "抱歉未找到相关信息", -1)
app.OK(c, result, "")
}
func InsertSysJob(c *gin.Context) {
var data models.SysJob
err := c.ShouldBindJSON(&data)
data.CreateBy = tools.GetUserIdStr(c)
tools.HasError(err, "", 500)
result, err := data.Create()
tools.HasError(err, "", -1)
app.OK(c, result, "")
}
func UpdateSysJob(c *gin.Context) {
var data models.SysJob
err := c.ShouldBindJSON(&data)
tools.HasError(err, "数据解析失败", -1)
data.UpdateBy = tools.GetUserIdStr(c)
result, err := data.Update(data.JobId)
tools.HasError(err, "", -1)
app.OK(c, result, "")
}
func DeleteSysJob(c *gin.Context) {
var data models.SysJob
data.UpdateBy = tools.GetUserIdStr(c)
IDS := tools.IdsStrToIdsIntGroup("jobId", c)
_, err := data.BatchDelete(IDS)
tools.HasError(err, msg.DeletedFail, 500)
app.OK(c, nil, msg.DeletedSuccess)
}
func RemoveJob(c *gin.Context) {
var data models.SysJob
data.JobId, _ = tools.StringToInt(c.Param("jobId"))
result, err := data.Get()
tools.HasError(err, "", 500)
cn := jobs.Remove(result.EntryId)
select {
case res := <-cn:
if res {
_, _ = data.RemoveEntryID(result.EntryId)
app.OK(c, nil, msg.DeletedSuccess)
}
case <-time.After(time.Second * 1):
app.OK(c, nil, msg.TimeOut)
}
}
func StartJob(c *gin.Context) {
var data models.SysJob
data.JobId, _ = tools.StringToInt(c.Param("jobId"))
result, err := data.Get()
tools.HasError(err, "", 500)
if result.JobType == 1{
var j = &jobs.HttpJob{}
j.InvokeTarget = result.InvokeTarget
j.CronExpression = result.CronExpression
j.JobId = result.JobId
j.Name = result.JobName
data.EntryId, err = jobs.AddJob(j)
} else {
var j = &jobs.ExecJob{}
j.InvokeTarget = result.InvokeTarget
j.CronExpression = result.CronExpression
j.JobId = result.JobId
j.Name = result.JobName
data.EntryId, err = jobs.AddJob(j)
}
tools.HasError(err, "", 500)
_, err = data.Update(data.JobId)
tools.HasError(err, "", 500)
app.OK(c, nil, msg.DeletedSuccess)
}
+6 -8
View File
@@ -20,7 +20,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/configList [get]
// @Security
// @Security Bearer
func GetConfigList(c *gin.Context) {
var data models.SysConfig
var err error
@@ -60,7 +60,7 @@ func GetConfigList(c *gin.Context) {
// @Param configId path int true "配置编码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/config/{configId} [get]
// @Security
// @Security Bearer
func GetConfig(c *gin.Context) {
var Config models.SysConfig
Config.ConfigId, _ = tools.StringToInt(c.Param("configId"))
@@ -79,14 +79,14 @@ func GetConfig(c *gin.Context) {
// @Param configKey path int true "configKey"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/configKey/{configKey} [get]
// @Security
// @Security Bearer
func GetConfigByConfigKey(c *gin.Context) {
var Config models.SysConfig
Config.ConfigKey = c.Param("configKey")
result, err := Config.Get()
tools.HasError(err, "抱歉未找到相关信息", -1)
app.OK(c, result,result.ConfigValue)
app.OK(c, result, result.ConfigValue)
}
// @Summary 添加配置
@@ -107,7 +107,7 @@ func InsertConfig(c *gin.Context) {
result, err := data.Create()
tools.HasError(err, "", -1)
app.OK(c, result,"")
app.OK(c, result, "")
}
// @Summary 修改配置
@@ -127,7 +127,7 @@ func UpdateConfig(c *gin.Context) {
data.UpdateBy = tools.GetUserIdStr(c)
result, err := data.Update(data.ConfigId)
tools.HasError(err, "", -1)
app.OK(c, result,"")
app.OK(c, result, "")
}
// @Summary 删除配置
@@ -145,5 +145,3 @@ func DeleteConfig(c *gin.Context) {
tools.HasError(err, "修改失败", 500)
app.OK(c, result, msg.DeletedSuccess)
}
+19 -19
View File
@@ -17,26 +17,26 @@ import (
// @Param position query string false "position"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/deptList [get]
// @Security
// @Security Bearer
func GetDeptList(c *gin.Context) {
var Dept models.Dept
var Dept models.SysDept
Dept.DeptName = c.Request.FormValue("deptName")
Dept.Status = c.Request.FormValue("status")
Dept.DeptId, _ = tools.StringToInt(c.Request.FormValue("deptId"))
Dept.DataScope = tools.GetUserIdStr(c)
result, err := Dept.SetDept(true)
tools.HasError(err, "抱歉未找到相关信息", -1)
app.OK(c,result,"")
app.OK(c, result, "")
}
func GetDeptTree(c *gin.Context) {
var Dept models.Dept
var Dept models.SysDept
Dept.DeptName = c.Request.FormValue("deptName")
Dept.Status= c.Request.FormValue("status")
Dept.Status = c.Request.FormValue("status")
Dept.DeptId, _ = tools.StringToInt(c.Request.FormValue("deptId"))
result, err := Dept.SetDept(false)
tools.HasError(err, "抱歉未找到相关信息", -1)
app.OK(c,result,"")
app.OK(c, result, "")
}
// @Summary 部门列表数据
@@ -46,14 +46,14 @@ func GetDeptTree(c *gin.Context) {
// @Param position query string false "position"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dept/{deptId} [get]
// @Security
// @Security Bearer
func GetDept(c *gin.Context) {
var Dept models.Dept
var Dept models.SysDept
Dept.DeptId, _ = tools.StringToInt(c.Param("deptId"))
Dept.DataScope = tools.GetUserIdStr(c)
result, err := Dept.Get()
tools.HasError(err, msg.NotFound, 404)
app.OK(c,result, msg.GetSuccess)
app.OK(c, result, msg.GetSuccess)
}
// @Summary 添加部门
@@ -61,19 +61,19 @@ func GetDept(c *gin.Context) {
// @Tags 部门
// @Accept application/json
// @Product application/json
// @Param data body models.Dept true "data"
// @Param data body models.SysDept true "data"
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /api/v1/dept [post]
// @Security Bearer
func InsertDept(c *gin.Context) {
var data models.Dept
var data models.SysDept
err := c.BindWith(&data, binding.JSON)
tools.HasError(err, "", 500)
data.CreateBy = tools.GetUserIdStr(c)
result, err := data.Create()
tools.HasError(err, "", -1)
app.OK(c,result, msg.CreatedSuccess)
app.OK(c, result, msg.CreatedSuccess)
}
// @Summary 修改部门
@@ -82,19 +82,19 @@ func InsertDept(c *gin.Context) {
// @Accept application/json
// @Product application/json
// @Param id path int true "id"
// @Param data body models.Dept true "body"
// @Param data body models.SysDept true "body"
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /api/v1/dept [put]
// @Security Bearer
func UpdateDept(c *gin.Context) {
var data models.Dept
var data models.SysDept
err := c.BindJSON(&data)
tools.HasError(err, "", -1)
data.UpdateBy = tools.GetUserIdStr(c)
result, err := data.Update(data.DeptId)
tools.HasError(err, "", -1)
app.OK(c,result, msg.UpdatedSuccess)
app.OK(c, result, msg.UpdatedSuccess)
}
// @Summary 删除部门
@@ -105,15 +105,15 @@ func UpdateDept(c *gin.Context) {
// @Success 200 {string} string "{"code": -1, "message": "删除失败"}"
// @Router /api/v1/dept/{id} [delete]
func DeleteDept(c *gin.Context) {
var data models.Dept
var data models.SysDept
id, err := tools.StringToInt(c.Param("id"))
_, err = data.Delete(id)
tools.HasError(err, "删除失败", 500)
app.OK(c,"", msg.DeletedSuccess)
app.OK(c, "", msg.DeletedSuccess)
}
func GetDeptTreeRoleselect(c *gin.Context) {
var Dept models.Dept
var Dept models.SysDept
var SysRole models.SysRole
id, err := tools.StringToInt(c.Param("roleId"))
SysRole.RoleId = id
@@ -124,7 +124,7 @@ func GetDeptTreeRoleselect(c *gin.Context) {
menuIds, err = SysRole.GetRoleDeptId()
tools.HasError(err, "抱歉未找到相关信息", -1)
}
app.Custum(c,gin.H{
app.Custum(c, gin.H{
"code": 200,
"depts": result,
"checkedKeys": menuIds,
@@ -19,7 +19,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dict/data/list [get]
// @Security
// @Security Bearer
func GetDictDataList(c *gin.Context) {
var data models.DictData
var err error
@@ -61,7 +61,7 @@ func GetDictDataList(c *gin.Context) {
// @Param dictCode path int true "字典编码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dict/data/{dictCode} [get]
// @Security
// @Security Bearer
func GetDictData(c *gin.Context) {
var DictData models.DictData
DictData.DictLabel = c.Request.FormValue("dictLabel")
@@ -79,7 +79,7 @@ func GetDictData(c *gin.Context) {
// @Param dictType path int true "dictType"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dict/databyType/{dictType} [get]
// @Security
// @Security Bearer
func GetDictDataByDictType(c *gin.Context) {
var DictData models.DictData
DictData.DictType = c.Param("dictType")
@@ -148,5 +148,5 @@ func DeleteDictData(c *gin.Context) {
IDS := tools.IdsStrToIdsIntGroup("dictCode", c)
result, err := data.BatchDelete(IDS)
tools.HasError(err, "修改失败", 500)
app.OK(c,result,"删除成功")
app.OK(c, result, "删除成功")
}
@@ -19,7 +19,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dict/type/list [get]
// @Security
// @Security Bearer
func GetDictTypeList(c *gin.Context) {
var data models.DictType
var err error
@@ -59,7 +59,7 @@ func GetDictTypeList(c *gin.Context) {
// @Param dictId path int true "字典类型编码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dict/type/{dictId} [get]
// @Security
// @Security Bearer
func GetDictType(c *gin.Context) {
var DictType models.DictType
DictType.DictName = c.Request.FormValue("dictName")
+3 -4
View File
@@ -1,6 +1,6 @@
package system
import(
import (
"github.com/gin-gonic/gin"
)
@@ -33,8 +33,7 @@ $(function(){
</html>
`
func HelloWorld(c *gin.Context){
func HelloWorld(c *gin.Context) {
c.Header("Content-Type", "text/html; charset=utf-8")
c.String(200, INDEX)
c.String(200, INDEX)
}
+25 -22
View File
@@ -7,15 +7,16 @@ import (
"go-admin/tools/app"
)
// @Summary 职位列表数据
// @Summary 岗位列表数据
// @Description 获取JSON
// @Tags 职位
// @Param name query string false "name"
// @Param id query string false "id"
// @Param position query string false "position"
// @Tags 岗位
// @Param postName query string false "postName"
// @Param postCode query string false "postCode"
// @Param postId query string false "postId"
// @Param status query string false "status"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/post [get]
// @Security
// @Security Bearer
func GetPostList(c *gin.Context) {
var data models.Post
var err error
@@ -30,35 +31,37 @@ func GetPostList(c *gin.Context) {
pageIndex = tools.StrToInt(err, index)
}
data.PostName = c.Request.FormValue("postName")
id := c.Request.FormValue("postId")
data.PostId, _ = tools.StringToInt(id)
data.PostCode = c.Request.FormValue("postCode")
data.PostName = c.Request.FormValue("postName")
data.Status = c.Request.FormValue("status")
data.DataScope = tools.GetUserIdStr(c)
result, count, err := data.GetPage(pageSize, pageIndex)
tools.HasError(err, "", -1)
app.PageOK(c, result, count, pageIndex, pageSize, "")
}
// @Summary 获取字典数据
// @Summary 获取岗位信息
// @Description 获取JSON
// @Tags 字典数据
// @Tags 岗位
// @Param postId path int true "postId"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/post/{postId} [get]
// @Security
// @Security Bearer
func GetPost(c *gin.Context) {
var Post models.Post
Post.PostId, _ = tools.StringToInt(c.Param("postId"))
result, err := Post.Get()
tools.HasError(err, "抱歉未找到相关信息", -1)
app.OK(c,result,"")
app.OK(c, result, "")
}
// @Summary 添加职位
// @Summary 添加岗位
// @Description 获取JSON
// @Tags 职位
// @Tags 岗位
// @Accept application/json
// @Product application/json
// @Param data body models.Post true "data"
@@ -73,15 +76,15 @@ func InsertPost(c *gin.Context) {
tools.HasError(err, "", 500)
result, err := data.Create()
tools.HasError(err, "", -1)
app.OK(c,result,"")
app.OK(c, result, "")
}
// @Summary 修改职位
// @Summary 修改岗位
// @Description 获取JSON
// @Tags 职位
// @Tags 岗位
// @Accept application/json
// @Product application/json
// @Param data body models.Dept true "body"
// @Param data body models.Post true "body"
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /api/v1/post/ [put]
@@ -94,15 +97,15 @@ func UpdatePost(c *gin.Context) {
tools.HasError(err, "", -1)
result, err := data.Update(data.PostId)
tools.HasError(err, "", -1)
app.OK(c,result,"修改成功")
app.OK(c, result, "修改成功")
}
// @Summary 删除职位
// @Summary 删除岗位
// @Description 删除数据
// @Tags 职位
// @Tags 岗位
// @Param id path int true "id"
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": -1, "message": "删除失败"}"
// @Success 500 {string} string "{"code": 500, "message": "删除失败"}"
// @Router /api/v1/post/{postId} [delete]
func DeletePost(c *gin.Context) {
var data models.Post
@@ -110,5 +113,5 @@ func DeletePost(c *gin.Context) {
IDS := tools.IdsStrToIdsIntGroup("postId", c)
result, err := data.BatchDelete(IDS)
tools.HasError(err, "删除失败", 500)
app.OK(c,result,"删除成功")
app.OK(c, result, "删除成功")
}
+1 -1
View File
@@ -18,7 +18,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/rolelist [get]
// @Security
// @Security Bearer
func GetRoleList(c *gin.Context) {
var data models.SysRole
var err error
+65
View File
@@ -0,0 +1,65 @@
package system
import (
"errors"
"fmt"
"github.com/gin-gonic/gin"
"go-admin/models"
"go-admin/tools"
"go-admin/tools/app"
"strings"
)
// @Summary 查询系统信息
// @Description 获取JSON
// @Tags 系统信息
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /api/v1/setting [get]
func GetSetting(c *gin.Context) {
var s models.SysSetting
r, e := s.Get()
if r.Logo != "" {
if !strings.HasPrefix(r.Logo, "http") {
r.Logo = fmt.Sprintf("http://%s/%s", c.Request.Host, r.Logo)
}
}
tools.HasError(e, "查询失败", 500)
app.OK(c, r, "查询成功")
}
// @Summary 更新或提交系统信息
// @Description 获取JSON
// @Tags 系统信息
// @Param data body models.SysUser true "body"
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /api/v1/system/setting [post]
func CreateSetting(c *gin.Context) {
var s models.ResponseSystemConfig
if err := c.ShouldBind(&s); err != nil {
app.Error(c, 200, errors.New("缺少必要参数"), "")
return
}
var sModel models.SysSetting
sModel.Logo = s.Logo
sModel.Name = s.Name
a, e := sModel.Update()
if e != nil {
app.Error(c, 200, e, "")
return
}
if a.Logo != "" {
if !strings.HasPrefix(a.Logo, "http") {
a.Logo = fmt.Sprintf("http://%s/%s", c.Request.Host, a.Logo)
}
}
app.OK(c, a, "提交成功")
}
+9 -9
View File
@@ -4,13 +4,13 @@ import (
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"github.com/google/uuid"
"go-admin/global"
"go-admin/models"
"go-admin/tools"
"go-admin/tools/app"
log "github.com/sirupsen/logrus"
)
// @Summary 列表数据
// @Summary 列表用户信息数据
// @Description 获取JSON
// @Tags 用户
// @Param username query string false "username"
@@ -34,7 +34,7 @@ func GetSysUserList(c *gin.Context) {
pageIndex = tools.StrToInt(err, index)
}
data.Username = c.Request.FormValue("userName")
data.Username = c.Request.FormValue("username")
data.Status = c.Request.FormValue("status")
data.Phone = c.Request.FormValue("phone")
@@ -57,7 +57,7 @@ func GetSysUserList(c *gin.Context) {
// @Param userId path int true "用户编码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/sysUser/{userId} [get]
// @Security
// @Security Bearer
func GetSysUser(c *gin.Context) {
var SysUser models.SysUser
SysUser.UserId, _ = tools.StringToInt(c.Param("userId"))
@@ -83,12 +83,12 @@ func GetSysUser(c *gin.Context) {
})
}
// @Summary 获取当前登录用户
// @Summary 获取个人中心用户
// @Description 获取JSON
// @Tags 个人中心
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/user/profile [get]
// @Security
// @Security Bearer
func GetSysUserProfile(c *gin.Context) {
var SysUser models.SysUser
userId := tools.GetUserIdStr(c)
@@ -97,7 +97,7 @@ func GetSysUserProfile(c *gin.Context) {
tools.HasError(err, "抱歉未找到相关信息", -1)
var SysRole models.SysRole
var Post models.Post
var Dept models.Dept
var Dept models.SysDept
//获取角色列表
roles, err := SysRole.GetList()
//获取职位列表
@@ -128,7 +128,7 @@ func GetSysUserProfile(c *gin.Context) {
// @Tags 用户
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/sysUser [get]
// @Security
// @Security Bearer
func GetSysUserInit(c *gin.Context) {
var SysRole models.SysRole
var Post models.Post
@@ -210,7 +210,7 @@ func InsetSysUserAvatar(c *gin.Context) {
guid := uuid.New().String()
filPath := "static/uploadfile/" + guid + ".jpg"
for _, file := range files {
log.Println(file.Filename)
global.Logger.Debug(file.Filename)
// 上传文件至指定目录
_ = c.SaveUploadedFile(file, filPath)
}
+1 -1
View File
@@ -31,7 +31,7 @@ func GetDBColumnList(c *gin.Context) {
}
data.TableName = c.Request.FormValue("tableName")
tools2.Assert(data.TableName=="","table name cannot be empty!",500)
tools2.Assert(data.TableName == "", "table name cannot be empty!", 500)
result, count, err := data.GetPage(pageSize, pageIndex)
tools2.HasError(err, "", -1)
+3 -4
View File
@@ -5,7 +5,7 @@ import (
"go-admin/models/tools"
tools2 "go-admin/tools"
"go-admin/tools/app"
config2 "go-admin/tools/config"
"go-admin/tools/config"
"net/http"
)
@@ -23,8 +23,8 @@ func GetDBTableList(c *gin.Context) {
var err error
var pageSize = 10
var pageIndex = 1
if config2.DatabaseConfig.Dbtype=="sqlite3"{
res.Msg="对不起,sqlite3 暂不支持代码生成!"
if config.DatabaseConfig.Driver == "sqlite3" || config.DatabaseConfig.Driver == "postgres" {
res.Msg = "对不起,sqlite3 或 postgres 不支持代码生成!"
c.JSON(http.StatusOK, res.ReturnError(500))
return
}
@@ -47,7 +47,6 @@ func GetDBTableList(c *gin.Context) {
mp["pageIndex"] = pageIndex
mp["pageSize"] = pageSize
res.Data = mp
c.JSON(http.StatusOK, res.ReturnOK())
+316
View File
@@ -3,9 +3,12 @@ package tools
import (
"bytes"
"github.com/gin-gonic/gin"
"go-admin/global"
"go-admin/models"
"go-admin/models/tools"
tools2 "go-admin/tools"
"go-admin/tools/app"
"go-admin/tools/config"
"net/http"
"text/template"
)
@@ -48,3 +51,316 @@ func Preview(c *gin.Context) {
c.JSON(http.StatusOK, res.ReturnOK())
}
func GenCode(c *gin.Context) {
table := tools.SysTables{}
id, err := tools2.StringToInt(c.Param("tableId"))
tools2.HasError(err, "", -1)
table.TableId = id
tab, _ := table.Get()
ischeckrole := true
routerfile := "template/routercheckrole.go.template"
if c.Request.FormValue("ischeckrole") != "" {
ischeckrole, err = tools2.StringToBool(c.Request.FormValue("ischeckrole"))
if err != nil {
ischeckrole = true
}
}
oldTest := "// {{认证路由自动补充在此处请勿删除}}"
newText := "// {{认证路由自动补充在此处请勿删除}} \r\n register" + tab.ClassName + "Router(v1,authMiddleware)"
if !ischeckrole {
oldTest = "// {{无需认证路由自动补充在此处请勿删除}}"
newText = "// {{无需认证路由自动补充在此处请勿删除}} \r\n register" + tab.ClassName + "Router(v1)"
routerfile = "template/routernocheckrole.go.template"
}
t1, err := template.ParseFiles("template/model.go.template")
tools2.HasError(err, "", -1)
t2, err := template.ParseFiles("template/api.go.template")
tools2.HasError(err, "", -1)
t3, err := template.ParseFiles(routerfile)
tools2.HasError(err, "", -1)
t4, err := template.ParseFiles("template/js.go.template")
tools2.HasError(err, "", -1)
t5, err := template.ParseFiles("template/vue.go.template")
tools2.HasError(err, "", -1)
_ = tools2.PathCreate("./apis/" + tab.ModuleName + "/")
_ = tools2.PathCreate("./models/")
_ = tools2.PathCreate("./router/")
_ = tools2.PathCreate(config.GenConfig.FrontPath + "/api/")
_ = tools2.PathCreate(config.GenConfig.FrontPath + "/views/" + tab.PackageName)
var b1 bytes.Buffer
err = t1.Execute(&b1, tab)
var b2 bytes.Buffer
err = t2.Execute(&b2, tab)
var b3 bytes.Buffer
err = t3.Execute(&b3, tab)
var b4 bytes.Buffer
err = t4.Execute(&b4, tab)
var b5 bytes.Buffer
err = t5.Execute(&b5, tab)
tools2.FileCreate(b1, "./models/"+tab.PackageName+".go")
tools2.FileCreate(b2, "./apis/"+tab.ModuleName+"/"+tab.PackageName+".go")
tools2.FileCreate(b3, "./router/"+tab.PackageName+".go")
tools2.FileCreate(b4, config.GenConfig.FrontPath+"/api/"+tab.PackageName+".js")
tools2.FileCreate(b5, config.GenConfig.FrontPath+"/views/"+tab.PackageName+"/index.vue")
helper := tools2.ReplaceHelper{
Root: "./router/router.go",
OldText: oldTest,
NewText: newText,
}
if helper.OldText == helper.NewText {
global.Logger.Println("error !! the NewText isEqual the OldText")
return
}
if err := helper.DoWrok(); err != nil {
global.Logger.Print("error:", err.Error())
} else {
global.Logger.Print("done!")
}
app.OK(c, "", "Code generated successfully!")
}
func GenMenuAndApi(c *gin.Context) {
table := tools.SysTables{}
timeNow := tools2.GetCurrentTime()
id, err := tools2.StringToInt(c.Param("tableId"))
tools2.HasError(err, "", -1)
table.TableId = id
tab, _ := table.Get()
Mmenu := models.Menu{}
Mmenu.MenuName = tab.TBName + "管理"
Mmenu.Title = tab.TableComment
Mmenu.Icon = "pass"
Mmenu.Path = "/" + tab.TBName
Mmenu.MenuType = "M"
Mmenu.Action = "无"
Mmenu.ParentId = 0
Mmenu.NoCache = false
Mmenu.Component = "Layout"
Mmenu.Sort = 0
Mmenu.Visible = "0"
Mmenu.IsFrame = "0"
Mmenu.CreateBy = "1"
Mmenu.UpdateBy = "1"
Mmenu.CreatedAt = timeNow
Mmenu.UpdatedAt = timeNow
Mmenu.MenuId, err = Mmenu.Create()
Cmenu := models.Menu{}
Cmenu.MenuName = tab.TBName + "管理"
Cmenu.Title = tab.TableComment
Cmenu.Icon = "pass"
Cmenu.Path = tab.TBName
Cmenu.MenuType = "C"
Cmenu.Action = "无"
Cmenu.Permission = tab.PackageName + ":" + tab.ModuleName + ":list"
Cmenu.ParentId = Mmenu.MenuId
Cmenu.NoCache = false
Cmenu.Component = "/" + tab.ModuleName + "/index"
Cmenu.Sort = 0
Cmenu.Visible = "0"
Cmenu.IsFrame = "0"
Cmenu.CreateBy = "1"
Cmenu.UpdateBy = "1"
Cmenu.CreatedAt = timeNow
Cmenu.UpdatedAt = timeNow
Cmenu.MenuId, err = Cmenu.Create()
MList := models.Menu{}
MList.MenuName = tab.TBName
MList.Title = "分页获取" + tab.TableComment
MList.Icon = "pass"
MList.Path = tab.TBName
MList.MenuType = "F"
MList.Action = "无"
MList.Permission = tab.PackageName + ":" + tab.ModuleName + ":query"
MList.ParentId = Cmenu.MenuId
MList.NoCache = false
MList.Sort = 0
MList.Visible = "0"
MList.IsFrame = "0"
MList.CreateBy = "1"
MList.UpdateBy = "1"
MList.CreatedAt = timeNow
MList.UpdatedAt = timeNow
MList.MenuId, err = MList.Create()
MCreate := models.Menu{}
MCreate.MenuName = tab.TBName
MCreate.Title = "创建" + tab.TableComment
MCreate.Icon = "pass"
MCreate.Path = tab.TBName
MCreate.MenuType = "F"
MCreate.Action = "无"
MCreate.Permission = tab.PackageName + ":" + tab.ModuleName + ":add"
MCreate.ParentId = Cmenu.MenuId
MCreate.NoCache = false
MCreate.Sort = 0
MCreate.Visible = "0"
MCreate.IsFrame = "0"
MCreate.CreateBy = "1"
MCreate.UpdateBy = "1"
MCreate.CreatedAt = timeNow
MCreate.UpdatedAt = timeNow
MCreate.MenuId, err = MCreate.Create()
MUpdate := models.Menu{}
MUpdate.MenuName = tab.TBName
MUpdate.Title = "修改" + tab.TableComment
MUpdate.Icon = "pass"
MUpdate.Path = tab.TBName
MUpdate.MenuType = "F"
MUpdate.Action = "无"
MUpdate.Permission = tab.PackageName + ":" + tab.ModuleName + ":edit"
MUpdate.ParentId = Cmenu.MenuId
MUpdate.NoCache = false
MUpdate.Sort = 0
MUpdate.Visible = "0"
MUpdate.IsFrame = "0"
MUpdate.CreateBy = "1"
MUpdate.UpdateBy = "1"
MUpdate.CreatedAt = timeNow
MUpdate.UpdatedAt = timeNow
MUpdate.MenuId, err = MUpdate.Create()
MDelete := models.Menu{}
MDelete.MenuName = tab.TBName
MDelete.Title = "删除" + tab.TableComment
MDelete.Icon = "pass"
MDelete.Path = tab.TBName
MDelete.MenuType = "F"
MDelete.Action = "无"
MDelete.Permission = tab.PackageName + ":" + tab.ModuleName + ":remove"
MDelete.ParentId = Cmenu.MenuId
MDelete.NoCache = false
MDelete.Sort = 0
MDelete.Visible = "0"
MDelete.IsFrame = "0"
MDelete.CreateBy = "1"
MDelete.UpdateBy = "1"
MDelete.CreatedAt = timeNow
MDelete.UpdatedAt = timeNow
MDelete.MenuId, err = MDelete.Create()
var InterfaceId = 63
Amenu := models.Menu{}
Amenu.MenuName = tab.TBName
Amenu.Title = tab.TableComment
Amenu.Icon = "bug"
Amenu.Path = tab.TBName
Amenu.MenuType = "M"
Amenu.Action = "无"
Amenu.ParentId = InterfaceId
Amenu.NoCache = false
Amenu.Sort = 0
Amenu.Visible = "1"
Amenu.IsFrame = "0"
Amenu.CreateBy = "1"
Amenu.UpdateBy = "1"
Amenu.CreatedAt = timeNow
Amenu.UpdatedAt = timeNow
Amenu.MenuId, err = Amenu.Create()
AList := models.Menu{}
AList.MenuName = tab.TBName
AList.Title = "分页获取" + tab.TableComment
AList.Icon = "bug"
AList.Path = "/api/v1/" + tab.ModuleName + "List"
AList.MenuType = "A"
AList.Action = "GET"
AList.ParentId = Amenu.MenuId
AList.NoCache = false
AList.Sort = 0
AList.Visible = "1"
AList.IsFrame = "0"
AList.CreateBy = "1"
AList.UpdateBy = "1"
AList.CreatedAt = timeNow
AList.UpdatedAt = timeNow
AList.MenuId, err = AList.Create()
AGet := models.Menu{}
AGet.MenuName = tab.TBName
AGet.Title = "根据id获取" + tab.TableComment
AGet.Icon = "bug"
AGet.Path = "/api/v1/" + tab.ModuleName + "/:id"
AGet.MenuType = "A"
AGet.Action = "GET"
AGet.ParentId = Amenu.MenuId
AGet.NoCache = false
AGet.Sort = 0
AGet.Visible = "1"
AGet.IsFrame = "0"
AGet.CreateBy = "1"
AGet.UpdateBy = "1"
AGet.CreatedAt = timeNow
AGet.UpdatedAt = timeNow
AGet.MenuId, err = AGet.Create()
ACreate := models.Menu{}
ACreate.MenuName = tab.TBName
ACreate.Title = "创建" + tab.TableComment
ACreate.Icon = "bug"
ACreate.Path = "/api/v1/" + tab.ModuleName
ACreate.MenuType = "A"
ACreate.Action = "POST"
ACreate.ParentId = Amenu.MenuId
ACreate.NoCache = false
ACreate.Sort = 0
ACreate.Visible = "1"
ACreate.IsFrame = "0"
ACreate.CreateBy = "1"
ACreate.UpdateBy = "1"
ACreate.CreatedAt = timeNow
ACreate.UpdatedAt = timeNow
ACreate.MenuId, err = ACreate.Create()
AUpdate := models.Menu{}
AUpdate.MenuName = tab.TBName
AUpdate.Title = "修改" + tab.TableComment
AUpdate.Icon = "bug"
AUpdate.Path = "/api/v1/" + tab.ModuleName
AUpdate.MenuType = "A"
AUpdate.Action = "PUT"
AUpdate.ParentId = Amenu.MenuId
AUpdate.NoCache = false
AUpdate.Sort = 0
AUpdate.Visible = "1"
AUpdate.IsFrame = "0"
AUpdate.CreateBy = "1"
AUpdate.UpdateBy = "1"
AUpdate.CreatedAt = timeNow
AUpdate.UpdatedAt = timeNow
AUpdate.MenuId, err = AUpdate.Create()
ADelete := models.Menu{}
ADelete.MenuName = tab.TBName
ADelete.Title = "删除" + tab.TableComment
ADelete.Icon = "bug"
ADelete.Path = "/api/v1/" + tab.ModuleName + "/:id"
ADelete.MenuType = "A"
ADelete.Action = "DELETE"
ADelete.ParentId = Amenu.MenuId
ADelete.NoCache = false
ADelete.Sort = 0
ADelete.Visible = "1"
ADelete.IsFrame = "0"
ADelete.CreateBy = "1"
ADelete.UpdateBy = "1"
ADelete.CreatedAt = timeNow
ADelete.UpdatedAt = timeNow
ADelete.MenuId, err = ADelete.Create()
app.OK(c, "", "数据生成成功!")
}
+12 -5
View File
@@ -24,11 +24,11 @@ func GetSysTableList(c *gin.Context) {
var pageIndex = 1
if size := c.Request.FormValue("pageSize"); size != "" {
pageSize = tools2.StrToInt(err, size)
pageSize, err = tools2.StringToInt(size)
}
if index := c.Request.FormValue("pageIndex"); index != "" {
pageIndex = tools2.StrToInt(err, index)
pageIndex, err = tools2.StringToInt(index)
}
data.TBName = c.Request.FormValue("tableName")
@@ -54,7 +54,7 @@ func GetSysTableList(c *gin.Context) {
// @Param configKey path int true "configKey"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/sys/tables/info/{tableId} [get]
// @Security
// @Security Bearer
func GetSysTables(c *gin.Context) {
var data tools.SysTables
data.TableId, _ = tools2.StringToInt(c.Param("tableId"))
@@ -168,8 +168,15 @@ func genTableInit(tablesList []string, i int, c *gin.Context) (tools.SysTables,
}
if strings.Contains(dbcolumn[i].ColumnType, "int") {
column.GoType = "int"
if strings.Contains(dbcolumn[i].ColumnKey, "PR") {
column.GoType = "int"
} else {
column.GoType = "string"
}
column.HtmlType = "input"
} else if strings.Contains(dbcolumn[i].ColumnType, "timestamp") {
column.GoType = "time.Time"
column.HtmlType = "datetime"
} else {
column.GoType = "string"
column.HtmlType = "input"
@@ -185,7 +192,7 @@ func genTableInit(tablesList []string, i int, c *gin.Context) (tools.SysTables,
// @Tags 工具 - 生成表
// @Accept application/json
// @Product application/json
// @Param data body models.Dept true "body"
// @Param data body tools.SysTables true "body"
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /api/v1/sys/tables/info [put]
+54 -40
View File
@@ -4,14 +4,16 @@ import (
"context"
"fmt"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go-admin/database"
"go-admin/global/orm"
"go-admin/global"
"go-admin/jobs"
mycasbin "go-admin/pkg/casbin"
"go-admin/pkg/logger"
"go-admin/router"
"go-admin/tools"
config2 "go-admin/tools/config"
"go-admin/tools/config"
"io/ioutil"
"net/http"
"os"
@@ -20,15 +22,15 @@ import (
)
var (
config string
port string
mode string
StartCmd = &cobra.Command{
Use: "server",
Short: "Start API server",
Example: "go-admin server config/settings.yml",
configYml string
port string
mode string
StartCmd = &cobra.Command{
Use: "server",
Short: "Start API server",
Example: "go-admin server -c config/settings.yml",
SilenceUsage: true,
PreRun: func(cmd *cobra.Command, args []string) {
usage()
setup()
},
RunE: func(cmd *cobra.Command, args []string) error {
@@ -37,76 +39,88 @@ var (
}
)
var echoTimes int
func init() {
StartCmd.PersistentFlags().StringVarP(&config, "config", "c", "config/settings.yml", "Start server with provided configuration file")
StartCmd.PersistentFlags().StringVarP(&configYml, "config", "c", "config/settings.yml", "Start server with provided configuration file")
StartCmd.PersistentFlags().StringVarP(&port, "port", "p", "8000", "Tcp port server listening on")
StartCmd.PersistentFlags().StringVarP(&mode, "mode", "m", "dev", "server mode ; eg:dev,test,prod")
}
func usage() {
usageStr := `starting api server`
log.Printf("%s\n", usageStr)
}
func setup() {
//1. 读取配置
config2.ConfigSetup(config)
config.Setup(configYml)
//2. 设置日志
tools.InitLogger()
logger.Setup()
//3. 初始化数据库链接
database.Setup()
database.Setup(config.DatabaseConfig.Driver)
//4. 接口访问控制加载
mycasbin.Setup()
usageStr := `starting api server`
global.Logger.Info(usageStr)
}
func run() error {
if mode != "" {
config2.SetConfig(config, "settings.application.mode", mode)
}
if viper.GetString("settings.application.mode") == string(tools.ModeProd) {
gin.SetMode(gin.ReleaseMode)
}
r := router.InitRouter()
defer orm.Eloquent.Close()
if port != "" {
config2.SetConfig(config, "settings.application.port", port)
}
defer global.Eloquent.Close()
srv := &http.Server{
Addr: config2.ApplicationConfig.Host + ":" + config2.ApplicationConfig.Port,
Addr: config.ApplicationConfig.Host + ":" + config.ApplicationConfig.Port,
Handler: r,
}
go func() {
jobs.InitJob()
jobs.Setup()
}()
go func() {
// 服务连接
if config2.ApplicationConfig.IsHttps {
if err := srv.ListenAndServeTLS(config2.SslConfig.Pem, config2.SslConfig.KeyStr); err != nil && err != http.ErrServerClosed {
log.Fatalf("listen: %s\n", err)
if config.SslConfig.Enable {
if err := srv.ListenAndServeTLS(config.SslConfig.Pem, config.SslConfig.KeyStr); err != nil && err != http.ErrServerClosed {
global.Logger.Fatal("listen: ", err)
}
} else {
if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed {
log.Fatalf("listen: %s\n", err)
global.Logger.Fatal("listen: ", err)
}
}
}()
content, _ := ioutil.ReadFile("./static/go-admin.txt")
fmt.Println(string(content))
fmt.Printf("%s Server Run http://127.0.0.1:%s/ \r\n", tools.GetCurrntTimeStr(), config2.ApplicationConfig.Port)
fmt.Printf("%s Swagger URL http://127.0.0.1:%s/swagger/index.html \r\n", tools.GetCurrntTimeStr(), config2.ApplicationConfig.Port)
fmt.Printf("%s Enter Control + C Shutdown Server \r\n", tools.GetCurrntTimeStr())
fmt.Println(tools.Red(string(content)))
tip()
fmt.Println(tools.Green("Server run at:"))
fmt.Printf("- Local: http://localhost:%s/ \r\n", config.ApplicationConfig.Port)
fmt.Printf("- Network: http://%s:%s/ \r\n", tools.GetLocaHonst(), config.ApplicationConfig.Port)
fmt.Println(tools.Green("Swagger run at:"))
fmt.Printf("- Local: http://localhost:%s/swagger/index.html \r\n", config.ApplicationConfig.Port)
fmt.Printf("- Network: http://%s:%s/swagger/index.html \r\n", tools.GetLocaHonst(), config.ApplicationConfig.Port)
fmt.Printf("%s Enter Control + C Shutdown Server \r\n", tools.GetCurrentTimeStr())
// 等待中断信号以优雅地关闭服务器(设置 5 秒的超时时间)
quit := make(chan os.Signal)
signal.Notify(quit, os.Interrupt)
<-quit
fmt.Printf("%s Shutdown Server ... \r\n", tools.GetCurrntTimeStr())
fmt.Printf("%s Shutdown Server ... \r\n", tools.GetCurrentTimeStr())
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if err := srv.Shutdown(ctx); err != nil {
log.Fatal("Server Shutdown:", err)
global.Logger.Fatal("Server Shutdown:", err)
}
log.Println("Server exiting")
global.Logger.Println("Server exiting")
return nil
}
func tip() {
usageStr := `欢迎使用 ` + tools.Green(`go-admin `+global.Version) + ` 可以使用 ` + tools.Red(`-h`) + ` 查看命令`
fmt.Printf("%s \n\n", usageStr)
}
+18 -6
View File
@@ -2,35 +2,47 @@ package cmd
import (
"errors"
"fmt"
"github.com/spf13/cobra"
"go-admin/cmd/api"
"go-admin/cmd/config"
"go-admin/cmd/migrate"
log "github.com/sirupsen/logrus"
"go-admin/cmd/version"
"go-admin/global"
"go-admin/tools"
"os"
)
var rootCmd = &cobra.Command{
Use: "go-admin",
Short: "-v",
Short: "go-admin",
SilenceUsage: true,
DisableAutoGenTag: true,
Long: `go-admin`,
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("requires at least one arg")
tip()
return errors.New(tools.Red("requires at least one arg"))
}
return nil
},
PersistentPreRunE: func(*cobra.Command, []string) error { return nil },
Run: func(cmd *cobra.Command, args []string) {
usageStr := `go-admin 1.0.0 欢迎使用,可以是用 -h 查看命令`
log.Printf("%s\n", usageStr)
tip()
},
}
func tip() {
usageStr := `欢迎使用 `+ tools.Green( `go-admin ` +global.Version) + ` 可以使用 ` + tools.Red(`-h`) + ` 查看命令`
usageStr1 := `也可以参考 http://doc.zhangwj.com/go-admin-site/guide/ksks.html 里边的【启动】章节`
fmt.Printf("%s\n", usageStr)
fmt.Printf("%s\n", usageStr1)
}
func init() {
rootCmd.AddCommand(api.StartCmd)
rootCmd.AddCommand(migrate.StartCmd)
rootCmd.AddCommand(version.StartCmd)
rootCmd.AddCommand(config.StartCmd)
}
//Execute : apply commands
+61
View File
@@ -0,0 +1,61 @@
package config
import (
"encoding/json"
"fmt"
"go-admin/tools/config"
"github.com/spf13/cobra"
)
var (
configYml string
mode string
StartCmd = &cobra.Command{
Use: "config",
Short: "Get Application config info",
Example: "go-admin config -c config/settings.yml",
Run: func(cmd *cobra.Command, args []string) {
run()
},
}
)
func init() {
StartCmd.PersistentFlags().StringVarP(&configYml, "config", "c", "config/settings.yml", "Start server with provided configuration file")
}
func run() {
config.Setup(configYml)
application, errs := json.MarshalIndent(config.ApplicationConfig, "", " ") //转换成JSON返回的是byte[]
if errs != nil {
fmt.Println(errs.Error())
}
fmt.Println("application:", string(application))
jwt, errs := json.MarshalIndent(config.JwtConfig, "", " ") //转换成JSON返回的是byte[]
if errs != nil {
fmt.Println(errs.Error())
}
fmt.Println("jwt:", string(jwt))
database, errs := json.MarshalIndent(config.DatabaseConfig, "", " ") //转换成JSON返回的是byte[]
if errs != nil {
fmt.Println(errs.Error())
}
fmt.Println("database:", string(database))
gen, errs := json.MarshalIndent(config.GenConfig, "", " ") //转换成JSON返回的是byte[]
if errs != nil {
fmt.Println(errs.Error())
}
fmt.Println("gen:", string(gen))
loggerConfig, errs := json.MarshalIndent(config.LoggerConfig, "", " ") //转换成JSON返回的是byte[]
if errs != nil {
fmt.Println(errs.Error())
}
fmt.Println("logger:", string(loggerConfig))
}
+17 -18
View File
@@ -2,23 +2,23 @@ package migrate
import (
"fmt"
log "github.com/sirupsen/logrus"
"go-admin/database"
"go-admin/global/orm"
"go-admin/global"
"go-admin/models"
"go-admin/models/gorm"
"go-admin/tools"
config2 "go-admin/tools/config"
"go-admin/pkg/logger"
"go-admin/tools/config"
"github.com/spf13/cobra"
)
var (
config string
mode string
StartCmd = &cobra.Command{
configYml string
mode string
StartCmd = &cobra.Command{
Use: "init",
Short: "initialize the database",
Short: "Initialize the database",
Example: "go-admin init -c config/settings.yml",
Run: func(cmd *cobra.Command, args []string) {
run()
},
@@ -26,7 +26,7 @@ var (
)
func init() {
StartCmd.PersistentFlags().StringVarP(&config, "config", "c", "config/settings.yml", "Start server with provided configuration file")
StartCmd.PersistentFlags().StringVarP(&configYml, "config", "c", "config/settings.yml", "Start server with provided configuration file")
StartCmd.PersistentFlags().StringVarP(&mode, "mode", "m", "dev", "server mode ; eg:dev,test,prod")
}
@@ -34,26 +34,25 @@ func run() {
usage := `start init`
fmt.Println(usage)
//1. 读取配置
config2.ConfigSetup(config)
config.Setup(configYml)
//2. 设置日志
tools.InitLogger()
logger.Setup()
//3. 初始化数据库链接
database.Setup()
database.Setup(config.DatabaseConfig.Driver)
//4. 数据库迁移
_ = migrateModel()
log.Println("数据库结构初始化成功!")
fmt.Println("数据库结构初始化成功!")
//5. 数据初始化完成
if err := models.InitDb(); err != nil {
log.Fatal("数据库基础数据初始化失败!")
global.Logger.Fatal("数据库基础数据初始化失败!")
}
usage = `数据库基础数据初始化成功`
fmt.Println(usage)
}
func migrateModel() error {
if config2.DatabaseConfig.Dbtype == "mysql" {
orm.Eloquent = orm.Eloquent.Set("gorm:table_options", "ENGINE=InnoDB CHARSET=utf8mb4")
if config.DatabaseConfig.Driver == "mysql" {
global.Eloquent = global.Eloquent.Set("gorm:table_options", "ENGINE=InnoDB CHARSET=utf8mb4")
}
return gorm.AutoMigrate(orm.Eloquent)
return gorm.AutoMigrate(global.Eloquent)
}
+30
View File
@@ -0,0 +1,30 @@
package version
import (
"fmt"
"github.com/spf13/cobra"
"go-admin/global"
)
var (
configYml string
port string
mode string
StartCmd = &cobra.Command{
Use: "version",
Short: "Get version info",
Example: "go-admin version",
PreRun: func(cmd *cobra.Command, args []string) {
},
RunE: func(cmd *cobra.Command, args []string) error {
return run()
},
}
)
func run() error {
fmt.Println(global.Version)
return nil
}
+454 -660
View File
File diff suppressed because it is too large Load Diff
+11
View File
@@ -0,0 +1,11 @@
-- 开始初始化数据 ;
select setval('sys_role_role_id_seq',4);
select setval('sys_user_user_id_seq',5);
select setval('sys_post_post_id_seq',4);
select setval('sys_menu_menu_id_seq',268);
select setval('sys_dict_type_dict_id_seq',12);
select setval('sys_dict_data_dict_code_seq',32);
select setval('sys_dept_dept_id_seq',11);
select setval('sys_config_config_id_seq',4);
select setval('sys_job_id_seq',3);
-- 数据完成 ;
-11
View File
@@ -1,11 +0,0 @@
[request_definition]
r = sub, obj, act
[policy_definition]
p = sub, obj, act
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
m = r.sub == p.sub && (keyMatch2(r.obj, p.obj) || keyMatch(r.obj, p.obj)) && (r.act == p.act || p.act == "*")
+56
View File
@@ -0,0 +1,56 @@
settings:
application:
# dev开发环境 test测试环境 prod线上环境
mode: dev
# 服务器ip,默认使用 0.0.0.0
host: 0.0.0.0
# 服务名称
name: testApp
# 端口号
port: 8000 # 服务端口号
readtimeout: 1
writertimeout: 2
# 数据权限功能开关
enabledp: false
ssl:
# https对应的域名
domain: localhost:8000
# https开关
enable: false
# ssl 证书key
key: keystring
# ssl 证书路径
pem: temp/pem.pem
logger:
# 日志存放路径
path: temp/logs
# 控制台日志
stdout: true
# 日志等级
level: all
# 业务日志开关
enabledbus: false
# 请求日志开关
enabledreq: false
# 数据库日志开关 dev模式,将自动开启
enableddb: false
# 自动任务日志开关 dev模式,将自动开启
enabledjob: false
jwt:
# token 密钥,生产环境时及的修改
secret: go-admin
# token 过期时间 单位:秒
timeout: 3600
database:
# 数据库类型 mysql,sqlite3, postgres
driver: mysql
# 数据库连接字符串 mysql 缺省信息 charset=utf8&parseTime=True&loc=Local&timeout=1000ms
source: user:password@tcp(127.0.0.1:3306)/dbname?charset=utf8&parseTime=True&loc=Local&timeout=1000ms
# source: sqlite3.db
# source: host=myhost port=myport user=gorm dbname=gorm password=mypassword
gen:
# 代码生成读取的数据库名称
dbname: dbname
# 代码生成是使用前端代码存放位置,需要指定到src文件夹,相对路径
frontpath: ../go-admin-ui/src
>>>>>>> c396f318ef0649f7231b8ee7b2a70d26159c19c2
+34 -16
View File
@@ -1,26 +1,44 @@
settings:
application:
mode: dev # dev开发环境 test测试环境 prod线上环境
# dev开发环境 test测试环境 prod线上环境
mode: dev
# 服务器ip,默认使用 0.0.0.0
host: 0.0.0.0
# 服务名称
name: testApp
port: 8000
# 端口号
port: 8000 # 服务端口号
readtimeout: 1
writertimeout: 2
domain: localhost:8000
ishttps: false
ssl:
key: keystring
pem: temp/pem.pem
log:
operdb: false
dir: temp/logs
# 数据权限功能开关
enabledp: false
logger:
# 日志存放路径
path: temp/logs
# 控制台日志
stdout: true
# 日志等级
level: all
# 业务日志开关
enabledbus: true
# 请求日志开关
enabledreq: false
# 数据库日志开关 dev模式,将自动开启
enableddb: false
# 自动任务日志开关 dev模式,将自动开启
enabledjob: false
jwt:
# token 密钥,生产环境时及的修改
secret: go-admin
# token 过期时间 单位:秒
timeout: 3600
database:
name: goadmindb
dbtype: mysql
host: 127.0.0.1
password: 123456
port: 3306
username: root
# 数据库类型 mysql,sqlite3, postgres
driver: mysql
# 数据库连接字符串 mysql 缺省信息 charset=utf8&parseTime=True&loc=Local&timeout=1000ms
source: user:password@tcp(127.0.0.1:3306)/dbname?charset=utf8&parseTime=True&loc=Local&timeout=1000ms
gen:
# 代码生成读取的数据库名称
dbname: dbname
# 代码生成是使用前端代码存放位置,需要指定到src文件夹,相对路径
frontpath: ../go-admin-ui/src
-662
View File
@@ -1,662 +0,0 @@
PRAGMA synchronous = OFF;
PRAGMA journal_mode = MEMORY;
BEGIN TRANSACTION;
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/calendar', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/calendar', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/calendar/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/calendar/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/config', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/config/', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/config/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/config/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/configKey/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/configList', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dept', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dept', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dept/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dept/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/deptList', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/data', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/data/', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/data/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/data/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/databytype/', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/databytype/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/datalist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/type', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/type', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/type/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/type/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/dict/typelist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/doctor', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/doctor', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/doctor/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/doctor/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/doctor/pic/', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/getinfo', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/loginlog/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/loginloglist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/member', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/member', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/member/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/member/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/menu', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/menu/', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/menu/', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/menu/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/menu/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/menuids', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/menulist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/menurole', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/menuTreeselect', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/operloglist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/orders', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/orders', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/orders/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/orders/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/orders/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/post', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/post', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/post/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/post/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/postlist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/role', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/role', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/role/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/role/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/rolelist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/rolemenu', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/rolemenu', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/rolemenu/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/roleMenuTreeselect/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/sysUser/', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/sysUser/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/sysUserList', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'common', '/api/v1/user/profile', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/calendar', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/calendar', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/calendar/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/calendar/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/config', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/config', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/config/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/config/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/configKey/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/configList', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dept', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dept', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dept/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dept/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/deptList', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/deptTree', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/data', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/data/', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/data/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/data/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/databytype/', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/databytype/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/datalist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/type', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/type', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/type/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/type/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/typelist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/dict/typeoptionselect', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/doctor', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/doctor', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/doctor/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/doctor/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/doctor/pic/', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/getinfo', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/loginlog/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/loginloglist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/logout', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/member', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/member', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/member/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/member/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/menu', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/menu', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/menu/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/menu/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/menuids', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/menulist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/menurole', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/menuTreeselect', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/operloglist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/orders', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/orders', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/orders/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/orders/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/orders/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/post', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/post', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/post/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/post/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/postlist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/role', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/role', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/role/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/role/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/roledatascope', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/roleDeptTreeselect/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/rolelist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/rolemenu', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/rolemenu', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/rolemenu/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/roleMenuTreeselect/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/user/avatar', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'Tester', '/api/v1/user/pwd', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/sysUserList', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menulist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menu', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/databytype/', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menu', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menu/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/sysUserList', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/sysUser/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/sysUser/', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/sysUser', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/sysUser', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/sysUser/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/user/profile', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/rolelist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/role/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/role', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/role', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/role/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/configList', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/config/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/configKey/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/config', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/config', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/config/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menurole', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/roleMenuTreeselect/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menuTreeselect', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/rolemenu', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/rolemenu', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/rolemenu/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/doctor', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/doctor', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/doctor/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/doctor/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/doctor/pic/', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/deptList', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dept/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dept', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dept', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dept/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/datalist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/data/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/databytype/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/data', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/data/', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/data/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/typelist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/type/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/type', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/type', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/type/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/postlist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/post/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/post', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/post', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/post/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/calendar', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/calendar', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/calendar/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/calendar/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/member', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/member', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/member/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/member/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/orders', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/orders/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/orders', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/orders/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/orders/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menulist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menu/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menu', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menu/:id', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menu/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/menuids', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/loginloglist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/loginlog/:id', 'DELETE', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/operloglist', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/getinfo', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/roledatascope', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/roleDeptTreeselect/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/deptTree', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/configKey/:id', 'GET', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/logout', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/user/avatar', 'POST', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/user/pwd', 'PUT', NULL, NULL, NULL);
INSERT INTO `casbin_rule` VALUES ('p', 'admin', '/api/v1/dict/typeoptionselect', 'GET', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (341, 20, 'table_id', '表编码', 'int(11)', 'int64', 'TableId', 'tableId', '1', '', '1', '1', '', '', '', 'EQ', 'input', '', 1, '', '1', '1', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (342, 20, 'table_name', '表名称', 'varchar(255)', 'string', 'TableName', 'tableName', '0', '', '0', '1', '', '1', '1', 'EQ', 'input', '', 2, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (343, 20, 'table_comment', '表备注', 'varchar(255)', 'string', 'TableComment', 'tableComment', '0', '', '0', '1', '', '1', '1', 'EQ', 'input', '', 3, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (344, 20, 'class_name', '类名', 'varchar(255)', 'string', 'ClassName', 'className', '0', '', '0', '1', '', '1', '1', 'EQ', 'input', '', 4, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (345, 20, 'tpl_category', '模板类型', 'varchar(255)', 'string', 'TplCategory', 'tplCategory', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 5, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (346, 20, 'package_name', '包名', 'varchar(255)', 'string', 'PackageName', 'packageName', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 6, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (347, 20, 'module_name', '模块名', 'varchar(255)', 'string', 'ModuleName', 'moduleName', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 7, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (348, 20, 'business_name', '业务名', 'varchar(255)', 'string', 'BusinessName', 'businessName', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 8, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (349, 20, 'function_name', '功能名称', 'varchar(255)', 'string', 'FunctionName', 'functionName', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 9, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (350, 20, 'function_author', '功能作者', 'varchar(255)', 'string', 'FunctionAuthor', 'functionAuthor', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 10, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (351, 20, 'pk_column', '主键列名', 'varchar(255)', 'string', 'PkColumn', 'pkColumn', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 11, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (352, 20, 'pk_go_field', '主键go类型名', 'varchar(255)', 'string', 'PkGoField', 'pkGoField', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 12, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (353, 20, 'pk_json_field', '主键json名', 'varchar(255)', 'string', 'PkJsonField', 'pkJsonField', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 13, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (354, 20, 'options', '', 'varchar(255)', 'string', 'Options', 'options', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 14, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (355, 20, 'tree_code', '树编码', 'varchar(255)', 'string', 'TreeCode', 'treeCode', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 15, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (356, 20, 'tree_parent_code', '树上级编码', 'varchar(255)', 'string', 'TreeParentCode', 'treeParentCode', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 16, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (357, 20, 'tree_name', '树显示名', 'varchar(255)', 'string', 'TreeName', 'treeName', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 17, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (358, 20, 'tree', '是否是树', 'char(1)', 'string', 'Tree', 'tree', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 18, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (359, 20, 'crud', '是否crud', 'char(1)', 'string', 'Crud', 'crud', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 19, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (360, 20, 'remark', '备注', 'varchar(255)', 'string', 'Remark', 'remark', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 20, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (361, 20, 'create_by', '', 'varchar(128)', 'string', 'CreateBy', 'createBy', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 21, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (362, 20, 'create_time', '', 'datetime', 'string', 'CreateTime', 'createTime', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 22, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (363, 20, 'update_by', '', 'varchar(128)', 'string', 'UpdateBy', 'updateBy', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 23, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (364, 20, 'update_time', '', 'datetime', 'string', 'UpdateTime', 'updateTime', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 24, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (365, 20, 'is_logical_delete', '是否逻辑删除', 'char(4)', 'string', 'IsLogicalDelete', 'isLogicalDelete', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 25, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (366, 20, 'logical_delete_column', '逻辑删除字段', 'varchar(128)', 'string', 'LogicalDeleteColumn', 'logicalDeleteColumn', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 26, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_columns` VALUES (367, 20, 'logical_delete', '', 'char(1)', 'string', 'LogicalDelete', 'logicalDelete', '0', '', '0', '1', '', '', '', 'EQ', 'input', '', 27, '', '0', '0', '0', '0', '0', '1', '0', '0', '', '', '', NULL, NULL, NULL);
INSERT INTO `sys_config` VALUES (1, '主框架页-默认皮肤样式名称', 'sys_index_skinName', 'skin-blue', 'Y', '蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow', '1', '1', '2020-02-29 10:37:48', '2020-04-08 13:03:21', NULL);
INSERT INTO `sys_config` VALUES (2, '用户管理-账号初始密码', 'sys.user.initPassword', '123456', 'Y', '初始化密码 123456', '1', '1', '2020-02-29 10:38:23', '2020-03-11 00:35:28', NULL);
INSERT INTO `sys_config` VALUES (3, '主框架页-侧边栏主题', 'sys_index_sideTheme', 'theme-dark', 'Y', '深色主题theme-dark,浅色主题theme-light', '1', '1', '2020-02-29 10:39:01', '2020-04-07 23:21:50', NULL);
INSERT INTO `sys_dept` VALUES (1, 0, '/0/1', '爱拓科技', 0, 'aituo', '13782218188', 'atuo@aituo.com', 0, '1', '1', '2020-02-27 15:30:19', '2020-03-10 21:09:21', NULL);
INSERT INTO `sys_dept` VALUES (7, 1, '/0/1/7', '研发部', 1, '', '', '', 0, '1', '1', '2020-03-08 23:10:59', '2020-04-08 13:00:03', NULL);
INSERT INTO `sys_dept` VALUES (8, 1, '/0/1/8', '运维部', 0, '', '', '', 0, '1', NULL, '2020-03-08 23:11:08', '2020-03-10 16:50:27', NULL);
INSERT INTO `sys_dept` VALUES (9, 1, '/0/1/9', '客服部', 0, '', '', '', 0, '1', NULL, '2020-03-08 23:11:15', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dept` VALUES (10, 1, '/0/1/10', '人力资源', 3, '张三', '', '', 1, '1', '1', '2020-04-07 23:48:38', '2020-04-07 23:48:46', NULL);
INSERT INTO `sys_dict_data` VALUES (1, 0, '正常', '0', 'sys_normal_disable', '', '', '', 0, '', '1', '', '系统正常', '2020-02-28 20:55:34', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (2, 0, '停用', '1', 'sys_normal_disable', '', '', '', 0, '', '1', '', '系统停用', '2020-02-28 21:10:41', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (3, 0, '男', '0', 'sys_user_sex', '', '', '', 0, '', '1', '', '性别男', '2020-02-28 21:37:28', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (4, 0, '女', '1', 'sys_user_sex', '', '', '', 0, '', '1', '', '性别女', '2020-02-28 21:37:40', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (5, 0, '未知', '2', 'sys_user_sex', '', '', '', 0, '', '1', '', '性别未知', '2020-02-28 21:38:05', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (6, 0, '显示', '0', 'sys_show_hide', '', '', '', 0, '', '1', '', '显示菜单', '2020-02-28 21:38:36', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (7, 0, '隐藏', '1', 'sys_show_hide', '', '', '', 0, '', '1', '', '隐藏菜单', '2020-02-28 21:38:50', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (8, 0, '是', 'Y', 'sys_yes_no', '', '', '', 0, '', '1', '', '系统默认是', '2020-02-28 21:39:40', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (9, 0, '否', 'N', 'sys_yes_no', '', '', '', 0, '', '1', '', '系统默认否', '2020-02-28 21:40:06', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (10, 0, '正常', '0', 'sys_job_status', '', '', '', 0, '', '1', '', '正常状态', '2020-02-28 21:41:02', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (11, 0, '停用', '1', 'sys_job_status', '', '', '', 0, '', '1', '', '停用状态', '2020-02-28 21:41:15', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (12, 0, '默认', 'DEFAULT', 'sys_job_group', '', '', '', 0, '', '1', '', '默认分组', '2020-02-28 21:41:48', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (13, 0, '系统', 'SYSTEM', 'sys_job_group', '', '', '', 0, '', '1', '', '系统分组', '2020-02-28 21:42:02', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (14, 0, '通知', '1', 'sys_notice_type', '', '', '', 0, '', '1', '', '通知', '2020-02-28 21:42:43', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (15, 0, '公告', '2', 'sys_notice_type', '', '', '', 0, '', '1', '', '公告', '2020-02-28 21:42:53', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (16, 0, '正常', '0', 'sys_common_status', '', '', '', 0, '', '1', '', '正常状态', '2020-02-28 21:43:21', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (17, 0, '关闭', '1', 'sys_common_status', '', '', '', 0, '', '1', '', '关闭状态', '2020-02-28 21:43:31', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (18, 0, '新增', '1', 'sys_oper_type', '', '', '', 0, '', '1', '', '新增操作', '2020-02-28 21:44:14', '2020-02-28 22:00:22', NULL);
INSERT INTO `sys_dict_data` VALUES (19, 0, '修改', '2', 'sys_oper_type', '', '', '', 0, '', '1', '', '修改操作', '2020-02-28 21:44:34', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (20, 0, '删除', '3', 'sys_oper_type', '', '', '', 0, '', '1', '', '删除操作', '2020-02-28 21:44:52', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (21, 0, '授权', '4', 'sys_oper_type', '', '', '', 0, '', '1', '', '授权操作', '2020-02-28 21:45:18', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (22, 0, '导出', '5', 'sys_oper_type', '', '', '', 0, '', '1', '', '导出操作', '2020-02-28 21:45:44', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (23, 0, '导入', '6', 'sys_oper_type', '', '', '', 0, '', '1', '', '导入操作', '2020-02-28 21:46:02', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (24, 0, '强退', '7', 'sys_oper_type', '', '', '', 0, '', '1', '', '强退操作', '2020-02-28 21:46:25', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (25, 0, '生成代码', '8', 'sys_oper_type', '', '', '', 0, '', '1', '', '生成操作', '2020-02-28 21:46:53', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (26, 0, '清空数据', '9', 'sys_oper_type', '', '', '', 0, '', '1', '', '清空操作', '2020-02-28 21:47:15', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (27, 0, '成功', '0', 'sys_notice_status', '', '', '', 0, '', '1', '', '成功状态', '2020-02-28 22:03:24', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (28, 0, '失败', '1', 'sys_notice_status', '', '', '', 0, '', '1', '', '失败状态', '2020-02-28 22:03:39', '2020-03-08 23:11:15', NULL);
INSERT INTO `sys_dict_data` VALUES (29, 0, '登录', '10', 'sys_oper_type', '', '', '', 0, '', '1', '1', '登录操作', '2020-03-15 18:35:23', '2020-03-15 18:39:30', NULL);
INSERT INTO `sys_dict_data` VALUES (30, 0, '退出', '11', 'sys_oper_type', '', '', '', 0, '', '1', '', '', '2020-03-15 18:35:39', '2020-03-15 18:35:39', NULL);
INSERT INTO `sys_dict_data` VALUES (31, 0, '获取验证码', '12', 'sys_oper_type', '', '', '', 0, '', '1', '', '获取验证码', '2020-03-15 18:38:42', '2020-03-15 18:35:39', NULL);
INSERT INTO `sys_dict_type` VALUES (1, '系统开关', 'sys_normal_disable', 0, '1', '1', '系统开关列表', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (2, '用户性别', 'sys_user_sex', 0, '1', '', '用户性别列表', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (3, '菜单状态', 'sys_show_hide', 0, '1', '', '菜单状态列表', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (4, '系统是否', 'sys_yes_no', 0, '1', '', '系统是否列表', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (5, '任务状态', 'sys_job_status', 0, '1', '', '任务状态列表', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (6, '任务分组', 'sys_job_group', 0, '1', '', '任务分组列表', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (7, '通知类型', 'sys_notice_type', 0, '1', '', '通知类型列表', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (8, '系统状态', 'sys_common_status', 0, '1', '', '登录状态列表', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (9, '操作类型', 'sys_oper_type', 0, '1', '', '操作类型列表', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (10, '通知状态', 'sys_notice_status', 0, '1', '', '通知状态列表', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_dict_type` VALUES (11, '1', '1', 1, '1', '1', '1', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (2, 'Upms', '系统管理', 'example', '/upms', '/0/2', 'M', '无', '', 0, '1', '', 'Layout', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (3, 'Sysuser', '用户管理', 'user', 'sysuser', '/0/2/3', 'C', '无', 'system:sysuser:list', 2, NULL, NULL, '/sysuser/index', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:10:42', NULL);
INSERT INTO `sys_menu` VALUES (43, NULL, '新增用户', NULL, '/api/v1/sysuser', '/0/2/3/43', 'F', 'POST', 'system:sysuser:add', 3, NULL, NULL, NULL, 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (44, NULL, '查询用户', NULL, '/api/v1/sysuser', '/0/2/3/44', 'F', 'GET', 'system:sysuser:query', 3, NULL, NULL, NULL, 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (45, NULL, '修改用户', NULL, '/api/v1/sysuser/', '/0/2/3/45', 'F', 'PUT', 'system:sysuser:edit', 3, NULL, NULL, NULL, 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (46, NULL, '删除用户', NULL, '/api/v1/sysuser/', '/0/2/3/46', 'F', 'DELETE', 'system:sysuser:remove', 3, NULL, NULL, NULL, 0, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 15:32:45', NULL);
INSERT INTO `sys_menu` VALUES (50, 'Mangent', '基础信息', 'network', '/mangent', '/0/50', 'M', '无', '', 0, '1', '', 'Layout', 2, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (51, 'Menu', '菜单管理', 'tree-table', 'menu', '/0/2/51', 'C', '无', 'system:sysmenu:list', 2, '1', '', '/menu/index', 3, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:16:30', NULL);
INSERT INTO `sys_menu` VALUES (52, 'Role', '角色管理', 'peoples', 'role', '/0/2/52', 'C', '无', 'system:sysrole:list', 2, '1', '', '/role/index', 2, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:16:19', NULL);
INSERT INTO `sys_menu` VALUES (53, 'Doctor', '医生管理', 'pass', 'doctor', '/0/50/53', 'C', '无', '', 50, '1', '', '/doctor/index', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (54, 'Calendar', '排班管理', 'calendar', 'calendar', '/0/50/54', 'C', '无', '', 50, '1', '', '/calendar/index', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (55, 'Menber', '会员管理', 'vip', 'member', '/0/50/55', 'C', '无', '', 50, '1', '', '/member/index', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (56, 'Dept', '部门管理', 'tree', 'dept', '/0/2/56', 'C', '无', 'system:sysdept:list', 2, '0', '', '/dept/index', 4, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:16:47', NULL);
INSERT INTO `sys_menu` VALUES (57, 'post', '岗位管理', 'pass', 'post', '/0/2/57', 'C', '无', 'system:syspost:list', 2, '0', '', '/post/index', 5, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:16:53', NULL);
INSERT INTO `sys_menu` VALUES (58, 'Dict', '字典管理', 'education', 'dict', '/0/2/58', 'C', '无', 'system:sysdicttype:list', 2, '0', '', '/dict/index', 6, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:17:04', NULL);
INSERT INTO `sys_menu` VALUES (59, 'DictData', '字典数据', 'education', 'dict/data/:dictId', '/0/2/59', 'C', '无', 'system:sysdictdata:list', 2, '0', '', '/dict/data', 100, '1', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:17:25', NULL);
INSERT INTO `sys_menu` VALUES (60, 'Tools', '系统工具', 'component', '/tools', '/0/60', 'M', '无', '', 0, '0', '', 'Layout', 3, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (61, 'Swagger', '系统接口', 'guide', 'swagger', '/0/60/61', 'C', '无', '', 60, '0', '', '/tools/swagger/index', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (62, 'Config', '参数设置', 'list', '/config', '/0/2/62', 'C', '无', 'system:sysconfig:list', 2, '0', '', '/config/index', 7, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:17:16', NULL);
INSERT INTO `sys_menu` VALUES (63, '', '接口权限', 'bug', '', '/0/63', 'M', '', '', 0, '0', '', '', 99, '1', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 16:39:32', NULL);
INSERT INTO `sys_menu` VALUES (64, '', '用户管理', 'user', '', '/0/63/64', 'M', '', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (65, NULL, '用户列表', NULL, '/api/v1/sysUserList', '', 'A', 'GET', NULL, 64, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (66, '', '菜单管理', 'tree-table', '', '/0/63/66', 'C', '', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (67, '', '菜单列表', 'tree-table', '/api/v1/menulist', '/0/63/66/67', 'A', 'GET', '', 66, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (68, '', '新建菜单', 'tree', '/api/v1/menu', '/0/63/66/68', 'A', 'POST', '', 66, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (69, '', '字典', 'dict', '', '/0/63/69', 'M', '', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (70, '', '类型', 'dict', '', '/0/63/69/70', 'C', '', '', 69, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (71, '', '字典类型获取', 'tree', '/api/v1/dict/databytype/', '/0/63/256/71', 'A', 'GET', '', 256, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (72, '', '修改菜单', 'bug', '/api/v1/menu', '/0/63/66/72', 'A', 'PUT', '', 66, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (73, '', '删除菜单', 'bug', '/api/v1/menu/:id', '/0/63/66/73', 'A', 'DELETE', '', 66, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (74, NULL, '管理员列表', 'bug', '/api/v1/sysUserList', '/0/63/64/74', 'A', 'GET', NULL, 64, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (75, NULL, '根据id获取管理员', 'bug', '/api/v1/sysUser/:id', '/0/63/64/75', 'A', 'GET', NULL, 64, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (76, NULL, '获取管理员', 'bug', '/api/v1/sysUser/', '/0/63/64/76', 'A', 'GET', NULL, 64, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (77, NULL, '创建管理员', 'bug', '/api/v1/sysUser', '/0/63/64/77', 'A', 'POST', NULL, 64, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (78, NULL, '修改管理员', 'bug', '/api/v1/sysUser', '/0/63/64/78', 'A', 'PUT', NULL, 64, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (79, NULL, '删除管理员', 'bug', '/api/v1/sysUser/:id', '/0/63/64/79', 'A', 'DELETE', NULL, 64, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (80, NULL, '当前用户个人信息', 'bug', '/api/v1/user/profile', '/0/63/64/80', 'A', 'GET', NULL, 64, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (81, NULL, '角色列表', 'bug', '/api/v1/rolelist', '/0/63/201/81', 'A', 'GET', NULL, 201, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (82, NULL, '获取角色信息', 'bug', '/api/v1/role/:id', '/0/63/201/82', 'A', 'GET', NULL, 201, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (83, NULL, '创建角色', 'bug', '/api/v1/role', '/0/63/201/83', 'A', 'POST', NULL, 201, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (84, NULL, '修改角色', 'bug', '/api/v1/role', '/0/63/201/84', 'A', 'PUT', NULL, 201, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (85, NULL, '删除角色', 'bug', '/api/v1/role/:id', '/0/63/201/85', 'A', 'DELETE', NULL, 201, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (86, NULL, '参数列表', 'bug', '/api/v1/configList', '/0/63/202/86', 'A', 'GET', NULL, 202, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (87, NULL, '根据id获取参数', 'bug', '/api/v1/config/:id', '/0/63/202/87', 'A', 'GET', NULL, 202, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (88, NULL, '根据key获取参数', 'bug', '/api/v1/configKey/:id', '/0/63/202/88', 'A', 'GET', NULL, 202, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (89, NULL, '创建参数', 'bug', '/api/v1/config', '/0/63/202/89', 'A', 'POST', NULL, 202, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (90, NULL, '修改参数', 'bug', '/api/v1/config', '/0/63/202/90', 'A', 'PUT', NULL, 202, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (91, NULL, '删除参数', 'bug', '/api/v1/config/:id', '/0/63/202/91', 'A', 'DELETE', NULL, 202, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (92, NULL, '获取角色菜单', 'bug', '/api/v1/menurole', '/0/63/201/92', 'A', 'GET', NULL, 201, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (93, NULL, '根据角色id获取角色', 'bug', '/api/v1/roleMenuTreeselect/:id', '/0/63/201/93', 'A', 'GET', NULL, 201, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (94, NULL, '获取菜单树', 'bug', '/api/v1/menuTreeselect', '/0/63/205/94', 'A', 'GET', NULL, 205, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (95, NULL, '获取角色菜单', 'bug', '/api/v1/rolemenu', '/0/63/205/95', 'A', 'GET', NULL, 205, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (96, NULL, '创建角色菜单', 'bug', '/api/v1/rolemenu', '/0/63/205/96', 'A', 'POST', NULL, 205, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (97, NULL, '删除用户菜单数据', 'bug', '/api/v1/rolemenu/:id', '/0/63/205/97', 'A', 'DELETE', NULL, 205, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (98, NULL, '医生获取', 'bug', '/api/v1/doctor', '/0/63/208/98', 'A', 'GET', NULL, 208, NULL, NULL, NULL, 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (99, NULL, '创建医生', 'bug', '/api/v1/doctor', '/0/63/208/99', 'A', 'POST', NULL, 208, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (100, NULL, '修改医生', 'bug', '/api/v1/doctor/:id', '/0/63/208/100', 'A', 'PUT', NULL, 208, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (101, NULL, '删除医生', 'bug', '/api/v1/doctor/:id', '/0/63/208/101', 'A', 'DELETE', NULL, 208, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (102, NULL, '添加医生头像', 'bug', '/api/v1/doctor/pic/', '/0/63/208/102', 'A', 'POST', NULL, 208, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (103, NULL, '部门菜单列表', 'bug', '/api/v1/deptList', '/0/63/203/103', 'A', 'GET', NULL, 203, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (104, NULL, '根据id获取部门信息', 'bug', '/api/v1/dept/:id', '/0/63/203/104', 'A', 'GET', NULL, 203, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (105, NULL, '创建部门', 'bug', '/api/v1/dept', '/0/63/203/105', 'A', 'POST', NULL, 203, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (106, NULL, '修改部门', 'bug', '/api/v1/dept', '/0/63/203/106', 'A', 'PUT', NULL, 203, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (107, NULL, '删除部门', 'bug', '/api/v1/dept/:id', '/0/63/203/107', 'A', 'DELETE', NULL, 203, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (108, NULL, '字典数据列表', 'bug', '/api/v1/dict/datalist', '/0/63/69/206/108', 'A', 'GET', NULL, 206, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (109, NULL, '通过编码获取字典数据', 'bug', '/api/v1/dict/data/:id', '/0/63/69/206/109', 'A', 'GET', NULL, 206, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (110, NULL, '通过字典类型获取字典数据', 'bug', '/api/v1/dict/databytype/:id', '/0/63/256/110', 'A', 'GET', NULL, 256, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (111, NULL, '创建字典数据', 'bug', '/api/v1/dict/data', '/0/63/69/206/111', 'A', 'POST', NULL, 206, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (112, NULL, '修改字典数据', 'bug', '/api/v1/dict/data/', '/0/63/69/206/112', 'A', 'PUT', NULL, 206, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (113, NULL, '删除字典数据', 'bug', '/api/v1/dict/data/:id', '/0/63/69/206/113', 'A', 'DELETE', NULL, 206, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (114, NULL, '字典类型列表', 'bug', '/api/v1/dict/typelist', '/0/63/69/70/114', 'A', 'GET', NULL, 70, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (115, NULL, '通过id获取字典类型', 'bug', '/api/v1/dict/type/:id', '/0/63/69/70/115', 'A', 'GET', NULL, 70, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (116, NULL, '创建字典类型', 'bug', '/api/v1/dict/type', '/0/63/69/70/116', 'A', 'POST', NULL, 70, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (117, NULL, '修改字典类型', 'bug', '/api/v1/dict/type', '/0/63/69/70/117', 'A', 'PUT', NULL, 70, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (118, NULL, '删除字典类型', 'bug', '/api/v1/dict/type/:id', '/0/63/69/70/118', 'A', 'DELETE', NULL, 70, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (119, NULL, '获取岗位列表', 'bug', '/api/v1/postlist', '/0/63/204/119', 'A', 'GET', NULL, 204, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (120, NULL, '通过id获取岗位信息', 'bug', '/api/v1/post/:id', '/0/63/204/120', 'A', 'GET', NULL, 204, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (121, NULL, '创建岗位', 'bug', '/api/v1/post', '/0/63/204/121', 'A', 'POST', NULL, 204, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (122, NULL, '修改岗位', 'bug', '/api/v1/post', '/0/63/204/122', 'A', 'PUT', NULL, 204, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (123, NULL, '删除岗位', 'bug', '/api/v1/post/:id', '/0/63/204/123', 'A', 'DELETE', NULL, 204, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (124, NULL, '获取排班信息', 'bug', '/api/v1/calendar', '/0/63/210/124', 'A', 'GET', NULL, 210, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (125, NULL, '创建排班', 'bug', '/api/v1/calendar', '/0/63/210/125', 'A', 'POST', NULL, 210, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (126, NULL, '修改排班', 'bug', '/api/v1/calendar/:id', '/0/63/210/126', 'A', 'PUT', NULL, 210, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (127, NULL, '删除排班', 'bug', '/api/v1/calendar/:id', '/0/63/210/127', 'A', 'DELETE', NULL, 210, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (128, NULL, '获取会员', 'bug', '/api/v1/member', '/0/63/207/128', 'A', 'GET', NULL, 207, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (129, NULL, '创建会员', 'bug', '/api/v1/member', '/0/63/207/129', 'A', 'POST', NULL, 207, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (130, NULL, '修改会员', 'bug', '/api/v1/member/:id', '/0/63/207/130', 'A', 'PUT', NULL, 207, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (131, NULL, '删除会员', 'bug', '/api/v1/member/:id', '/0/63/207/131', 'A', 'DELETE', NULL, 207, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (132, NULL, '获取订单', 'bug', '/api/v1/orders', '/0/63/209/132', 'A', 'GET', NULL, 209, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (133, NULL, '通过id获取订单', 'bug', '/api/v1/orders/:id', '/0/63/209/133', 'A', 'GET', NULL, 209, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (134, NULL, '新建订单', 'bug', '/api/v1/orders', '/0/63/209/134', 'A', 'POST', NULL, 209, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (135, NULL, '修改订单', 'bug', '/api/v1/orders/:id', '/0/63/209/135', 'A', 'PUT', NULL, 209, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (136, NULL, '删除订单', 'bug', '/api/v1/orders/:id', '/0/63/209/136', 'A', 'DELETE', NULL, 209, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (137, NULL, '菜单列表', 'bug', '/api/v1/menulist', '/0/63/66/137', 'A', 'GET', NULL, 66, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (138, NULL, '获取根据id菜单信息', 'bug', '/api/v1/menu/:id', '/0/63/66/138', 'A', 'GET', NULL, 66, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (139, NULL, '创建菜单', 'bug', '/api/v1/menu', '/0/63/66/139', 'A', 'POST', NULL, 66, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (140, NULL, '修改菜单', 'bug', '/api/v1/menu/:id', '/0/63/66/140', 'A', 'PUT', NULL, 66, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (141, NULL, '删除菜单', 'bug', '/api/v1/menu/:id', '', 'A', 'DELETE', NULL, 66, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (142, NULL, '获取角色对应的菜单id数组', 'bug', '/api/v1/menuids', '/0/63/256/142', 'A', 'GET', NULL, 256, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (201, '', '角色管理', 'peoples', '', '/0/63/201', 'C', 'GET', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (202, '', '参数设置', 'list', '', '/0/63/202', 'C', 'DELETE', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (203, '', '部门管理', 'tree', '', '/0/63/203', 'C', 'POST', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (204, '', '岗位管理', 'pass', '', '/0/63/204', 'C', '', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (205, '', '角色菜单管理', 'nested', '', '/0/63/205', 'C', '', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (206, '', '数据', '', '', '/0/63/69/206', 'C', 'PUT', '', 69, '0', '', '', 2, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (207, '', '会员管理', 'vip', '', '/0/63/207', 'C', 'DELETE', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (208, '', '医生管理', 'theme', '', '/0/63/208', 'C', '', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (209, '', '订单管理', 'tab', '', '/0/63/209', 'M', '', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (210, '', '排班管理', 'calendar', '', '/0/63/210', 'C', 'DELETE', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (211, 'Log', '日志管理', 'log', '/log', '/0/2/211', 'M', '', '', 2, '0', '', '/log/index', 8, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:15:32', NULL);
INSERT INTO `sys_menu` VALUES (212, 'LoginLog', '登录日志', 'logininfor', '/loginlog', '/0/2/211/212', 'C', '', 'system:sysloginlog:list', 211, '0', '', '/loginlog/index', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (213, NULL, '获取登录日志', 'bug', '/api/v1/loginloglist', '/0/63/214/213', 'A', 'GET', NULL, 214, NULL, NULL, NULL, 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (214, '', '日志管理', 'log', '', '/0/63/214', 'M', 'GET', '', 63, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (215, '', '删除日志', 'bug', '/api/v1/loginlog/:id', '/0/63/214/215', 'A', 'DELETE', '', 214, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (216, 'OperLog', '操作日志', 'skill', '/operlog', '/0/2/211/216', 'C', '', 'system:sysoperlog:list', 211, '0', '', '/operlog/index', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (217, '', '获取操作日志', 'bug', '/api/v1/operloglist', '/0/63/214/217', 'A', 'GET', '', 214, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (218, 'Calendars', '日历', 'calendar', 'calendar', '/0/60/218', 'C', '', '', 60, '0', '', '/calendar/index', 4, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:17:58', NULL);
INSERT INTO `sys_menu` VALUES (219, 'Excel', 'Excel导入', 'excel', '/excel', '/0/50/219', 'C', '', '', 50, '0', '', '/excel/upload-excel', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (220, '', '新增菜单', '', '', '/0/2/51/220', 'F', '', 'system:sysmenu:add', 51, '0', '', '', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (221, '', '修改菜单', 'edit', '', '/0/2/51/221', 'F', '', 'system:sysmenu:edit', 51, '0', '', '', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (222, '', '查询菜单', 'search', '', '/0/2/51/222', 'F', '', 'system:sysmenu:query', 51, '0', '', '', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (223, '', '删除菜单', '', '', '/0/2/51/223', 'F', '', 'system:sysmenu:remove', 51, '0', '', '', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (224, '', '新增角色', '', '', '/0/2/52/224', 'F', '', 'system:sysrole:add', 52, '0', '', '', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (225, '', '查询角色', '', '', '/0/2/52/225', 'F', '', 'system:sysrole:query', 52, '0', '', '', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (226, '', '修改角色', '', '', '/0/2/52/226', 'F', '', 'system:sysrole:edit', 52, '0', '', '', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (227, '', '删除角色', '', '', '/0/2/52/227', 'F', '', 'system:sysrole:remove', 52, '0', '', '', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (228, '', '查询部门', '', '', '/0/2/56/228', 'F', '', 'system:sysdept:query', 56, '0', '', '', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (229, '', '新增部门', '', '', '/0/2/56/229', 'F', '', 'system:sysdept:add', 56, '0', '', '', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (230, '', '修改部门', '', '', '/0/2/56/230', 'F', '', 'system:sysdept:edit', 56, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (231, '', '删除部门', '', '', '/0/2/56/231', 'F', '', 'system:sysdept:remove', 56, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (232, '', '查询岗位', '', '', '/0/2/57/232', 'F', '', 'system:syspost:query', 57, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (233, '', '新增岗位', '', '', '/0/2/57/233', 'F', '', 'system:syspost:add', 57, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (234, '', '修改岗位', '', '', '/0/2/57/234', 'F', '', 'system:syspost:edit', 57, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (235, '', '删除岗位', '', '', '/0/2/57/235', 'F', '', 'system:syspost:remove', 57, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (236, '', '字典查询', '', '', '/0/2/58/236', 'F', '', 'system:sysdicttype:query', 58, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (237, '', '新增类型', '', '', '/0/2/58/237', 'F', '', 'system:sysdicttype:add', 58, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (238, '', '修改类型', '', '', '/0/2/58/238', 'F', '', 'system:sysdicttype:edit', 58, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (239, '', '删除类型', '', '', '/0/2/58/239', 'F', '', 'system:sysdicttype:remove', 58, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (240, '', '查询数据', '', '', '/0/2/59/240', 'F', '', 'system:sysdictdata:query', 59, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (241, '', '新增数据', '', '', '/0/2/59/241', 'F', '', 'system:sysdictdata:add', 59, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (242, '', '修改数据', '', '', '/0/2/59/242', 'F', '', 'system:sysdictdata:edit', 59, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (243, '', '删除数据', '', '', '/0/2/59/243', 'F', '', 'system:sysdictdata:remove', 59, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (244, '', '查询参数', '', '', '/0/2/62/244', 'F', '', 'system:sysconfig:query', 62, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (245, '', '新增参数', '', '', '/0/2/62/245', 'F', '', 'system:sysconfig:add', 62, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (246, '', '修改参数', '', '', '/0/2/62/246', 'F', '', 'system:sysconfig:edit', 62, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (247, '', '删除参数', '', '', '/0/2/62/247', 'F', '', 'system:sysconfig:remove', 62, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (248, '', '查询登录日志', '', '', '/0/2/211/212/248', 'F', '', 'system:sysloginlog:query', 212, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (249, '', '删除登录日志', '', '', '/0/2/211/212/249', 'F', '', 'system:sysloginlog:remove', 212, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (250, '', '查询操作日志', '', '', '/0/2/211/216/250', 'F', '', 'system:sysoperlog:query', 216, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (251, '', '删除操作日志', '', '', '/0/2/211/216/251', 'F', '', 'system:sysoperlog:remove', 216, '0', '', '', 0, '0', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (252, '', '获取登录用户信息', '', '/api/v1/getinfo', '/0/63/256/252', 'A', 'GET', '', 256, '0', '', '', 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (253, '', '角色数据权限', '', '/api/v1/roledatascope', '/0/63/201/253', 'A', 'PUT', '', 201, '0', '', '', 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (254, '', '部门树接口【数据权限】', '', '/api/v1/roleDeptTreeselect/:id', '/0/63/256/254', 'A', 'GET', '', 256, '0', '', '', 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (255, '', '部门树【用户列表】', '', '/api/v1/deptTree', '/0/63/256/255', 'A', 'GET', '', 256, '0', '', '', 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (256, '', '必开接口', '', '', '/0/63/256', 'M', 'GET', '', 63, '0', '', '', 0, '1', '1', '', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (257, '', '通过key获取参数', 'bug', '/api/v1/configKey/:id', '/0/63/256/257', 'A', 'GET', '', 256, '0', '', '', 1, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (258, '', '退出登录', '', '/api/v1/logout', '/0/63/256/258', 'A', 'POST', '', 256, '0', '', '', 0, '1', '1', '1', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (259, '', '头像上传', '', '/api/v1/user/avatar', '/0/63/256/259', 'A', 'POST', '', 256, '0', '', '', 0, '1', '1', '', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (260, '', '修改密码', '', '/api/v1/user/pwd', '/0/63/256/260', 'A', 'PUT', '', 256, '0', '', '', 0, '1', '1', '', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (261, 'Gen', '代码生成', 'code', 'gen', '/0/60/261', 'C', '', '', 60, '0', '', '/tools/gen/index', 2, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:18:12', NULL);
INSERT INTO `sys_menu` VALUES (262, 'EditTable', '数据表修改', 'build', 'editTable', '/0/60/262', 'C', '', '', 60, '0', '', '/tools/gen/editTable', 100, '1', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:18:22', NULL);
INSERT INTO `sys_menu` VALUES (263, '', '字典类型下拉框【生成功能】', '', '/api/v1/dict/typeoptionselect', '/0/63/256/263', 'A', 'GET', '', 256, '0', '', '', 0, '1', '1', '', 0, '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_menu` VALUES (264, 'Build', '表单构建', 'build', 'build', '/0/60/264', 'C', '', '', 60, '0', '', '/tools/build/index', 1, '0', '1', '1', 0, '2020-04-11 15:52:48', '2020-04-12 11:18:05', NULL);
INSERT INTO `sys_menu` VALUES (265, '', '打赏', 'heart', 'http://doc.zhangwj.com/go-admin-site/donate/', '/0/265', 'M', '', '', 0, '0', '', '', 5, '0', '1', '1', 0, '2020-04-12 16:39:04', '2020-04-12 16:58:59', NULL);
INSERT INTO `sys_menu` VALUES (266, '', '文档', 'documentation', 'http://doc.zhangwj.com', '/0/266', 'M', '', '', 0, '0', '', '', 4, '0', '1', '1', 0, '2020-04-12 16:58:41', '2020-04-12 16:58:52', NULL);
INSERT INTO `sys_post` VALUES (1, '首席执行官', 'CEO', 0, 0, '首席执行官', '1', '2020-03-08 23:11:15', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_post` VALUES (2, '开发工程师', 'Development ', 2, 0, '开发工程师', '1', '1', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_post` VALUES (3, '测试工程师', 'Test', 3, 0, '测试工程师', '1', '1', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_post` VALUES (4, '产品经理', 'Product', 3, 0, '产品经理', '1', '1', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_post` VALUES (5, '运维工程师', 'Opetion&Maintenance', 4, 0, '', '1', '1', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_post` VALUES (6, '首席运营官', 'COO', 1, 0, '', '1', '1', '2020-04-11 15:52:48', NULL, NULL);
INSERT INTO `sys_role` VALUES (1, '系统管理员', 0, 'admin', 1, NULL, '1', NULL, NULL, '0', '2020-04-11 15:52:48', '2020-04-12 22:46:03', NULL);
INSERT INTO `sys_role` VALUES (2, '普通角色', 0, 'common', 2, NULL, '1', NULL, NULL, '0', '2020-04-11 15:52:48', '2020-04-12 14:10:47', NULL);
INSERT INTO `sys_role` VALUES (3, '测试角色', 0, 'Tester', 3, '', '1', '', '', '0', '2020-04-11 15:52:48', '2020-04-12 14:10:52', NULL);
INSERT INTO `sys_role_menu` VALUES (1, 2, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 3, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 43, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 44, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 45, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 46, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 50, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 51, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 52, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 56, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 57, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 58, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 59, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 60, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 61, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 62, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 63, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 64, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 65, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 66, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 67, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 68, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 69, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 70, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 71, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 72, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 73, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 74, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 75, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 76, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 77, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 78, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 79, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 80, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 81, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 82, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 83, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 84, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 85, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 86, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 87, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 88, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 89, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 90, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 91, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 92, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 93, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 94, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 95, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 96, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 97, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 98, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 99, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 100, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 101, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 102, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 103, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 104, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 105, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 106, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 107, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 108, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 109, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 110, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 111, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 112, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 113, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 114, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 115, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 116, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 117, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 118, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 119, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 120, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 121, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 122, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 123, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 124, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 125, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 126, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 127, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 128, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 129, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 130, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 131, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 132, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 133, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 134, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 135, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 136, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 137, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 138, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 139, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 140, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 141, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 142, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 201, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 202, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 203, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 204, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 205, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 206, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 207, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 208, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 209, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 210, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 211, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 212, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 213, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 214, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 215, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 216, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 217, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 218, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 219, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 220, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 221, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 222, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 223, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 224, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 225, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 226, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 227, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 228, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 229, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 230, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 231, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 232, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 233, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 234, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 235, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 236, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 237, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 238, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 239, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 240, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 241, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 242, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 243, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 244, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 245, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 246, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 247, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 248, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 249, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 250, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 251, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 252, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 253, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 254, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 255, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 256, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 257, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 258, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 259, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 260, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 261, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 262, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 263, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 264, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 265, 'admin', NULL, NULL);
INSERT INTO `sys_role_menu` VALUES (1, 266, 'admin', NULL, NULL);
INSERT INTO `sys_tables` VALUES (23, 'sys_config', '参数表', 'SysConfig', 'crud', 'sysconfig', 'sysconfig', 'sysconfig', '参数表', 'wenjianzhang', 'config_id', 'ConfigId', 'configId', '', '', '', '', '0', '1', '', '1', '1', 'is_del', '', '', NULL, NULL, NULL);
INSERT INTO `sys_tables` VALUES (24, 'sys_dept', 'SysDept', 'SysDept', 'crud', 'sysdept', 'sysdept', 'sysdept', 'SysDept', 'wenjianzhang', 'dept_id', 'DeptId', 'deptId', '', '', '', '', '0', '1', '', '1', '1', 'is_del', '', '', NULL, NULL, NULL);
INSERT INTO `sys_tables` VALUES (25, 'sys_dict_data', 'SysDictData', 'SysDictData', 'crud', 'sysdictdata', 'sysdictdata', 'sysdictdata', 'SysDictData', 'wenjianzhang', 'dict_code', 'DictCode', 'dictCode', '', '', '', '', '0', '1', '', '1', '1', 'is_del', '', '', NULL, NULL, NULL);
INSERT INTO `sys_tables` VALUES (26, 'sys_dict_type', 'SysDictType', 'SysDictType', 'crud', 'sysdicttype', 'sysdicttype', 'sysdicttype', 'SysDictType', 'wenjianzhang', 'dict_id', 'DictId', 'dictId', '', '', '', '', '0', '1', '', '1', '1', 'is_del', '', '', NULL, NULL, NULL);
INSERT INTO `sys_tables` VALUES (27, 'sys_loginlog', 'SysLoginlog', 'SysLoginlog', 'crud', 'sysloginlog', 'sysloginlog', 'sysloginlog', 'SysLoginlog', 'wenjianzhang', 'info_id', 'InfoId', 'infoId', '', '', '', '', '0', '1', '', '1', '1', 'is_del', '', '', NULL, NULL, NULL);
INSERT INTO `sys_tables` VALUES (28, 'sys_menu', 'SysMenu', 'SysMenu', 'crud', 'sysmenu', 'sysmenu', 'sysmenu', 'SysMenu', 'wenjianzhang', 'menu_id', 'MenuId', 'menuId', '', '', '', '', '0', '1', '', '1', '1', 'is_del', '', '', NULL, NULL, NULL);
INSERT INTO `sys_tables` VALUES (29, 'sys_post', 'SysPost', 'SysPost', 'crud', 'syspost', 'syspost', 'syspost', 'SysPost', 'wenjianzhang', 'post_id', 'PostId', 'postId', '', '', '', '', '0', '1', '', '1', '1', 'is_del', '', '', NULL, NULL, NULL);
INSERT INTO `sys_tables` VALUES (30, 'sys_operlog', 'SysOperlog', 'SysOperlog', 'crud', 'sysoperlog', 'sysoperlog', 'sysoperlog', 'SysOperlog', 'wenjianzhang', 'oper_id', 'OperId', 'operId', '', '', '', '', '0', '1', '', '1', '1', 'is_del', '', '', NULL, NULL, NULL);
INSERT INTO `sys_user` VALUES (1, 'zhangwj', '13818888888', 1, NULL, '', '0', '1@qq.com', 1, 2, '1', '1', NULL, 0, '2019-11-10 14:05:55', '2020-03-15 19:16:02', NULL, 'admin', '$2a$10$cKFFTCzGOvaIHHJY2K45Zuwt8TD6oPzYi4s5MzYIBAWCLL6ZhouP2');
INSERT INTO `sys_user` VALUES (2, 'zhangwj', '13211111111', 3, NULL, NULL, '0', 'q@q.com', 8, 2, '1', '1', NULL, 0, '2019-11-12 18:28:27', '2020-03-14 20:08:43', NULL, 'zhangwj', '$2a$10$CqMwHahA3cNrNv16CoSxmeD4XMPU.BiKHPEAeaG5oXMavOKrjInXi');
INSERT INTO `sys_user` VALUES (3, '赵四', '13838385438', 2, '', '', '0', 'qq@qq.com', 7, 2, '1', '1', '', 0, '2020-04-07 22:17:38', '2020-04-07 22:17:50', NULL, 'zhaosi', '$2a$10$DejldFea5.hGZGC7/oVN9OLDrHAWgu9l29RDz9FomLnWnro4umYl2');
INSERT INTO `sys_user` VALUES (4, '王五', '13535353535', 3, '', '', '2', 'qq@qq.com', 8, 2, '1', '1', '', 0, '2020-04-12 14:06:49', '2020-04-12 14:07:09', NULL, 'wangwu', '$2a$10$3.RT6rpXANXvvlibX6PzU.FGA2CvfDxd1UmJ2H5zTzF4sYocbvsTO');
END TRANSACTION;
+13 -4
View File
@@ -1,11 +1,20 @@
package database
import "go-admin/tools/config"
func Setup() {
dbType := config.DatabaseConfig.Dbtype
func Setup(driver string) {
dbType := driver
if dbType == "mysql" {
var db = new(Mysql)
db.Setup()
}
//TODO: 如果需要sqlite3请开启下面注释
//if dbType == "sqlite3" {
// var db = new(SqLite)
// db.Setup()
//}
if dbType == "postgres" {
var db = new(PgSql)
db.Setup()
}
}
+2
View File
@@ -3,6 +3,8 @@ package database
import "github.com/jinzhu/gorm"
type Database interface {
Setup()
Open(dbType string, conn string) (db *gorm.DB, err error)
GetConnect() string
GetDriver() string
}
+47
View File
@@ -0,0 +1,47 @@
package database
import (
_ "github.com/go-sql-driver/mysql" //加载mysql
"github.com/jinzhu/gorm"
"go-admin/global"
"go-admin/tools"
"go-admin/tools/config"
)
type Mysql struct {
}
func (e *Mysql) Setup() {
var err error
var db Database
db = new(Mysql)
global.Source = db.GetConnect()
global.Logger.Info(tools.Green(global.Source))
global.Eloquent, err = db.Open(db.GetDriver(), db.GetConnect())
if err != nil {
global.Logger.Fatal(tools.Red(db.GetDriver()+" connect error :"), err)
} else {
global.Logger.Info(tools.Green(db.GetDriver() + " connect success !"))
}
if global.Eloquent.Error != nil {
global.Logger.Fatal(tools.Red(" database error :"), global.Eloquent.Error)
}
global.Eloquent.LogMode(config.LoggerConfig.EnabledDB)
}
// 打开数据库连接
func (e *Mysql) Open(dbType string, conn string) (db *gorm.DB, err error) {
return gorm.Open(dbType, conn)
}
// 获取数据库连接
func (e *Mysql) GetConnect() string {
return config.DatabaseConfig.Source
}
func (e *Mysql) GetDriver() string {
return config.DatabaseConfig.Driver
}
-74
View File
@@ -1,74 +0,0 @@
package database
import (
"bytes"
_ "github.com/go-sql-driver/mysql" //加载mysql
"github.com/jinzhu/gorm"
log "github.com/sirupsen/logrus"
"go-admin/global/orm"
"go-admin/tools/config"
"strconv"
)
var (
DbType string
Host string
Port int
Name string
Username string
Password string
)
func (e *Mysql) Setup() {
var err error
var db Database
db = new(Mysql)
orm.MysqlConn = db.GetConnect()
log.Info(orm.MysqlConn)
orm.Eloquent, err = db.Open(DbType, orm.MysqlConn)
if err != nil {
log.Fatalf("%s connect error %v", DbType, err)
} else {
log.Printf("%s connect success!", DbType)
}
if orm.Eloquent.Error != nil {
log.Fatalf("database error %v", orm.Eloquent.Error)
}
orm.Eloquent.LogMode(true)
}
type Mysql struct {
}
func (e *Mysql) Open(dbType string, conn string) (db *gorm.DB, err error) {
return gorm.Open(dbType, conn)
}
func (e *Mysql) GetConnect() string {
DbType = config.DatabaseConfig.Dbtype
Host = config.DatabaseConfig.Host
Port = config.DatabaseConfig.Port
Name = config.DatabaseConfig.Name
Username = config.DatabaseConfig.Username
Password = config.DatabaseConfig.Password
var conn bytes.Buffer
conn.WriteString(Username)
conn.WriteString(":")
conn.WriteString(Password)
conn.WriteString("@tcp(")
conn.WriteString(Host)
conn.WriteString(":")
conn.WriteString(strconv.Itoa(Port))
conn.WriteString(")")
conn.WriteString("/")
conn.WriteString(Name)
conn.WriteString("?charset=utf8&parseTime=True&loc=Local&timeout=1000ms")
return conn.String()
}
+47
View File
@@ -0,0 +1,47 @@
package database
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
"go-admin/global"
"go-admin/tools/config"
"log"
)
type PgSql struct {
}
func (e *PgSql) Setup() {
var err error
var db Database
db = new(PgSql)
global.Source = db.GetConnect()
log.Println(global.Source)
global.Eloquent, err = db.Open(db.GetDriver(), db.GetConnect())
if err != nil {
log.Fatalf("%s connect error %v", db.GetDriver(), err)
} else {
log.Printf("%s connect success!", db.GetDriver())
}
if global.Eloquent.Error != nil {
log.Fatalf("database error %v", global.Eloquent.Error)
}
global.Eloquent.LogMode(true)
}
// 打开数据库连接
func (*PgSql) Open(dbType string, conn string) (db *gorm.DB, err error) {
eloquent, err := gorm.Open(dbType, conn)
return eloquent, err
}
func (e *PgSql) GetConnect() string {
return config.DatabaseConfig.Source
}
func (e *PgSql) GetDriver() string {
return config.DatabaseConfig.Driver
}
+50
View File
@@ -0,0 +1,50 @@
// +build sqlite3
package database
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/sqlite"
"log"
"go-admin/global"
"go-admin/tools/config"
)
type SqLite struct {
}
func (e *SqLite) Setup() {
var err error
var db Database
db = new(SqLite)
global.Source = db.GetConnect()
log.Info(global.Source)
global.Eloquent, err = db.Open(db.GetDriver(), db.GetConnect())
if err != nil {
log.Fatalf("%s connect error %v", db.GetDriver(), err)
} else {
log.Printf("%s connect success!", db.GetDriver())
}
if global.Eloquent.Error != nil {
log.Fatalf("database error %v", global.Eloquent.Error)
}
global.Eloquent.LogMode(true)
}
// 打开数据库连接
func (*SqLite) Open(dbType string, conn string) (db *gorm.DB, err error) {
eloquent, err := gorm.Open(dbType, conn)
return eloquent, err
}
func (e *SqLite) GetConnect() string {
return config.DatabaseConfig.Source
}
func (e *SqLite) GetDriver() string {
return config.DatabaseConfig.Driver
}
-15
View File
@@ -1,15 +0,0 @@
// +build sqlite3
package database
import (
_ "github.com/jinzhu/gorm/dialects/sqlite"
)
type SqlLite struct {
}
func (*SqlLite) Open(dbType string, conn string) (db *gorm.DB, err error) {
eloquent, err := gorm.Open(dbType, conn)
return eloquent, err
}
+360 -117
View File
@@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2020-05-25 21:14:52.220986 +0800 CST m=+0.139814492
// 2020-07-17 22:43:59.920467 +0800 CST m=+0.161144112
package docs
@@ -70,7 +70,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -125,7 +125,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -156,7 +156,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -310,7 +310,7 @@ var doc = `{
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Dept"
"$ref": "#/definitions/models.SysDept"
}
}
],
@@ -345,7 +345,7 @@ var doc = `{
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Dept"
"$ref": "#/definitions/models.SysDept"
}
}
],
@@ -363,7 +363,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -425,7 +425,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "分页列表",
@@ -539,7 +539,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -593,7 +593,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -648,7 +648,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -751,7 +751,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -805,7 +805,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -932,7 +932,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -987,7 +987,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1359,7 +1359,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1416,7 +1416,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1470,31 +1470,37 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
"tags": [
"职位"
"岗位"
],
"summary": "职位列表数据",
"summary": "岗位列表数据",
"parameters": [
{
"type": "string",
"description": "name",
"name": "name",
"description": "postName",
"name": "postName",
"in": "query"
},
{
"type": "string",
"description": "id",
"name": "id",
"description": "postCode",
"name": "postCode",
"in": "query"
},
{
"type": "string",
"description": "position",
"name": "position",
"description": "postId",
"name": "postId",
"in": "query"
},
{
"type": "string",
"description": "status",
"name": "status",
"in": "query"
}
],
@@ -1518,9 +1524,9 @@ var doc = `{
"application/json"
],
"tags": [
"职位"
"岗位"
],
"summary": "添加职位",
"summary": "添加岗位",
"parameters": [
{
"description": "data",
@@ -1555,9 +1561,9 @@ var doc = `{
"application/json"
],
"tags": [
"职位"
"岗位"
],
"summary": "修改职位",
"summary": "修改岗位",
"parameters": [
{
"description": "body",
@@ -1566,7 +1572,7 @@ var doc = `{
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Dept"
"$ref": "#/definitions/models.Post"
}
}
],
@@ -1584,14 +1590,14 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
"tags": [
"字典数据"
"岗位"
],
"summary": "获取字典数据",
"summary": "获取岗位信息",
"parameters": [
{
"type": "integer",
@@ -1613,9 +1619,9 @@ var doc = `{
"delete": {
"description": "删除数据",
"tags": [
"职位"
"岗位"
],
"summary": "删除职位",
"summary": "删除岗位",
"parameters": [
{
"type": "integer",
@@ -1627,7 +1633,13 @@ var doc = `{
],
"responses": {
"200": {
"description": "{\"code\": -1, \"message\": \"删除失败\"}",
"description": "{\"code\": 200, \"message\": \"删除成功\"}",
"schema": {
"type": "string"
}
},
"500": {
"description": "{\"code\": 500, \"message\": \"删除失败\"}",
"schema": {
"type": "string"
}
@@ -1755,7 +1767,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "Get JSON",
@@ -1890,7 +1902,7 @@ var doc = `{
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Dept"
"$ref": "#/definitions/tools.SysTables"
}
}
],
@@ -1939,7 +1951,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2031,7 +2043,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2083,7 +2095,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2121,7 +2133,7 @@ var doc = `{
"tags": [
"用户"
],
"summary": "列表数据",
"summary": "列表用户信息数据",
"parameters": [
{
"type": "string",
@@ -2200,14 +2212,14 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
"tags": [
"个人中心"
],
"summary": "获取当前登录用户",
"summary": "获取个人中心用户",
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
@@ -2249,15 +2261,15 @@ var doc = `{
},
"/login": {
"post": {
"description": "获取token",
"description": "获取token\nLoginHandler can be used by clients to get a jwt token.\nPayload needs to be json in the form of {\"username\": \"USERNAME\", \"password\": \"PASSWORD\"}.\nReply will be of the form {\"token\": \"TOKEN\"}.\ndev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password\n注意:开发模式:需要注意全部字段不能为空,账号密码外可以传入0值",
"consumes": [
"application/json"
],
"summary": "登陆",
"parameters": [
{
"description": "Add account",
"name": "username",
"description": "account",
"name": "account",
"in": "body",
"required": true,
"schema": {
@@ -2280,7 +2292,7 @@ var doc = `{
"post": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取token",
@@ -2430,73 +2442,6 @@ var doc = `{
}
}
},
"models.Dept": {
"type": "object",
"properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Dept"
}
},
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"dataScope": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"deptId": {
"description": "部门编码",
"type": "integer"
},
"deptName": {
"description": "部门名称",
"type": "string"
},
"deptPath": {
"type": "string"
},
"email": {
"description": "邮箱",
"type": "string"
},
"leader": {
"description": "负责人",
"type": "string"
},
"params": {
"type": "string"
},
"parentId": {
"description": "上级部门",
"type": "integer"
},
"phone": {
"description": "手机",
"type": "string"
},
"sort": {
"description": "排序",
"type": "integer"
},
"status": {
"description": "状态",
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"models.DictType": {
"type": "object",
"properties": {
@@ -2825,6 +2770,73 @@ var doc = `{
}
}
},
"models.SysDept": {
"type": "object",
"properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysDept"
}
},
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"dataScope": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"deptId": {
"description": "部门编码",
"type": "integer"
},
"deptName": {
"description": "部门名称",
"type": "string"
},
"deptPath": {
"type": "string"
},
"email": {
"description": "邮箱",
"type": "string"
},
"leader": {
"description": "负责人",
"type": "string"
},
"params": {
"type": "string"
},
"parentId": {
"description": "上级部门",
"type": "integer"
},
"phone": {
"description": "手机",
"type": "string"
},
"sort": {
"description": "排序",
"type": "integer"
},
"status": {
"description": "状态",
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"models.SysOperLog": {
"type": "object",
"properties": {
@@ -3076,6 +3088,237 @@ var doc = `{
"type": "string"
}
}
},
"tools.Params": {
"type": "object",
"properties": {
"treeCode": {
"type": "string"
},
"treeName": {
"type": "string"
},
"treeParentCode": {
"type": "string"
}
}
},
"tools.SysColumns": {
"type": "object",
"properties": {
"columnComment": {
"type": "string"
},
"columnId": {
"type": "integer"
},
"columnName": {
"type": "string"
},
"columnType": {
"type": "string"
},
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"dictType": {
"type": "string"
},
"edit": {
"type": "boolean"
},
"goField": {
"type": "string"
},
"goType": {
"type": "string"
},
"htmlType": {
"type": "string"
},
"increment": {
"type": "boolean"
},
"insert": {
"type": "boolean"
},
"isEdit": {
"type": "string"
},
"isIncrement": {
"type": "string"
},
"isInsert": {
"type": "string"
},
"isList": {
"type": "string"
},
"isPk": {
"type": "string"
},
"isQuery": {
"type": "string"
},
"isRequired": {
"type": "string"
},
"jsonField": {
"type": "string"
},
"list": {
"type": "string"
},
"pk": {
"type": "boolean"
},
"query": {
"type": "boolean"
},
"queryType": {
"type": "string"
},
"remark": {
"type": "string"
},
"required": {
"type": "boolean"
},
"sort": {
"type": "integer"
},
"superColumn": {
"type": "boolean"
},
"tableId": {
"type": "integer"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
},
"usableColumn": {
"type": "boolean"
}
}
},
"tools.SysTables": {
"type": "object",
"properties": {
"businessName": {
"type": "string"
},
"className": {
"description": "类名",
"type": "string"
},
"columns": {
"type": "array",
"items": {
"$ref": "#/definitions/tools.SysColumns"
}
},
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"crud": {
"type": "boolean"
},
"dataScope": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"functionAuthor": {
"description": "功能作者",
"type": "string"
},
"functionName": {
"description": "功能名称",
"type": "string"
},
"isLogicalDelete": {
"type": "string"
},
"logicalDelete": {
"type": "boolean"
},
"logicalDeleteColumn": {
"type": "string"
},
"moduleName": {
"description": "模块名",
"type": "string"
},
"options": {
"type": "string"
},
"packageName": {
"description": "包名",
"type": "string"
},
"params": {
"type": "object",
"$ref": "#/definitions/tools.Params"
},
"pkColumn": {
"type": "string"
},
"pkGoField": {
"type": "string"
},
"pkJsonField": {
"type": "string"
},
"remark": {
"type": "string"
},
"tableComment": {
"description": "表备注",
"type": "string"
},
"tableId": {
"description": "表编码",
"type": "integer"
},
"tableName": {
"description": "表名称",
"type": "string"
},
"tplCategory": {
"type": "string"
},
"tree": {
"type": "boolean"
},
"treeCode": {
"type": "string"
},
"treeName": {
"type": "string"
},
"treeParentCode": {
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
}
},
"securityDefinitions": {
@@ -3098,7 +3341,7 @@ type swaggerInfo struct {
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{
Version: "0.0.1",
Version: "1.0.1",
Host: "",
BasePath: "",
Schemes: []string{},
+359 -116
View File
@@ -8,7 +8,7 @@
"name": "MIT",
"url": "https://github.com/wenjianzhang/go-admin/blob/master/LICENSE.md"
},
"version": "0.0.1"
"version": "1.0.1"
},
"paths": {
"/api/v1/config": {
@@ -52,7 +52,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -107,7 +107,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -138,7 +138,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -292,7 +292,7 @@
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Dept"
"$ref": "#/definitions/models.SysDept"
}
}
],
@@ -327,7 +327,7 @@
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Dept"
"$ref": "#/definitions/models.SysDept"
}
}
],
@@ -345,7 +345,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -407,7 +407,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "分页列表",
@@ -521,7 +521,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -575,7 +575,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -630,7 +630,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -733,7 +733,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -787,7 +787,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -914,7 +914,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -969,7 +969,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1341,7 +1341,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1398,7 +1398,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1452,31 +1452,37 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
"tags": [
"职位"
"岗位"
],
"summary": "职位列表数据",
"summary": "岗位列表数据",
"parameters": [
{
"type": "string",
"description": "name",
"name": "name",
"description": "postName",
"name": "postName",
"in": "query"
},
{
"type": "string",
"description": "id",
"name": "id",
"description": "postCode",
"name": "postCode",
"in": "query"
},
{
"type": "string",
"description": "position",
"name": "position",
"description": "postId",
"name": "postId",
"in": "query"
},
{
"type": "string",
"description": "status",
"name": "status",
"in": "query"
}
],
@@ -1500,9 +1506,9 @@
"application/json"
],
"tags": [
"职位"
"岗位"
],
"summary": "添加职位",
"summary": "添加岗位",
"parameters": [
{
"description": "data",
@@ -1537,9 +1543,9 @@
"application/json"
],
"tags": [
"职位"
"岗位"
],
"summary": "修改职位",
"summary": "修改岗位",
"parameters": [
{
"description": "body",
@@ -1548,7 +1554,7 @@
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Dept"
"$ref": "#/definitions/models.Post"
}
}
],
@@ -1566,14 +1572,14 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
"tags": [
"字典数据"
"岗位"
],
"summary": "获取字典数据",
"summary": "获取岗位信息",
"parameters": [
{
"type": "integer",
@@ -1595,9 +1601,9 @@
"delete": {
"description": "删除数据",
"tags": [
"职位"
"岗位"
],
"summary": "删除职位",
"summary": "删除岗位",
"parameters": [
{
"type": "integer",
@@ -1609,7 +1615,13 @@
],
"responses": {
"200": {
"description": "{\"code\": -1, \"message\": \"删除失败\"}",
"description": "{\"code\": 200, \"message\": \"删除成功\"}",
"schema": {
"type": "string"
}
},
"500": {
"description": "{\"code\": 500, \"message\": \"删除失败\"}",
"schema": {
"type": "string"
}
@@ -1737,7 +1749,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "Get JSON",
@@ -1872,7 +1884,7 @@
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Dept"
"$ref": "#/definitions/tools.SysTables"
}
}
],
@@ -1921,7 +1933,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2013,7 +2025,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2065,7 +2077,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2103,7 +2115,7 @@
"tags": [
"用户"
],
"summary": "列表数据",
"summary": "列表用户信息数据",
"parameters": [
{
"type": "string",
@@ -2182,14 +2194,14 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
"tags": [
"个人中心"
],
"summary": "获取当前登录用户",
"summary": "获取个人中心用户",
"responses": {
"200": {
"description": "{\"code\": 200, \"data\": [...]}",
@@ -2231,15 +2243,15 @@
},
"/login": {
"post": {
"description": "获取token",
"description": "获取token\nLoginHandler can be used by clients to get a jwt token.\nPayload needs to be json in the form of {\"username\": \"USERNAME\", \"password\": \"PASSWORD\"}.\nReply will be of the form {\"token\": \"TOKEN\"}.\ndev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password\n注意:开发模式:需要注意全部字段不能为空,账号密码外可以传入0值",
"consumes": [
"application/json"
],
"summary": "登陆",
"parameters": [
{
"description": "Add account",
"name": "username",
"description": "account",
"name": "account",
"in": "body",
"required": true,
"schema": {
@@ -2262,7 +2274,7 @@
"post": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取token",
@@ -2412,73 +2424,6 @@
}
}
},
"models.Dept": {
"type": "object",
"properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Dept"
}
},
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"dataScope": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"deptId": {
"description": "部门编码",
"type": "integer"
},
"deptName": {
"description": "部门名称",
"type": "string"
},
"deptPath": {
"type": "string"
},
"email": {
"description": "邮箱",
"type": "string"
},
"leader": {
"description": "负责人",
"type": "string"
},
"params": {
"type": "string"
},
"parentId": {
"description": "上级部门",
"type": "integer"
},
"phone": {
"description": "手机",
"type": "string"
},
"sort": {
"description": "排序",
"type": "integer"
},
"status": {
"description": "状态",
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"models.DictType": {
"type": "object",
"properties": {
@@ -2807,6 +2752,73 @@
}
}
},
"models.SysDept": {
"type": "object",
"properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/models.SysDept"
}
},
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"dataScope": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"deptId": {
"description": "部门编码",
"type": "integer"
},
"deptName": {
"description": "部门名称",
"type": "string"
},
"deptPath": {
"type": "string"
},
"email": {
"description": "邮箱",
"type": "string"
},
"leader": {
"description": "负责人",
"type": "string"
},
"params": {
"type": "string"
},
"parentId": {
"description": "上级部门",
"type": "integer"
},
"phone": {
"description": "手机",
"type": "string"
},
"sort": {
"description": "排序",
"type": "integer"
},
"status": {
"description": "状态",
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"models.SysOperLog": {
"type": "object",
"properties": {
@@ -3058,6 +3070,237 @@
"type": "string"
}
}
},
"tools.Params": {
"type": "object",
"properties": {
"treeCode": {
"type": "string"
},
"treeName": {
"type": "string"
},
"treeParentCode": {
"type": "string"
}
}
},
"tools.SysColumns": {
"type": "object",
"properties": {
"columnComment": {
"type": "string"
},
"columnId": {
"type": "integer"
},
"columnName": {
"type": "string"
},
"columnType": {
"type": "string"
},
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"dictType": {
"type": "string"
},
"edit": {
"type": "boolean"
},
"goField": {
"type": "string"
},
"goType": {
"type": "string"
},
"htmlType": {
"type": "string"
},
"increment": {
"type": "boolean"
},
"insert": {
"type": "boolean"
},
"isEdit": {
"type": "string"
},
"isIncrement": {
"type": "string"
},
"isInsert": {
"type": "string"
},
"isList": {
"type": "string"
},
"isPk": {
"type": "string"
},
"isQuery": {
"type": "string"
},
"isRequired": {
"type": "string"
},
"jsonField": {
"type": "string"
},
"list": {
"type": "string"
},
"pk": {
"type": "boolean"
},
"query": {
"type": "boolean"
},
"queryType": {
"type": "string"
},
"remark": {
"type": "string"
},
"required": {
"type": "boolean"
},
"sort": {
"type": "integer"
},
"superColumn": {
"type": "boolean"
},
"tableId": {
"type": "integer"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
},
"usableColumn": {
"type": "boolean"
}
}
},
"tools.SysTables": {
"type": "object",
"properties": {
"businessName": {
"type": "string"
},
"className": {
"description": "类名",
"type": "string"
},
"columns": {
"type": "array",
"items": {
"$ref": "#/definitions/tools.SysColumns"
}
},
"createBy": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"crud": {
"type": "boolean"
},
"dataScope": {
"type": "string"
},
"deletedAt": {
"type": "string"
},
"functionAuthor": {
"description": "功能作者",
"type": "string"
},
"functionName": {
"description": "功能名称",
"type": "string"
},
"isLogicalDelete": {
"type": "string"
},
"logicalDelete": {
"type": "boolean"
},
"logicalDeleteColumn": {
"type": "string"
},
"moduleName": {
"description": "模块名",
"type": "string"
},
"options": {
"type": "string"
},
"packageName": {
"description": "包名",
"type": "string"
},
"params": {
"type": "object",
"$ref": "#/definitions/tools.Params"
},
"pkColumn": {
"type": "string"
},
"pkGoField": {
"type": "string"
},
"pkJsonField": {
"type": "string"
},
"remark": {
"type": "string"
},
"tableComment": {
"description": "表备注",
"type": "string"
},
"tableId": {
"description": "表编码",
"type": "integer"
},
"tableName": {
"description": "表名称",
"type": "string"
},
"tplCategory": {
"type": "string"
},
"tree": {
"type": "boolean"
},
"treeCode": {
"type": "string"
},
"treeName": {
"type": "string"
},
"treeParentCode": {
"type": "string"
},
"updateBy": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
}
},
"securityDefinitions": {
+266 -96
View File
@@ -12,53 +12,6 @@ definitions:
description: 消息
type: string
type: object
models.Dept:
properties:
children:
items:
$ref: '#/definitions/models.Dept'
type: array
createBy:
type: string
createdAt:
type: string
dataScope:
type: string
deletedAt:
type: string
deptId:
description: 部门编码
type: integer
deptName:
description: 部门名称
type: string
deptPath:
type: string
email:
description: 邮箱
type: string
leader:
description: 负责人
type: string
params:
type: string
parentId:
description: 上级部门
type: integer
phone:
description: 手机
type: string
sort:
description: 排序
type: integer
status:
description: 状态
type: string
updateBy:
type: string
updatedAt:
type: string
type: object
models.DictType:
properties:
createBy:
@@ -287,6 +240,53 @@ definitions:
updatedAt:
type: string
type: object
models.SysDept:
properties:
children:
items:
$ref: '#/definitions/models.SysDept'
type: array
createBy:
type: string
createdAt:
type: string
dataScope:
type: string
deletedAt:
type: string
deptId:
description: 部门编码
type: integer
deptName:
description: 部门名称
type: string
deptPath:
type: string
email:
description: 邮箱
type: string
leader:
description: 负责人
type: string
params:
type: string
parentId:
description: 上级部门
type: integer
phone:
description: 手机
type: string
sort:
description: 排序
type: integer
status:
description: 状态
type: string
updateBy:
type: string
updatedAt:
type: string
type: object
models.SysOperLog:
properties:
businessType:
@@ -467,6 +467,162 @@ definitions:
username:
type: string
type: object
tools.Params:
properties:
treeCode:
type: string
treeName:
type: string
treeParentCode:
type: string
type: object
tools.SysColumns:
properties:
columnComment:
type: string
columnId:
type: integer
columnName:
type: string
columnType:
type: string
createBy:
type: string
createdAt:
type: string
deletedAt:
type: string
dictType:
type: string
edit:
type: boolean
goField:
type: string
goType:
type: string
htmlType:
type: string
increment:
type: boolean
insert:
type: boolean
isEdit:
type: string
isIncrement:
type: string
isInsert:
type: string
isList:
type: string
isPk:
type: string
isQuery:
type: string
isRequired:
type: string
jsonField:
type: string
list:
type: string
pk:
type: boolean
query:
type: boolean
queryType:
type: string
remark:
type: string
required:
type: boolean
sort:
type: integer
superColumn:
type: boolean
tableId:
type: integer
updateBy:
type: string
updatedAt:
type: string
usableColumn:
type: boolean
type: object
tools.SysTables:
properties:
businessName:
type: string
className:
description: 类名
type: string
columns:
items:
$ref: '#/definitions/tools.SysColumns'
type: array
createBy:
type: string
createdAt:
type: string
crud:
type: boolean
dataScope:
type: string
deletedAt:
type: string
functionAuthor:
description: 功能作者
type: string
functionName:
description: 功能名称
type: string
isLogicalDelete:
type: string
logicalDelete:
type: boolean
logicalDeleteColumn:
type: string
moduleName:
description: 模块名
type: string
options:
type: string
packageName:
description: 包名
type: string
params:
$ref: '#/definitions/tools.Params'
type: object
pkColumn:
type: string
pkGoField:
type: string
pkJsonField:
type: string
remark:
type: string
tableComment:
description: 表备注
type: string
tableId:
description: 表编码
type: integer
tableName:
description: 表名称
type: string
tplCategory:
type: string
tree:
type: boolean
treeCode:
type: string
treeName:
type: string
treeParentCode:
type: string
updateBy:
type: string
updatedAt:
type: string
type: object
info:
contact: {}
description: |-
@@ -476,7 +632,7 @@ info:
name: MIT
url: https://github.com/wenjianzhang/go-admin/blob/master/LICENSE.md
title: go-admin API
version: 0.0.1
version: 1.0.1
paths:
/api/v1/config:
put:
@@ -532,7 +688,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取配置
tags:
- 配置
@@ -551,7 +707,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取配置
tags:
- 配置
@@ -585,7 +741,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 配置列表数据
tags:
- 配置
@@ -648,7 +804,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/models.Dept'
$ref: '#/definitions/models.SysDept'
type: object
responses:
"200":
@@ -675,7 +831,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/models.Dept'
$ref: '#/definitions/models.SysDept'
type: object
responses:
"200":
@@ -705,7 +861,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 部门列表数据
tags:
- 部门
@@ -748,7 +904,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 分页部门列表数据
tags:
- 部门
@@ -828,7 +984,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 通过编码获取字典数据
tags:
- 字典数据
@@ -862,7 +1018,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 字典数据列表
tags:
- 字典数据
@@ -881,7 +1037,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 通过字典类型获取字典数据
tags:
- 字典数据
@@ -961,7 +1117,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 通过字典id获取字典类型
tags:
- 字典类型
@@ -995,7 +1151,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 字典类型列表数据
tags:
- 字典类型
@@ -1075,7 +1231,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 通过编码获取登录日志
tags:
- 登录日志
@@ -1109,7 +1265,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 登录日志列表
tags:
- 登录日志
@@ -1328,7 +1484,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 通过编码获取登录日志
tags:
- 登录日志
@@ -1379,7 +1535,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 登录日志列表
tags:
- 登录日志
@@ -1387,17 +1543,21 @@ paths:
get:
description: 获取JSON
parameters:
- description: name
- description: postName
in: query
name: name
name: postName
type: string
- description: id
- description: postCode
in: query
name: id
name: postCode
type: string
- description: position
- description: postId
in: query
name: position
name: postId
type: string
- description: status
in: query
name: status
type: string
responses:
"200":
@@ -1405,10 +1565,10 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
summary: 职位列表数据
- Bearer: []
summary: 岗位列表数据
tags:
- 职位
- 岗位
post:
consumes:
- application/json
@@ -1428,9 +1588,9 @@ paths:
type: string
security:
- Bearer: []
summary: 添加职位
summary: 添加岗位
tags:
- 职位
- 岗位
/api/v1/post/:
put:
consumes:
@@ -1442,7 +1602,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/models.Dept'
$ref: '#/definitions/models.Post'
type: object
responses:
"200":
@@ -1451,9 +1611,9 @@ paths:
type: string
security:
- Bearer: []
summary: 修改职位
summary: 修改岗位
tags:
- 职位
- 岗位
/api/v1/post/{postId}:
delete:
description: 删除数据
@@ -1465,12 +1625,16 @@ paths:
type: integer
responses:
"200":
description: '{"code": -1, "message": "删除失败"}'
description: '{"code": 200, "message": "删除成功"}'
schema:
type: string
summary: 删除职位
"500":
description: '{"code": 500, "message": "删除失败"}'
schema:
type: string
summary: 删除岗位
tags:
- 职位
- 岗位
get:
description: 获取JSON
parameters:
@@ -1485,10 +1649,10 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
summary: 获取字典数据
- Bearer: []
summary: 获取岗位信息
tags:
- 字典数据
- 岗位
/api/v1/role:
get:
description: 获取JSON
@@ -1594,7 +1758,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 角色列表数据
tags:
- 角色/Role
@@ -1667,7 +1831,7 @@ paths:
name: data
required: true
schema:
$ref: '#/definitions/models.Dept'
$ref: '#/definitions/tools.SysTables'
type: object
responses:
"200":
@@ -1710,7 +1874,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取配置
tags:
- 工具 - 生成表
@@ -1747,7 +1911,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取用户角色和职位
tags:
- 用户
@@ -1786,7 +1950,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取用户
tags:
- 用户
@@ -1805,7 +1969,7 @@ paths:
type: string
security:
- Bearer: []
summary: 列表数据
summary: 列表用户信息数据
tags:
- 用户
/api/v1/sysuser/{userId}:
@@ -1854,8 +2018,8 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
summary: 获取当前登录用户
- Bearer: []
summary: 获取个人中心用户
tags:
- 个人中心
/api/v1/user/profileAvatar:
@@ -1881,11 +2045,17 @@ paths:
post:
consumes:
- application/json
description: 获取token
description: |-
获取token
LoginHandler can be used by clients to get a jwt token.
Payload needs to be json in the form of {"username": "USERNAME", "password": "PASSWORD"}.
Reply will be of the form {"token": "TOKEN"}.
dev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password
注意:开发模式:需要注意全部字段不能为空,账号密码外可以传入0值
parameters:
- description: Add account
- description: account
in: body
name: username
name: account
required: true
schema:
$ref: '#/definitions/models.Login'
@@ -1909,7 +2079,7 @@ paths:
schema:
type: string
security:
- "": []
- Bearer: []
summary: 退出登录
/sd/cpu:
get:
+24
View File
@@ -0,0 +1,24 @@
package main
import (
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
"go-admin/global"
mycasbin "go-admin/pkg/casbin"
"go-admin/pkg/logger"
"go-admin/router"
"log"
)
func main() {
var err error
global.Eloquent, err = gorm.Open("mysql", "root:123456@tcp/inmg?charset=utf8&parseTime=True&loc=Local")
if err != nil {
panic(err)
}
mycasbin.Setup()
logger.Setup()
global.GinEngine = gin.Default()
router.InitRouter()
log.Fatal(global.GinEngine.Run(":8000"))
}
+34
View File
@@ -0,0 +1,34 @@
package global
import (
"github.com/casbin/casbin/v2"
"github.com/gin-gonic/gin"
"github.com/gogf/gf/os/glog"
"github.com/jinzhu/gorm"
"github.com/robfig/cron/v3"
)
var GinEngine *gin.Engine
var CasbinEnforcer *casbin.SyncedEnforcer
var Eloquent *gorm.DB
var GADMCron *cron.Cron
var (
Source string
Driver string
DBName string
)
// go-admin Version Info
var Version string
func init() {
Version = "1.1.5"
}
var (
Logger *glog.Logger
JobLogger *glog.Logger
RequestLogger *glog.Logger
)
-13
View File
@@ -1,14 +1 @@
package global
import (
"github.com/sirupsen/logrus"
)
var RequestLogger = &logrus.Entry{}
func init() {
// TODO: requestLogger log format
// RequestLogger = logrus.WithFields(logrus.Fields{"request_id": request_id, "user_ip": user_ip})
}
-9
View File
@@ -1,9 +0,0 @@
package orm
import (
"github.com/jinzhu/gorm"
)
var Eloquent *gorm.DB
var MysqlConn string
+9 -12
View File
@@ -8,34 +8,31 @@ require (
github.com/casbin/casbin/v2 v2.2.1
github.com/casbin/gorm-adapter/v2 v2.0.3
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gin-gonic/gin v1.4.0
github.com/go-kit/kit v0.8.0
github.com/gin-gonic/gin v1.6.3
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/go-openapi/spec v0.19.7 // indirect
github.com/go-openapi/swag v0.19.8 // indirect
github.com/go-sql-driver/mysql v1.4.1
github.com/golang/protobuf v1.3.2 // indirect
github.com/go-redis/redis/v7 v7.4.0
github.com/go-sql-driver/mysql v1.5.0
github.com/gogf/gf v1.13.2
github.com/google/uuid v1.1.1
github.com/gorilla/websocket v1.4.1
github.com/jinzhu/gorm v1.9.10
github.com/json-iterator/go v1.1.8 // indirect
github.com/mailru/easyjson v0.7.1 // indirect
github.com/mattn/go-isatty v0.0.10 // indirect
github.com/matchstalk/redisqueue v1.0.3
github.com/matchstalk/utils v0.0.0-20200806172422-ecd38701b407
github.com/mattn/go-sqlite3 v1.14.0 // indirect
github.com/mojocn/base64Captcha v1.3.1
github.com/mssola/user_agent v0.5.1
github.com/pkg/errors v0.8.1
github.com/pkg/errors v0.9.1
github.com/robfig/cron/v3 v3.0.0
github.com/satori/go.uuid v1.2.0
github.com/shirou/gopsutil v2.20.3+incompatible
github.com/sirupsen/logrus v1.2.0
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.6.2
github.com/swaggo/gin-swagger v1.2.0
github.com/swaggo/swag v1.6.5
github.com/ugorji/go v1.1.7 // indirect
github.com/unrolled/secure v1.0.8
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e // indirect
golang.org/x/tools v0.0.0-20200402223321-bcf690261a44 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
)
+91 -83
View File
@@ -1,15 +1,15 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/AlecAivazis/survey/v2 v2.0.5/go.mod h1:WYBhg6f0y/fNYUuesWQc0PKbJcEliGcYHB9sNT3Bg74=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw=
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
github.com/Netflix/go-expect v0.0.0-20180615182759-c93bf25de8e8/go.mod h1:oX5x61PbNXchhh0oikYAH+4Pcfw5LKv21+Jnpr6r6Pc=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/PuerkitoBio/purell v1.1.0 h1:rmGxhojJlM0tuKtfdvliR84CFHljx9ag64t2xmVkjK4=
github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc=
github.com/PuerkitoBio/purell v1.1.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
@@ -19,21 +19,24 @@ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWX
github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUWq3EgK3CesDbo8upS2Vm9/P3FtgI+Jk=
github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc h1:cAKDfWh5VpdgMhJosfJnn5/FoN2SRZ4p7fJNX58YPaU=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 h1:JYp7IbQjafoB+tBA3gMyHYHrpOtNuDiK/uB5uXxq5wM=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/bsm/redislock v0.5.0 h1:ODM11/cbuUXQqLgZWK6XQnufaTjsBE2UcwBc2EAFNDA=
github.com/bsm/redislock v0.5.0/go.mod h1:qagqKlV+xiLy26iV34Y3zRPxRcJjQYbV7pZfWFeSZ8M=
github.com/casbin/casbin/v2 v2.0.0/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
github.com/casbin/casbin/v2 v2.2.1 h1:ijrSMfBfbQlDc4LnMTGtGYWmhKuuR6RLSQRj8vHrMzc=
github.com/casbin/casbin/v2 v2.2.1/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ=
github.com/casbin/gorm-adapter/v2 v2.0.3 h1:m8o/APMGkm5Gb8RLHU51F/+9ODUyGgPmC+EEzRJsPr0=
github.com/casbin/gorm-adapter/v2 v2.0.3/go.mod h1:pnulk7RNHbFsldTBruui8jqUhq91sLHtub8LJCJSZg8=
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/clbanning/mxj v1.8.4/go.mod h1:BVjHeAH+rl9rs6f+QIpeRl0tfu10SXn1pUSa5PVGJng=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
@@ -43,9 +46,7 @@ github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfc
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3 h1:tkum0XDgfR0jcVVXuTsYv/erY2NnEDqwRojbxR1rBYA=
github.com/denisenkom/go-mssqldb v0.0.0-20190515213511-eb9f6a1743f3/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
@@ -53,58 +54,62 @@ github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8
github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y=
github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0=
github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/gin-contrib/gzip v0.0.1 h1:ezvKOL6jH+jlzdHNE4h9h8q8uMpDQjyl0NN0Jd7jozc=
github.com/gin-contrib/gzip v0.0.1/go.mod h1:fGBJBCdt6qCZuCAOwWuFhBB4OOq9EFqlo5dEaFhhu5w=
github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3 h1:t8FVkw33L+wilf2QiWkw0UV77qRpcH/JHPKGpKa2E8g=
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
github.com/gin-gonic/gin v1.3.0/go.mod h1:7cKuhb5qV2ggCFctp2fJQ+ErvciLZrIeoOSOm6mUr7Y=
github.com/gin-gonic/gin v1.4.0 h1:3tMoCCfM7ppqsR0ptz/wi1impNpT7/9wQtMZ8lr1mCQ=
github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM=
github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0=
github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14=
github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
github.com/git-chglog/git-chglog v0.0.0-20190923122001-6050f20bcdb0/go.mod h1:Dcsy1kii/xFyNad5JqY/d0GO5mu91sungp5xotbm3Yk=
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-ole/go-ole v1.2.4 h1:nNBDSCOigTSiarFpYE9J/KtEA1IOW4CNeqT9TQDqCxI=
github.com/go-ole/go-ole v1.2.4/go.mod h1:XCwSNxSkXRo4vlyPy93sltvi/qJq0jqQhjqQNIwKuxM=
github.com/go-openapi/jsonpointer v0.17.0 h1:nH6xp8XdXHx8dqveo0ZuJBluCO2qGrPbDNZ0dwoRHP0=
github.com/go-openapi/jsonpointer v0.17.0/go.mod h1:cOnomiV+CVVwFLk0A/MExoFMjwdsUdVpsRhURCKh+3M=
github.com/go-openapi/jsonpointer v0.19.2 h1:A9+F4Dc/MCNB5jibxf6rRvOvR/iFgQdyNx9eIhnGqq0=
github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg=
github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=
github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
github.com/go-openapi/jsonreference v0.17.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/jsonreference v0.19.0 h1:BqWKpV1dFd+AuiKlgtddwVIFQsuMpxfBDBHGfM2yNpk=
github.com/go-openapi/jsonreference v0.19.0/go.mod h1:g4xxGn04lDIRh0GJb5QlpE3HfopLOL6uZrK/VgnsK9I=
github.com/go-openapi/jsonreference v0.19.2 h1:o20suLFB4Ri0tuzpWtyHlh7E7HnkqTNLq6aR6WVNS1w=
github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc=
github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o=
github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8=
github.com/go-openapi/spec v0.19.0 h1:A4SZ6IWh3lnjH0rG0Z5lkxazMGBECtrZcbyYQi+64k4=
github.com/go-openapi/spec v0.19.0/go.mod h1:XkF/MOi14NmjsfZ8VtAKf8pIlbZzyoTvZsdfssdxcBI=
github.com/go-openapi/spec v0.19.4 h1:ixzUSnHTd6hCemgtAJgluaTSGYpLNpJY4mA2DIkdOAo=
github.com/go-openapi/spec v0.19.4/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo=
github.com/go-openapi/spec v0.19.7 h1:0xWSeMd35y5avQAThZR2PkEuqSosoS5t6gDH4L8n11M=
github.com/go-openapi/spec v0.19.7/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk=
github.com/go-openapi/swag v0.17.0 h1:iqrgMg7Q7SvtbWLlltPrkMs0UBJI6oTSs79JFRUi880=
github.com/go-openapi/swag v0.17.0/go.mod h1:AByQ+nYG6gQg71GINrmuDXCPWdL640yX49/kXLo40Tg=
github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=
github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
github.com/go-openapi/swag v0.19.8 h1:vfK6jLhs7OI4tAXkvkooviaE1JEPcw3mutyegLHHjmk=
github.com/go-openapi/swag v0.19.8/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY=
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
github.com/go-redis/redis v6.15.7+incompatible h1:3skhDh95XQMpnqeqNftPkQD9jL9e5e36z/1SUm6dy1U=
github.com/go-redis/redis v6.15.7+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis/v7 v7.2.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
github.com/go-redis/redis/v7 v7.4.0 h1:7obg6wUoj05T0EpY0o8B59S9w5yeMWql7sw2kwNW1x4=
github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogf/gf v1.13.2 h1:R6iFOl+JdBE0J9eqFyZxtKwfJpP1QBHJ9ym0lWXGWHs=
github.com/gogf/gf v1.13.2/go.mod h1:iDDJJJeh5KTUbow6IIYgQpRLjyIfhM/IfWkLR3vb/Ac=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
@@ -113,17 +118,16 @@ github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGw
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk=
github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
@@ -131,72 +135,81 @@ github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OI
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/gqcn/structs v1.1.1 h1:cyzGRwfmn3d1d54fwW3KUNyG9QxR0ldIeqwFGeBt638=
github.com/gqcn/structs v1.1.1/go.mod h1:/aBhTBSsKQ2Ec9pbnYdGphtdWXHFn4KrCL0fXM/Adok=
github.com/grokify/html-strip-tags-go v0.0.0-20190921062105-daaa06bf1aaf/go.mod h1:2Su6romC5/1VXOQMaWL2yb618ARB8iVo6/DR99A6d78=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hinshun/vt10x v0.0.0-20180616224451-1954e6464174/go.mod h1:DqJ97dSdRW1W22yXSB90986pcOyQ7r45iio1KN2ez1A=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jinzhu/gorm v1.9.10 h1:HvrsqdhCW78xpJF67g1hMxS6eCToo9PZH4LDB8WKPac=
github.com/jinzhu/gorm v1.9.10/go.mod h1:Kh6hTsSGffh4ui079FHrR5Gg+5D0hgihqDcsDN2BBJY=
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
github.com/jinzhu/now v1.0.1 h1:HjfetcXq097iXP0uoPCdnM4Efp5/9MsM0/M+XOTeR3M=
github.com/jinzhu/now v1.0.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/json-iterator/go v1.1.8 h1:QiWkFLKq0T7mpzwOTu6BzNDbfTE8OLrYhVKYMLF46Ok=
github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/json-iterator/go v1.1.10 h1:Kz6Cvnvv2wGdaG/V8yMvfkmNiXq9Ya2KUv4rouJJr68=
github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
github.com/lib/pq v1.1.1 h1:sJZmqHoEaY7f+NPP8pgLB/WxulyR3fewgCM2qaSlBb4=
github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329 h1:2gxZ0XQIU/5z3Z3bUBu+FXuk2pFbkN6tcwi/pjyaDic=
github.com/mailru/easyjson v0.0.0-20180823135443-60711f1a8329/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
github.com/mailru/easyjson v0.7.1 h1:mdxE1MF9o53iCb2Ghj1VfWvh7ZOwHpnVG/xwXrV90U8=
github.com/mailru/easyjson v0.7.1/go.mod h1:KAzv3t3aY1NaHWoQz1+4F1ccyAH66Jk7yos7ldAVICs=
github.com/matchstalk/redisqueue v1.0.3 h1:ZRrEhnvA6/YxLu2EbzdZYeQHQQYT8yZBAi1qv/USEQA=
github.com/matchstalk/redisqueue v1.0.3/go.mod h1:5DZ3X4w9t+6Wv9vz9wmUt/i15gsOorGXRnqzGhBP6zI=
github.com/matchstalk/utils v0.0.0-20200806172422-ecd38701b407 h1:95XGYkq+UyegTe1BfPJBtOtUpk7JXKCaV5ZJLsrOA/8=
github.com/matchstalk/utils v0.0.0-20200806172422-ecd38701b407/go.mod h1:sVKWLQbzrdi4K5697S/4emCEQ18a9ztUuVns8PRw+00=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc=
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10=
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o=
github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE=
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
github.com/mattn/goveralls v0.0.5/go.mod h1:Xg2LHi51faXLyKXwsndxiW6uxEEQT9+3sjGzzwU4xy0=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y=
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
@@ -212,19 +225,23 @@ github.com/mssola/user_agent v0.5.1 h1:sJUCUozh+j7c0dR2zMIUX5aJjoY/TNo/gXiNujoH5
github.com/mssola/user_agent v0.5.1/go.mod h1:TTPno8LPY3wAIEKRpAtkdMT0f8SE24pLRGPahjCH4uw=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.7.0 h1:WSHQ+IS43OoUrWtD1/bbclrwK8TTH5hzp+umCiuxHgs=
github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU=
github.com/onsi/ginkgo v1.10.1/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg=
github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA=
github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
@@ -249,18 +266,16 @@ github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdh
github.com/shirou/gopsutil v2.20.3+incompatible h1:0JVooMPsT7A7HqEYdydp/OfjSOYSjhXV7w1hkKj/NPQ=
github.com/shirou/gopsutil v2.20.3+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/sirupsen/logrus v1.2.0 h1:juTguoYk5qI21pwyTXY3B3Y5cOTH3ZUyZCg1v/mihuo=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng=
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v1.0.0 h1:6m/oheQuQ13N9ks4hubMG6BnvwOeaJrqSPLahSnczz8=
github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE=
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
@@ -273,30 +288,26 @@ github.com/spf13/viper v1.6.2/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfD
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s=
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
github.com/swaggo/files v0.0.0-20190704085106-630677cd5c14/go.mod h1:gxQT6pBGRuIGunNf/+tSOB5OHvguWi8Tbt82WOkf35E=
github.com/swaggo/gin-swagger v1.2.0 h1:YskZXEiv51fjOMTsXrOetAjrMDfFaXD79PEoQBOe2W0=
github.com/swaggo/gin-swagger v1.2.0/go.mod h1:qlH2+W7zXGZkczuL+r2nEBR2JTT+/lX05Nn6vPhc7OI=
github.com/swaggo/swag v1.5.1 h1:2Agm8I4K5qb00620mHq0VJ05/KT4FtmALPIcQR9lEZM=
github.com/swaggo/swag v1.5.1/go.mod h1:1Bl9F/ZBpVWh22nY0zmYyASPO1lI/zIwRDrpZU+tv8Y=
github.com/swaggo/swag v1.6.5 h1:2C+t+xyK6p1sujqncYO/VnMvPZcBJjNdKKyxbOdAW8o=
github.com/swaggo/swag v1.6.5/go.mod h1:Y7ZLSS0d0DdxhWGVhQdu+Bu1QhaF5k0RD7FKdiAykeY=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/ugorji/go v1.1.4 h1:j4s+tAvLfL3bZyefP2SEWmhBzmuIlH/eqNuPdFPgngw=
github.com/tsuyoshiwada/go-gitcmd v0.0.0-20180205145712-5f1f5f9475df/go.mod h1:pnyouUty/nBr/zm3GYwTIt+qFTLWbdjeLjZmJdzJOu8=
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
github.com/ugorji/go v1.1.5-pre h1:jyJKFOSEbdOc2HODrf2qcCkYOdq7zzXqA9bhW5oV4fM=
github.com/ugorji/go v1.1.5-pre/go.mod h1:FwP/aQVg39TXzItUBMwnWp9T9gPQnXw4Poh4/oBQZ/0=
github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
github.com/ugorji/go/codec v0.0.0-20181022190402-e5e69e061d4f/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
github.com/ugorji/go/codec v1.1.5-pre h1:5YV9PsFAN+ndcCtTM7s60no7nY7eTG3LPtxhSwuxzCs=
github.com/ugorji/go/codec v1.1.5-pre/go.mod h1:tULtS6Gy1AE1yCENaw4Vb//HLH5njI2tfCQDUqRd8fI=
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
@@ -304,7 +315,7 @@ github.com/unrolled/secure v1.0.8 h1:JaMvKbe4CRt8oyxVXn+xY+6jlqd7pyJNSVkmsBxxQsM
github.com/unrolled/secure v1.0.8/go.mod h1:fO+mEan+FLB0CdEnHf6Q4ZZVNqG+5fuLFnP8p0BXDPI=
github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/urfave/cli v1.22.2/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/negroni v1.0.0 h1:kIimOitoypq34K7TG7DUaJ9kq/N4Ofuwi1sjz0KipXc=
github.com/urfave/cli v1.22.3/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4=
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
@@ -316,8 +327,8 @@ go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/
go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c h1:Vj5n4GlwjmQteupaxJ9+0FNOmBrHfq7vN4btdGoDZgI=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190611184440-5c40567a22f8/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59 h1:3zb4D3T4G8jdExgVU/95+vQXfpEPiMdCaZgmGVxjNHM=
@@ -329,8 +340,9 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/mod v0.2.0 h1:KU7oHjnv3XNWfa5COkzUifxZmxp1TyI7ImMXqFxLwvQ=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -343,23 +355,23 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco=
golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190611141213-3f473d35a33a h1:+KkCgOMgnKSgenxTBoiwkMqTiouMIy/3o8RLdmSbGoY=
golang.org/x/net v0.0.0-20190611141213-3f473d35a33a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e h1:3G+cUijn7XD+S4eJFddp53Pv7+slrESplyjG25HgL+k=
golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 h1:pNX+40auqi2JqRfOP1akLGtYcn15TUbkhwuCO3foqqM=
golang.org/x/net v0.0.0-20200602114024-627f9648deb9/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -369,19 +381,21 @@ golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181228144115-9a3f9b0469bb/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae h1:xiXzMMEQdQcric9hXtr1QU98MHunKK7OTtsoU6bYWs4=
golang.org/x/sys v0.0.0-20190530182044-ad28b68e88f1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190610200419-93c9922d18ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae h1:Ih9Yo4hSPImZOpfGuA4bR/ORKTAbhZo2AbWNRCnevdo=
golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
@@ -396,19 +410,17 @@ golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190606050223-4d9ae51c2468/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b h1:/mJ+GKieZA6hFDQGdWZrjj4AXPl5ylY+5HusG80roy0=
golang.org/x/tools v0.0.0-20190611222205-d73e1c7e250b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200113040837-eac381796e91/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20200402223321-bcf690261a44 h1:bMm0eoDiGkM5VfIyKjxDvoflW5GLp7+VCo+60n8F+TE=
golang.org/x/tools v0.0.0-20200402223321-bcf690261a44/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
@@ -416,30 +428,26 @@ google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRn
google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
gopkg.in/AlecAivazis/survey.v1 v1.8.8/go.mod h1:CaHjv79TCgAvXMSFJSVgonHXYWxnhzI3eoHtnX5UgUo=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM=
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
gopkg.in/go-playground/validator.v8 v8.18.2 h1:lFB4DoMU6B626w8ny76MV7VX6W2VHct2GVOI3xgiMrQ=
gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y=
gopkg.in/ini.v1 v1.51.0 h1:AQvPpx3LzTDM0AjnIRlVFwFFGC+npRopjZxLJj6gdno=
gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/kyokomi/emoji.v1 v1.5.1/go.mod h1:N9AZ6hi1jHOPn34PsbpufQZUcKftSD7WgS2pgpmH4Lg=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+56 -38
View File
@@ -4,10 +4,11 @@ import (
"github.com/gin-gonic/gin"
"github.com/mojocn/base64Captcha"
"github.com/mssola/user_agent"
"go-admin/global"
"go-admin/models"
jwt "go-admin/pkg/jwtauth"
"go-admin/tools"
log "github.com/sirupsen/logrus"
"go-admin/tools/config"
"net/http"
)
@@ -43,60 +44,76 @@ func IdentityHandler(c *gin.Context) interface{} {
// @Summary 登陆
// @Description 获取token
// LoginHandler can be used by clients to get a jwt token.
// Payload needs to be json in the form of {"username": "USERNAME", "password": "PASSWORD"}.
// Reply will be of the form {"token": "TOKEN"}.
// @Description LoginHandler can be used by clients to get a jwt token.
// @Description Payload needs to be json in the form of {"username": "USERNAME", "password": "PASSWORD"}.
// @Description Reply will be of the form {"token": "TOKEN"}.
// @Description dev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password
// @Description 注意:开发模式:需要注意全部字段不能为空,账号密码外可以传入0值
// @Accept application/json
// @Product application/json
// @Param username body models.Login true "Add account"
// @Param account body models.Login true "account"
// @Success 200 {string} string "{"code": 200, "expire": "2019-08-07T12:45:48+08:00", "token": ".eyJleHAiOjE1NjUxNTMxNDgsImlkIjoiYWRtaW4iLCJvcmlnX2lhdCI6MTU2NTE0OTU0OH0.-zvzHvbg0A" }"
// @Router /login [post]
func Authenticator(c *gin.Context) (interface{}, error) {
var loginVals models.Login
var loginlog models.LoginLog
ua := user_agent.New(c.Request.UserAgent())
loginlog.Ipaddr = c.ClientIP()
location := tools.GetLocation(c.ClientIP())
loginlog.LoginLocation = location
loginlog.LoginTime = tools.GetCurrntTime()
loginlog.Status = "0"
loginlog.Remark = c.Request.UserAgent()
browserName, browserVersion := ua.Browser()
loginlog.Browser = browserName + " " + browserVersion
loginlog.Os = ua.OS()
loginlog.Msg = "登录成功"
loginlog.Platform = ua.Platform()
var status = "0"
var msg = "登录成功"
var username = ""
if err := c.ShouldBind(&loginVals); err != nil {
loginlog.Status = "1"
loginlog.Msg = "数据解析失败"
loginlog.Username = loginVals.Username
loginlog.Create()
username = loginVals.Username
msg = "数据解析失败"
status = "1"
LoginLogToDB(c, status, msg, username)
return nil, jwt.ErrMissingLoginValues
}
loginlog.Username = loginVals.Username
if !store.Verify(loginVals.UUID, loginVals.Code, true) {
loginlog.Status = "1"
loginlog.Msg = "验证码错误"
loginlog.Create()
return nil, jwt.ErrInvalidVerificationode
}
if config.ApplicationConfig.Mode != "dev" {
if !store.Verify(loginVals.UUID, loginVals.Code, true) {
username = loginVals.Username
msg = "验证码错误"
status = "1"
LoginLogToDB(c, status, msg, username)
return nil, jwt.ErrInvalidVerificationode
}
}
user, role, e := loginVals.GetUser()
if e == nil {
loginlog.Create()
username = loginVals.Username
LoginLogToDB(c, status, msg, username)
return map[string]interface{}{"user": user, "role": role}, nil
} else {
loginlog.Status = "1"
loginlog.Msg = "登录失败"
loginlog.Create()
log.Println(e.Error())
msg = "登录失败"
status = "1"
LoginLogToDB(c, status, msg, username)
global.RequestLogger.Println(e.Error())
}
return nil, jwt.ErrFailedAuthentication
}
// Write log to database
func LoginLogToDB(c *gin.Context, status string, msg string, username string) {
if config.LoggerConfig.EnabledDB {
var loginlog models.LoginLog
ua := user_agent.New(c.Request.UserAgent())
loginlog.Ipaddr = c.ClientIP()
loginlog.Username = username
location := tools.GetLocation(c.ClientIP())
loginlog.LoginLocation = location
loginlog.LoginTime = tools.GetCurrentTime()
loginlog.Status = status
loginlog.Remark = c.Request.UserAgent()
browserName, browserVersion := ua.Browser()
loginlog.Browser = browserName + " " + browserVersion
loginlog.Os = ua.OS()
loginlog.Msg = msg
loginlog.Platform = ua.Platform()
_, _ = loginlog.Create()
}
}
// @Summary 退出登录
// @Description 获取token
// LoginHandler can be used by clients to get a jwt token.
@@ -105,14 +122,14 @@ func Authenticator(c *gin.Context) (interface{}, error) {
// @Product application/json
// @Success 200 {string} string "{"code": 200, "msg": "成功退出系统" }"
// @Router /logout [post]
// @Security
// @Security Bearer
func LogOut(c *gin.Context) {
var loginlog models.LoginLog
ua := user_agent.New(c.Request.UserAgent())
loginlog.Ipaddr = c.ClientIP()
location := tools.GetLocation(c.ClientIP())
loginlog.LoginLocation = location
loginlog.LoginTime = tools.GetCurrntTime()
loginlog.LoginTime = tools.GetCurrentTime()
loginlog.Status = "0"
loginlog.Remark = c.Request.UserAgent()
browserName, browserVersion := ua.Browser()
@@ -122,6 +139,7 @@ func LogOut(c *gin.Context) {
loginlog.Username = tools.GetUserName(c)
loginlog.Msg = "退出成功"
loginlog.Create()
c.JSON(http.StatusOK, gin.H{
"code": 200,
"msg": "退出成功",
+1 -1
View File
@@ -10,7 +10,7 @@ func TlsHandler() gin.HandlerFunc {
return func(c *gin.Context) {
secureMiddleware := secure.New(secure.Options{
SSLRedirect: true,
SSLHost: config.ApplicationConfig.Domain,
SSLHost: config.SslConfig.Domain,
})
err := secureMiddleware.Process(c.Writer, c.Request)
if err != nil {
+1 -1
View File
@@ -3,7 +3,7 @@ package handler
import (
"github.com/gin-gonic/gin"
jwt "go-admin/pkg/jwtauth"
log "github.com/sirupsen/logrus"
"log"
"net/http"
)
+1 -1
View File
@@ -8,4 +8,4 @@ func Ping(c *gin.Context) {
c.JSON(200, gin.H{
"message": "ok",
})
}
}
+12 -13
View File
@@ -75,12 +75,12 @@ func DiskCheck(c *gin.Context) {
func OSCheck(c *gin.Context) {
status := http.StatusOK
app.Custum(c, gin.H{
"code": 200,
"status": status,
"goOs": runtime.GOOS,
"compiler": runtime.Compiler,
"numCpu": runtime.NumCPU(),
"version": runtime.Version(),
"code": 200,
"status": status,
"goOs": runtime.GOOS,
"compiler": runtime.Compiler,
"numCpu": runtime.NumCPU(),
"version": runtime.Version(),
"numGoroutine": runtime.NumGoroutine(),
})
}
@@ -153,13 +153,12 @@ func RAMCheck(c *gin.Context) {
text = "WARNING"
}
app.Custum(c, gin.H{
"code": 200,
"msg": text,
"status": status,
"used": usedMB,
"total": totalMB,
"usedPercent": usedPercent,
"code": 200,
"msg": text,
"status": status,
"used": usedMB,
"total": totalMB,
"usedPercent": usedPercent,
})
}
+24
View File
@@ -0,0 +1,24 @@
package jobs
import (
"fmt"
"time"
)
// 需要将定义的struct 添加到字典中;
// 字典 key 可以配置到 自动任务 调用目标 中;
func InitJob() {
jobList = map[string]JobsExec{
"ExamplesOne": ExamplesOne{},
// ...
}
}
// 新添加的job 必须按照以下格式定义,并实现Exec函数
type ExamplesOne struct {
}
func (t ExamplesOne) Exec() {
str := time.Now().Format(timeFormat) + " [INFO] JobCore ExamplesOne exec success"
fmt.Println(str)
}
+183
View File
@@ -0,0 +1,183 @@
package jobs
import (
"fmt"
"github.com/robfig/cron/v3"
"go-admin/global"
"go-admin/models"
"go-admin/pkg"
"go-admin/pkg/cronjob"
"sync"
"time"
)
var timeFormat = "2006-01-02 15:04:05"
var retryCount = 3
var jobList map[string]JobsExec
var lock sync.Mutex
type JobCore struct {
InvokeTarget string
Name string
JobId int
EntryId int
CronExpression string
}
// 任务类型 http
type HttpJob struct {
JobCore
}
type ExecJob struct {
JobCore
}
func (e *ExecJob) Run() {
startTime := time.Now()
var obj = jobList[e.InvokeTarget]
if obj == nil {
global.JobLogger.Warning(" ExecJob Run job nil", e)
return
}
CallExec(obj.(JobsExec))
// 结束时间
endTime := time.Now()
// 执行时间
latencyTime := endTime.Sub(startTime)
//TODO: 待完善部分
//str := time.Now().Format(timeFormat) + " [INFO] JobCore " + string(e.EntryId) + "exec success , spend :" + latencyTime.String()
//ws.SendAll(str)
global.JobLogger.Info(time.Now().Format(timeFormat), " [INFO] JobCore ", e, "exec success , spend :", latencyTime)
}
//http 任务接口
func (h *HttpJob) Run() {
startTime := time.Now()
var count = 0
/* 循环 */
LOOP:
if count < retryCount {
/* 跳过迭代 */
str, err := pkg.Get(h.InvokeTarget)
if err != nil {
// 如果失败暂停一段时间重试
fmt.Println(time.Now().Format(timeFormat), " [ERROR] mission failed! ", err)
fmt.Printf(time.Now().Format(timeFormat)+" [INFO] Retry after the task fails %d seconds! %s \n", time.Duration(count)*time.Second, str)
time.Sleep(time.Duration(count) * time.Second)
goto LOOP
}
count = count + 1
}
// 结束时间
endTime := time.Now()
// 执行时间
latencyTime := endTime.Sub(startTime)
//TODO: 待完善部分
//str := time.Now().Format(timeFormat) + " [INFO] JobCore " + string(h.EntryId) + "exec success , spend :" + latencyTime.String()
//ws.SendAll(str)
global.JobLogger.Info(time.Now().Format(timeFormat), " [INFO] JobCore ", h, "exec success , spend :", latencyTime)
}
// 初始化
func Setup() {
fmt.Println(time.Now().Format(timeFormat), " [INFO] JobCore Starting...")
global.GADMCron = cronjob.NewWithSeconds()
sysJob := models.SysJob{}
jobList, err := sysJob.GetList()
if err != nil {
fmt.Println(time.Now().Format(timeFormat), " [ERROR] JobCore init error", err)
}
if len(jobList) == 0 {
fmt.Println(time.Now().Format(timeFormat), " [INFO] JobCore total:0")
}
_, err = sysJob.RemoveAllEntryID()
if err != nil {
fmt.Println(time.Now().Format(timeFormat), " [ERROR] JobCore remove entry_id error", err)
}
for i := 0; i < len(jobList); i++ {
if jobList[i].JobType == 1 {
j := &HttpJob{}
j.InvokeTarget = jobList[i].InvokeTarget
j.CronExpression = jobList[i].CronExpression
j.JobId = jobList[i].JobId
j.Name = jobList[i].JobName
sysJob.EntryId, err = AddJob(j)
} else if jobList[i].JobType == 2 {
j := &ExecJob{}
j.InvokeTarget = jobList[i].InvokeTarget
j.CronExpression = jobList[i].CronExpression
j.JobId = jobList[i].JobId
j.Name = jobList[i].JobName
sysJob.EntryId, err = AddJob(j)
}
_, err = sysJob.Update(jobList[i].JobId)
}
// 其中任务
global.GADMCron.Start()
fmt.Println(time.Now().Format(timeFormat), " [INFO] JobCore start success.")
// 关闭任务
defer global.GADMCron.Stop()
select {}
}
// 添加任务 AddJob(invokeTarget string, jobId int, jobName string, cronExpression string)
func AddJob(job Job) (int, error) {
if job == nil {
fmt.Println("unknown")
return 0, nil
}
return job.addJob()
}
func (h *HttpJob) addJob() (int, error) {
id, err := global.GADMCron.AddJob(h.CronExpression, h)
if err != nil {
fmt.Println(time.Now().Format(timeFormat), " [ERROR] JobCore AddJob error", err)
return 0, err
}
EntryId := int(id)
return EntryId, nil
}
func (h *ExecJob) addJob() (int, error) {
id, err := global.GADMCron.AddJob(h.CronExpression, h)
if err != nil {
fmt.Println(time.Now().Format(timeFormat), " [ERROR] JobCore AddJob error", err)
return 0, err
}
EntryId := int(id)
return EntryId, nil
}
// 移除任务
func Remove(entryID int) chan bool {
ch := make(chan bool)
go func() {
global.GADMCron.Remove(cron.EntryID(entryID))
fmt.Println(time.Now().Format(timeFormat), " [INFO] JobCore Remove success ,info entryID :", entryID)
ch <- true
}()
return ch
}
// 任务停止
func Stop() chan bool {
ch := make(chan bool)
go func() {
global.GADMCron.Stop()
ch <- true
}()
return ch
}
+14
View File
@@ -0,0 +1,14 @@
package jobs
type Job interface {
Run()
addJob() (int, error)
}
type JobsExec interface {
Exec()
}
func CallExec(e JobsExec) {
e.Exec()
}
+1 -1
View File
@@ -5,7 +5,7 @@ import (
)
// @title go-admin API
// @version 0.0.1
// @version 1.0.1
// @description 基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档
// @description 添加qq群: 74520518 进入技术交流群 请备注,谢谢!
// @license.name MIT
+1 -1
View File
@@ -26,7 +26,7 @@ func CustomError(c *gin.Context) {
}
c.Status(statusCode)
fmt.Println(
time.Now().Format("\n 2006-01-02 15:04:05.9999"),
time.Now().Format("2006-01-02 15:04:05"),
"[ERROR]",
c.Request.Method,
c.Request.URL,
+10 -7
View File
@@ -1,8 +1,9 @@
package middleware
import (
"fmt"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
"go-admin/global"
"go-admin/models"
"go-admin/tools"
config2 "go-admin/tools/config"
@@ -39,16 +40,18 @@ func LoggerToFile() gin.HandlerFunc {
clientIP := c.ClientIP()
// 日志格式
log.Infof(" %s %3d %13v %15s %s %s \r\n",
startTime.Format("2006-01-02 15:04:05.9999"),
fmt.Printf("%s [INFO] %s %s %3d %13v %15s \r\n",
startTime.Format("2006-01-02 15:04:05"),
reqMethod,
reqUri,
statusCode,
latencyTime,
clientIP,
reqMethod,
reqUri,
)
if c.Request.Method != "GET" && c.Request.Method != "OPTIONS" && config2.LogConfig.Operdb {
global.RequestLogger.Info(statusCode, latencyTime, clientIP, reqMethod, reqUri)
if c.Request.Method != "GET" && c.Request.Method != "OPTIONS" && config2.LoggerConfig.EnabledDB {
SetDBOperLog(c, clientIP, statusCode, reqUri, reqMethod, latencyTime)
}
}
@@ -93,7 +96,7 @@ func SetDBOperLog(c *gin.Context, clientIP string, statusCode int, reqUri string
b, _ := c.Get("body")
sysOperLog.OperParam, _ = tools.StructToJsonStr(b)
sysOperLog.CreateBy = tools.GetUserName(c)
sysOperLog.OperTime = tools.GetCurrntTime()
sysOperLog.OperTime = tools.GetCurrentTime()
sysOperLog.LatencyTime = (latencyTime).String()
sysOperLog.UserAgent = c.Request.UserAgent()
if c.Err() == nil {
+8 -3
View File
@@ -1,12 +1,12 @@
package middleware
import (
"fmt"
"github.com/gin-gonic/gin"
mycasbin "go-admin/pkg/casbin"
"go-admin/pkg/jwtauth"
_ "go-admin/pkg/jwtauth"
"go-admin/tools"
log "github.com/sirupsen/logrus"
"net/http"
)
@@ -19,10 +19,15 @@ func AuthCheckRole() gin.HandlerFunc {
tools.HasError(err, "", 500)
//检查权限
res, err := e.Enforce(v["rolekey"], c.Request.URL.Path, c.Request.Method)
log.Println("----------------", v["rolekey"], c.Request.URL.Path, c.Request.Method)
tools.HasError(err, "", 500)
fmt.Printf("%s [INFO] %s %s %s \r\n",
tools.GetCurrentTimeStr(),
c.Request.Method,
c.Request.URL.Path,
v["rolekey"],
)
if res {
c.Next()
} else {
+7 -7
View File
@@ -2,13 +2,13 @@ package models
//casbin_rule
type CasbinRule struct {
PType string `json:"p_type" gorm:"type:varchar(100);"`
V0 string `json:"v0" gorm:"type:varchar(100);"`
V1 string `json:"v1" gorm:"type:varchar(100);"`
V2 string `json:"v2" gorm:"type:varchar(100);"`
V3 string `json:"v3" gorm:"type:varchar(100);"`
V4 string `json:"v4" gorm:"type:varchar(100);"`
V5 string `json:"v5" gorm:"type:varchar(100);"`
PType string `json:"p_type" gorm:"size:100;"`
V0 string `json:"v0" gorm:"size:100;"`
V1 string `json:"v1" gorm:"size:100;"`
V2 string `json:"v2" gorm:"size:100;"`
V3 string `json:"v3" gorm:"size:100;"`
V4 string `json:"v4" gorm:"size:100;"`
V5 string `json:"v5" gorm:"size:100;"`
}
func (CasbinRule) TableName() string {
+14 -8
View File
@@ -2,25 +2,31 @@ package models
import (
"errors"
orm "go-admin/global/orm"
orm "go-admin/global"
"go-admin/tools"
_ "time"
)
type SysConfig struct {
ConfigId int `json:"configId" gorm:"primary_key;auto_increment;"` //编码
ConfigName string `json:"configName" gorm:"type:varchar(128);"` //参数名称
ConfigKey string `json:"configKey" gorm:"type:varchar(128);"` //参数键名
ConfigValue string `json:"configValue" gorm:"type:varchar(255);"` //参数键值
ConfigType string `json:"configType" gorm:"type:varchar(64);"` //是否系统内置
Remark string `json:"remark" gorm:"type:varchar(128);"` //备注
CreateBy string `json:"createBy" gorm:"type:varchar(128);"`
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"`
ConfigName string `json:"configName" gorm:"size:128;"` //参数名称
ConfigKey string `json:"configKey" gorm:"size:128;"` //参数键名
ConfigValue string `json:"configValue" gorm:"size:255;"` //参数键值
ConfigType string `json:"configType" gorm:"size:64;"` //是否系统内置
Remark string `json:"remark" gorm:"size:128;"` //备注
CreateBy string `json:"createBy" gorm:"size:128;"`
UpdateBy string `json:"updateBy" gorm:"size:128;"`
DataScope string `json:"dataScope" gorm:"-"`
Params string `json:"params" gorm:"-"`
BaseModel
}
func DataInit() {
//config1:=SysConfig{1, "主框架页-默认皮肤样式名称", "sys_index_skinName", "skin-blue", "Y", "蓝色 skin-blue、绿色 skin-green、紫色 skin-purple、红色 skin-red、黄色 skin-yellow", "1", "1", "","",BaseModel{time.Now(), time.Now(), nil}}
//
//orm.Eloquent.Create(&config1)
}
func (SysConfig) TableName() string {
return "sys_config"
}
+8
View File
@@ -2,8 +2,10 @@ package models
import (
"errors"
"fmt"
"github.com/jinzhu/gorm"
"go-admin/tools"
"go-admin/tools/config"
)
type DataPermission struct {
@@ -14,6 +16,12 @@ type DataPermission struct {
}
func (e *DataPermission) GetDataScope(tbname string, table *gorm.DB) (*gorm.DB, error) {
if !config.ApplicationConfig.EnableDP {
usageStr := `数据权限已经为您` + tools.Green(`关闭`) + `,如需开启请参考配置文件字段说明`
fmt.Printf("%s\n", usageStr)
return table, nil
}
SysUser := new(SysUser)
SysRole := new(SysRole)
SysUser.UserId = e.UserId
+57 -39
View File
@@ -2,30 +2,30 @@ package models
import (
"errors"
"go-admin/global/orm"
orm "go-admin/global"
"go-admin/tools"
_ "time"
)
type Dept struct {
DeptId int `json:"deptId" gorm:"primary_key;AUTO_INCREMENT"` //部门编码
ParentId int `json:"parentId" gorm:"type:int(11);"` //上级部门
DeptPath string `json:"deptPath" gorm:"type:varchar(255);"` //
DeptName string `json:"deptName" gorm:"type:varchar(128);"` //部门名称
Sort int `json:"sort" gorm:"type:int(4);"` //排序
Leader string `json:"leader" gorm:"type:varchar(128);"` //负责人
Phone string `json:"phone" gorm:"type:varchar(11);"` //手机
Email string `json:"email" gorm:"type:varchar(64);"` //邮箱
Status string `json:"status" gorm:"type:int(1);"` //状态
CreateBy string `json:"createBy" gorm:"type:varchar(64);"`
UpdateBy string `json:"updateBy" gorm:"type:varchar(64);"`
DataScope string `json:"dataScope" gorm:"-"`
Params string `json:"params" gorm:"-"`
Children []Dept `json:"children" gorm:"-"`
type SysDept struct {
DeptId int `json:"deptId" gorm:"primary_key;AUTO_INCREMENT"` //部门编码
ParentId int `json:"parentId" gorm:""` //上级部门
DeptPath string `json:"deptPath" gorm:"size:255;"` //
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
Sort int `json:"sort" gorm:""` //排序
Leader string `json:"leader" gorm:"size:128;"` //负责人
Phone string `json:"phone" gorm:"size:11;"` //手机
Email string `json:"email" gorm:"size:64;"` //邮箱
Status string `json:"status" gorm:"size:4;"` //状态
CreateBy string `json:"createBy" gorm:"size:64;"`
UpdateBy string `json:"updateBy" gorm:"size:64;"`
DataScope string `json:"dataScope" gorm:"-"`
Params string `json:"params" gorm:"-"`
Children []SysDept `json:"children" gorm:"-"`
BaseModel
}
func (Dept) TableName() string {
func (SysDept) TableName() string {
return "sys_dept"
}
@@ -35,8 +35,8 @@ type DeptLable struct {
Children []DeptLable `gorm:"-" json:"children"`
}
func (e *Dept) Create() (Dept, error) {
var doc Dept
func (e *SysDept) Create() (SysDept, error) {
var doc SysDept
result := orm.Eloquent.Table(e.TableName()).Create(&e)
if result.Error != nil {
err := result.Error
@@ -44,7 +44,7 @@ func (e *Dept) Create() (Dept, error) {
}
deptPath := "/" + tools.IntToString(e.DeptId)
if int(e.ParentId) != 0 {
var deptP Dept
var deptP SysDept
orm.Eloquent.Table(e.TableName()).Where("dept_id = ?", e.ParentId).First(&deptP)
deptPath = deptP.DeptPath + deptPath
} else {
@@ -61,8 +61,8 @@ func (e *Dept) Create() (Dept, error) {
return doc, nil
}
func (e *Dept) Get() (Dept, error) {
var doc Dept
func (e *SysDept) Get() (SysDept, error) {
var doc SysDept
table := orm.Eloquent.Table(e.TableName())
if e.DeptId != 0 {
@@ -78,8 +78,8 @@ func (e *Dept) Get() (Dept, error) {
return doc, nil
}
func (e *Dept) GetList() ([]Dept, error) {
var doc []Dept
func (e *SysDept) GetList() ([]SysDept, error) {
var doc []SysDept
table := orm.Eloquent.Table(e.TableName())
if e.DeptId != 0 {
@@ -98,8 +98,8 @@ func (e *Dept) GetList() ([]Dept, error) {
return doc, nil
}
func (e *Dept) GetPage(bl bool) ([]Dept, error) {
var doc []Dept
func (e *SysDept) GetPage(bl bool) ([]SysDept, error) {
var doc []SysDept
table := orm.Eloquent.Select("*").Table(e.TableName())
if e.DeptId != 0 {
@@ -131,10 +131,10 @@ func (e *Dept) GetPage(bl bool) ([]Dept, error) {
return doc, nil
}
func (e *Dept) SetDept(bl bool) ([]Dept, error) {
func (e *SysDept) SetDept(bl bool) ([]SysDept, error) {
list, err := e.GetPage(bl)
m := make([]Dept, 0)
m := make([]SysDept, 0)
for i := 0; i < len(list); i++ {
if list[i].ParentId != 0 {
continue
@@ -146,16 +146,16 @@ func (e *Dept) SetDept(bl bool) ([]Dept, error) {
return m, err
}
func Digui(deptlist *[]Dept, menu Dept) Dept {
func Digui(deptlist *[]SysDept, menu SysDept) SysDept {
list := *deptlist
min := make([]Dept, 0)
min := make([]SysDept, 0)
for j := 0; j < len(list); j++ {
if menu.DeptId != list[j].ParentId {
continue
}
mi := Dept{}
mi := SysDept{}
mi.DeptId = list[j].DeptId
mi.ParentId = list[j].ParentId
mi.DeptPath = list[j].DeptPath
@@ -165,7 +165,7 @@ func Digui(deptlist *[]Dept, menu Dept) Dept {
mi.Phone = list[j].Phone
mi.Email = list[j].Email
mi.Status = list[j].Status
mi.Children = []Dept{}
mi.Children = []SysDept{}
ms := Digui(deptlist, mi)
min = append(min, ms)
@@ -174,14 +174,14 @@ func Digui(deptlist *[]Dept, menu Dept) Dept {
return menu
}
func (e *Dept) Update(id int) (update Dept, err error) {
func (e *SysDept) Update(id int) (update SysDept, err error) {
if err = orm.Eloquent.Table(e.TableName()).Where("dept_id = ?", id).First(&update).Error; err != nil {
return
}
deptPath := "/" + tools.IntToString(e.DeptId)
if int(e.ParentId) != 0 {
var deptP Dept
var deptP SysDept
orm.Eloquent.Table(e.TableName()).Where("dept_id = ?", e.ParentId).First(&deptP)
deptPath = deptP.DeptPath + deptPath
} else {
@@ -203,23 +203,41 @@ func (e *Dept) Update(id int) (update Dept, err error) {
return
}
func (e *Dept) Delete(id int) (success bool, err error) {
func (e *SysDept) Delete(id int) (success bool, err error) {
user := SysUser{}
user.DeptId = id
userlist, err := user.GetList()
tools.HasError(err, "", 500)
tools.Assert(len(userlist) <= 0, "当前部门存在用户,不能删除!",500)
tools.Assert(len(userlist) <= 0, "当前部门存在用户,不能删除!", 500)
if err = orm.Eloquent.Table(e.TableName()).Where("dept_id = ?", id).Delete(&Dept{}).Error; err != nil {
tx := orm.Eloquent.Begin()
defer func() {
if r := recover(); r != nil {
tx.Rollback()
}
}()
if err = tx.Error; err != nil {
success = false
return
}
if err = tx.Table(e.TableName()).Where("dept_id = ?", id).Delete(&SysDept{}).Error; err != nil {
success = false
tx.Rollback()
return
}
if err = tx.Commit().Error; err != nil {
success = false
return
}
success = true
return
}
func (dept *Dept) SetDeptLable() (m []DeptLable, err error) {
func (dept *SysDept) SetDeptLable() (m []DeptLable, err error) {
deptlist, err := dept.GetList()
m = make([]DeptLable, 0)
@@ -237,7 +255,7 @@ func (dept *Dept) SetDeptLable() (m []DeptLable, err error) {
return
}
func DiguiDeptLable(deptlist *[]Dept, dept DeptLable) DeptLable {
func DiguiDeptLable(deptlist *[]SysDept, dept DeptLable) DeptLable {
list := *deptlist
min := make([]DeptLable, 0)
+13 -13
View File
@@ -2,24 +2,24 @@ package models
import (
"errors"
"go-admin/global/orm"
orm "go-admin/global"
"go-admin/tools"
)
type DictData struct {
DictCode int `gorm:"primary_key;AUTO_INCREMENT" json:"dictCode" example:"1"` //字典编码
DictSort int `gorm:"type:int(4);" json:"dictSort"` //显示顺序
DictLabel string `gorm:"type:varchar(128);" json:"dictLabel"` //数据标签
DictValue string `gorm:"type:varchar(255);" json:"dictValue"` //数据键值
DictType string `gorm:"type:varchar(64);" json:"dictType"` //字典类型
CssClass string `gorm:"type:varchar(128);" json:"cssClass"` //
ListClass string `gorm:"type:varchar(128);" json:"listClass"` //
IsDefault string `gorm:"type:varchar(8);" json:"isDefault"` //
Status string `gorm:"type:int(1);" json:"status"` //状态
Default string `gorm:"type:varchar(8);" json:"default"` //
CreateBy string `gorm:"type:varchar(64);" json:"createBy"` //
UpdateBy string `gorm:"type:varchar(64);" json:"updateBy"` //
Remark string `gorm:"type:varchar(255);" json:"remark"` //备注
DictSort int `gorm:"" json:"dictSort"` //显示顺序
DictLabel string `gorm:"size:128;" json:"dictLabel"` //数据标签
DictValue string `gorm:"size:255;" json:"dictValue"` //数据键值
DictType string `gorm:"size:64;" json:"dictType"` //字典类型
CssClass string `gorm:"size:128;" json:"cssClass"` //
ListClass string `gorm:"size:128;" json:"listClass"` //
IsDefault string `gorm:"size:8;" json:"isDefault"` //
Status string `gorm:"size:4;" json:"status"` //状态
Default string `gorm:"size:8;" json:"default"` //
CreateBy string `gorm:"size:64;" json:"createBy"` //
UpdateBy string `gorm:"size:64;" json:"updateBy"` //
Remark string `gorm:"size:255;" json:"remark"` //备注
Params string `gorm:"-" json:"params"`
DataScope string `gorm:"-" json:"dataScope"`
BaseModel
+9 -9
View File
@@ -2,20 +2,20 @@ package models
import (
"errors"
"go-admin/global/orm"
orm "go-admin/global"
"go-admin/tools"
)
type DictType struct {
DictId int `gorm:"primary_key;AUTO_INCREMENT" json:"dictId"`
DictName string `gorm:"type:varchar(128);" json:"dictName"` //字典名称
DictType string `gorm:"type:varchar(128);" json:"dictType"` //字典类型
Status string `gorm:"type:int(1);" json:"status"` //状态
DataScope string `gorm:"-" json:"dataScope"` //
Params string `gorm:"-" json:"params"` //
CreateBy string `gorm:"type:varchar(11);" json:"createBy"` //创建者
UpdateBy string `gorm:"type:varchar(11);" json:"updateBy"` //更新者
Remark string `gorm:"type:varchar(255);" json:"remark"` //备注
DictName string `gorm:"size:128;" json:"dictName"` //字典名称
DictType string `gorm:"size:128;" json:"dictType"` //字典类型
Status string `gorm:"size:4;" json:"status"` //状态
DataScope string `gorm:"-" json:"dataScope"` //
Params string `gorm:"-" json:"params"` //
CreateBy string `gorm:"size:11;" json:"createBy"` //创建者
UpdateBy string `gorm:"size:11;" json:"updateBy"` //更新者
Remark string `gorm:"size:255;" json:"remark"` //备注
BaseModel
}
+80 -17
View File
@@ -8,21 +8,84 @@ import (
func AutoMigrate(db *gorm.DB) error {
db.SingularTable(true)
return db.AutoMigrate(
new(models.CasbinRule),
new(tools.SysTables),
new(tools.SysColumns),
new(models.Dept),
new(models.Menu),
new(models.LoginLog),
new(models.SysOperLog),
new(models.RoleMenu),
new(models.SysRoleDept),
new(models.SysUser),
new(models.SysRole),
new(models.Post),
new(models.DictData),
new(models.SysConfig),
new(models.DictType),
).Error
err := db.AutoMigrate(new(models.CasbinRule)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.SysDept)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.SysConfig)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(tools.SysTables)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(tools.SysColumns)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.Menu)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.LoginLog)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.SysOperLog)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.RoleMenu)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.SysRoleDept)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.SysUser)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.SysRole)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.Post)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.DictData)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.DictType)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.SysJob)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.SysConfig)).Error
if err != nil {
return err
}
err = db.AutoMigrate(new(models.SysSetting)).Error
if err != nil {
return err
}
models.DataInit()
return err
}
func CustomMigrate(db *gorm.DB, table interface{}) error {
db.SingularTable(true)
return db.AutoMigrate(&table).Error
}
+14 -9
View File
@@ -2,31 +2,36 @@ package models
import (
"fmt"
"go-admin/global/orm"
config2 "go-admin/tools/config"
"go-admin/global"
"io/ioutil"
"strings"
)
func InitDb() error {
filePath := "config/db.sql"
if config2.DatabaseConfig.Dbtype == "sqlite3" {
fmt.Println("sqlite3数据库无需初始化!")
return nil
err := ExecSql(filePath)
if global.Driver == "postgres" {
filePath = "config/pg.sql"
err = ExecSql(filePath)
}
return err
}
func ExecSql(filePath string) error {
sql, err := Ioutil(filePath)
if err != nil {
fmt.Println("数据库基础数据初始化脚本读取失败!原因:", err.Error())
return err
}
sqlList := strings.Split(sql, ";")
for i := 0; i < len(sqlList) - 1; i++ {
for i := 0; i < len(sqlList)-1; i++ {
if strings.Contains(sqlList[i], "--") {
fmt.Println(sqlList[i])
continue
}
sql := strings.Replace(sqlList[i]+";", "\n", "", 0)
if err = orm.Eloquent.Exec(sql).Error; err != nil {
sql = strings.TrimSpace(sql)
if err = global.Eloquent.Exec(sql).Error; err != nil {
if !strings.Contains(err.Error(), "Query was empty") {
return err
}
@@ -35,8 +40,8 @@ func InitDb() error {
return nil
}
func Ioutil(name string) (string, error) {
if contents, err := ioutil.ReadFile(name); err == nil {
func Ioutil(filePath string) (string, error) {
if contents, err := ioutil.ReadFile(filePath); err == nil {
//因为contents是[]byte类型,直接转换成string类型后会多一行空格,需要使用strings.Replace替换换行符
result := strings.Replace(string(contents), "\n", "", 1)
fmt.Println("Use ioutil.ReadFile to read a file:", result)
+1 -1
View File
@@ -1,7 +1,7 @@
package models
import (
"go-admin/global/orm"
orm "go-admin/global"
"go-admin/tools"
)
+12 -12
View File
@@ -1,26 +1,26 @@
package models
import (
"go-admin/global/orm"
orm "go-admin/global"
"time"
)
type LoginLog struct {
InfoId int `json:"infoId" gorm:"primary_key;AUTO_INCREMENT"` //主键
Username string `json:"username" gorm:"type:varchar(128);"` //用户名
Status string `json:"status" gorm:"type:int(1);"` //状态
Ipaddr string `json:"ipaddr" gorm:"type:varchar(255);"` //ip地址
LoginLocation string `json:"loginLocation" gorm:"type:varchar(255);"` //归属地
Browser string `json:"browser" gorm:"type:varchar(255);"` //浏览器
Os string `json:"os" gorm:"type:varchar(255);"` //系统
Platform string `json:"platform" gorm:"type:varchar(255);"` // 固件
Username string `json:"username" gorm:"size:128;"` //用户名
Status string `json:"status" gorm:"size:4;"` //状态
Ipaddr string `json:"ipaddr" gorm:"size:255;"` //ip地址
LoginLocation string `json:"loginLocation" gorm:"size:255;"` //归属地
Browser string `json:"browser" gorm:"size:255;"` //浏览器
Os string `json:"os" gorm:"size:255;"` //系统
Platform string `json:"platform" gorm:"size:255;"` // 固件
LoginTime time.Time `json:"loginTime" gorm:"type:timestamp;"` //登录时间
CreateBy string `json:"createBy" gorm:"type:varchar(128);"` //创建人
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"` //更新者
CreateBy string `json:"createBy" gorm:"size:128;"` //创建人
UpdateBy string `json:"updateBy" gorm:"size:128;"` //更新者
DataScope string `json:"dataScope" gorm:"-"` //数据
Params string `json:"params" gorm:"-"` //
Remark string `json:"remark" gorm:"type:varchar(255);"` //备注
Msg string `json:"msg" gorm:"type:varchar(255);"`
Remark string `json:"remark" gorm:"size:255;"` //备注
Msg string `json:"msg" gorm:"size:255;"`
BaseModel
}
+19 -18
View File
@@ -2,29 +2,29 @@ package models
import (
"errors"
"go-admin/global/orm"
orm "go-admin/global"
"go-admin/tools"
)
type Menu struct {
MenuId int `json:"menuId" gorm:"primary_key;AUTO_INCREMENT"`
MenuName string `json:"menuName" gorm:"type:varchar(128);"`
Title string `json:"title" gorm:"type:varchar(64);"`
Icon string `json:"icon" gorm:"type:varchar(128);"`
Path string `json:"path" gorm:"type:varchar(128);"`
Paths string `json:"paths" gorm:"type:varchar(128);"`
MenuType string `json:"menuType" gorm:"type:varchar(1);"`
Action string `json:"action" gorm:"type:varchar(16);"`
Permission string `json:"permission" gorm:"type:varchar(32);"`
ParentId int `json:"parentId" gorm:"type:int(11);"`
NoCache bool `json:"noCache" gorm:"type:char(1);"`
Breadcrumb string `json:"breadcrumb" gorm:"type:varchar(255);"`
Component string `json:"component" gorm:"type:varchar(255);"`
Sort int `json:"sort" gorm:"type:int(4);"`
Visible string `json:"visible" gorm:"type:char(1);"`
CreateBy string `json:"createBy" gorm:"type:varchar(128);"`
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"`
IsFrame string `json:"isFrame" gorm:"type:int(1);DEFAULT:0;"`
MenuName string `json:"menuName" gorm:"size:128;"`
Title string `json:"title" gorm:"size:128;"`
Icon string `json:"icon" gorm:"size:128;"`
Path string `json:"path" gorm:"size:128;"`
Paths string `json:"paths" gorm:"size:128;"`
MenuType string `json:"menuType" gorm:"size:1;"`
Action string `json:"action" gorm:"size:16;"`
Permission string `json:"permission" gorm:"size:255;"`
ParentId int `json:"parentId" gorm:"size:11;"`
NoCache bool `json:"noCache" gorm:"size:8;"`
Breadcrumb string `json:"breadcrumb" gorm:"size:255;"`
Component string `json:"component" gorm:"size:255;"`
Sort int `json:"sort" gorm:"size:4;"`
Visible string `json:"visible" gorm:"size:1;"`
CreateBy string `json:"createBy" gorm:"size:128;"`
UpdateBy string `json:"updateBy" gorm:"size:128;"`
IsFrame string `json:"isFrame" gorm:"size:1;DEFAULT:0;"`
DataScope string `json:"dataScope" gorm:"-"`
Params string `json:"params" gorm:"-"`
RoleId int `gorm:"-"`
@@ -128,6 +128,7 @@ func DiguiMenu(menulist *[]Menu, menu Menu) Menu {
mi.Component = list[j].Component
mi.Sort = list[j].Sort
mi.Visible = list[j].Visible
mi.CreatedAt = list[j].CreatedAt
mi.Children = []Menu{}
if mi.MenuType != "F" {
+3 -3
View File
@@ -5,7 +5,7 @@ import (
)
type BaseModel struct {
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `sql:"index" json:"deletedAt"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt *time.Time `json:"deletedAt"`
}
+23 -23
View File
@@ -1,35 +1,35 @@
package models
import (
"go-admin/global/orm"
orm "go-admin/global"
"time"
)
//sys_operlog
type SysOperLog struct {
OperId int `json:"operId" gorm:"primary_key;AUTO_INCREMENT"` //日志编码
Title string `json:"title" gorm:"size(255);"` //操作模块
BusinessType string `json:"businessType" gorm:"type:varchar(128);"` //操作类型
BusinessTypes string `json:"businessTypes" gorm:"type:varchar(128);"`
Method string `json:"method" gorm:"type:varchar(128);"` //函数
RequestMethod string `json:"requestMethod" gorm:"type:varchar(128);"` //请求方式
OperatorType string `json:"operatorType" gorm:"type:varchar(128);"` //操作类型
OperName string `json:"operName" gorm:"type:varchar(128);"` //操作者
DeptName string `json:"deptName" gorm:"type:varchar(128);"` //部门名称
OperUrl string `json:"operUrl" gorm:"type:varchar(255);"` //访问地址
OperIp string `json:"operIp" gorm:"type:varchar(128);"` //客户端ip
OperLocation string `json:"operLocation" gorm:"type:varchar(128);"` //访问位置
OperParam string `json:"operParam" gorm:"type:varchar(255);"` //请求参数
Status string `json:"status" gorm:"type:int(1);"` //操作状态
OperTime time.Time `json:"operTime" gorm:"type:timestamp;"` //操作时间
JsonResult string `json:"jsonResult" gorm:"type:varchar(255);"` //返回数据
CreateBy string `json:"createBy" gorm:"type:varchar(128);"` //创建人
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"` //更新者
DataScope string `json:"dataScope" gorm:"-"` //数据
Params string `json:"params" gorm:"-"` //参数
Remark string `json:"remark" gorm:"type:varchar(255);"` //备注
LatencyTime string `json:"latencyime" gorm:"type:varchar(128);"` //耗时
UserAgent string `json:"userAgent" gorm:"type:varchar(255);"` //ua
Title string `json:"title" gorm:"size:255;"` //操作模块
BusinessType string `json:"businessType" gorm:"size:128;"` //操作类型
BusinessTypes string `json:"businessTypes" gorm:"size:128;"`
Method string `json:"method" gorm:"size:128;"` //函数
RequestMethod string `json:"requestMethod" gorm:"size:128;"` //请求方式
OperatorType string `json:"operatorType" gorm:"size:128;"` //操作类型
OperName string `json:"operName" gorm:"size:128;"` //操作者
DeptName string `json:"deptName" gorm:"size:128;"` //部门名称
OperUrl string `json:"operUrl" gorm:"size:255;"` //访问地址
OperIp string `json:"operIp" gorm:"size:128;"` //客户端ip
OperLocation string `json:"operLocation" gorm:"size:128;"` //访问位置
OperParam string `json:"operParam" gorm:"size:255;"` //请求参数
Status string `json:"status" gorm:"size:4;"` //操作状态
OperTime time.Time `json:"operTime" gorm:"type:timestamp;"` //操作时间
JsonResult string `json:"jsonResult" gorm:"size:255;"` //返回数据
CreateBy string `json:"createBy" gorm:"size:128;"` //创建人
UpdateBy string `json:"updateBy" gorm:"size:128;"` //更新者
DataScope string `json:"dataScope" gorm:"-"` //数据
Params string `json:"params" gorm:"-"` //参数
Remark string `json:"remark" gorm:"size:255;"` //备注
LatencyTime string `json:"latencyime" gorm:"size:128;"` //耗时
UserAgent string `json:"userAgent" gorm:"size:255;"` //ua
BaseModel
}
+11 -8
View File
@@ -1,19 +1,19 @@
package models
import (
"go-admin/global/orm"
orm "go-admin/global"
"go-admin/tools"
)
type Post struct {
PostId int `gorm:"primary_key;AUTO_INCREMENT" json:"postId"` //岗位编号
PostName string `gorm:"type:varchar(128);" json:"postName"` //岗位名称
PostCode string `gorm:"type:varchar(128);" json:"postCode"` //岗位代码
Sort int `gorm:"type:int(4);" json:"sort"` //岗位排序
Status string `gorm:"type:int(1);" json:"status"` //状态
Remark string `gorm:"type:varchar(255);" json:"remark"` //描述
CreateBy string `gorm:"type:varchar(128);" json:"createBy"`
UpdateBy string `gorm:"type:varchar(128);" json:"updateBy"`
PostName string `gorm:"size:128;" json:"postName"` //岗位名称
PostCode string `gorm:"size:128;" json:"postCode"` //岗位代码
Sort int `gorm:"" json:"sort"` //岗位排序
Status string `gorm:"size:4;" json:"status"` //状态
Remark string `gorm:"size:255;" json:"remark"` //描述
CreateBy string `gorm:"size:128;" json:"createBy"`
UpdateBy string `gorm:"size:128;" json:"updateBy"`
DataScope string `gorm:"-" json:"dataScope"`
Params string `gorm:"-" json:"params"`
BaseModel
@@ -90,6 +90,9 @@ func (e *Post) GetPage(pageSize int, pageIndex int) ([]Post, int, error) {
if e.PostName != "" {
table = table.Where("post_name = ?", e.PostName)
}
if e.PostCode != "" {
table = table.Where("post_code = ?", e.PostCode)
}
if e.Status != "" {
table = table.Where("status = ?", e.Status)
}
+29 -29
View File
@@ -2,22 +2,22 @@ package models
import (
"github.com/pkg/errors"
"go-admin/global/orm"
orm "go-admin/global"
"go-admin/tools"
)
type SysRole struct {
RoleId int `json:"roleId" gorm:"primary_key;AUTO_INCREMENT"` // 角色编码
RoleName string `json:"roleName" gorm:"type:varchar(128);"` // 角色名称
Status string `json:"status" gorm:"type:int(1);"` //
RoleKey string `json:"roleKey" gorm:"type:varchar(128);"` //角色代码
RoleSort int `json:"roleSort" gorm:"type:int(4);"` //角色排序
Flag string `json:"flag" gorm:"type:varchar(128);"` //
CreateBy string `json:"createBy" gorm:"type:varchar(128);"` //
UpdateBy string `json:"updateBy" gorm:"type:varchar(128);"` //
Remark string `json:"remark" gorm:"type:varchar(255);"` //备注
Admin bool `json:"admin" gorm:"type:char(1);"`
DataScope string `json:"dataScope" gorm:"type:varchar(128);"`
RoleName string `json:"roleName" gorm:"size:128;"` // 角色名称
Status string `json:"status" gorm:"size:4;"` //
RoleKey string `json:"roleKey" gorm:"size:128;"` //角色代码
RoleSort int `json:"roleSort" gorm:""` //角色排序
Flag string `json:"flag" gorm:"size:128;"` //
CreateBy string `json:"createBy" gorm:"size:128;"` //
UpdateBy string `json:"updateBy" gorm:"size:128;"` //
Remark string `json:"remark" gorm:"size:255;"` //备注
Admin bool `json:"admin" gorm:"size:4;"`
DataScope string `json:"dataScope" gorm:"size:128;"`
Params string `json:"params" gorm:"-"`
MenuIds []int `json:"menuIds" gorm:"-"`
DeptIds []int `json:"deptIds" gorm:"-"`
@@ -32,27 +32,27 @@ type MenuIdList struct {
MenuId int `json:"menuId"`
}
func (e *SysRole) GetPage(pageSize int, pageIndex int) ([]SysRole, int, error) {
func (role *SysRole) GetPage(pageSize int, pageIndex int) ([]SysRole, int, error) {
var doc []SysRole
table := orm.Eloquent.Select("*").Table("sys_role")
if e.RoleId != 0 {
table = table.Where("role_id = ?", e.RoleId)
if role.RoleId != 0 {
table = table.Where("role_id = ?", role.RoleId)
}
if e.RoleName != "" {
table = table.Where("role_name = ?", e.RoleName)
if role.RoleName != "" {
table = table.Where("role_name = ?", role.RoleName)
}
if e.Status != "" {
table = table.Where("status = ?", e.Status)
if role.Status != "" {
table = table.Where("status = ?", role.Status)
}
if e.RoleKey != "" {
table = table.Where("role_key = ?", e.RoleKey)
if role.RoleKey != "" {
table = table.Where("role_key = ?", role.RoleKey)
}
// 数据权限控制
dataPermission := new(DataPermission)
dataPermission.UserId, _ = tools.StringToInt(e.DataScope)
table,err := dataPermission.GetDataScope("sys_role", table)
dataPermission.UserId, _ = tools.StringToInt(role.DataScope)
table, err := dataPermission.GetDataScope("sys_role", table)
if err != nil {
return nil, 0, err
}
@@ -99,7 +99,7 @@ func (role *SysRole) GetList() (SysRole []SysRole, err error) {
func (role *SysRole) GetRoleMeunId() ([]int, error) {
menuIds := make([]int, 0)
menuList := make([]MenuIdList, 0)
if err := orm.Eloquent.Table("sys_role_menu").Select("sys_role_menu.menu_id").Joins("LEFT JOIN sys_menu on sys_menu.menu_id=sys_role_menu.menu_id").Where("role_id = ? ", role.RoleId).Where(" sys_role_menu.menu_id not in(select sys_menu.parent_id from sys_role_menu LEFT JOIN sys_menu on sys_menu.menu_id=sys_role_menu.menu_id where role_id =? )", role.RoleId).Find(&menuList).Error; err != nil {
if err := orm.Eloquent.Table("sys_role_menu").Select("sys_role_menu.menu_id").Where("role_id = ? ", role.RoleId).Where(" sys_role_menu.menu_id not in(select sys_menu.parent_id from sys_role_menu LEFT JOIN sys_menu on sys_menu.menu_id=sys_role_menu.menu_id where role_id =? and parent_id is not null)", role.RoleId).Find(&menuList).Error; err != nil {
return nil, err
}
@@ -111,12 +111,12 @@ func (role *SysRole) GetRoleMeunId() ([]int, error) {
func (role *SysRole) Insert() (id int, err error) {
i := 0
orm.Eloquent.Table("sys_role").Where("role_name=? or role_key = ?", role.RoleName, role.RoleKey).Count(&i)
orm.Eloquent.Table(role.TableName()).Where("role_name=? or role_key = ?", role.RoleName, role.RoleKey).Count(&i)
if i > 0 {
return 0, errors.New("角色名称或者角色标识已经存在!")
}
role.UpdateBy = ""
result := orm.Eloquent.Table("sys_role").Create(&role)
result := orm.Eloquent.Table(role.TableName()).Create(&role)
if result.Error != nil {
err = result.Error
return
@@ -145,7 +145,7 @@ func (role *SysRole) GetRoleDeptId() ([]int, error) {
//修改
func (role *SysRole) Update(id int) (update SysRole, err error) {
if err = orm.Eloquent.Table("sys_role").First(&update, id).Error; err != nil {
if err = orm.Eloquent.Table(role.TableName()).First(&update, id).Error; err != nil {
return
}
@@ -159,15 +159,15 @@ func (role *SysRole) Update(id int) (update SysRole, err error) {
//参数1:是要修改的数据
//参数2:是修改的数据
if err = orm.Eloquent.Table("sys_role").Model(&update).Updates(&role).Error; err != nil {
if err = orm.Eloquent.Table(role.TableName()).Model(&update).Updates(&role).Error; err != nil {
return
}
return
}
//批量删除
func (e *SysRole) BatchDelete(id []int) (Result bool, err error) {
if err = orm.Eloquent.Table("sys_role").Where("role_id in (?)", id).Delete(&SysRole{}).Error; err != nil {
func (role *SysRole) BatchDelete(id []int) (Result bool, err error) {
if err = orm.Eloquent.Table(role.TableName()).Where("role_id in (?)", id).Delete(SysRole{}).Error; err != nil {
return
}
Result = true
+3 -3
View File
@@ -2,13 +2,13 @@ package models
import (
"fmt"
"go-admin/global/orm"
orm "go-admin/global"
)
//sys_role_dept
type SysRoleDept struct {
RoleId int `gorm:"type:int(11)"`
DeptId int `gorm:"type:int(11)"`
RoleId int `gorm:""`
DeptId int `gorm:""`
}
func (SysRoleDept) TableName() string {
+77 -18
View File
@@ -2,16 +2,16 @@ package models
import (
"fmt"
"go-admin/global/orm"
orm "go-admin/global"
"go-admin/tools"
)
type RoleMenu struct {
RoleId int `gorm:"type:int(11)"`
MenuId int `gorm:"type:int(11)"`
RoleName string `gorm:"type:varchar(128)"`
CreateBy string `gorm:"type:varchar(128)"`
UpdateBy string `gorm:"type:varchar(128)"`
RoleId int `gorm:""`
MenuId int `gorm:""`
RoleName string `gorm:"size:128)"`
CreateBy string `gorm:"size:128)"`
UpdateBy string `gorm:"size:128)"`
}
func (RoleMenu) TableName() string {
@@ -65,47 +65,98 @@ func (rm *RoleMenu) GetIDS() ([]MenuPath, error) {
}
func (rm *RoleMenu) DeleteRoleMenu(roleId int) (bool, error) {
if err := orm.Eloquent.Table("sys_role_dept").Where("role_id = ?", roleId).Delete(&rm).Error; err != nil {
tx := orm.Eloquent.Begin()
defer func() {
if r := recover(); r != nil {
tx.Rollback()
}
}()
if err := tx.Error; err != nil {
return false, err
}
if err := orm.Eloquent.Table("sys_role_menu").Where("role_id = ?", roleId).Delete(&rm).Error; err != nil {
if err := tx.Table("sys_role_dept").Where("role_id = ?", roleId).Delete(&rm).Error; err != nil {
tx.Rollback()
return false, err
}
if err := tx.Table("sys_role_menu").Where("role_id = ?", roleId).Delete(&rm).Error; err != nil {
tx.Rollback()
return false, err
}
var role SysRole
if err := orm.Eloquent.Table("sys_role").Where("role_id = ?", roleId).First(&role).Error; err != nil {
if err := tx.Table("sys_role").Where("role_id = ?", roleId).First(&role).Error; err != nil {
tx.Rollback()
return false, err
}
sql3 := "delete from casbin_rule where v0= '" + role.RoleKey + "';"
orm.Eloquent.Exec(sql3)
if err := tx.Exec(sql3).Error; err != nil {
tx.Rollback()
return false, err
}
if err := tx.Commit().Error; err != nil {
return false, err
}
return true, nil
}
func (rm *RoleMenu) BatchDeleteRoleMenu(roleIds []int) (bool, error) {
if err := orm.Eloquent.Table("sys_role_menu").Where("role_id in (?)", roleIds).Delete(&rm).Error; err != nil {
tx := orm.Eloquent.Begin()
defer func() {
if r := recover(); r != nil {
tx.Rollback()
}
}()
if err := tx.Error; err != nil {
return false, err
}
if err := tx.Table("sys_role_menu").Where("role_id in (?)", roleIds).Delete(&rm).Error; err != nil {
tx.Rollback()
return false, err
}
var role []SysRole
if err := orm.Eloquent.Table("sys_role").Where("role_id in (?)", roleIds).Find(&role).Error; err != nil {
if err := tx.Table("sys_role").Where("role_id in (?)", roleIds).Find(&role).Error; err != nil {
tx.Rollback()
return false, err
}
sql := ""
for i := 0; i < len(role); i++ {
sql += "delete from casbin_rule where v0= '" + role[i].RoleName + "';"
}
orm.Eloquent.Exec(sql)
if err := tx.Exec(sql).Error; err != nil {
tx.Rollback()
return false, err
}
if err := tx.Commit().Error; err != nil {
return false, err
}
return true, nil
}
func (rm *RoleMenu) Insert(roleId int, menuId []int) (bool, error) {
var role SysRole
if err := orm.Eloquent.Table("sys_role").Where("role_id = ?", roleId).First(&role).Error; err != nil {
tx := orm.Eloquent.Begin()
defer func() {
if r := recover(); r != nil {
tx.Rollback()
}
}()
if err := tx.Error; err != nil {
return false, err
}
if err := tx.Table("sys_role").Where("role_id = ?", roleId).First(&role).Error; err != nil {
tx.Rollback()
return false, err
}
var menu []Menu
if err := orm.Eloquent.Table("sys_menu").Where("menu_id in (?)", menuId).Find(&menu).Error; err != nil {
if err := tx.Table("sys_menu").Where("menu_id in (?)", menuId).Find(&menu).Error; err != nil {
tx.Rollback()
return false, err
}
//ORM不支持批量插入所以需要拼接 sql 串
@@ -126,10 +177,18 @@ func (rm *RoleMenu) Insert(roleId int, menuId []int) (bool, error) {
}
}
}
orm.Eloquent.Exec(sql)
if err := tx.Exec(sql).Error; err != nil {
tx.Rollback()
return false, err
}
sql2 = sql2[0:len(sql2)-1] + ";"
orm.Eloquent.Exec(sql2)
if err := tx.Exec(sql2).Error; err != nil {
tx.Rollback()
return false, err
}
if err := tx.Commit().Error; err != nil {
return false, err
}
return true, nil
}
+186
View File
@@ -0,0 +1,186 @@
package models
import (
orm "go-admin/global"
"go-admin/tools"
)
type SysJob struct {
JobId int `json:"jobId" gorm:"primary_key;AUTO_INCREMENT"` // 编码
JobName string `json:"jobName" gorm:"size:255;"` // 名称
JobGroup string `json:"jobGroup" gorm:"size:255;"` // 任务分组
JobType int `json:"jobType" gorm:"size:1;"` // 任务类型
CronExpression string `json:"cronExpression" gorm:"size:255;"` // cron表达式
InvokeTarget string `json:"invokeTarget" gorm:"size:255;"` // 调用目标
MisfirePolicy int `json:"misfirePolicy" gorm:"size:255;"` // 执行策略
Concurrent int `json:"concurrent" gorm:"size:1;"` // 是否并发
Status int `json:"status" gorm:"size:1;"` // 状态
EntryId int `json:"entry_id" gorm:"size:11;"` // job启动时返回的id
CreateBy string `json:"createBy" gorm:"size:128;"` //
UpdateBy string `json:"updateBy" gorm:"size:128;"` //
DataScope string `json:"dataScope" gorm:"-"`
BaseModel
}
func (SysJob) TableName() string {
return "sys_job"
}
// 创建SysJob
func (e *SysJob) Create() (SysJob, error) {
var doc SysJob
result := orm.Eloquent.Table(e.TableName()).Create(&e)
if result.Error != nil {
err := result.Error
return doc, err
}
doc = *e
return doc, nil
}
// 获取SysJob
func (e *SysJob) Get() (SysJob, error) {
var doc SysJob
table := orm.Eloquent.Table(e.TableName())
if e.JobId != 0 {
table = table.Where("job_id = ?", e.JobId)
}
if e.JobName != "" {
table = table.Where("job_name like ?", "%"+e.JobName+"%")
}
if e.JobGroup != "" {
table = table.Where("job_group = ?", e.JobGroup)
}
if e.CronExpression != "" {
table = table.Where("cron_expression = ?", e.CronExpression)
}
if e.InvokeTarget != "" {
table = table.Where("invoke_target = ?", e.InvokeTarget)
}
if e.Status != 0 {
table = table.Where("status = ?", e.Status)
}
if err := table.First(&doc).Error; err != nil {
return doc, err
}
return doc, nil
}
// 获取SysJob带分页
func (e *SysJob) GetPage(pageSize int, pageIndex int) ([]SysJob, int, error) {
var doc []SysJob
table := orm.Eloquent.Select("*").Table(e.TableName())
if e.JobId != 0 {
table = table.Where("job_id = ?", e.JobId)
}
if e.JobName != "" {
table = table.Where("job_name like ?", "%"+e.JobName+"%")
}
if e.JobGroup != "" {
table = table.Where("job_group = ?", e.JobGroup)
}
if e.CronExpression != "" {
table = table.Where("cron_expression = ?", e.CronExpression)
}
if e.InvokeTarget != "" {
table = table.Where("invoke_target = ?", e.InvokeTarget)
}
if e.Status != 0 {
table = table.Where("status = ?", e.Status)
}
// 数据权限控制(如果不需要数据权限请将此处去掉)
dataPermission := new(DataPermission)
dataPermission.UserId, _ = tools.StringToInt(e.DataScope)
table, err := dataPermission.GetDataScope(e.TableName(), table)
if err != nil {
return nil, 0, err
}
var count int
if err := table.Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Error; err != nil {
return nil, 0, err
}
table.Where("`deleted_at` IS NULL").Count(&count)
return doc, count, nil
}
func (e *SysJob) GetList() ([]SysJob, error) {
var doc []SysJob
table := orm.Eloquent.Select("*").Table(e.TableName())
table = table.Where("status = ?", 2)
if err := table.Find(&doc).Error; err != nil {
return nil, err
}
return doc, nil
}
// 更新SysJob
func (e *SysJob) Update(id int) (update SysJob, err error) {
if err = orm.Eloquent.Table(e.TableName()).Where("job_id = ?", id).First(&update).Error; err != nil {
return
}
//参数1:是要修改的数据
//参数2:是修改的数据
if err = orm.Eloquent.Table(e.TableName()).Model(&update).Updates(&e).Error; err != nil {
return
}
return
}
func (e *SysJob) RemoveAllEntryID() (update SysJob, err error) {
//参数1:是要修改的数据
//参数2:是修改的数据
if err = orm.Eloquent.Table(e.TableName()).Updates(map[string]interface{}{"entry_id": 0}).Error; err != nil {
return
}
return
}
func (e *SysJob) RemoveEntryID(entryID int) (update SysJob, err error) {
//参数1:是要修改的数据
//参数2:是修改的数据
if err = orm.Eloquent.Table(e.TableName()).Where("entry_id = ?", entryID).Updates(map[string]interface{}{"entry_id": 0}).Error; err != nil {
return
}
return
}
// 删除SysJob
func (e *SysJob) Delete(id int) (success bool, err error) {
if err = orm.Eloquent.Table(e.TableName()).Where("job_id = ?", id).Delete(&SysJob{}).Error; err != nil {
success = false
return
}
success = true
return
}
//批量删除
func (e *SysJob) BatchDelete(id []int) (Result bool, err error) {
if err = orm.Eloquent.Table(e.TableName()).Where("job_id in (?)", id).Delete(&SysJob{}).Error; err != nil {
return
}
Result = true
return
}
+39
View File
@@ -0,0 +1,39 @@
package models
import (
orm "go-admin/global"
)
type SysSetting struct {
SettingsId int `json:"settings_id" gorm:"primary_key;AUTO_INCREMENT"`
Name string `json:"name" gorm:"type:varchar(256);"`
Logo string `json:"logo" gorm:"type:varchar(256);"`
BaseModel
}
func (SysSetting) TableName() string {
return "sys_setting"
}
//查询
func (s *SysSetting) Get() (create SysSetting, err error) {
result := orm.Eloquent.Table("sys_setting").First(&create)
if result.Error != nil {
err = result.Error
return
}
return create,nil
}
//修改
func (s *SysSetting) Update() (update SysSetting, err error) {
if err = orm.Eloquent.Table("sys_setting").Model(&update).Updates(&s).Error; err != nil {
return
}
return
}
type ResponseSystemConfig struct {
Name string `json:"name" binding:"required"` // 名称
Logo string `json:"logo" binding:"required"` // 头像
}
+17 -17
View File
@@ -2,10 +2,10 @@ package models
import (
"errors"
"go-admin/global/orm"
"log"
orm "go-admin/global"
"go-admin/tools"
"golang.org/x/crypto/bcrypt"
log "github.com/sirupsen/logrus"
"strings"
)
@@ -22,12 +22,12 @@ type User struct {
}
type UserName struct {
Username string `gorm:"type:varchar(64)" json:"username"`
Username string `gorm:"size:64" json:"username"`
}
type PassWord struct {
// 密码
Password string `gorm:"type:varchar(128)" json:"password"`
Password string `gorm:"size:128" json:"password"`
}
type LoginM struct {
@@ -40,19 +40,19 @@ type SysUserId struct {
}
type SysUserB struct {
NickName string `gorm:"type:varchar(128)" json:"nickName"` // 昵称
Phone string `gorm:"type:varchar(11)" json:"phone"` // 手机号
RoleId int `gorm:"type:int(11)" json:"roleId"` // 角色编码
Salt string `gorm:"type:varchar(255)" json:"salt"` //盐
Avatar string `gorm:"type:varchar(255)" json:"avatar"` //头像
Sex string `gorm:"type:varchar(255)" json:"sex"` //性别
Email string `gorm:"type:varchar(128)" json:"email"` //邮箱
DeptId int `gorm:"type:int(11)" json:"deptId"` //部门编码
PostId int `gorm:"type:int(11)" json:"postId"` //职位编码
CreateBy string `gorm:"type:varchar(128)" json:"createBy"` //
UpdateBy string `gorm:"type:varchar(128)" json:"updateBy"` //
Remark string `gorm:"type:varchar(255)" json:"remark"` //备注
Status string `gorm:"type:int(1);" json:"status"`
NickName string `gorm:"size:128" json:"nickName"` // 昵称
Phone string `gorm:"size:11" json:"phone"` // 手机号
RoleId int `gorm:"" json:"roleId"` // 角色编码
Salt string `gorm:"size:255" json:"salt"` //盐
Avatar string `gorm:"size:255" json:"avatar"` //头像
Sex string `gorm:"size:255" json:"sex"` //性别
Email string `gorm:"size:128" json:"email"` //邮箱
DeptId int `gorm:"" json:"deptId"` //部门编码
PostId int `gorm:"" json:"postId"` //职位编码
CreateBy string `gorm:"size:128" json:"createBy"` //
UpdateBy string `gorm:"size:128" json:"updateBy"` //
Remark string `gorm:"size:255" json:"remark"` //备注
Status string `gorm:"size:4;" json:"status"`
DataScope string `gorm:"-" json:"dataScope"`
Params string `gorm:"-" json:"params"`
+24 -15
View File
@@ -2,7 +2,9 @@ package tools
import (
"errors"
"go-admin/global/orm"
"github.com/jinzhu/gorm"
orm "go-admin/global"
"go-admin/tools"
config2 "go-admin/tools/config"
)
@@ -23,37 +25,44 @@ type DBColumns struct {
func (e *DBColumns) GetPage(pageSize int, pageIndex int) ([]DBColumns, int, error) {
var doc []DBColumns
table := orm.Eloquent.Select("*").Table("information_schema.`COLUMNS`")
table = table.Where("table_schema= ? ", config2.DatabaseConfig.Name)
if e.TableName != "" {
return nil, 0, errors.New("table name cannot be empty!")
}
table = table.Where("TABLE_NAME = ?", e.TableName)
var count int
table := new(gorm.DB)
if config2.DatabaseConfig.Driver == "mysql" {
table = orm.Eloquent.Select("*").Table("information_schema.`COLUMNS`")
table = table.Where("table_schema= ? ", config2.GenConfig.DBName)
if e.TableName != "" {
return nil, 0, errors.New("table name cannot be empty!")
}
table = table.Where("TABLE_NAME = ?", e.TableName)
}
if err := table.Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Error; err != nil {
return nil, 0, err
}
table.Count(&count)
return doc, count, nil
}
func (e *DBColumns) GetList() ([]DBColumns, error) {
var doc []DBColumns
table := orm.Eloquent.Select("*").Table("information_schema.columns")
table = table.Where("table_schema= ? ", config2.DatabaseConfig.Name)
table := new(gorm.DB)
if e.TableName == "" {
return nil, errors.New("table name cannot be empty!")
}
table = table.Where("TABLE_NAME = ?", e.TableName)
if config2.DatabaseConfig.Driver == "mysql" {
table = orm.Eloquent.Select("*").Table("information_schema.columns")
table = table.Where("table_schema= ? ", config2.GenConfig.DBName)
table = table.Where("TABLE_NAME = ?", e.TableName)
} else {
tools.Assert(true, "目前只支持mysql数据库", 500)
}
if err := table.Find(&doc).Error; err != nil {
return doc, err
}
+28 -19
View File
@@ -2,7 +2,9 @@ package tools
import (
"errors"
"go-admin/global/orm"
"github.com/jinzhu/gorm"
orm "go-admin/global"
"go-admin/tools"
config2 "go-admin/tools/config"
)
@@ -18,34 +20,41 @@ type DBTables struct {
func (e *DBTables) GetPage(pageSize int, pageIndex int) ([]DBTables, int, error) {
var doc []DBTables
table := orm.Eloquent.Select("*").Table("information_schema.tables")
table = table.Where("TABLE_NAME not in (select table_name from "+config2.DatabaseConfig.Name+".sys_tables) ")
table = table.Where("table_schema= ? ", config2.DatabaseConfig.Name)
if e.TableName != "" {
table = table.Where("TABLE_NAME = ?", e.TableName)
}
table := new(gorm.DB)
var count int
if err := table.Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Error; err != nil {
return nil, 0, err
if config2.DatabaseConfig.Driver == "mysql" {
table = orm.Eloquent.Select("*").Table("information_schema.tables")
table = table.Where("TABLE_NAME not in (select table_name from " + config2.GenConfig.DBName + ".sys_tables) ")
table = table.Where("table_schema= ? ", config2.GenConfig.DBName)
if e.TableName != "" {
table = table.Where("TABLE_NAME = ?", e.TableName)
}
if err := table.Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Error; err != nil {
return nil, 0, err
}
} else {
tools.Assert(true, "目前只支持mysql数据库", 500)
}
table.Count(&count)
return doc, count, nil
}
func (e *DBTables) Get() (DBTables, error) {
var doc DBTables
table := orm.Eloquent.Select("*").Table("information_schema.tables")
table = table.Where("table_schema= ? ", config2.DatabaseConfig.Name)
if e.TableName == "" {
return doc, errors.New("table name cannot be empty!")
table := new(gorm.DB)
if config2.DatabaseConfig.Driver == "mysql" {
table = orm.Eloquent.Select("*").Table("information_schema.tables")
table = table.Where("table_schema= ? ", config2.GenConfig.DBName)
if e.TableName == "" {
return doc, errors.New("table name cannot be empty!")
}
table = table.Where("TABLE_NAME = ?", e.TableName)
} else {
tools.Assert(true, "目前只支持mysql数据库", 500)
}
table = table.Where("TABLE_NAME = ?", e.TableName)
if err := table.First(&doc).Error; err != nil {
return doc, err
}
+32 -32
View File
@@ -1,42 +1,42 @@
package tools
import (
"go-admin/global/orm"
orm "go-admin/global"
"go-admin/models"
)
type SysColumns struct {
ColumnId int `gorm:"primary_key;auto_increment" json:"columnId"`
TableId int `gorm:"type:int(11);" json:"tableId"`
ColumnName string `gorm:"type:varchar(128);" json:"columnName"`
ColumnComment string `gorm:"column:column_comment;type:varchar(128);" json:"columnComment"`
ColumnType string `gorm:"column:column_type;type:varchar(128);" json:"columnType"`
GoType string `gorm:"column:go_type;type:varchar(128);" json:"goType"`
GoField string `gorm:"column:go_field;type:varchar(128);" json:"goField"`
JsonField string `gorm:"column:json_field;type:varchar(128);" json:"jsonField"`
IsPk string `gorm:"column:is_pk;type:char(4);" json:"isPk"`
IsIncrement string `gorm:"column:is_increment;type:char(4);" json:"isIncrement"`
IsRequired string `gorm:"column:is_required;type:char(4);" json:"isRequired"`
IsInsert string `gorm:"column:is_insert;type:char(4);" json:"isInsert"`
IsEdit string `gorm:"column:is_edit;type:char(4);" json:"isEdit"`
IsList string `gorm:"column:is_list;type:char(4);" json:"isList"`
IsQuery string `gorm:"column:is_query;type:char(4);" json:"isQuery"`
QueryType string `gorm:"column:query_type;type:varchar(128);" json:"queryType"`
HtmlType string `gorm:"column:html_type;type:varchar(128);" json:"htmlType"`
DictType string `gorm:"column:dict_type;type:varchar(128);" json:"dictType"`
Sort int `gorm:"column:sort;type:int(4);" json:"sort"`
List string `gorm:"column:list;type:char(1);" json:"list"`
Pk bool `gorm:"column:pk;type:char(1);" json:"pk"`
Required bool `gorm:"column:required;type:char(1);" json:"required"`
SuperColumn bool `gorm:"column:super_column;type:char(1);" json:"superColumn"`
UsableColumn bool `gorm:"column:usable_column;type:char(1);" json:"usableColumn"`
Increment bool `gorm:"column:increment;type:char(1);" json:"increment"`
Insert bool `gorm:"column:insert;type:char(1);" json:"insert"`
Edit bool `gorm:"column:edit;type:char(1);" json:"edit"`
Query bool `gorm:"column:query;type:char(1);" json:"query"`
Remark string `gorm:"column:remark;type:varchar(255);" json:"remark"`
CreateBy string `gorm:"column:create_by;type:varchar(128);" json:"createBy"`
UpdateBy string `gorm:"column:update_By;type:varchar(128);" json:"updateBy"`
ColumnId int `gorm:"primary_key;auto_increment" json:"columnId"`
TableId int `gorm:"" json:"tableId"`
ColumnName string `gorm:"size:128;" json:"columnName"`
ColumnComment string `gorm:"column:column_comment;size:128;" json:"columnComment"`
ColumnType string `gorm:"column:column_type;size:128;" json:"columnType"`
GoType string `gorm:"column:go_type;size:128;" json:"goType"`
GoField string `gorm:"column:go_field;size:128;" json:"goField"`
JsonField string `gorm:"column:json_field;size:128;" json:"jsonField"`
IsPk string `gorm:"column:is_pk;size:4;" json:"isPk"`
IsIncrement string `gorm:"column:is_increment;size:4;" json:"isIncrement"`
IsRequired string `gorm:"column:is_required;size:4;" json:"isRequired"`
IsInsert string `gorm:"column:is_insert;size:4;" json:"isInsert"`
IsEdit string `gorm:"column:is_edit;size:4;" json:"isEdit"`
IsList string `gorm:"column:is_list;size:4;" json:"isList"`
IsQuery string `gorm:"column:is_query;size:4;" json:"isQuery"`
QueryType string `gorm:"column:query_type;size:128;" json:"queryType"`
HtmlType string `gorm:"column:html_type;size:128;" json:"htmlType"`
DictType string `gorm:"column:dict_type;size:128;" json:"dictType"`
Sort int `gorm:"column:sort;" json:"sort"`
List string `gorm:"column:list;size:1;" json:"list"`
Pk bool `gorm:"column:pk;size:1;" json:"pk"`
Required bool `gorm:"column:required;size:1;" json:"required"`
SuperColumn bool `gorm:"column:super_column;size:1;" json:"superColumn"`
UsableColumn bool `gorm:"column:usable_column;size:1;" json:"usableColumn"`
Increment bool `gorm:"column:increment;size:1;" json:"increment"`
Insert bool `gorm:"column:insert;size:1;" json:"insert"`
Edit bool `gorm:"column:edit;size:1;" json:"edit"`
Query bool `gorm:"column:query;size:1;" json:"query"`
Remark string `gorm:"column:remark;size:255;" json:"remark"`
CreateBy string `gorm:"column:create_by;size:128;" json:"createBy"`
UpdateBy string `gorm:"column:update_By;size:128;" json:"updateBy"`
models.BaseModel
}
+26 -26
View File
@@ -1,36 +1,36 @@
package tools
import (
"go-admin/global/orm"
orm "go-admin/global"
"go-admin/models"
)
type SysTables struct {
TableId int `gorm:"primary_key;auto_increment" json:"tableId"` //表编码
TBName string `gorm:"column:table_name;type:varchar(255);" json:"tableName"` //表名称
TableComment string `gorm:"type:varchar(255);" json:"tableComment"` //表备注
ClassName string `gorm:"type:varchar(255);" json:"className"` //类名
TplCategory string `gorm:"type:varchar(255);" json:"tplCategory"`
PackageName string `gorm:"type:varchar(255);" json:"packageName"` //包名
ModuleName string `gorm:"type:varchar(255);" json:"moduleName"` //模块名
BusinessName string `gorm:"type:varchar(255);" json:"businessName"`
FunctionName string `gorm:"type:varchar(255);" json:"functionName"` //功能名称
FunctionAuthor string `gorm:"type:varchar(255);" json:"functionAuthor"` //功能作者
PkColumn string `gorm:"type:varchar(255);" json:"pkColumn"`
PkGoField string `gorm:"type:varchar(255);" json:"pkGoField"`
PkJsonField string `gorm:"type:varchar(255);" json:"pkJsonField"`
Options string `gorm:"type:varchar(255);" json:"options"`
TreeCode string `gorm:"type:varchar(255);" json:"treeCode"`
TreeParentCode string `gorm:"type:varchar(255);" json:"treeParentCode"`
TreeName string `gorm:"type:varchar(255);" json:"treeName"`
Tree bool `gorm:"type:char(1);" json:"tree"`
Crud bool `gorm:"type:char(1);" json:"crud"`
Remark string `gorm:"type:varchar(255);" json:"remark"`
IsLogicalDelete string `gorm:"type:char(1);" json:"isLogicalDelete"`
LogicalDelete bool `gorm:"type:char(1);" json:"logicalDelete"`
LogicalDeleteColumn string `gorm:"type:varchar(128);" json:"logicalDeleteColumn"`
CreateBy string `gorm:"type:varchar(128);" json:"createBy"`
UpdateBy string `gorm:"type:varchar(128);" json:"updateBy"`
TableId int `gorm:"primary_key;auto_increment" json:"tableId"` //表编码
TBName string `gorm:"column:table_name;size:255;" json:"tableName"` //表名称
TableComment string `gorm:"size:255;" json:"tableComment"` //表备注
ClassName string `gorm:"size:255;" json:"className"` //类名
TplCategory string `gorm:"size:255;" json:"tplCategory"`
PackageName string `gorm:"size:255;" json:"packageName"` //包名
ModuleName string `gorm:"size:255;" json:"moduleName"` //模块名
BusinessName string `gorm:"size:255;" json:"businessName"`
FunctionName string `gorm:"size:255;" json:"functionName"` //功能名称
FunctionAuthor string `gorm:"size:255;" json:"functionAuthor"` //功能作者
PkColumn string `gorm:"size:255;" json:"pkColumn"`
PkGoField string `gorm:"size:255;" json:"pkGoField"`
PkJsonField string `gorm:"size:255;" json:"pkJsonField"`
Options string `gorm:"size:255;" json:"options"`
TreeCode string `gorm:"size:255;" json:"treeCode"`
TreeParentCode string `gorm:"size:255;" json:"treeParentCode"`
TreeName string `gorm:"size:255;" json:"treeName"`
Tree bool `gorm:"size:1;" json:"tree"`
Crud bool `gorm:"size:1;" json:"crud"`
Remark string `gorm:"size:255;" json:"remark"`
IsLogicalDelete string `gorm:"size:1;" json:"isLogicalDelete"`
LogicalDelete bool `gorm:"size:1;" json:"logicalDelete"`
LogicalDeleteColumn string `gorm:"size:128;" json:"logicalDeleteColumn"`
CreateBy string `gorm:"size:128;" json:"createBy"`
UpdateBy string `gorm:"size:128;" json:"updateBy"`
DataScope string `gorm:"-" json:"dataScope"`
Params Params `gorm:"-" json:"params"`
Columns []SysColumns `gorm:"-" json:"columns"`
+3
View File
@@ -0,0 +1,3 @@
{
"lockfileVersion": 1
}
+6
View File
@@ -0,0 +1,6 @@
package cache
// 缓存+队列套件,redis队列使用时,请参考单元测试中的配置
// 目前支持:
// - redis
// - memory
+15
View File
@@ -0,0 +1,15 @@
package cache
import (
"github.com/matchstalk/utils/cache"
)
var MemoryAdapter Adapter
func InitMemory() error {
MemoryAdapter = &cache.Memory{
PoolNum: 100,
}
err := MemoryAdapter.Connect()
return err
}
+45
View File
@@ -0,0 +1,45 @@
package cache
import (
"fmt"
"github.com/matchstalk/utils/cache"
"testing"
"time"
)
func TestInitMemory(t *testing.T) {
tests := []struct {
name string
wantErr bool
}{
{
"test01",
false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := InitMemory(); (err != nil) != tt.wantErr {
t.Errorf("InitRedis() error = %v, wantErr %v", err, tt.wantErr)
}
MemoryAdapter.Set("test", "1", 100)
key, _ := MemoryAdapter.Get("test")
message := &cache.MemoryMessage{}
message.Stream = "queuetest"
message.Values = map[string]interface{}{
"key": "value",
}
MemoryAdapter.Append("queuetest", message)
MemoryAdapter.Register("queuetest", func(message cache.Message) error {
fmt.Println(message.GetValues())
return nil
})
go func() {
MemoryAdapter.Run()
}()
time.Sleep(time.Second)
MemoryAdapter.Shutdown()
fmt.Println(key)
})
}
}
+31
View File
@@ -0,0 +1,31 @@
package cache
import (
"github.com/go-redis/redis/v7"
"github.com/matchstalk/redisqueue"
"github.com/matchstalk/utils/cache"
"time"
)
var RedisAdapter Adapter
func InitRedis() error {
RedisAdapter = &cache.Redis{
ConnectOption: &redis.Options{
Addr: "127.0.0.1:6379",
},
ConsumerOptions: &redisqueue.ConsumerOptions{
VisibilityTimeout: 60 * time.Second,
BlockingTimeout: 5 * time.Second,
ReclaimInterval: 1 * time.Second,
BufferSize: 100,
Concurrency: 10,
},
ProducerOptions: &redisqueue.ProducerOptions{
StreamMaxLength: 100,
ApproximateMaxLength: true,
},
}
err := RedisAdapter.Connect()
return err
}
+45
View File
@@ -0,0 +1,45 @@
package cache
import (
"fmt"
"github.com/matchstalk/utils/cache"
"testing"
"time"
)
func TestInitRedis(t *testing.T) {
tests := []struct {
name string
wantErr bool
}{
{
"test01",
false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if err := InitRedis(); (err != nil) != tt.wantErr {
t.Errorf("InitRedis() error = %v, wantErr %v", err, tt.wantErr)
}
RedisAdapter.Set("test", "1", 100)
key, _ := RedisAdapter.Get("test")
message := &cache.RedisMessage{}
message.Stream = "queuetest"
message.Values = map[string]interface{}{
"key": "value",
}
RedisAdapter.Append("queuetest", message)
RedisAdapter.Register("queuetest", func(message cache.Message) error {
fmt.Println(message.GetValues())
return nil
})
go func() {
RedisAdapter.Run()
}()
time.Sleep(time.Second)
RedisAdapter.Shutdown()
fmt.Println(key)
})
}
}
+29
View File
@@ -0,0 +1,29 @@
package cache
import (
"time"
"github.com/matchstalk/utils/cache"
)
type Adapter interface {
Connect() error
Get(key string) (string, error)
Set(key string, val interface{}, expire int) error
Del(key string) error
HashGet(hk, key string) (string, error)
HashDel(hk, key string) error
Increase(key string) error
Decrease(key string) error
Expire(key string, dur time.Duration) error
cache.AdapterQueue
}
type Message interface {
SetID(string)
SetStream(string)
SetValues(map[string]interface{})
GetID() string
GetStream() string
GetValues() map[string]interface{}
}
+33 -14
View File
@@ -2,28 +2,47 @@ package mycasbin
import (
"github.com/casbin/casbin/v2"
gormadapter "github.com/casbin/gorm-adapter/v2"
"github.com/go-kit/kit/endpoint"
"github.com/casbin/casbin/v2/model"
gormAdapter "github.com/casbin/gorm-adapter/v2"
_ "github.com/go-sql-driver/mysql"
log "github.com/sirupsen/logrus"
"go-admin/global/orm"
"go-admin/tools/config"
"log"
"go-admin/global"
)
var Em endpoint.Middleware
// Initialize the model from a string.
var text = `
[request_definition]
r = sub, obj, act
func Casbin() (*casbin.Enforcer, error) {
conn := orm.MysqlConn
Apter, err := gormadapter.NewAdapter(config.DatabaseConfig.Dbtype, conn, true)
[policy_definition]
p = sub, obj, act
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
m = r.sub == p.sub && (keyMatch2(r.obj, p.obj) || keyMatch(r.obj, p.obj)) && (r.act == p.act || p.act == "*")
`
func Setup() {
Apter, err := gormAdapter.NewAdapterByDB(global.Eloquent)
if err != nil {
return nil, err
panic(err)
}
e, err := casbin.NewEnforcer("config/rbac_model.conf", Apter)
m, err := model.NewModelFromString(text)
if err != nil {
return nil, err
panic(err)
}
if err := e.LoadPolicy(); err == nil {
return e, err
e, err := casbin.NewSyncedEnforcer(m, Apter)
if err != nil {
panic(err)
}
global.CasbinEnforcer = e
}
func Casbin() (*casbin.SyncedEnforcer, error) {
if err := global.CasbinEnforcer.LoadPolicy(); err == nil {
return global.CasbinEnforcer, err
} else {
log.Printf("casbin rbac_model or policy init error, message: %v \r\n", err.Error())
return nil, err
+13
View File
@@ -0,0 +1,13 @@
package cronjob
import (
"github.com/robfig/cron/v3"
)
// newWithSeconds returns a Cron with the seconds field enabled.
func NewWithSeconds() *cron.Cron {
secondParser := cron.NewParser(cron.Second | cron.Minute |
cron.Hour | cron.Dom | cron.Month | cron.DowOptional | cron.Descriptor)
return cron.New(cron.WithParser(secondParser), cron.WithChain())
}
-19
View File
@@ -1,19 +0,0 @@
package cronjob
import (
"github.com/robfig/cron/v3"
log "github.com/sirupsen/logrus"
)
func TestJob(c *cron.Cron) {
id, err := c.AddFunc("1 * * * *", func() {
log.Println("Every hour on the one hour")
})
if err != nil {
log.Println(err)
log.Println("start error")
} else {
log.Printf("Start Success; ID: %v \r\n", id)
}
}
+52
View File
@@ -0,0 +1,52 @@
package pkg
import (
"bytes"
"encoding/json"
"io/ioutil"
"net/http"
"time"
)
// 发送GET请求
// url: 请求地址
// response: 请求返回的内容
func Get(url string) (string, error) {
client := &http.Client{}
req, err := http.NewRequest("GET", url, nil)
req.Header.Set("Accept", "*/*")
req.Header.Set("Content-Type", "application/json")
if err != nil {
return "", err
}
resp, err := client.Do(req)
if err != nil {
return "", err
}
defer resp.Body.Close()
result, _ := ioutil.ReadAll(resp.Body)
return string(result), nil
}
// 发送POST请求
// url: 请求地址
// data: POST请求提交的数据
// contentType: 请求体格式,如:application/json
// content: 请求放回的内容
func Post(url string, data interface{}, contentType string) string {
// 超时时间:5秒
client := &http.Client{Timeout: 5 * time.Second}
jsonStr, _ := json.Marshal(data)
resp, err := client.Post(url, contentType, bytes.NewBuffer(jsonStr))
if err != nil {
panic(err)
}
defer resp.Body.Close()
result, _ := ioutil.ReadAll(resp.Body)
return string(result)
}
+6 -1
View File
@@ -152,7 +152,7 @@ var (
ErrMissingAuthenticatorFunc = errors.New("ginJWTMiddleware.Authenticator func is undefined")
// ErrMissingLoginValues indicates a user tried to authenticate without username or password
ErrMissingLoginValues = errors.New("missing Username or Password")
ErrMissingLoginValues = errors.New("missing Username or Password or Code")
// ErrFailedAuthentication indicates authentication failed, could be faulty username or password
ErrFailedAuthentication = errors.New("incorrect Username or Password")
@@ -288,6 +288,11 @@ func (mw *GinJWTMiddleware) MiddlewareInit() error {
mw.Timeout = time.Duration(config2.JwtConfig.Timeout) * time.Second
}
if config2.ApplicationConfig.Mode == "dev" {
// TODO: dev mode token过期时长 为 10 年
mw.Timeout = time.Duration(876010) * time.Hour
}
if mw.TimeFunc == nil {
mw.TimeFunc = time.Now
}
+31 -6
View File
@@ -1,13 +1,38 @@
package logger
import (
log "github.com/sirupsen/logrus"
"github.com/gogf/gf/os/glog"
"go-admin/global"
"go-admin/tools"
"go-admin/tools/config"
)
var (
Info *log.Logger
Warning *log.Logger
Error * log.Logger
)
var Logger *glog.Logger
var JobLogger *glog.Logger
var RequestLogger *glog.Logger
func Setup() {
Logger = glog.New()
_ = Logger.SetPath(config.LoggerConfig.Path + "/bus")
Logger.SetStdoutPrint(config.LoggerConfig.EnabledBUS && config.LoggerConfig.Stdout)
Logger.SetFile("bus-{Ymd}.log")
_ = Logger.SetLevelStr(config.LoggerConfig.Level)
JobLogger = glog.New()
_ = JobLogger.SetPath(config.LoggerConfig.Path + "/job")
JobLogger.SetStdoutPrint(false)
JobLogger.SetFile("db-{Ymd}.log")
_ = JobLogger.SetLevelStr(config.LoggerConfig.Level)
RequestLogger = glog.New()
_ = RequestLogger.SetPath(config.LoggerConfig.Path + "/request")
RequestLogger.SetStdoutPrint(false)
RequestLogger.SetFile("access-{Ymd}.log")
_ = RequestLogger.SetLevelStr(config.LoggerConfig.Level)
Logger.Info(tools.Green("Logger init success!"))
global.Logger = Logger.Line()
global.JobLogger = JobLogger.Line()
global.RequestLogger = RequestLogger.Line()
}
+65
View File
@@ -0,0 +1,65 @@
package utils
import (
"io/ioutil"
"mime/multipart"
"os"
"path"
)
// 获取文件大小
func GetSize(f multipart.File) (int, error) {
content, err := ioutil.ReadAll(f)
return len(content), err
}
// 获取文件后缀
func GetExt(fileName string) string {
return path.Ext(fileName)
}
//检查文件是否存在
func CheckExist(src string) bool {
_, err := os.Stat(src)
return os.IsNotExist(err)
}
// 检查文件权限
func CheckPermission(src string) bool {
_, err := os.Stat(src)
return os.IsPermission(err)
}
//如果不存在则新建文件夹
func IsNotExistMkDir(src string) error {
if exist := CheckExist(src); exist == false {
if err := MkDir(src); err != nil {
return err
}
}
return nil
}
//新建文件夹
func MkDir(src string) error {
err := os.MkdirAll(src, os.ModePerm)
if err != nil {
return err
}
return nil
}
// 打开文件
func Open(name string, flag int, perm os.FileMode) (*os.File, error) {
f, err := os.OpenFile(name, flag, perm)
if err != nil {
return nil, err
}
return f, nil
}
+42
View File
@@ -0,0 +1,42 @@
package utils
import (
"database/sql/driver"
"fmt"
"time"
)
// JSONTime format json time field by myself
type JSONTime struct {
time.Time
}
// MarshalJSON on JSONTime format Time field with %Y-%m-%d %H:%M:%S
func (t JSONTime) MarshalJSON() ([]byte, error) {
if (t == JSONTime{}) {
formatted := fmt.Sprintf("\"%s\"", "")
return []byte(formatted), nil
} else {
formatted := fmt.Sprintf("\"%s\"", t.Format("2006-01-02 15:04:05"))
return []byte(formatted), nil
}
}
// Value insert timestamp into mysql need this function.
func (t JSONTime) Value() (driver.Value, error) {
var zeroTime time.Time
if t.Time.UnixNano() == zeroTime.UnixNano() {
return nil, nil
}
return t.Time, nil
}
// Scan valueof time.Time
func (t *JSONTime) Scan(v interface{}) error {
value, ok := v.(time.Time)
if ok {
*t = JSONTime{Time: value}
return nil
}
return fmt.Errorf("can not convert %v to timestamp", v)
}
+55
View File
@@ -0,0 +1,55 @@
package utils
import (
"net/http"
"time"
)
// api结构体
type APIException struct {
Code int `json:"code"`
Success bool `json:"success"`
Msg string `json:"msg"`
Timestamp int64 `json:"timestamp"`
Result interface{} `json:"result"`
}
// 实现接口
func (e *APIException) Error() string {
return e.Msg
}
func newAPIException(code int,msg string,data interface{},success bool) *APIException {
return &APIException{
Code: code,
Success: success,
Msg: msg,
Timestamp: time.Now().Unix(),
Result: data,
}
}
// 500 错误处理
func ServerError() *APIException {
return newAPIException(http.StatusInternalServerError, http.StatusText(http.StatusInternalServerError),nil,false)
}
// 404 错误
func NotFound() *APIException {
return newAPIException(http.StatusNotFound, http.StatusText(http.StatusNotFound),nil,false)
}
// 未知错误
func UnknownError(message string) *APIException {
return newAPIException(http.StatusForbidden, message,nil,false)
}
// 参数错误
func ParameterError(message string) *APIException {
return newAPIException(http.StatusBadRequest, message,nil,false)
}
// 授权错误
func AuthError(message string) *APIException {
return newAPIException(http.StatusBadRequest, message,nil,false)
}
// 200
func ResponseJson(message string,data interface{},success bool) *APIException {
return newAPIException(http.StatusOK,message,data,success)
}

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