Skip to content

Commit 11cde72

Browse files
author
pixel
committed
Merge remote-tracking branch 'origin/gva_gormv2_dev' into gva_gormv2_dev
# Conflicts: # server/go.mod # server/initialize/data.go # server/model/sys_base_menu.go # server/service/sys_db_initialize.go
2 parents fb6dfcb + 734ff79 commit 11cde72

Some content is hidden

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

45 files changed

+310
-8282
lines changed
File renamed without changes.

docker/server-handle.sh renamed to .docker-compose/shell/server-handle.sh

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"fmt"
1212
"gin-vue-admin/global"
1313
"gin-vue-admin/initialize"
14+
"go.uber.org/zap"
1415
"time"
1516
)
1617
@@ -35,10 +36,10 @@ func RunWindowsServer() {
3536
// 保证文本顺序输出
3637
// In order to ensure that the text order output can be deleted
3738
time.Sleep(10 * time.Microsecond)
38-
global.GVA_LOG.Debug("server run success on ", address)
39+
global.GVA_LOG.Debug("server run success on ", zap.String("address", address))
3940
4041
fmt.Printf("欢迎使用 Gin-Vue-Admin默认自动化文档地址:http://127.0.0.1%s/swagger/index.html\n 默认前端文件运行地址:http://127.0.0.1:8888/admin\n", address)
41-
global.GVA_LOG.Error(s.ListenAndServe())
42+
global.GVA_LOG.Error(s.ListenAndServe().Error())
4243
}
4344
EOF
4445

@@ -63,7 +64,7 @@ mysql:
6364
password: 'Aa@6447985'
6465
path: mysql
6566
db-name: 'qmPlus'
66-
config: 'charset=utf8&parseTime=True&loc=Local'
67+
config: 'charset=utf8mb4&parseTime=True&loc=Local'
6768
max-idle-conns: 10
6869
max-open-conns: 10
6970
log-mode: true
@@ -76,6 +77,12 @@ sqlite:
7677
7778
# oss configuration
7879
80+
# 切换本地与七牛云上传,分配头像和文件路径
81+
localupload:
82+
local: false
83+
avatar-path: uploads/avatar
84+
file-path: uploads/file
85+
7986
# 请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址
8087
qiniu:
8188
access-key: '25j8dYBZ2wuiy0yhwShytjZDTX662b8xiFguwxzZ'
@@ -102,11 +109,19 @@ captcha:
102109
img-width: 240
103110
img-height: 80
104111
105-
# logger configuration
106-
log:
107-
prefix: '[GIN-VUE-ADMIN]'
108-
log-file: true
109-
stdout: 'DEBUG'
110-
file: 'DEBUG'
112+
# zap logger configuration
113+
zap:
114+
# 可使用 "debug", "info", "warn", "error", "dpanic", "panic", "fatal",
115+
level: 'debug'
116+
# console: 控制台, json: json格式输出
117+
format: 'console'
118+
prefix: '[GIN-VUE-ADMIN]'
119+
director: 'log'
120+
link_name: 'latest_log'
121+
show_line: true
122+
# LowercaseLevelEncoder:小写, LowercaseColorLevelEncoder:小写带颜色,CapitalLevelEncoder: 大写, CapitalColorLevelEncoder: 大写带颜色,
123+
encode_level: 'LowercaseColorLevelEncoder'
124+
stacktrace_key: 'stacktrace'
125+
log_in_console: true
111126
EOF
112127

File renamed without changes.

README-zh_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[English](./README.md) | 简体中文
1414

