提交 825e7ef7 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 6d1434ec
......@@ -9,4 +9,9 @@ public class FgBulletinForm {
private String name;
@ApiModelProperty(value="栏目id")
private Integer id;
@ApiModelProperty(value="数量",required = true)
private Integer num;
@ApiModelProperty(value="栏目名称")
private String bulletinColumnName;
}
......@@ -75,6 +75,12 @@ public class FgBulletinController {
return CallBack.success(service.page(form,pageParam));
}
@ApiOperation(value = "查询内容分页列表", notes = "根据栏目名查询公告")
@GetMapping(value = "/bulletin-content/list")
public CallBack<List<FgBulletinContentVo>> getList(FgBulletinForm form) {
return CallBack.success(service.getList(form));
}
@ApiOperation(value = "热门资讯", notes = "热门资讯")
@GetMapping(value = "/hot/list")
public CallBack<List<FgBulletinContentVo>> hotBulletinContentList() {
......
......@@ -32,6 +32,7 @@ public interface FgBulletinContentMapper extends BaseMapper<BulletinContent> {
+ "left join sys_bulletin_Column m on t.columnId = m.id "
+ " where 1 = 1 and t.status = 1 and DATE(t.releaserTime) &lt;= DATE(NOW()) "
+ " eq(t.columnId,form.id)"
+ " eq(m.name,form.bulletinColumnName)"
+ " like(t.name,form.name) "
+ " order by t.topStatus desc, t.releaserTime desc, t.id desc "
......
......@@ -31,4 +31,11 @@ public interface FgBulletinContentService extends
* @return
*/
List<FgBulletinContentVo> hotBulletinContentList();
/**
* 查询公告列表
* @param form
* @return
*/
List<FgBulletinContentVo> getList(FgBulletinForm form);
}
......@@ -12,6 +12,7 @@ import org.jsoup.select.Elements;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.github.pagehelper.PageHelper;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.core.util.page.PageInfo;
......@@ -117,5 +118,24 @@ public class FgFgBulletinContentServiceImpl extends
}
return null;
}
@Override
public List<FgBulletinContentVo> getList(FgBulletinForm form) {
PageHelper.startPage(1, form.getNum());
List<FgBulletinContentVo> list = mapper.page(form);
list.forEach(f -> {
Date date = f.getReleaserTime();
SimpleDateFormat monthFormat = new SimpleDateFormat("M");
f.setMonth(monthFormat.format(date));
SimpleDateFormat dayFormat = new SimpleDateFormat("dd");
f.setDay(dayFormat.format(date));
String content = f.getContent();
String img = getFirstImgOfText(content);
f.setCover(img);
content = removeLabel(f.getContent());
f.setContent(content);
});
return list;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论