Rebuild SCUM plugin data ownership
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
package dto
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"browser.local/platform/domain"
|
||||
)
|
||||
import "browser.local/platform/domain"
|
||||
|
||||
type SCUMPlayerLiveStateListResponse struct {
|
||||
Items []domain.SCUMPlayerLiveState `json:"items"`
|
||||
@@ -36,25 +32,6 @@ type SCUMCurrentPositionListResponse struct {
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
type SCUMDataRowResponse struct {
|
||||
ID string `json:"id"`
|
||||
ServerInstanceID string `json:"serverInstanceId"`
|
||||
TargetTable string `json:"targetTable"`
|
||||
UpsertKey string `json:"upsertKey"`
|
||||
Fields map[string]any `json:"fields"`
|
||||
Payload map[string]any `json:"payload"`
|
||||
PluginID string `json:"pluginId"`
|
||||
QueryKey string `json:"queryKey"`
|
||||
Freshness domain.SCUMProjectionFreshnessState `json:"freshness"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
type SCUMDataRowListResponse struct {
|
||||
Items []SCUMDataRowResponse `json:"items"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
func SCUMPlayerLiveStatesFromDomain(values []domain.SCUMPlayerLiveState) SCUMPlayerLiveStateListResponse {
|
||||
out := make([]domain.SCUMPlayerLiveState, len(values))
|
||||
for index, value := range values {
|
||||
@@ -102,12 +79,3 @@ func SCUMCurrentPositionsFromDomain(values []domain.SCUMCurrentPosition) SCUMCur
|
||||
}
|
||||
return SCUMCurrentPositionListResponse{Items: out, Count: len(out)}
|
||||
}
|
||||
|
||||
func SCUMDataRowsFromDomain(values []domain.SCUMDataRow) SCUMDataRowListResponse {
|
||||
items := make([]SCUMDataRowResponse, len(values))
|
||||
for index, value := range values {
|
||||
value = domain.CopySCUMDataRow(value)
|
||||
items[index] = SCUMDataRowResponse{ID: value.ID, ServerInstanceID: value.ServerInstanceID, TargetTable: string(value.TargetTable), UpsertKey: value.UpsertKey, Fields: value.Fields, Payload: value.Payload, PluginID: value.PluginID, QueryKey: value.QueryKey, Freshness: value.Freshness, CreatedAt: value.CreatedAt, UpdatedAt: value.UpdatedAt}
|
||||
}
|
||||
return SCUMDataRowListResponse{Items: items, Count: len(items)}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user