UPDATE: Project Module
All checks were successful
Build and Release / release (push) Successful in 1m15s
All checks were successful
Build and Release / release (push) Successful in 1m15s
This commit is contained in:
54
pkg/constants/project.go
Normal file
54
pkg/constants/project.go
Normal file
@@ -0,0 +1,54 @@
|
||||
package constants
|
||||
|
||||
type ProjectStatusType int16
|
||||
|
||||
|
||||
const (
|
||||
ProjectStatusTypePrivate ProjectStatusType = 1
|
||||
ProjectStatusTypePublic ProjectStatusType = 2
|
||||
ProjectStatusTypeArchive ProjectStatusType = 3
|
||||
ProjectStatusTypeUnknow ProjectStatusType = 0
|
||||
)
|
||||
|
||||
func (t ProjectStatusType) String() string {
|
||||
switch t {
|
||||
case ProjectStatusTypePrivate:
|
||||
return "PRIVATE"
|
||||
case ProjectStatusTypePublic:
|
||||
return "PUBLIC"
|
||||
case ProjectStatusTypeArchive:
|
||||
return "ARCHIVE"
|
||||
default:
|
||||
return "UNKNOWN"
|
||||
}
|
||||
}
|
||||
|
||||
func ParseProjectStatusTypeText(v string) ProjectStatusType {
|
||||
switch v {
|
||||
case "PRIVATE":
|
||||
return ProjectStatusTypePrivate
|
||||
case "PUBLIC":
|
||||
return ProjectStatusTypePublic
|
||||
case "ARCHIVE":
|
||||
return ProjectStatusTypeArchive
|
||||
default:
|
||||
return ProjectStatusTypeUnknow
|
||||
}
|
||||
}
|
||||
|
||||
func (t ProjectStatusType) Int16() int16 {
|
||||
return int16(t)
|
||||
}
|
||||
|
||||
func ParseProjectStatusType(v int16) ProjectStatusType {
|
||||
switch v {
|
||||
case 1:
|
||||
return ProjectStatusTypePrivate
|
||||
case 2:
|
||||
return ProjectStatusTypePublic
|
||||
case 3:
|
||||
return ProjectStatusTypeArchive
|
||||
default:
|
||||
return ProjectStatusTypeUnknow
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user