feat: 完整游戏运维功能

This commit is contained in:
npc0-hue
2026-07-18 09:04:01 +08:00
parent f3b14b7945
commit 48b8ad8d6c
187 changed files with 16607 additions and 1140 deletions
+7 -1
View File
@@ -9,7 +9,10 @@ import (
"browser.local/platform/domain"
)
const MaxArtifactChunkBytes = 1024 * 1024
const (
MaxArtifactChunkBytes = 1024 * 1024
MaxArtifactBytes = int64(512 * 1024 * 1024)
)
func ValidateArtifactTransferOpen(open domain.ArtifactTransferOpen) error {
var violations []string
@@ -31,6 +34,9 @@ func ValidateArtifactTransferOpen(open domain.ArtifactTransferOpen) error {
if open.SizeBytes <= 0 {
violations = append(violations, "sizeBytes must be positive")
}
if open.SizeBytes > MaxArtifactBytes {
violations = append(violations, fmt.Sprintf("sizeBytes must not exceed %d", MaxArtifactBytes))
}
if open.ChunkSizeBytes <= 0 {
violations = append(violations, "chunkSizeBytes must be positive")
}