营销文章:修正文章浏览量类型错误,新增时初始化浏览量

This commit is contained in:
puhui999 2023-10-18 11:27:14 +08:00
parent 6081ce30d5
commit ffbf9278b8
3 changed files with 5 additions and 1 deletions

View File

@ -16,6 +16,9 @@ public class ArticleRespVO extends ArticleBaseVO {
@Schema(description = "文章编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8606")
private Long id;
@Schema(description = "浏览量", requiredMode = Schema.RequiredMode.REQUIRED, example = "99999")
private Integer browseCount;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;

View File

@ -54,7 +54,7 @@ public class ArticleDO extends BaseDO {
/**
* 浏览次数
*/
private String browseCount;
private Integer browseCount;
/**
* 排序
*/

View File

@ -42,6 +42,7 @@ public class ArticleServiceImpl implements ArticleService {
// 插入
ArticleDO article = ArticleConvert.INSTANCE.convert(createReqVO);
article.setBrowseCount(0); // 初始浏览量
articleMapper.insert(article);
// 返回
return article.getId();