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;