|
| 1 | +package models |
| 2 | + |
| 3 | +import ( |
| 4 | +"time" |
| 5 | + |
| 6 | +"github.com/google/uuid" |
| 7 | +) |
| 8 | + |
| 9 | +typePoststruct { |
| 10 | +ID uuid.UUID`gorm:"type:uuid;default:uuid_generate_v4();primary_key"` |
| 11 | +Titlestring`` |
| 12 | +Contentstring`` |
| 13 | +Imagestring`` |
| 14 | +Userstring`` |
| 15 | +CreateAt time.Time`` |
| 16 | +UpdatedAt time.Time`` |
| 17 | +} |
| 18 | + |
| 19 | +typeCreatePostRequeststruct { |
| 20 | +Titlestring`json:"title" bson:"title" binding:"required"` |
| 21 | +Contentstring`json:"content" bson:"content" binding:"required"` |
| 22 | +Imagestring`json:"image,omitempty" bson:"image,omitempty"` |
| 23 | +Userstring`json:"user" bson:"user" binding:"required"` |
| 24 | +CreateAt time.Time`json:"created_at,omitempty" bson:"created_at,omitempty"` |
| 25 | +UpdatedAt time.Time`json:"updated_at,omitempty" bson:"updated_at,omitempty"` |
| 26 | +} |
| 27 | + |
| 28 | +typeUpdatePoststruct { |
| 29 | +ID uuid.UUID`gorm:"type:uuid;default:uuid_generate_v4();primary_key"` |
| 30 | +Titlestring`json:"title,omitempty" bson:"title,omitempty"` |
| 31 | +Contentstring`json:"content,omitempty" bson:"content,omitempty"` |
| 32 | +Imagestring`json:"image,omitempty" bson:"image,omitempty"` |
| 33 | +Userstring`json:"user,omitempty" bson:"user,omitempty"` |
| 34 | +CreateAt time.Time`json:"created_at,omitempty" bson:"created_at,omitempty"` |
| 35 | +UpdatedAt time.Time`json:"updated_at,omitempty" bson:"updated_at,omitempty"` |
| 36 | +} |