fix:gorm not autoIncrement && update doc

This commit is contained in:
Sakurasan
2023-06-12 21:32:27 +08:00
parent 06bd5e048b
commit 933a70a474
12 changed files with 127 additions and 52 deletions

View File

@@ -2,11 +2,14 @@ package store
import (
"time"
"gorm.io/gorm"
)
type User struct {
gorm.Model
IsDelete bool `gorm:"default:false" json:"IsDelete"`
ID uint `gorm:"primaryKey;autoIncrement" json:"id,omitempty"`
ID uint `gorm:"primarykey autoIncrement;" json:"id,omitempty"`
Name string `gorm:"unique;not null" json:"name,omitempty"`
Token string `gorm:"unique;not null" json:"token,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`