MSP-623 split entity
This commit is contained in:
1 parent
4b5412e21b
commit
0934f8136f
6 files changed
+62
-67
No files matched your search
@@ -0,0 +1,7 @@
|
||||
package entity
|
||||
|
||||
type AccessList struct {
|
||||
AppId int
|
||||
Method string
|
||||
Value bool
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Application struct {
|
||||
Id int
|
||||
Name string
|
||||
Description *string
|
||||
ServiceId int
|
||||
Type string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Domain struct {
|
||||
Id int
|
||||
Name string
|
||||
Description *string
|
||||
SystemId int
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package entity
|
||||
|
||||
import "time"
|
||||
|
||||
const (
|
||||
RootAdminApplicationId = 1
|
||||
)
|
||||
|
||||
const (
|
||||
AppTypeSystem = "SYSTEM"
|
||||
AppTypeMobile = "MOBILE"
|
||||
)
|
||||
|
||||
type System struct {
|
||||
tableName string `pg:"system_service.system" json:"-"` //nolint
|
||||
Id int32
|
||||
Name string `valid:"required~Required"`
|
||||
Description string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type Domain struct {
|
||||
tableName string `pg:"system_service.domain" json:"-"` //nolint
|
||||
Name string `valid:"required~Required"`
|
||||
Id int32
|
||||
SystemId int32
|
||||
Description string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
tableName string `pg:"system_service.service" json:"-"` //nolint
|
||||
Id int32
|
||||
DomainId int32 `valid:"required~Required"`
|
||||
Name string `valid:"required~Required"`
|
||||
Description string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type Application struct {
|
||||
tableName string `pg:"system_service.application" json:"-"` //nolint
|
||||
Name string `valid:"required~Required"`
|
||||
Description string
|
||||
Type string `valid:"required~Required,in(SYSTEM|MOBILE)"`
|
||||
ServiceId int32 `valid:"required~Required"`
|
||||
Id int32
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type Token struct {
|
||||
tableName string `pg:"system_service.token" json:"-"` //nolint
|
||||
Token string `valid:"required~Required" pg:"pk:token"`
|
||||
AppId int32 `valid:"required~Required"`
|
||||
ExpireTime int64
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type AccessList struct {
|
||||
tableName string `pg:"system_service.access_list" json:"-"` //nolint
|
||||
Method string `pg:",pk"`
|
||||
AppId int32 `pg:",pk"`
|
||||
Value bool
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
Id int
|
||||
Name string
|
||||
Description *string
|
||||
DomainId int
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Token struct {
|
||||
Token string
|
||||
AppId int
|
||||
ExpireTime int
|
||||
CreatedAt time.Time
|
||||
}
|
||||
Reference in new issue
Block a user