feat(platform): improve admin data workflows

This commit is contained in:
2026-08-05 13:58:16 +08:00
parent 3b0188e9cf
commit 20e3071789
23 changed files with 666 additions and 296 deletions

View File

@@ -56,7 +56,6 @@ func registerGasRoute(group *gin.RouterGroup) {
basic.GET("/:identity", gas.GetGasBasic)
basic.PUT("/:identity", gas.UpdateGasBasic)
basic.PATCH("/:identity/status", gas.UpdateGasBasicStatus)
basic.POST("/:identity/review", gas.ReviewGasBasic)
basic.DELETE("/:identity", func(ctx *gin.Context) { common.ArchiveRecord(ctx, &models.GasBasic{}) })
registerWritableResource(group, "/gas_account", gas.ListGasAccount, gas.CreateGasAccount, gas.GetGasAccount, gas.UpdateGasAccount, &models.GasAccount{})
}

View File

@@ -63,16 +63,15 @@ func TestPlatformGasRouteUsesGasBasic(t *testing.T) {
t.Fatal("gas_basic list route is not registered")
}
func TestPlatformGasRouteExposesReview(t *testing.T) {
func TestPlatformGasRouteDoesNotExposeReview(t *testing.T) {
engine := gin.New()
RegisterPlatform("heqi", engine)
for _, route := range engine.Routes() {
if route.Method == http.MethodPost && route.Path == "/heqi/platform/v1/gas_basic/:identity/review" {
return
t.Fatal("gas_basic review route must not be registered")
}
}
t.Fatal("gas_basic review route is not registered")
}
func TestPlatformOrganizationAndAccountRoutesExposeResourceCRUD(t *testing.T) {