chore: 并入 iotlcm-admin-svr 历史到 admin-svr/(原提交 49818c6)

This commit is contained in:
MiFaZhan
2026-11-02 13:27:59 +08:00
1250 changed files with 154111 additions and 0 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)
}
}
}