Browse Source

2.0.0 修改轮播图接口

feature/v.2.0.0
peihao 3 years ago
parent
commit
3151ab9434
  1. 7
      air/src/main/java/com/air/cityarea/controller/ReportController.java
  2. 4
      air/src/main/java/com/air/cityarea/controller/RotateImageController.java
  3. 3
      air/src/main/java/com/air/cityarea/entity/Report.java

7
air/src/main/java/com/air/cityarea/controller/ReportController.java

@ -51,7 +51,7 @@ public class ReportController {
if (CollectionUtil.isNotEmpty(reportPage.getRecords())){
reportPage.getRecords().stream().forEach(e -> {
e.setFilePath(fileUtil.getUrlByInnerPath(e.getFilePath()));
e.setReportType(ReportTypeEnum.getName(e.getReportType()));
e.setReportTypeName(ReportTypeEnum.getName(e.getReportType()));
e.setStatusName(ReportStatusEnum.getName(e.getStatusCd()));
});
}
@ -71,7 +71,8 @@ public class ReportController {
if(report == null ){
return R.failed("id正确");
}
report.setReportType(ReportTypeEnum.getName(report.getReportType()));
report.setFilePath(fileUtil.getUrlByInnerPath(report.getFilePath()));
report.setReportTypeName(ReportTypeEnum.getName(report.getReportType()));
return R.ok(report);
}
@ -97,7 +98,7 @@ public class ReportController {
if (report.getId() == null){
return R.failed("id不能为空");
}
fileUtil.getInnerPath(report.getFilePath());
report.setFilePath(fileUtil.getInnerPath(report.getFilePath()));
return R.ok(reportService.updateById(report));
}

4
air/src/main/java/com/air/cityarea/controller/RotateImageController.java

@ -87,7 +87,9 @@ public class RotateImageController {
@ApiOperation(value = "通过id查询", notes = "通过id查询")
@GetMapping("/{id}")
public R getById(@PathVariable("id") Long id) {
return R.ok(rotateImageService.getById(id));
RotateImage rotateImage = rotateImageService.getById(id);
rotateImage.setImagePath(fileUtil.getUrlByInnerPath(rotateImage.getImagePath()));
return R.ok(rotateImage);
}
/**

3
air/src/main/java/com/air/cityarea/entity/Report.java

@ -56,4 +56,7 @@ public class Report extends Model<Report> {
@TableField(exist = false)
@ApiModelProperty(value="状态名称(1000:保存(下架),1100:发布(推荐)")
private String statusName;
@TableField(exist = false)
@ApiModelProperty(value="报告类型名称")
private String reportTypeName;
}

Loading…
Cancel
Save