feat: 页面配置key改为枚举下拉框+自动填method
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user