cslms-api/internal/models/quizpaper.go

68 lines
3.1 KiB
Go
Raw Normal View History

2023-12-27 17:31:49 +09:00
package models
import (
"time"
"gorm.io/datatypes"
)
type QuizPaper struct {
ID int64 `json:"id" db:"id" example:"100001" gorm:"column:id;primary_key;"`
GUID string `json:"guid_id" db:"guid_id" example:"ef74c59a-c707-4162-a52b-455906c81ec1" gorm:"column:guid_id;size:255;index;"`
CenterID int64 `json:"center_id" db:"center_id" example:"100001" gorm:"column:center_id;index;"`
ManagerID int64 `json:"manager_id" db:"manager_id" example:"100001" gorm:"column:manager_id;index;"`
Title string `json:"title" db:"title" example:"퀴즈 시트 제목" gorm:"column:title;size:255;index;"`
Content string `json:"content" db:"content" example:"퀴즈 시트 설명" gorm:"column:content;size:512;"`
Category string `json:"category" db:"category" example:"파이썬기본" gorm:"column:category;size:255;"`
2023-12-27 17:31:49 +09:00
Tag datatypes.JSON `json:"tag" db:"tag" gorm:"column:tag;"`
2024-02-22 21:11:18 +09:00
QuizCount int `json:"quiz_count" db:"quiz_count" example:"5" gorm:"column:quiz_count;"`
2023-12-27 17:31:49 +09:00
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"`
2024-01-07 18:47:50 +09:00
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;"`
2023-12-27 17:31:49 +09:00
}
// 테이블이름 정의
func (QuizPaper) TableName() string {
return "QuizPapers"
}
type QuizPaperRequest struct {
2023-12-29 00:27:12 +09:00
CenterID int64 `json:"center_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"`
2023-12-27 17:31:49 +09:00
}
type QuizPaperResponse struct {
2024-01-07 18:47:50 +09:00
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,파이썬"`
2024-02-22 21:11:18 +09:00
QuizCount int `json:"quiz_count" example:"5"`
2024-01-07 18:47:50 +09:00
Status string `json:"status" example:"on"`
CreatedAt time.Time `json:"created_at" example:"2023-11-10T13:10:00+09:00"`
2023-12-27 17:31:49 +09:00
}
type QuizPaperListResponse struct {
Data []QuizPaper `json:"data"`
Total int64 `json:"total" example:"999"`
Page int `json:"page" example:"1"`
TotalPage int64 `json:"totalPage" example:"99"`
PageSize int `json:"pageSize" example:"10"`
}
type QuizPaperCopyRequest struct {
Title string `json:"title" example:"퀴즈 시트 제목"`
CenterID int64 `json:"center_id" example:"100002"`
}
type QuizPaperCopyResponse struct {
QuizPaper QuizPaper `json:"quiz_paper"`
Quiz []Quiz `json:"quiz"`
}