learnsteam-quiz-api/internal/models/user.go

22 lines
938 B
Go
Raw Normal View History

2023-10-19 22:47:12 +09:00
package models
2023-11-17 01:38:01 +09:00
import "time"
2023-10-19 22:47:12 +09:00
type User struct {
2023-11-17 01:38:01 +09:00
ID string `json:"id" db:"id" example:"137c1683-2ad6-4201-b256-253828b61c49" gorm:"column:id;size:255;primary_key;"`
Username string `json:"username" db:"username" example:"user0" gorm:"column:username;size:50;uniqueIndex;"`
Name string `json:"name" db:"name" example:"홍길동" gorm:"column:name;size:50;"`
Score int32 `json:"score" db:"score" example:"9999" gorm:"column:score;"`
Password string `json:"-" db:"password" gorm:"column:password;size:255;not null;"`
UpdatedAt time.Time `json:"-" gorm:"column:updated_at;index;"`
CreatedAt time.Time `json:"-" gorm:"column:created_at;index;"`
}
type UserListResponse struct {
Data []User `json:"data"`
Total int64 `json:"total" example:"90"`
Page int `json:"page" example:"1"`
TotalPage int64 `json:"totalPage" example:"9"`
PageSize int `json:"pageSize" example:"10"`
2023-10-19 22:47:12 +09:00
}