🎉 Initial commit

This commit is contained in:
landaiqing
2024-08-03 20:34:12 +08:00
parent 93b37f9b46
commit 908a9d10f2
9 changed files with 69 additions and 0 deletions

1
.gitignore vendored
View File

@@ -26,6 +26,7 @@ go.work
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml

8
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

10
config/conf_logger.go Normal file
View File

@@ -0,0 +1,10 @@
package config
// Logger 配置
type Logger struct {
Level string `yaml:"level"` // 日志级别
Prefix string `yaml:"prefix"` // 日志前缀
Director string `yaml:"director"` // 日志文件存放目录
ShowLine string `yaml:"showLine"` // 是否显示文件行号
LogInConsole string `yaml:"logInConsole"` // 是否在控制台打印日志
}

11
config/conf_mysql.go Normal file
View File

@@ -0,0 +1,11 @@
package config
// MySQL 配置
type MySQL struct {
Host string `yaml:"host"` //主机地址
Port string `yaml:"port"` //端口号
DB string `yaml:"db"` //数据库名
User string `yaml:"user"` //用户名
Password string `yaml:"password"` //密码
LogLevel string `yaml:"log-level"` // 日志级别 debug: 输出全部SQL语句; release: 只输出错误信息
}

8
config/conf_system.go Normal file
View File

@@ -0,0 +1,8 @@
package config
// System 系统配置
type System struct {
Host string `yaml:"host"` //主机地址
Port string `yaml:"port"` //端口号
Env string `yaml:"env"` //环境
}

7
config/config.go Normal file
View File

@@ -0,0 +1,7 @@
package config
type Config struct {
MySQL MySQL `yaml:"mysql"`
Logger Logger `yaml:"logger"`
System System `yaml:"system"`
}

3
go.mod Normal file
View File

@@ -0,0 +1,3 @@
module schisandra-cloud-album
go 1.22.5

1
main.go Normal file
View File

@@ -0,0 +1 @@
package main

20
settings.yaml Normal file
View File

@@ -0,0 +1,20 @@
# 系统配置
system:
host: "0.0.0.0" # 主机地址
port: 8080 # 端口
env: env # 环境
# MySQL配置
mysql:
host: "1.95.0.111" # 主机地址
port: 3306 # 端口
db: schisandra-cloud-album # 数据库名称
user: root # 用户名
password: LDQ20020618xxx # 密码
log-level: dev # 日志级别
# 日志配置
logger:
level: info # 日志级别
prefix: "[schisandra]" # 日志前缀
director: log # 日志文件存放目录
show-line: true # 是否显示文件行号
log-in-console: true # 是否在控制台打印日志