diff --git a/docs/docs.go b/docs/docs.go index dbf8ba7..5772fbc 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1376,6 +1376,10 @@ const docTemplate = `{ "type": "string", "example": "퀴즈 시트 설명" }, + "created_at": { + "type": "string", + "example": "2023-11-10T13:10:00+09:00" + }, "guid_id": { "type": "string", "example": "ef74c59a-c707-4162-a52b-455906c81ec1" @@ -1510,6 +1514,10 @@ const docTemplate = `{ "type": "string", "example": "퀴즈 시트 설명" }, + "created_at": { + "type": "string", + "example": "2023-11-10T13:10:00+09:00" + }, "id": { "type": "integer", "example": 100001 diff --git a/docs/swagger.json b/docs/swagger.json index d648772..2c5fd43 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1368,6 +1368,10 @@ "type": "string", "example": "퀴즈 시트 설명" }, + "created_at": { + "type": "string", + "example": "2023-11-10T13:10:00+09:00" + }, "guid_id": { "type": "string", "example": "ef74c59a-c707-4162-a52b-455906c81ec1" @@ -1502,6 +1506,10 @@ "type": "string", "example": "퀴즈 시트 설명" }, + "created_at": { + "type": "string", + "example": "2023-11-10T13:10:00+09:00" + }, "id": { "type": "integer", "example": 100001 diff --git a/docs/swagger.yaml b/docs/swagger.yaml index ca78e85..9d786fa 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -172,6 +172,9 @@ definitions: content: example: 퀴즈 시트 설명 type: string + created_at: + example: "2023-11-10T13:10:00+09:00" + type: string guid_id: example: ef74c59a-c707-4162-a52b-455906c81ec1 type: string @@ -267,6 +270,9 @@ definitions: content: example: 퀴즈 시트 설명 type: string + created_at: + example: "2023-11-10T13:10:00+09:00" + type: string id: example: 100001 type: integer diff --git a/internal/models/quizpaper.go b/internal/models/quizpaper.go index c36224e..4368b6d 100644 --- a/internal/models/quizpaper.go +++ b/internal/models/quizpaper.go @@ -17,7 +17,7 @@ type QuizPaper struct { Tag datatypes.JSON `json:"tag" db:"tag" gorm:"column:tag;"` Status string `json:"status" example:"on" gorm:"column:status;size:10;index;"` UpdatedAt time.Time `json:"-" gorm:"column:updated_at;type:DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;index;->:false"` - CreatedAt time.Time `json:"-" gorm:"column:created_at;type:DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP;index;->:false;<-:create"` + CreatedAt time.Time `json:"created_at" db:"created_at" example:"2023-11-10T13:10:00+09:00" gorm:"column:created_at;type:DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP;index;"` } // 테이블이름 정의 @@ -35,14 +35,15 @@ type QuizPaperRequest struct { } type QuizPaperResponse struct { - ID int64 `json:"id" example:"100001"` - CenterID int64 `json:"center_id" example:"100001"` - ManagerID int64 `json:"manager_id" example:"100001"` - Title string `json:"title" example:"퀴즈 시트 제목"` - Content string `json:"content" example:"퀴즈 시트 설명"` - Category string `json:"category" example:"파이썬기본"` - Tag []string `json:"tag" example:"Python,AI,Robot,파이썬"` - Status string `json:"status" example:"on"` + ID int64 `json:"id" example:"100001"` + CenterID int64 `json:"center_id" example:"100001"` + ManagerID int64 `json:"manager_id" example:"100001"` + Title string `json:"title" example:"퀴즈 시트 제목"` + Content string `json:"content" example:"퀴즈 시트 설명"` + Category string `json:"category" example:"파이썬기본"` + Tag []string `json:"tag" example:"Python,AI,Robot,파이썬"` + Status string `json:"status" example:"on"` + CreatedAt time.Time `json:"created_at" example:"2023-11-10T13:10:00+09:00"` } type QuizPaperListResponse struct {