File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -25,23 +25,20 @@ go get -u github.com/tiancheng92/gin_example_with_generic
25
25
* 修改` ./config_file/local.yaml ` 文件
26
26
27
27
``` yaml
28
- Mysql :
29
- DBHost : " 127.0.0.1" # # 数据库地址
30
- DBPort : " 3306" # # 数据库端口
31
- DBName : " gin_example" # # 数据库名称
32
- DBUser : " root" # # 数据库用户名
33
- DBPassword : " " # # 数据库密码
28
+ # # 数据库链接DSN
29
+ Mysql : " root:@tcp(127.0.0.1:3306)/gin_example?charset=utf8&parseTime=true&loc=Local"
34
30
31
+ # # gin服务配置
35
32
Server :
36
33
Mode : " debug" # # 运行模式,test、debug或release
37
34
ServicePort : " 8080" # # 服务端口
38
35
ServiceHost : " 0.0.0.0" # # 服务器地址
39
36
40
- Log :
41
- Level : " debug" # # 日志级别,debug、info、warn、error
37
+ # # 日志级别,debug、info、warn、error
38
+ LogLevel : " debug"
42
39
43
- I18n :
44
- Locale : " zh" # # 国际化, zh en ja
40
+ # # 国际化
41
+ I18n : " zh" # zh en ja
45
42
` ` `
46
43
47
44
### 构建
@@ -273,7 +270,7 @@ type ReadOnlyControllerInterface[M ModelInterface] interface {
273
270
### 参数校验
274
271
275
272
* gin_example_with_generic模型使用[ validator] ( https://github.com/go-playground/validator ) 进行参数校验,并对其进行了二次分装。
276
- * 默认支持了中、英、日语言(仅需在配置文件的` I18n.Locale ` 字段中进行设置)
273
+ * 默认支持了中、英、日语言(仅需在配置文件的` I18n ` 字段中进行设置)
277
274
* 支持自定义翻译与自定义校验规则定义
278
275
* Code:
279
276
[ pkg/validator/validator.go] ( https://github.com/tiancheng92/gin_example_with_generic/blob/main/pkg/validator/validator.go )
You can’t perform that action at this time.
0 commit comments