Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite0bc54d

Browse files
committed
updated
1 parent421054b commite0bc54d

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

‎models/post.model.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp