|
|
|
@@ -16,12 +16,16 @@ const ( |
|
|
|
) |
|
|
|
|
|
|
|
type Dataset struct { |
|
|
|
ID int64 `xorm:"pk autoincr"` |
|
|
|
Title string `xorm:"INDEX NOT NULL"` |
|
|
|
Status int32 `xorm:"INDEX"` // normal_private: 0, pulbic: 1, is_delete: 2 |
|
|
|
ID int64 `xorm:"pk autoincr"` |
|
|
|
Title string `xorm:"INDEX NOT NULL"` |
|
|
|
Status int32 `xorm:"INDEX"` // normal_private: 0, pulbic: 1, is_delete: 2 |
|
|
|
Scope string //领域 |
|
|
|
Topics []string `xorm:"TEXT JSON"` //分类,实现方式类似项目的主题 |
|
|
|
Category string |
|
|
|
Description string `xorm:"TEXT"` |
|
|
|
DownloadTimes int64 |
|
|
|
BrowserTimes int64 |
|
|
|
Stars int64 |
|
|
|
License string |
|
|
|
Task string |
|
|
|
ReleaseID int64 `xorm:"INDEX"` |
|
|
|
@@ -30,9 +34,32 @@ type Dataset struct { |
|
|
|
Repo *Repository `xorm:"-"` |
|
|
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` |
|
|
|
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` |
|
|
|
User *User `xorm:"-"` |
|
|
|
Attachments []*Attachment `xorm:"-"` |
|
|
|
} |
|
|
|
|
|
|
|
type DatasetRepoInfo struct { |
|
|
|
ID int64 `xorm:"pk autoincr"` |
|
|
|
DataSetID int64 `xorm:"INDEX"` |
|
|
|
RepoID int64 `xorm:"INDEX"` |
|
|
|
UserID int64 `xorm:"INDEX"` |
|
|
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` |
|
|
|
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` |
|
|
|
} |
|
|
|
|
|
|
|
type DatasetStar struct { |
|
|
|
ID int64 `xorm:"pk autoincr"` |
|
|
|
UID int64 `xorm:"UNIQUE(s)"` |
|
|
|
DatasetID int64 `xorm:"UNIQUE(s)"` |
|
|
|
CreatedUnix timeutil.TimeStamp `xorm:"created"` |
|
|
|
} |
|
|
|
|
|
|
|
User *User `xorm:"-"` |
|
|
|
Attachments []*Attachment `xorm:"-"` |
|
|
|
type DatasetTopic struct { |
|
|
|
ID int64 |
|
|
|
Name string `xorm:"UNIQUE VARCHAR(105)"` |
|
|
|
DatasetCount int |
|
|
|
CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` |
|
|
|
UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` |
|
|
|
} |
|
|
|
|
|
|
|
func (d *Dataset) IsPrivate() bool { |
|
|
|
|