Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
更新表结构,更改配置文件读取优先级
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Info committed Aug 16, 2021
1 parent e1711fb commit b89c8ad
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ trusted-proxies:
# database config >>>
db-username: "root"
db-password: "passwd"
db-database: "info_test"
db-database: "info2021"
# "db-hostname: 127.0.0.1" & "port: 3306" can be omitted
# db-hostname: 127.0.0.1
# db-port: 3306
Expand All @@ -22,6 +22,6 @@ excel:
faculty: "学院"
class: "班级"
uid: "学号"
house: "寝室楼"
room: "寝室号"
bed: "床号"
house: "楼号"
room: "寝室"
bed: ""
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
)

const (
VERSION = "v1.2.0"
VERSION = "v1.2.1"
)

func main() {
Expand All @@ -39,8 +39,8 @@ func main() {
} else {
viper.SetConfigName("config")
viper.SetConfigType("yaml")
viper.AddConfigPath("/etc/info")
viper.AddConfigPath(".")
viper.AddConfigPath("/etc/info")
}
if err := viper.ReadInConfig(); err != nil {
if _, ok := err.(viper.ConfigFileNotFoundError); ok {
Expand Down
2 changes: 1 addition & 1 deletion model/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ type Student struct {
Class string `gorm:"comment:班级;size:50"`
Campus string `gorm:"comment:校区;size:10"`
House string `gorm:"comment:寝室楼;size:15"`
Room string `gorm:"comment:寝室号;size:5"`
Room string `gorm:"comment:寝室号;size:15"`
Bed int8 `gorm:"comment:床号"`
}

0 comments on commit b89c8ad

Please sign in to comment.