1515
# 项目文档
16-
[在线文档](https://www.gin-vue-admin.com/)
16+
[在线文档](https://www.gin-vue-admin.com/) : https://www.gin-vue-admin.com/
1717

1818
[开发教学](https://www.gin-vue-admin.com/docs/help) (贡献者: <a href="https://github.com/LLemonGreen">LLemonGreen</a> And <a href="https://github.com/fkk0509">Fann</a>)
1919
- 前端UI框架:[element-ui](https://github.com/ElemeFE/element)

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
English | [简体中文](./README-zh_CN.md)
1414

1515
# Project Guidelines
16-
[Online Documentation](https://www.gin-vue-admin.com/)
16+
[Online Documentation](https://www.gin-vue-admin.com/) : https://www.gin-vue-admin.com/
17+
18+
1719

1820
[Development Steps](https://www.gin-vue-admin.com/docs/help) (Contributor: <a href="https://github.com/LLemonGreen">LLemonGreen</a> And <a href="https://github.com/fkk0509">Fann</a>)
1921
- Web UI Framework:[element-ui](https://github.com/ElemeFE/element)

docker-compose.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ services:
1414
- redis
1515

1616
mysql:
17-
image: registry.cn-shanghai.aliyuncs.com/gva/gva-mysql:1.1
17+
image: mysql:8.0.21
1818
container_name: gva-mysql
1919
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci #设置utf8字符集
2020
restart: always
2121
ports:
2222
- "13306:3306" # host物理直接映射端口为6606
2323
environment:
24-
MYSQL_ROOT_PASSWORD: "Aa@6447985" # root管理员用户密码
24+
MYSQL_DATABASE: 'qmPlus' # 初始化启动时要创建的数据库的名称
25+
MYSQL_ROOT_PASSWORD: 'Aa@6447985' # root管理员用户密码
26+
volumes:
27+
- '.docker-compose/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d'
2528

2629
redis:
2730
image: redis:6.0.6

dockerfile_server

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ WORKDIR /gva_web/
44
COPY web/ .
55

66
RUN cat .env.production
7-
COPY docker/web-handle.sh .
7+
COPY .docker-compose/shell/web-handle.sh .
8+
RUN ls -al
89
RUN sh ./web-handle.sh
910
RUN cat .env.production
1011
RUN rm -f web-handle.sh
@@ -22,7 +23,8 @@ COPY server/ ./
2223

2324
RUN cat ./core/server.go
2425
RUN cat ./config.yaml
25-
COPY docker/server-handle.sh .
26+
COPY .docker-compose/shell/server-handle.sh .
27+
RUN ls -al
2628
RUN sh ./server-handle.sh
2729
RUN rm -f server-handle.sh
2830
RUN cat ./core/server.go

server/config.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,19 @@ log:
6464
prefix: '[GIN-VUE-ADMIN]'
6565
log-file: true
6666
stdout: 'DEBUG'
67-
file: 'DEBUG'
67+
file: 'DEBUG'
68+
69+
# zap logger configuration
70+
zap:
71+
# 可使用 "debug", "info", "warn", "error", "dpanic", "panic", "fatal",
72+
level: 'debug'
73+
# console: 控制台, json: json格式输出
74+
format: 'console'
75+
prefix: '[GIN-VUE-ADMIN]'
76+
director: 'log'
77+
link_name: 'latest_log'
78+
show_line: true
79+
# LowercaseLevelEncoder:小写, LowercaseColorLevelEncoder:小写带颜色,CapitalLevelEncoder: 大写, CapitalColorLevelEncoder: 大写带颜色,
80+
encode_level: 'LowercaseColorLevelEncoder'
81+
stacktrace_key: 'stacktrace'
82+
log_in_console: true

server/config/config.go

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package config
22

33
type Server struct {
4-
Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
5-
Sqlite Sqlite `mapstructure:"sqlite" json:"sqlite" yaml:"sqlite"`
6-
Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
7-
Casbin Casbin `mapstructure:"casbin" json:"casbin" yaml:"casbin"`
8-
Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"`
9-
System System `mapstructure:"system" json:"system" yaml:"system"`
10-
JWT JWT `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
11-
Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"`
12-
Log Log `mapstructure:"log" json:"log" yaml:"log"`
4+
Mysql Mysql `mapstructure:"mysql" json:"mysql" yaml:"mysql"`
5+
Sqlite Sqlite `mapstructure:"sqlite" json:"sqlite" yaml:"sqlite"`
6+
Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`
7+
Casbin Casbin `mapstructure:"casbin" json:"casbin" yaml:"casbin"`
8+
Redis Redis `mapstructure:"redis" json:"redis" yaml:"redis"`
9+
System System `mapstructure:"system" json:"system" yaml:"system"`
10+
JWT JWT `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
11+
Captcha Captcha `mapstructure:"captcha" json:"captcha" yaml:"captcha"`
12+
Zap Zap `mapstructure:"zap" json:"zap" yaml:"zap"`
1313
LocalUpload LocalUpload `mapstructure:"localUpload" json:"localUpload" yaml:"localUpload"`
1414
}
1515

@@ -46,9 +46,9 @@ type Redis struct {
4646
}
4747

4848
type LocalUpload struct {
49-
Local bool `mapstructure:"local" json:"local" yaml:"local"`
49+
Local bool `mapstructure:"local" json:"local" yaml:"local"`
5050
AvatarPath string `mapstructure:"avatar-path" json:"avatarPath" yaml:"avatar-path"`
51-
FilePath string `mapstructure:"file-path" json:"filePath" yaml:"file-path"`
51+
FilePath string `mapstructure:"file-path" json:"filePath" yaml:"file-path"`
5252
}
5353

5454
type Qiniu struct {
@@ -64,17 +64,22 @@ type Captcha struct {
6464
ImgHeight int `mapstructure:"img-height" json:"imgHeight" yaml:"img-height"`
6565
}
6666

67-
type Log struct {
68-
Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
69-
LogFile bool `mapstructure:"log-file" json:"logFile" yaml:"log-file"`
70-
Stdout string `mapstructure:"stdout" json:"stdout" yaml:"stdout"`
71-
File string `mapstructure:"file" json:"file" yaml:"file"`
72-
}
73-
7467
type Sqlite struct {
7568
Username string `mapstructure:"username" json:"username" yaml:"username"`
7669
Password string `mapstructure:"password" json:"password" yaml:"password"`
7770
Path string `mapstructure:"path" json:"path" yaml:"path"`
7871
Config string `mapstructure:"config" json:"config" yaml:"config"`
7972
LogMode bool `mapstructure:"log-mode" json:"logMode" yaml:"log-mode"`
8073
}
74+
75+
type Zap struct {
76+
Level string `mapstructure:"level" json:"level" yaml:"level"`
77+
Format string `mapstructure:"format" json:"format" yaml:"format"`
78+
Prefix string `mapstructure:"prefix" json:"prefix" yaml:"prefix"`
79+
Director string `mapstructure:"director" json:"director" yaml:"director"`
80+
LinkName string `mapstructure:"link_name" json:"linkName" yaml:"link_name"`
81+
ShowLine bool `mapstructure:"show_line" json:"showLine" yaml:"showLine"`
82+
EncodeLevel string `mapstructure:"encode_level" json:"encodeLevel" yaml:"encode_level"`
83+
StacktraceKey string `mapstructure:"stacktrace_key" json:"stacktraceKey" yaml:"stacktrace_key"`
84+
LogInConsole bool `mapstructure:"log_in_console" json:"logInConsole" yaml:"log_in_console"`
85+
}

server/core/log.go

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

0 commit comments

Comments
 (0)