package task import "github.com/gogf/gf/v2/util/gconv" var ( StatusPending = newStatus(gconv.PtrInt8(1), "排队中") // 排队中 StatusRunning = newStatus(gconv.PtrInt8(2), "执行中") // 执行中 StatusSuccess = newStatus(gconv.PtrInt8(3), "成功") // 成功 StatusFailed = newStatus(gconv.PtrInt8(4), "失败") // 失败 StatusDownloaded = newStatus(gconv.PtrInt8(5), "已下载") // 已下载 ) type Status *int8 type status struct { code Status desc string } func (s status) Code() Status { return s.code } func (s status) Desc() string { return s.desc } func newStatus(code Status, desc string) status { return status{code: code, desc: desc} }