Implement api
This commit is contained in:
1 parent
80a99c425b
commit
b2e34c00a4
30 files changed
+708
-69
No files matched your search
@@ -0,0 +1,5 @@
|
||||
package domain
|
||||
|
||||
const (
|
||||
ErrorCodeBadRequest = 400
|
||||
)
|
||||
@@ -0,0 +1,26 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"github.com/txix-open/isp-kit/json"
|
||||
)
|
||||
|
||||
type ConfigIdRequest struct {
|
||||
Id string `validate:"required"`
|
||||
}
|
||||
|
||||
type GetByModuleIdRequest struct {
|
||||
ModuleId string `validate:"required"`
|
||||
}
|
||||
|
||||
type GetByModuleNameRequest struct {
|
||||
ModuleName string `validate:"required"`
|
||||
}
|
||||
|
||||
type CreateUpdateConfigRequest struct {
|
||||
Id string
|
||||
Name string `validate:"required"`
|
||||
ModuleId string `validate:"required"`
|
||||
Version int
|
||||
Data json.RawMessage
|
||||
Unsafe bool
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/txix-open/isp-kit/cluster"
|
||||
"github.com/txix-open/isp-kit/json"
|
||||
"github.com/txix-open/isp-kit/rc/schema"
|
||||
)
|
||||
|
||||
type DeleteResponse struct {
|
||||
Deleted int
|
||||
}
|
||||
|
||||
type ModuleInfo struct {
|
||||
Id string
|
||||
Name string
|
||||
Active bool
|
||||
LastConnectedAt *time.Time
|
||||
LastDisconnectedAt *time.Time
|
||||
ConfigSchema json.RawMessage
|
||||
Status []Connection
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type Connection struct {
|
||||
LibVersion string
|
||||
Version string
|
||||
Address cluster.AddressConfiguration
|
||||
Endpoints []cluster.EndpointDescriptor
|
||||
EstablishedAt time.Time
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Id string
|
||||
Name string
|
||||
ModuleId string
|
||||
Valid bool
|
||||
Data json.RawMessage
|
||||
Version int
|
||||
Active bool
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type ConfigVersion struct {
|
||||
Id string
|
||||
ConfigId string
|
||||
ConfigVersion int32
|
||||
Data json.RawMessage
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type ConfigSchema struct {
|
||||
Id string
|
||||
Version string
|
||||
ModuleId string
|
||||
Schema schema.Schema
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
Reference in new issue
Block a user