Skip to content

Commit

Permalink
fix: postcount always is zero
Browse files Browse the repository at this point in the history
Signed-off-by: daz-3ux <[email protected]>
  • Loading branch information
Daz-3ux committed Oct 9, 2023
1 parent b051300 commit 2b398e9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion configs/dazBlog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion internal/pkg/model/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/dazBlog/v1/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)"`
Expand All @@ -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"`
}
Expand Down

0 comments on commit 2b398e9

Please sign in to comment.