笔记详情接口
This commit is contained in:
parent
31be301f09
commit
b1184323cb
@ -1,5 +1,6 @@
|
||||
package com.dd.admin.business.api;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.dd.admin.business.card.domain.CardDto;
|
||||
import com.dd.admin.business.card.domain.CardVo;
|
||||
@ -18,6 +19,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class ApiController {
|
||||
@Autowired
|
||||
@ -32,5 +36,20 @@ public class ApiController {
|
||||
return ResultBean.success(pageInfo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "获取单个笔记")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@GetMapping("/api/getNote")
|
||||
@OperLog(operModule = "获取单个笔记",operType = OperType.QUERY,operDesc = "获取单个笔记")
|
||||
public ResultBean<NoteVo> getNoteById(NoteDto noteDto) {
|
||||
Note note = noteService.getById(noteDto.getNoteId());
|
||||
NoteVo noteVo = BeanUtil.copyProperties(note, NoteVo.class);
|
||||
noteVo.setCreateTimeStr(noteVo.getCreateTime());
|
||||
List<String> imageList = new ArrayList<>();
|
||||
imageList.add(noteVo.getFirstPicture());
|
||||
imageList.add(noteVo.getAuthorAvatar());
|
||||
|
||||
noteVo.setImgList(imageList);
|
||||
return ResultBean.success(noteVo);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
@ -87,5 +88,7 @@ public class NoteVo {
|
||||
@ApiModelProperty(value = "收藏数")
|
||||
private Long starCount;
|
||||
|
||||
@ApiModelProperty(value = "图片集合")
|
||||
private List<String> imgList;
|
||||
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ spring:
|
||||
|
||||
datasource:
|
||||
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
|
||||
url: jdbc:p6spy:mysql://127.0.0.1:3306/memberShop?useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
|
||||
url: jdbc:p6spy:mysql://127.0.0.1:3306/ddxhs?useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: wxlwxl12
|
||||
|
||||
@ -35,6 +35,7 @@ jwt:
|
||||
- "/favicon.ico"
|
||||
# 需要过滤的请求,不限方法
|
||||
pattern:
|
||||
- "/api/**"
|
||||
- "/upload/**"
|
||||
- "/doc.html"
|
||||
- "/swagger-resources/**"
|
||||
@ -51,4 +52,4 @@ mybatis-plus:
|
||||
#================================================= mybatis-plus end ===================================================
|
||||
|
||||
server:
|
||||
port: 8888
|
||||
port: 8080
|
||||
|
Loading…
x
Reference in New Issue
Block a user