sync: 同步 v1.0.4 并脱敏配置与镜像

This commit is contained in:
MiFaZhan
2026-10-29 14:36:49 +08:00
parent 743e8e6e6e
commit 2206a393f7
516 changed files with 18119 additions and 2253 deletions
@@ -0,0 +1,28 @@
package router
import (
"testing"
"github.com/gogf/gf/v2/util/gmeta"
v1 "git.5iot.com/iotlcm-public/iotlcm-admin-svr/api/iot/v1"
)
func TestFullSyncMonitorPermissionDeclarations(t *testing.T) {
// A slice of pairs rather than a map: request structs may contain slice
// fields (for example the channel scope), which are not hashable.
checks := []struct {
request any
want string
}{
{v1.FullSyncRunsListReq{}, "cpm:iot:fullSyncRuns:view"},
{v1.FullSyncRunDetailReq{}, "cpm:iot:fullSyncRuns:view"},
{v1.FullSyncRunFailuresReq{}, "cpm:iot:fullSyncRuns:failures"},
{v1.FullSyncRunStartReq{}, "cpm:iot:fullSyncRuns:start"},
{v1.FullSyncChannelOptionsReq{}, "cpm:iot:fullSyncRuns:view"},
}
for _, check := range checks {
if got := gmeta.Get(check.request, "x-check-permission").String(); got != check.want {
t.Fatalf("%T permission = %q, want %q", check.request, got, check.want)
}
}
}