Files
urldb/db/entity/ready_resource.go

33 lines
1.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package entity
import (
"time"
"gorm.io/gorm"
)
// ReadyResource 待处理资源模型
type ReadyResource struct {
ID uint `json:"id" gorm:"primaryKey;autoIncrement"`
Title *string `json:"title" gorm:"size:255;comment:资源标题"`
Description string `json:"description" gorm:"type:text;comment:资源描述"`
URL string `json:"url" gorm:"size:500;not null;comment:资源链接"`
Category string `json:"category" gorm:"size:100;comment:资源分类"`
Tags string `json:"tags" gorm:"size:500;comment:资源标签,多个标签用逗号分隔"`
Img string `json:"img" gorm:"size:500;comment:封面链接"`
Source string `json:"source" gorm:"size:100;comment:数据来源"`
Extra string `json:"extra" gorm:"type:text;comment:额外附加数据"`
Key string `json:"key" gorm:"size:64;index;comment:资源组标识相同key表示同一组资源"`
ErrorMsg string `json:"error_msg" gorm:"type:text;comment:处理失败时的错误信息"`
CreateTime time.Time `json:"create_time" gorm:"default:CURRENT_TIMESTAMP"`
IP *string `json:"ip" gorm:"size:45;comment:IP地址"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index"`
}
// TableName 指定表名
func (ReadyResource) TableName() string {
return "ready_resource"
}