|
|
@ -1,5 +1,6 @@
|
|
|
|
package com.controller;
|
|
|
|
package com.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.text.ParseException;
|
|
|
@ -11,6 +12,7 @@ import java.util.HashMap;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
|
@ -24,13 +26,13 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
|
import com.baomidou.mybatisplus.mapper.EntityWrapper;
|
|
|
|
import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
|
|
import com.baomidou.mybatisplus.mapper.Wrapper;
|
|
|
|
import com.annotation.IgnoreAuth;
|
|
|
|
import com.annotation.IgnoreAuth;
|
|
|
|
|
|
|
|
|
|
|
|
import com.entity.NewsEntity;
|
|
|
|
import com.entity.NewsEntity;
|
|
|
|
import com.entity.view.NewsView;
|
|
|
|
import com.entity.view.NewsView;
|
|
|
|
|
|
|
|
|
|
|
|
import com.service.NewsService;
|
|
|
|
import com.service.NewsService;
|
|
|
|
import com.service.TokenService;
|
|
|
|
import com.service.TokenService;
|
|
|
|
import com.utils.PageUtils;
|
|
|
|
import com.utils.PageUtils;
|
|
|
@ -50,181 +52,218 @@ import com.utils.CommonUtil;
|
|
|
|
@RequestMapping("/news")
|
|
|
|
@RequestMapping("/news")
|
|
|
|
public class NewsController {
|
|
|
|
public class NewsController {
|
|
|
|
@Autowired
|
|
|
|
@Autowired
|
|
|
|
private NewsService newsService;
|
|
|
|
private NewsService newsService;//注入新闻服务类
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 后端列表
|
|
|
|
* 后端列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping("/page")
|
|
|
|
@RequestMapping("/page")
|
|
|
|
public R page(@RequestParam Map<String, Object> params,NewsEntity news,
|
|
|
|
public R page(@RequestParam Map<String, Object> params, NewsEntity news, HttpServletRequest request) {
|
|
|
|
HttpServletRequest request){
|
|
|
|
// 创建一个EntityWrapper对象,用于构建查询条件
|
|
|
|
|
|
|
|
|
|
|
|
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
|
|
|
|
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
|
|
|
|
|
|
|
|
|
|
|
|
PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
|
|
|
|
// 使用MPUtil工具类对查询条件进行排序和分页处理
|
|
|
|
request.setAttribute("data", page);
|
|
|
|
PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 将分页结果设置到request对象中
|
|
|
|
|
|
|
|
request.setAttribute("data", page);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 返回成功响应,包含分页结果
|
|
|
|
return R.ok().put("data", page);
|
|
|
|
return R.ok().put("data", page);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 前端列表
|
|
|
|
* 前端列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@IgnoreAuth
|
|
|
|
@IgnoreAuth
|
|
|
|
@RequestMapping("/list")
|
|
|
|
@RequestMapping("/list")
|
|
|
|
public R list(@RequestParam Map<String, Object> params,NewsEntity news,
|
|
|
|
public R list(@RequestParam Map<String, Object> params, NewsEntity news, HttpServletRequest request) {
|
|
|
|
HttpServletRequest request){
|
|
|
|
// 创建一个EntityWrapper对象,用于构建查询条件
|
|
|
|
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
|
|
|
|
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
|
|
|
|
|
|
|
|
|
|
|
|
PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
|
|
|
|
// 使用MPUtil工具类对查询条件进行排序和分页处理
|
|
|
|
request.setAttribute("data", page);
|
|
|
|
PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 将分页结果设置到request对象中
|
|
|
|
|
|
|
|
request.setAttribute("data", page);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 返回成功响应,包含分页结果
|
|
|
|
return R.ok().put("data", page);
|
|
|
|
return R.ok().put("data", page);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 列表
|
|
|
|
* 列表
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping("/lists")
|
|
|
|
@RequestMapping("/lists")
|
|
|
|
public R list( NewsEntity news){
|
|
|
|
//一个Spring MVC的注解,用于将HTTP请求映射到 list 方法。当客户端发送一个HTTP请求到 /lists 路径时,Spring MVC会调用 list 方法来处理这个请求
|
|
|
|
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
|
|
|
|
public R list(NewsEntity news) //NewsEntity news 参数表示要查询的 NewsEntity 对象
|
|
|
|
ew.allEq(MPUtil.allEQMapPre( news, "news"));
|
|
|
|
{
|
|
|
|
|
|
|
|
// 创建一个EntityWrapper对象,用于构建查询条件
|
|
|
|
|
|
|
|
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 使用MPUtil工具类对查询条件进行排序和分页处理
|
|
|
|
|
|
|
|
ew.allEq(MPUtil.allEQMapPre(news, "news"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 返回成功响应,包含查询结果
|
|
|
|
return R.ok().put("data", newsService.selectListView(ew));
|
|
|
|
return R.ok().put("data", newsService.selectListView(ew));
|
|
|
|
|
|
|
|
//这行代码返回一个表示请求成功的响应对象,并将 newsService.selectListView(ew) 的结果添加到响应对象中,键为 "data"。
|
|
|
|
|
|
|
|
//newsService.selectListView(ew) 方法用于查询满足 ew 对象的查询条件的记录,并返回一个包含查询结果的列表。
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 查询
|
|
|
|
* 查询
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping("/query")
|
|
|
|
@RequestMapping("/query")
|
|
|
|
public R query(NewsEntity news){
|
|
|
|
public R query(NewsEntity news) {
|
|
|
|
EntityWrapper< NewsEntity> ew = new EntityWrapper< NewsEntity>();
|
|
|
|
// 创建一个EntityWrapper对象,用于构建查询条件
|
|
|
|
ew.allEq(MPUtil.allEQMapPre( news, "news"));
|
|
|
|
EntityWrapper<NewsEntity> ew = new EntityWrapper<NewsEntity>();
|
|
|
|
NewsView newsView = newsService.selectView(ew);
|
|
|
|
|
|
|
|
return R.ok("查询公告信息成功").put("data", newsView);
|
|
|
|
// 使用MPUtil工具类对查询条件进行排序和分页处理
|
|
|
|
|
|
|
|
ew.allEq(MPUtil.allEQMapPre(news, "news"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 调用 newsService 对象的 selectView 方法,查询满足 ew 对象的查询条件的记录,并返回一个 NewsView 对象
|
|
|
|
|
|
|
|
NewsView newsView = newsService.selectView(ew);
|
|
|
|
|
|
|
|
return R.ok("查询公告信息成功").put("data", newsView);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 后端详情
|
|
|
|
* 后端详情
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
//一个Spring MVC的注解,用于将HTTP请求映射到 info 方法。
|
|
|
|
|
|
|
|
//当客户端发送一个HTTP请求到 /info/{id} 路径时,Spring MVC会调用 info 方法来处理这个请求
|
|
|
|
@RequestMapping("/info/{id}")
|
|
|
|
@RequestMapping("/info/{id}")
|
|
|
|
public R info(@PathVariable("id") Long id){
|
|
|
|
public R info(@PathVariable("id") Long id) {
|
|
|
|
|
|
|
|
// 根据ID查询并返回结果
|
|
|
|
NewsEntity news = newsService.selectById(id);
|
|
|
|
NewsEntity news = newsService.selectById(id);
|
|
|
|
return R.ok().put("data", news);
|
|
|
|
//调用 newsService 对象的 selectById 方法,根据 id 参数的值查询数据库中的记录,并返回一个 NewsEntity 对象。
|
|
|
|
|
|
|
|
return R.ok().put("data", news); //将 news 对象添加到响应对象中,键为 "data"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 前端详情
|
|
|
|
* 前端详情
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@IgnoreAuth
|
|
|
|
@IgnoreAuth
|
|
|
|
@RequestMapping("/detail/{id}")
|
|
|
|
@RequestMapping("/detail/{id}")
|
|
|
|
public R detail(@PathVariable("id") Long id){
|
|
|
|
public R detail(@PathVariable("id") Long id) {
|
|
|
|
|
|
|
|
// 根据ID查询并返回结果
|
|
|
|
NewsEntity news = newsService.selectById(id);
|
|
|
|
NewsEntity news = newsService.selectById(id);
|
|
|
|
return R.ok().put("data", news);
|
|
|
|
return R.ok().put("data", news);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 后端保存
|
|
|
|
* 后端保存
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping("/save")
|
|
|
|
@RequestMapping("/save")
|
|
|
|
public R save(@RequestBody NewsEntity news, HttpServletRequest request){
|
|
|
|
public R save(@RequestBody NewsEntity news, HttpServletRequest request) {
|
|
|
|
news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
|
|
|
// 设置ID为当前时间戳加上一个随机数
|
|
|
|
//ValidatorUtils.validateEntity(news);
|
|
|
|
news.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 验证实体对象,如果需要验证,可以取消注释
|
|
|
|
|
|
|
|
// ValidatorUtils.validateEntity(news);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 插入数据,将 news 对象插入到数据库中
|
|
|
|
newsService.insert(news);
|
|
|
|
newsService.insert(news);
|
|
|
|
|
|
|
|
//返回一个表示请求成功的响应对象
|
|
|
|
return R.ok();
|
|
|
|
return R.ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 前端保存
|
|
|
|
* 前端保存
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping("/add")
|
|
|
|
@RequestMapping("/add")
|
|
|
|
public R add(@RequestBody NewsEntity news, HttpServletRequest request){
|
|
|
|
public R add(@RequestBody NewsEntity news, HttpServletRequest request) {
|
|
|
|
news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
|
|
|
|
// 设置ID为当前时间戳加上一个随机数
|
|
|
|
//ValidatorUtils.validateEntity(news);
|
|
|
|
news.setId(new Date().getTime() + new Double(Math.floor(Math.random() * 1000)).longValue());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 验证实体对象,如果需要验证,可以取消注释
|
|
|
|
|
|
|
|
// ValidatorUtils.validateEntity(news);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 插入数据
|
|
|
|
newsService.insert(news);
|
|
|
|
newsService.insert(news);
|
|
|
|
return R.ok();
|
|
|
|
return R.ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 修改
|
|
|
|
* 修改
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping("/update")
|
|
|
|
@RequestMapping("/update")
|
|
|
|
@Transactional
|
|
|
|
@Transactional
|
|
|
|
public R update(@RequestBody NewsEntity news, HttpServletRequest request){
|
|
|
|
public R update(@RequestBody NewsEntity news, HttpServletRequest request) {
|
|
|
|
//ValidatorUtils.validateEntity(news);
|
|
|
|
// 验证实体对象,如果需要验证,可以取消注释
|
|
|
|
newsService.updateById(news);//全部更新
|
|
|
|
// ValidatorUtils.validateEntity(news);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新数据
|
|
|
|
|
|
|
|
newsService.updateById(news);
|
|
|
|
return R.ok();
|
|
|
|
return R.ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 删除
|
|
|
|
* 删除
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping("/delete")
|
|
|
|
@RequestMapping("/delete")//这是一个Spring MVC的注解,用于将HTTP请求映射到 delete方法上
|
|
|
|
public R delete(@RequestBody Long[] ids){
|
|
|
|
public R delete(@RequestBody Long[] ids) {
|
|
|
|
|
|
|
|
// 批量删除数据
|
|
|
|
newsService.deleteBatchIds(Arrays.asList(ids));
|
|
|
|
newsService.deleteBatchIds(Arrays.asList(ids));
|
|
|
|
return R.ok();
|
|
|
|
return R.ok();//R.ok() 方法通常表示请求成功,并返回一个默认的成功响应。
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 提醒接口
|
|
|
|
* 提醒接口
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@RequestMapping("/remind/{columnName}/{type}")
|
|
|
|
@RequestMapping("/remind/{columnName}/{type}")
|
|
|
|
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
|
|
|
|
//这是一个Spring MVC的注解,用于将HTTP请求映射到 remindCount 方法。当客户端发送一个HTTP请求到 /remind/{columnName}/{type} 路径时,Spring MVC会调用 remindCount 方法来处理这个请求。
|
|
|
|
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
|
|
|
|
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
|
|
|
|
map.put("column", columnName);
|
|
|
|
@PathVariable("type") String type, @RequestParam Map<String, Object> map) {
|
|
|
|
map.put("type", type);
|
|
|
|
// 将列名和类型添加到map中,@PathVariable 注解表示 columnName 和 type 参数的值将从URL路径中获取
|
|
|
|
|
|
|
|
map.put("column", columnName);//将 columnName 参数的值添加到 map 中,键为 "column"。
|
|
|
|
if(type.equals("2")) {
|
|
|
|
map.put("type", type);
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
|
|
Calendar c = Calendar.getInstance();
|
|
|
|
if (type.equals("2")) //如果 type 参数的值为 "2"
|
|
|
|
Date remindStartDate = null;
|
|
|
|
{
|
|
|
|
Date remindEndDate = null;
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
if(map.get("remindstart")!=null) {
|
|
|
|
//创建一个 SimpleDateFormat 对象sdf,用于将日期格式化为 "yyyy-MM-dd" 格式。
|
|
|
|
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
|
|
|
|
Calendar c = Calendar.getInstance();
|
|
|
|
c.setTime(new Date());
|
|
|
|
//创建一个 Calendar 对象,用于处理日期和时间。Calendar.getInstance() 方法返回一个表示当前日期和时间的 Calendar 对象。
|
|
|
|
c.add(Calendar.DAY_OF_MONTH,remindStart);
|
|
|
|
Date remindStartDate = null;//声明一个变量 remindStartDate,初始化为 null,这个变量将用于存储提醒开始日期。
|
|
|
|
remindStartDate = c.getTime();
|
|
|
|
Date remindEndDate = null;
|
|
|
|
map.put("remindstart", sdf.format(remindStartDate));
|
|
|
|
|
|
|
|
}
|
|
|
|
if (map.get("remindstart") != null)//如果 map 中存在键为 "remindstart" 的元素
|
|
|
|
if(map.get("remindend")!=null) {
|
|
|
|
{
|
|
|
|
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
|
|
|
|
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
|
|
|
|
c.setTime(new Date());
|
|
|
|
//将 map 中键为 "remindstart" 的元素的值转换为 Integer 类型,并赋值给 remindStart
|
|
|
|
c.add(Calendar.DAY_OF_MONTH,remindEnd);
|
|
|
|
c.setTime(new Date());//setTime(new Date()) 方法将 Calendar 对象c的时间设置为当前时间。
|
|
|
|
remindEndDate = c.getTime();
|
|
|
|
c.add(Calendar.DAY_OF_MONTH, remindStart);//将 Calendar 对象的时间增加 remindStart 天。
|
|
|
|
map.put("remindend", sdf.format(remindEndDate));
|
|
|
|
remindStartDate = c.getTime();//返回一个表示 Calendar 对象当前时间的 Date 对象,并将其赋值给 remindStartDate。
|
|
|
|
}
|
|
|
|
map.put("remindstart", sdf.format(remindStartDate));//将 remindStartDate 格式化为 "yyyy-MM-dd" 格式,并将其作为 map 中键为 "remindstart" 的元素的值。
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Wrapper<NewsEntity> wrapper = new EntityWrapper<NewsEntity>();
|
|
|
|
if (map.get("remindend") != null)
|
|
|
|
if(map.get("remindstart")!=null) {
|
|
|
|
{
|
|
|
|
wrapper.ge(columnName, map.get("remindstart"));
|
|
|
|
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
|
|
|
|
}
|
|
|
|
c.setTime(new Date());//c 的时间设置为当前时间
|
|
|
|
if(map.get("remindend")!=null) {
|
|
|
|
c.add(Calendar.DAY_OF_MONTH, remindEnd);//c 的时间增加 remindStart 天
|
|
|
|
wrapper.le(columnName, map.get("remindend"));
|
|
|
|
remindEndDate = c.getTime();
|
|
|
|
}
|
|
|
|
map.put("remindend", sdf.format(remindEndDate));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
int count = newsService.selectCount(wrapper);
|
|
|
|
|
|
|
|
return R.ok().put("count", count);
|
|
|
|
// 创建一个EntityWrapper对象,用于构建查询条件
|
|
|
|
}
|
|
|
|
Wrapper<NewsEntity> wrapper = new EntityWrapper<NewsEntity>();
|
|
|
|
|
|
|
|
//创建一个EntityWrapper对象,用于构建查询条件
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (map.get("remindstart") != null)//如果map中存在键为"remindstart"的元素
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
wrapper.ge(columnName, map.get("remindstart"));
|
|
|
|
|
|
|
|
//将 wrapper 对象的查询条件设置为 columnName>=map 中键为 "remindend" 的元素的值
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (map.get("remindend") != null) {
|
|
|
|
|
|
|
|
wrapper.le(columnName, map.get("remindend"));
|
|
|
|
}
|
|
|
|
//将 wrapper 对象的查询条件设置为 columnName<=map 中键为 "remindend" 的元素的值
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询并返回结果
|
|
|
|
|
|
|
|
int count = newsService.selectCount(wrapper);
|
|
|
|
|
|
|
|
//查询满足wrapper对象的查询条件的记录数,并赋值给 count 变量
|
|
|
|
|
|
|
|
return R.ok().put("count", count);//返回一个包含 count 变量的 R 对象(请求成功的响应对象)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|