提交 e2b12ea8 作者: 刘明祎-运维用途

添加字段

上级 84e57226
...@@ -44,4 +44,7 @@ public class IndustryNewsVO implements Serializable { ...@@ -44,4 +44,7 @@ public class IndustryNewsVO implements Serializable {
@ApiModelProperty(value = "来源",example = "来源") @ApiModelProperty(value = "来源",example = "来源")
private String origin; private String origin;
@ApiModelProperty(value = "是否是热点新闻 1是 0不是")
private Integer isHot;
} }
...@@ -2,6 +2,7 @@ package com.mmc.csf.release.entity.information; ...@@ -2,6 +2,7 @@ package com.mmc.csf.release.entity.information;
import com.mmc.csf.infomation.vo.IndustryNewsDTO; import com.mmc.csf.infomation.vo.IndustryNewsDTO;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -32,13 +33,13 @@ public class IndustryNewsDO implements Serializable { ...@@ -32,13 +33,13 @@ public class IndustryNewsDO implements Serializable {
@ApiModelProperty(value = "来源") @ApiModelProperty(value = "来源")
private String origin; private String origin;
private Integer isDeleted; private Integer isDeleted;
private Integer isHot;
public IndustryNewsDTO buildIndustryNewsDTO(){ public IndustryNewsDTO buildIndustryNewsDTO(){
return IndustryNewsDTO.builder().id(id).newsTitle(newsTitle).newsAuthor(newsAuthor).userAccountId(userAccountId).surfaceImg(surfaceImg). return IndustryNewsDTO.builder().id(id).newsTitle(newsTitle).newsAuthor(newsAuthor).userAccountId(userAccountId).surfaceImg(surfaceImg).
newsContents(newsContents).createTime(createTime).updateTime(updateTime).origin(origin).build(); newsContents(newsContents).createTime(createTime).updateTime(updateTime).origin(origin).build();
} }
public IndustryNewsDO(Integer id, String newsTitle, String newsAuthor, Integer userAccountId, String surfaceImg, String newsContents, String origin) { public IndustryNewsDO(Integer id, String newsTitle, String newsAuthor, Integer userAccountId, String surfaceImg, String newsContents, String origin, Integer isHot) {
this.id = id; this.id = id;
this.newsTitle = newsTitle; this.newsTitle = newsTitle;
this.newsAuthor = newsAuthor; this.newsAuthor = newsAuthor;
...@@ -46,5 +47,6 @@ public class IndustryNewsDO implements Serializable { ...@@ -46,5 +47,6 @@ public class IndustryNewsDO implements Serializable {
this.surfaceImg = surfaceImg; this.surfaceImg = surfaceImg;
this.newsContents = newsContents; this.newsContents = newsContents;
this.origin = origin; this.origin = origin;
this.isHot = isHot;
} }
} }
...@@ -70,14 +70,14 @@ public class IndustryNewsServiceImpl implements IndustryNewsService { ...@@ -70,14 +70,14 @@ public class IndustryNewsServiceImpl implements IndustryNewsService {
if(count>0){ if(count>0){
return ResultBody.error(ResultEnum.INDUSTRY_NEWS_TITLE_EXISTS); return ResultBody.error(ResultEnum.INDUSTRY_NEWS_TITLE_EXISTS);
} }
industryNewsDO = new IndustryNewsDO(param.getId(), param.getNewsTitle(), param.getNewsAuthor(), userAccountId, param.getSurfaceImg(), param.getNewsContents(), param.getOrigin()); industryNewsDO = new IndustryNewsDO(param.getId(), param.getNewsTitle(), param.getNewsAuthor(), userAccountId, param.getSurfaceImg(), param.getNewsContents(), param.getOrigin(),param.getIsHot());
industryNewsDao.insert(industryNewsDO); industryNewsDao.insert(industryNewsDO);
return ResultBody.success(); return ResultBody.success();
} }
@Override @Override
public ResultBody upDateIndustryNews(IndustryNewsVO param, Integer userAccountId) { public ResultBody upDateIndustryNews(IndustryNewsVO param, Integer userAccountId) {
IndustryNewsDO industryNewsDO = new IndustryNewsDO(param.getId(), param.getNewsTitle(), param.getNewsAuthor(), userAccountId, param.getSurfaceImg(), param.getNewsContents(), param.getOrigin()); IndustryNewsDO industryNewsDO = new IndustryNewsDO(param.getId(), param.getNewsTitle(), param.getNewsAuthor(), userAccountId, param.getSurfaceImg(), param.getNewsContents(), param.getOrigin(),param.getIsHot());
industryNewsDao.update(industryNewsDO); industryNewsDao.update(industryNewsDO);
return ResultBody.success(); return ResultBody.success();
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<if test="keyword != null "> <if test="keyword != null ">
and news_title like CONCAT("%",#{keyword},"%") and news_title like CONCAT("%",#{keyword},"%")
</if> </if>
order by create_time desc order by is_hot desc,create_time desc
limit #{pageNo}, #{pageSize} limit #{pageNo}, #{pageSize}
</select> </select>
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
and create_time &lt;= #{endTime} and create_time &lt;= #{endTime}
</if> </if>
</where> </where>
order by create_time desc order by is_hot desc,create_time desc
limit #{pageNo}, #{pageSize} limit #{pageNo}, #{pageSize}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论