增加置顶接口

This commit is contained in:
wangliwen 2022-08-12 17:18:20 +08:00
parent 6e7c224109
commit 7d4f3cdb57
6 changed files with 42 additions and 4 deletions

View File

@ -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();

View File

@ -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("查询能力资源详细信息")

View File

@ -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<ResourceEntityDelFlag> resourceEntityDelFlagOptional = Optional.ofNullable(ResourceEntityDelFlag.getByFlag(this.delFlag));

View File

@ -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<AttrEntity> infoList;

View File

@ -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

View File

@ -37,6 +37,8 @@
<result property="infoList" column="info_list"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
<result property="applyNumber" column="apply_number"/>
<result property="pinTop" column="pin_top"/>
<result property="pinTopTime" column="pin_top_time"/>
</resultMap>
<resultMap id="resourceDTO" type="io.renren.modules.resource.dto.ResourceDTO">
@ -81,6 +83,8 @@
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
<result property="total" column="total"/>
<result property="applyNumber" column="apply_number"/>
<result property="pinTop" column="pin_top"/>
<result property="pinTopTime" column="pin_top_time"/>
</resultMap>
<update id="deleteByIds">