feat:完善项目

This commit is contained in:
henry
2021-11-11 17:10:43 +08:00
parent 3b09ec1efc
commit 27e61ed093
8 changed files with 396 additions and 3 deletions

View File

@ -3,12 +3,36 @@ package model
// WorkRepair 工单维修数据模型
type WorkRepair struct {
Model
WorkID uint64 `gorm:"column:work_id;type:int(11);default:0;comment:工单ID" json:"-"`
Status int `json:"status"`
OrderNo string `gorm:"column:order_no;type:varchar(30);default:null;comment:维修单号" json:"order_no"`
WorkID uint64 `gorm:"column:work_id;type:int(11);default:0;comment:工单ID" json:"-"`
Status WorkRepairStatus `gorm:"column:status;type:tinyint(1);default:0;comment:维修工单状态" json:"status"`
IsEvaluate WorkRepairStatusEvaluate `gorm:"column:is_evaluate;type:tinyint(1);default:0;comment:评价状态" json:"is_evaluate"`
EvaluateScore int `gorm:"column:evaluate_score;type:decimal(10,2);default:0;comment:评价分数" json:"evaluate_score"`
ModelDeleted
ModelAt
}
// WorkRepairStatus 工单状态
type WorkRepairStatus int
const (
// WorkRepairStatusForNotBegin 未开始
WorkRepairStatusForNotBegin WorkRepairStatus = iota
// WorkRepairStatusForOngoing 进行中
WorkRepairStatusForOngoing
// WorkRepairStatusForFinished 已结束
WorkRepairStatusForFinished
)
type WorkRepairStatusEvaluate int
const (
// WorkRepairStatusEvaluateForNot 未评价
WorkRepairStatusEvaluateForNot WorkRepairStatusEvaluate = iota
// WorkRepairStatusEvaluateForYes 已评价
WorkRepairStatusEvaluateForYes
)
func (m *WorkRepair) TableName() string {
return "work_repair"
}

View File

@ -0,0 +1,34 @@
package model
// WorkRepairDetail 维修工单详细数据模型
type WorkRepairDetail struct {
Model
UID uint64 `gorm:"column:uid;type:int;default:0;comment:用户uuid" json:"-"`
RepairID uint64 `gorm:"column:repair_id;type:int(11);default:0;comment:维修工单ID" json:"-"`
Tage WorkRepairDetailTags `gorm:"column:tage;type:varchar(255);default:null;comment:标签" json:"tage"`
Remark string `gorm:"column:remark;type:varchar(255);default:null;comment:备注信息" json:"remark"`
Other string `gorm:"column:other;type:varchar(255);default:null;comment:其他信息" json:"other"`
ModelDeleted
ModelAt
}
type (
WorkRepairDetailForFinish struct {
Image string `json:"image"`
}
)
type WorkRepairDetailTags string
const (
WorkRepairDetailTagsForBegin WorkRepairDetailTags = "开始维修"
WorkRepairDetailTagsForFinish WorkRepairDetailTags = "完成维修"
)
func (m *WorkRepairDetail) TableName() string {
return "work_repair_detail"
}
func NewWorkRepairDetail() *WorkRepairDetail {
return &WorkRepairDetail{}
}