feat: complete Kra admin backend migration
This commit is contained in:
@@ -19,7 +19,7 @@ type announcementPO struct {
|
||||
Title string
|
||||
Content string `gorm:"type:text"`
|
||||
UserID *uint `gorm:"column:user_id"`
|
||||
Attachments []byte `gorm:"type:json"`
|
||||
Attachments jsonPO
|
||||
}
|
||||
|
||||
func (announcementPO) TableName() string { return "kra_announcements_info" }
|
||||
@@ -33,7 +33,7 @@ func newAnnouncement(item *biz.Announcement) announcementPO {
|
||||
if len(attachments) == 0 || !json.Valid(attachments) {
|
||||
attachments = []byte("[]")
|
||||
}
|
||||
return announcementPO{ID: item.ID, Title: item.Title, Content: item.Content, UserID: item.UserID, Attachments: attachments}
|
||||
return announcementPO{ID: item.ID, Title: item.Title, Content: item.Content, UserID: item.UserID, Attachments: jsonPO(attachments)}
|
||||
}
|
||||
|
||||
func announcementToBiz(item announcementPO) *biz.Announcement {
|
||||
|
||||
Reference in New Issue
Block a user