From 89de07eac0255cfba953dc0fcba0521011e111e4 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 18 Nov 2022 11:12:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BF=E5=8A=A1=E4=BA=91=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E8=B5=84=E6=BA=90=20=E6=9C=AC=E5=9C=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/controller/ResourceController.java | 17 +++++++++++++++++ .../db/V7.4__create_policy_cloud_service.sql | 14 ++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index fc628c0f..6415e8b0 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -912,4 +912,21 @@ public class ResourceController { } } + @PostMapping("/getPolicyCloudService") + @ApiOperation("/获取政务云服务资源") + @LogOperation("/获取政务云服务资源") + public Result>> getPolicyCloudService(@RequestParam Map params) { + int page = 1; + int pageSize = 10; + if (params.containsKey("limit") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("limit").toString())) { + pageSize = Integer.parseInt(params.get("limit").toString()); + } + if (params.containsKey("page") && org.apache.commons.lang3.StringUtils.isNotBlank(params.get("page").toString())) { + page = Integer.parseInt(params.get("page").toString()); + } + String sql = String.format("SELECT * FROM policy_cloud_service LIMIT %d,%d", page * pageSize, pageSize); + List> result = jdbcTemplate.queryForList(sql); + return new Result>>().ok(new PageData<>(result, jdbcTemplate.queryForObject("SELECT COUNT(*) FROM policy_cloud_service", Long.class))); + } + } \ No newline at end of file diff --git a/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql b/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql new file mode 100644 index 00000000..6b8148ba --- /dev/null +++ b/renren-admin/src/main/resources/db/V7.4__create_policy_cloud_service.sql @@ -0,0 +1,14 @@ +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; +DROP TABLE IF EXISTS `policy_cloud_service`; +CREATE TABLE `policy_cloud_service` ( + `service_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `service_item_tier1` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `service_item_tier2` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `service_description` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `specification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `remark` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, + `year` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL + PRIMARY KEY (`service_type`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; +SET FOREIGN_KEY_CHECKS = 1;