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"/> + +