refactor platform menus and entity statuses
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user