mirror of
https://shylinux.com/x/operation
synced 2025-07-01 13:14:43 +08:00
130 lines
3.5 KiB
Go
130 lines
3.5 KiB
Go
package model
|
|
|
|
import "shylinux.com/x/mysql-story/src/db"
|
|
|
|
const (
|
|
CREATED_AT = "created_at"
|
|
UID = "uid"
|
|
NAME = "name"
|
|
INFO = "info"
|
|
TYPE = "type"
|
|
LEVEL = "level"
|
|
STATUS = "status"
|
|
COUNT = "count"
|
|
PRICE = "price"
|
|
LINK = "link"
|
|
TITLE = "title"
|
|
CONTENT = "content"
|
|
VERSION = "version"
|
|
USER_UID = "user_uid"
|
|
USER_ROLE = "user_role"
|
|
USER_NAME = "user_name"
|
|
USER_AVATAR = "user_avatar"
|
|
USER_STORY_ROLE = "user_story_role"
|
|
STORY_UID = "story_uid"
|
|
STORY_NAME = "story_name"
|
|
STORY_TYPE = "story_type"
|
|
PLAN_UID = "plan_uid"
|
|
PLAN_STATUS = "plan_status"
|
|
DESIGN_STATUS = "design_status"
|
|
DESIGN_COUNT = "design_count"
|
|
ISSUE_COUNT = "issue_count"
|
|
TASK_COUNT = "task_count"
|
|
CASE_COUNT = "case_count"
|
|
ISSUE_UID = "issue_uid"
|
|
ISSUE_TYPE = "issue_type"
|
|
ISSUE_STATUS = "issue_status"
|
|
TASK_UID = "task_uid"
|
|
TASK_STATUS = "task_status"
|
|
CASE_STATUS = "case_status"
|
|
MEET_TYPE = "meet_type"
|
|
FROM_USER_UID = "from_user_uid"
|
|
TO_USER_UID = "to_user_uid"
|
|
MARKET_UID = "market_uid"
|
|
BEGIN_TIME = "begin_time"
|
|
END_TIME = "end_time"
|
|
)
|
|
|
|
type UserStory struct {
|
|
db.ModelUserPlace
|
|
StoryUID string `gorm:"type:char(32);index"`
|
|
}
|
|
type Story struct {
|
|
db.ModelPlace
|
|
CompanyUID string `gorm:"type:char(32);index"`
|
|
}
|
|
type Plan struct {
|
|
db.ModelContent
|
|
StoryUID string `gorm:"type:char(32);index"`
|
|
Version string `gorm:"type:varchar(16)"`
|
|
Status uint8 `gorm:"default:0"`
|
|
IssueCount int `gorm:"default:0"`
|
|
BeginTime db.Time
|
|
EndTime db.Time
|
|
ProcessTime db.Time
|
|
FinishTime db.Time
|
|
}
|
|
type Issue struct {
|
|
Common
|
|
DesignCount int `gorm:"default:0"`
|
|
TaskCount int `gorm:"default:0"`
|
|
RejectTime db.Time
|
|
ApproveTime db.Time
|
|
}
|
|
type Design struct {
|
|
Common
|
|
IssueUID string `gorm:"type:char(32);index"`
|
|
RejectTime db.Time
|
|
ApproveTime db.Time
|
|
}
|
|
type Task struct {
|
|
Common
|
|
IssueUID string `gorm:"type:char(32);index"`
|
|
CaseCount int `gorm:"default:0"`
|
|
}
|
|
type Case struct {
|
|
Common
|
|
TaskUID string `gorm:"type:char(32);index"`
|
|
}
|
|
type Meet struct {
|
|
db.ModelContent
|
|
CompanyUID string `gorm:"type:char(32);index"`
|
|
StoryUID string `gorm:"type:char(32);index"`
|
|
PlanUID string `gorm:"type:char(32);index"`
|
|
IssueUID string `gorm:"type:char(32);index"`
|
|
Link string `gorm:"type:varchar(255)"`
|
|
Type uint8 `gorm:"default:0"`
|
|
BeginTime db.Time
|
|
EndTime db.Time
|
|
}
|
|
type Deal struct {
|
|
db.ModelContent
|
|
CompanyUID string `gorm:"type:char(32);index"`
|
|
StoryUID string `gorm:"type:char(32);index"`
|
|
PlanUID string `gorm:"type:char(32);index"`
|
|
IssueUID string `gorm:"type:char(32);index"`
|
|
FromUserUID string `gorm:"type:char(32);index"`
|
|
ToUserUID string `gorm:"type:char(32);index"`
|
|
Price int `gorm:"default:0"`
|
|
}
|
|
|
|
func init() {
|
|
db.CmdModels("", &UserStory{}, &Story{}, &Plan{}, &Issue{}, &Design{}, &Task{}, &Case{}, &Meet{}, &Deal{})
|
|
}
|
|
|
|
type Common struct {
|
|
db.ModelContent
|
|
StoryUID string `gorm:"type:char(32);index:idx_story"`
|
|
PlanUID string `gorm:"type:char(32);index:idx_story"`
|
|
Type uint8 `gorm:"default:0"`
|
|
Level uint8 `gorm:"default:2"`
|
|
Status uint8 `gorm:"default:0"`
|
|
Price int `gorm:"default:0"`
|
|
Score int `gorm:"default:0"`
|
|
Link string `gorm:"type:varchar(255)"`
|
|
BeginTime db.Time
|
|
EndTime db.Time
|
|
ProcessTime db.Time
|
|
FinishTime db.Time
|
|
}
|