feat: 页面配置key改为枚举下拉框+自动填method

This commit is contained in:
mediabot-pt
2026-07-06 01:00:30 +08:00
parent ca02476c3c
commit 18b045b4ba
3 changed files with 69 additions and 3 deletions

View File

@@ -91,6 +91,15 @@ public class SitePagesController {
return ApiResponse.success(Map.of("siteId", siteId, "version", version, "content", content));
}
/** 获取页面入口 key 枚举列表 */
@GetMapping("/api/v1/admin/page-keys")
public ApiResponse<List<Map<String, String>>> pageKeys() {
var list = java.util.Arrays.stream(com.par.core.enums.PageKey.values())
.map(pk -> Map.of("key", pk.getKey(), "label", pk.getLabel(), "defaultMethod", pk.getDefaultMethod()))
.toList();
return ApiResponse.success(list);
}
@GetMapping("/api/v1/admin/default-pages/{type}")
public ApiResponse<Map<String, Object>> getDefaultPages(@PathVariable String type, HttpServletRequest request) {
checkAdmin(request);