Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
TruthHun committed Dec 25, 2023
1 parent a0834dd commit 319cf16
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 18 deletions.
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![魔豆文库](web/static/static/images/logo.png)
![魔豆文库](docs/images/logo.png)

目录

Expand Down Expand Up @@ -157,7 +157,6 @@
├── cache # 缓存相关
├── conf # 配置定义
├── dict # 结巴分词字典,用于给文档自动进行分词
├── dist # 前端打包后的文件
├── docs # API文档等
├── documents # 用户上传的文档存储目录
├── go.mod # go依赖管理
Expand All @@ -170,8 +169,7 @@
├── sitemap # 站点地图
├── third_party # 第三方依赖,主要是proto文件
├── uploads # 文档文件之外的其他文件存储目录
├── util # 工具函数
└── web # 前端Web
└── util # 工具函数
```

<a name="dev-config"></a>
Expand All @@ -192,6 +190,7 @@ port="8880"
[database]
driver="mysql"
dsn="root:root@tcp(localhost:3306)/moredoc?charset=utf8mb4&loc=Local&parseTime=true"
# 生产环境,请将showSQL设置为false
showSQL=true
maxOpen=10
maxIdle=10
Expand Down
31 changes: 21 additions & 10 deletions app.example.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 程序运行级别:debug、info、warn、error,生产环境使用 info及其以上级别
# 程序运行级别:debug、info、warn、error,生产环境使用 info 及其以上级别
level = "debug"

# 日志编码方式,支持:json、console
Expand All @@ -9,15 +9,26 @@ port = "8880"

# 数据库配置
[database]
driver = "mysql"
dsn = "root:root@tcp(localhost:3306)/moredoc?charset=utf8mb4&loc=Local&parseTime=true"
showSQL = true
maxOpen = 10
maxIdle = 10
driver = "mysql"
dsn = "root:root@tcp(localhost:3306)/moredoc?charset=utf8mb4&loc=Local&parseTime=true"
# 是否显示 SQL 语句,生产环境下请设置为false
showSQL = true
maxOpen = 10
maxIdle = 10

# JSON Web Token 配置
[jwt]
# 生成 token 的密钥,请务必修改!!!
secret = "moredoc"
# token 过期时间
expireDays = 365
# 生成 token 的密钥,请务必修改!!!
secret = "moredoc"
# token 过期时间
expireDays = 365

# 日志配置
[logger]
# 如果配置了 filename,则日志会输出到文件,否则输出到控制台
# filename = "logs/moredoc.log"
filename = ""
maxSizeMB = 10
maxBackups = 10
maxAgeDays = 30
compress = true
4 changes: 2 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ func initLogger(level, LogEncoding string, logCfg ...conf.LoggerConfig) {
Filename: logCfg[0].Filename,
MaxSize: logCfg[0].MaxSizeMB, // megabytes
MaxBackups: logCfg[0].MaxBackups,
MaxAge: logCfg[0].MaxAgeDays, // days
Compress: logCfg[0].Comptress,
MaxAge: logCfg[0].MaxDays, // days
Compress: logCfg[0].Compress,
})

enc := zapcore.NewConsoleEncoder(cfg.EncoderConfig)
Expand Down
4 changes: 2 additions & 2 deletions conf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ type LoggerConfig struct {
Filename string
MaxSizeMB int // 每份日志大小
MaxBackups int // 日志保留多少份
MaxAgeDays int // 保留多少天的日志
Comptress bool
MaxDays int // 保留多少天的日志
Compress bool
}

// Config app config
Expand Down
Binary file added docs/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 319cf16

Please sign in to comment.