优化页面、修复BUG
This commit is contained in:
@@ -12,6 +12,7 @@ type Snippet struct {
|
||||
Title string `json:"title" gorm:"column:title"`
|
||||
Code string `json:"code" gorm:"column:code;type:text"`
|
||||
Type string `json:"type" gorm:"column:type"`
|
||||
CodeTypeID uint `json:"codeTypeId" gorm:"column:code_type_id"`
|
||||
Description string `json:"description" gorm:"column:description;type:text"`
|
||||
ViewCount uint `json:"viewCount" gorm:"column:view_count;default:0"`
|
||||
CreatedAt int64 `json:"createdAt" gorm:"column:created_at"`
|
||||
@@ -47,8 +48,12 @@ func (s *Snippet) BeforeUpdate(tx *gorm.DB) error {
|
||||
|
||||
// SnippetResponse 代码片段响应模型
|
||||
type SnippetResponse struct {
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Code string `json:"code"`
|
||||
Type string `json:"type"`
|
||||
ID string `json:"id"`
|
||||
Title string `json:"title"`
|
||||
Code string `json:"code"`
|
||||
Type string `json:"type"`
|
||||
CodeTypeID uint `json:"codeTypeId,omitempty"`
|
||||
CodeType *CodeTypeResponse `json:"codeType,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
ViewCount uint `json:"viewCount,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user