43 lines
2.2 KiB
Go
43 lines
2.2 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
type Center struct {
|
|
ID int64 `json:"id" db:"id" example:"100001" gorm:"column:id;primary_key;"`
|
|
GUID string `json:"guid_id" db:"guid_id" example:"2036023a-fb56-4b6c-b3bb-c787c681ada6" gorm:"column:guid_id;size:255;index;"`
|
|
Title string `json:"center_title" db:"center_title" example:"강동런스팀로봇코딩학원" gorm:"column:center_title;size:50;index;"`
|
|
Name string `json:"center_name" db:"center_name" example:"learnsteam_kd" gorm:"column:center_name;size:50;index;"`
|
|
OwnerID int64 `json:"owner_id" db:"owner_id" example:"100001" gorm:"column:owner_id;index;"`
|
|
Content string `json:"content_page" db:"content_page" example:"학원상세페이지, html/마크다운/text" gorm:"column:content_page;size:2048;"`
|
|
Info string `json:"company_info" db:"company_info" example:"사업자정보-json 기타 정보 추가 가능" gorm:"column:company_info;size:2048;"`
|
|
Memo string `json:"memo" db:"memo" example:"메모" gorm:"column:memo;size:1024;"`
|
|
Status string `json:"status" db:"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"`
|
|
}
|
|
|
|
// 테이블이름 정의
|
|
func (Center) TableName() string {
|
|
return "Centers"
|
|
}
|
|
|
|
type CenterRequest struct {
|
|
Title string `json:"center_title" example:"강동런스팀로봇코딩학원"`
|
|
Name string `json:"center_name" example:"learnsteam_kd"`
|
|
OwnerID int64 `json:"owner_id" example:"100001"`
|
|
Content string `json:"content_page" example:"학원상세페이지, html/마크다운/text"`
|
|
Info string `json:"company_info" example:"사업자정보-json 기타 정보 추가 가능"`
|
|
Memo string `json:"memo" example:"메모"`
|
|
Status string `json:"status" example:"on"`
|
|
}
|
|
|
|
type CenterListResponse struct {
|
|
Data []Center `json:"data"`
|
|
Total int64 `json:"total" example:"5"`
|
|
Page int `json:"page" example:"1"`
|
|
TotalPage int64 `json:"totalPage" example:"1"`
|
|
PageSize int `json:"pageSize" example:"10"`
|
|
}
|