|
@@ -2,11 +2,14 @@ package com.ym.mec.cms.controller;
|
|
|
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
+
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
|
|
import java.util.Date;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
@@ -17,9 +20,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.ym.mec.cms.controller.queryinfo.NewsInformationQueryInfo;
|
|
|
+import com.ym.mec.cms.dal.dao.SysNewsInformationDao;
|
|
|
import com.ym.mec.cms.dal.entity.SysNewsInformation;
|
|
|
import com.ym.mec.cms.service.SysNewsInformationService;
|
|
|
import com.ym.mec.common.controller.BaseController;
|
|
|
+import com.ym.mec.util.collection.MapUtil;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("news")
|
|
@@ -30,6 +35,9 @@ public class NewsController extends BaseController {
|
|
|
private SysNewsInformationService sysNewsInformationService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private SysNewsInformationDao sysNewsInformationDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
|
|
|
@ApiOperation("资讯列表分页查询")
|
|
@@ -38,6 +46,13 @@ public class NewsController extends BaseController {
|
|
|
if(queryInfo.getTenantId() == null){
|
|
|
queryInfo.setTenantId(1);
|
|
|
}
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<String, Object>();
|
|
|
+ MapUtil.populateMap(params, queryInfo);
|
|
|
+ int count = sysNewsInformationDao.queryCount(params);
|
|
|
+ if(count == 0){
|
|
|
+ queryInfo.setMemo(null);
|
|
|
+ }
|
|
|
return succeed(sysNewsInformationService.queryPage(queryInfo));
|
|
|
}
|
|
|
|