init: hgmj server initial commit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 16:50:13 +08:00
co-authored by Claude Opus 4.7
commit 625e89c15d
1870 changed files with 254090 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package sysconfdata
import (
"testing"
"91jd-server/models/v/sysconfmod"
)
func TestTotalWatchCount(t *testing.T) {
tests := []struct {
name string
config sysconfmod.ConfMap
want uint64
}{
{name: "configured", config: sysconfmod.ConfMap{string(sysconfmod.VCodeTotalWatchCount): "5"}, want: 5},
{name: "zero is allowed", config: sysconfmod.ConfMap{string(sysconfmod.VCodeTotalWatchCount): "0"}, want: 0},
{name: "missing", config: sysconfmod.ConfMap{}, want: DefaultTotalWatchCount},
{name: "invalid", config: sysconfmod.ConfMap{string(sysconfmod.VCodeTotalWatchCount): "invalid"}, want: DefaultTotalWatchCount},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := totalWatchCount(tt.config); got != tt.want {
t.Fatalf("totalWatchCount() = %d, want %d", got, tt.want)
}
})
}
}