增加mysql连接数据结构定义

This commit is contained in:
白茶清欢 2023-07-31 11:19:25 +08:00
parent edbcff8704
commit 537f028d2a
1 changed files with 33 additions and 0 deletions

33
api2sql/define/config.go Normal file
View File

@ -0,0 +1,33 @@
// Package define ...
//
// Description : define ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2023-07-31 10:36
package define
// MysqlConfig mysql数据库配置结构
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 10:53 2023/7/31
type MysqlConfig struct {
Host string `json:"host" gorm:"host" ini:"host" xml:"host" yaml:"host"` // 服务器地址
Port int `json:"port" gorm:"port" ini:"port" xml:"port" yaml:"port"` // 端口
Username string `json:"username" gorm:"username" ini:"username" xml:"username" yaml:"username"` // 用户名
Password string `json:"password" gorm:"password" ini:"password" xml:"password" yaml:"password"` // 密码
}
// LoggerConfig 日志配置
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 10:54 2023/7/31
type LoggerConfig struct {
LogPath string `json:"log_path" gorm:"log_path" ini:"log_path" xml:"log_path" yaml:"log_path"` // 日志路径, 不包含文件名, 相对路径, 则日志存储与项目路径下
Level int `json:"level" gorm:"level" ini:"level" xml:"level" yaml:"level"` // 日志等级
Console bool `json:"console" gorm:"console" ini:"console" xml:"console" yaml:"console"` // 控制台输出
Split string `json:"split" gorm:"split" ini:"split" xml:"split" yaml:"split"` // 切割规则 : 小时 / 天
}