refactor platform menus and entity statuses

This commit is contained in:
david
2026-07-29 13:18:52 +08:00
parent 978dc446d9
commit afd9dbdeb5
48 changed files with 510 additions and 421 deletions

View File

@@ -208,11 +208,7 @@ func registerPlatformRoute(group *gin.RouterGroup) {
role.PUT("/:identity/menu", platformlogic.ReplacePlatformRoleMenus)
menu := group.Group("/platform_menu")
menu.GET("", platformlogic.ListPlatformMenu)
menu.POST("", platformlogic.CreatePlatformMenu)
menu.GET("/:identity", platformlogic.GetPlatformMenu)
menu.PUT("/:identity", platformlogic.UpdatePlatformMenu)
menu.PATCH("/:identity/status", platformlogic.UpdatePlatformMenuStatus)
menu.DELETE("/:identity", platformlogic.ArchivePlatformMenu)
}
func registerFinanceRoute(group *gin.RouterGroup) {

View File

@@ -87,13 +87,16 @@ func TestPlatformOrganizationAndAccountRoutesExposeResourceCRUD(t *testing.T) {
"/user_service_relation",
"/platform_account",
"/platform_role",
"/platform_menu",
} {
assertRouteMethods(t, routes, "/heqi/platform/v1"+resource, http.MethodGet, http.MethodPost)
assertRouteMethods(t, routes, "/heqi/platform/v1"+resource+"/:identity", http.MethodGet, http.MethodPut, http.MethodDelete)
assertRouteMethods(t, routes, "/heqi/platform/v1"+resource+"/:identity/status", http.MethodPatch)
}
assertRouteMethods(t, routes, "/heqi/platform/v1/platform_menu", http.MethodGet)
assertRouteMethods(t, routes, "/heqi/platform/v1/platform_menu/:identity", http.MethodGet)
assertNoRouteMethods(t, routes, "/heqi/platform/v1/platform_menu", http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete)
assertNoRouteMethods(t, routes, "/heqi/platform/v1/platform_menu/:identity", http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete)
assertRouteMethods(t, routes, "/heqi/platform/v1/platform_role/:identity/menu", http.MethodGet, http.MethodPut)
assertNoRouteMethods(t, routes, "/heqi/platform/v1/platform_role/:identity/menus", http.MethodGet, http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete)
assertNoRouteMethods(t, routes, "/heqi/platform/v1/platfrom_account", http.MethodGet, http.MethodPost, http.MethodPut, http.MethodPatch, http.MethodDelete)