From 7d4f3cdb571a3100e942a856936885d0f485ff7d Mon Sep 17 00:00:00 2001 From: wangliwen Date: Fri, 12 Aug 2022 17:18:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BD=AE=E9=A1=B6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/db/V4.7__resource_add_col.sql | 7 +++++++ .../resource/controller/ResourceController.java | 14 ++++++++++++-- .../renren/modules/resource/dto/ResourceDTO.java | 6 ++++++ .../modules/resource/entity/ResourceEntity.java | 11 +++++++++++ .../src/main/resources/application-dev.yml | 4 ++-- .../main/resources/mapper/resource/ResourceDao.xml | 4 ++++ 6 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 config/db/V4.7__resource_add_col.sql diff --git a/config/db/V4.7__resource_add_col.sql b/config/db/V4.7__resource_add_col.sql new file mode 100644 index 00000000..e3297f0a --- /dev/null +++ b/config/db/V4.7__resource_add_col.sql @@ -0,0 +1,7 @@ +ALTER TABLE `tb_data_resource` +ADD COLUMN `pin_top` int NULL COMMENT '是否置顶' , +ADD COLUMN `pin_top_time` datetime NULL COMMENT '置顶操作时间'; + +UPDATE tb_data_resource +SET pin_top = 0, +pin_top_time = NOW(); \ No newline at end of file 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 58d8bf5b..1aac21a3 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 @@ -153,6 +153,16 @@ public class ResourceController { return new Result<>().ok(resourceService.pageWithAttrs(jsonObject, resourceService.selectDTOPageSpecilTotal(resourceDTO))); } + @PutMapping("/pin_top/{id}") + @LogOperation(value = "置顶该能力资源") + public Result pinTop(@PathVariable("id") Long id) { + ResourceDTO data = resourceService.get(id); + data.setPinTop(1); + data.setPinTopTime(new Date()); + resourceService.update(data); + return new Result<>().ok(id); + } + @GetMapping("/{id}") @ApiOperation("查询能力资源详细信息") @LogOperation("查询能力资源详细信息") @@ -253,7 +263,7 @@ public class ResourceController { if (!"f".equals(source) && dto.getId() != null) {//后台挂架直接上架 try { apiGatewayService.registerApi2Gateway(dto.getId().toString()); - }catch (Exception exception){ + } catch (Exception exception) { //注册失败忽略,简单记录一下 logger.error("挂接网关注册失败", exception); } @@ -268,7 +278,7 @@ public class ResourceController { try { apiGatewayService.resetApiGroup(source); apiGatewayService.registerApi2Gateway(source); - }catch (Exception exception){ + } catch (Exception exception) { //注册失败忽略,简单记录一下 logger.error("挂接网关注册失败", exception); return new Result().error(exception.getMessage()); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java b/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java index 803a6d42..550984b0 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dto/ResourceDTO.java @@ -116,6 +116,12 @@ public class ResourceDTO extends AuditingBaseDTO implements Serializable { @ApiModelProperty(value = "申请单号") private String applyNumber; + @ApiModelProperty(value = "置顶标识") + private Integer pinTop; + + @ApiModelProperty(value = "置顶时间") + private Date pinTopTime; + public String getDelFlagTip() { if (this.delFlag != null) { Optional resourceEntityDelFlagOptional = Optional.ofNullable(ResourceEntityDelFlag.getByFlag(this.delFlag)); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntity.java b/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntity.java index 546dbdfa..37ffb736 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/entity/ResourceEntity.java @@ -140,6 +140,17 @@ public class ResourceEntity extends BaseEntity { */ private String undercarriageEnclosure; + + /** + * 置顶标识 + */ + private Integer pinTop; + + /** + * 置顶时间 + */ + private Date pinTopTime; + @TableField(value = "info_list", typeHandler = FastjsonTypeHandler.class) private List infoList; diff --git a/renren-admin/src/main/resources/application-dev.yml b/renren-admin/src/main/resources/application-dev.yml index 30e09a8f..8ee2457d 100644 --- a/renren-admin/src/main/resources/application-dev.yml +++ b/renren-admin/src/main/resources/application-dev.yml @@ -6,9 +6,9 @@ spring: #MySQL driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.124.236:3306/share_platform?useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false + url: jdbc:mysql://192.168.124.243:3306/share_platform?useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false username: root - password: Hisense2019 + password: Liwen073898! #Hisense2019 # #Oracle # driver-class-name: oracle.jdbc.OracleDriver diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 8159225e..45c9dd29 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -37,6 +37,8 @@ + + @@ -81,6 +83,8 @@ typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> + +