diff --git a/configs/dazBlog.yaml b/configs/dazBlog.yaml index bc9e7e5..4bdc387 100644 --- a/configs/dazBlog.yaml +++ b/configs/dazBlog.yaml @@ -23,7 +23,7 @@ db: max-idle-connections: 100 max-open-connections: 100 max-connection-life-time: 10s - log-level: 4 # GORM log level, 1: silent, 2:error, 3:warn, 4:info + log-level: 2 # GORM log level, 1: silent, 2:error, 3:warn, 4:info # log configs log: diff --git a/internal/pkg/model/user.go b/internal/pkg/model/user.go index 65b0d8d..e0262d9 100644 --- a/internal/pkg/model/user.go +++ b/internal/pkg/model/user.go @@ -13,7 +13,7 @@ import ( type UserM struct { ID int64 `gorm:"column:id;primary_key"` // unique id for the user, server as the primary key - PostCount int64 `gorm:"column:postCount"` // number of posts the user has + PostCount int64 `gorm:"column:postcount"` // number of posts the user has Username string `gorm:"column:username"` // username of the user Password string `gorm:"column:password"` // password of the user Nickname string `gorm:"column:nickname"` // nickname of the user diff --git a/pkg/api/dazBlog/v1/user.go b/pkg/api/dazBlog/v1/user.go index f28baf0..025c164 100644 --- a/pkg/api/dazBlog/v1/user.go +++ b/pkg/api/dazBlog/v1/user.go @@ -8,7 +8,7 @@ package v1 // CreateUserRequest specifies the request parameters for // `POST /v1/users` type CreateUserRequest struct { - PostCount string `json:"postcount" valid:"required,stringlength(1|255)"` + Postcount int64 `json:"postcount" valid:"required,stringlength(1|255)"` Username string `json:"username" valid:"alphanum,required,stringlength(1|255)"` Password string `json:"password" valid:"required,stringlength(6|18)"` Nickname string `json:"nickname" valid:"required,stringlength(1|255)"` @@ -26,7 +26,7 @@ type UserInfo struct { Nickname string `json:"nickname"` Email string `json:"email"` Phone string `json:"phone"` - PostCount int64 `json:"postCount"` + PostCount int64 `json:"postcount"` CreatedAt string `json:"createdAt"` UpdatedAt string `json:"updatedAt"` }