update 动态消息查询标识
This commit is contained in:
+5
-2
@@ -3,6 +3,7 @@ package com.jero.modules.laws.standard.controller;
|
||||
import java.util.*;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.Translation;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.util.MessageUtils;
|
||||
import com.jero.modules.laws.common.constant.ResultCommon;
|
||||
@@ -142,8 +143,10 @@ public class LawsNewsFeedController extends JeroController<LawsNewsFeed, ILawsNe
|
||||
@AutoLog(value = "动态消息-通过id查询")
|
||||
@ApiOperation(value = "动态消息-通过id查询", notes = "动态消息-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<LawsNewsFeed> queryById(@RequestParam(name = "id") String id) {
|
||||
LawsNewsFeed lawsNewsFeed = lawsNewsFeedService.queryById(id);
|
||||
@Translation
|
||||
public Result<LawsNewsFeed> queryById(@RequestParam(name = "id") String id,
|
||||
@RequestParam(name = "type") String type) {
|
||||
LawsNewsFeed lawsNewsFeed = lawsNewsFeedService.queryById(id, type);
|
||||
return Result.OK(lawsNewsFeed);
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -32,5 +32,6 @@
|
||||
<if test="param.dynamicHeading != null and param.dynamicHeading != ''">
|
||||
AND lnf.dynamic_heading LIKE CONCAT('%', #{param.dynamicHeading}, '%')
|
||||
</if>
|
||||
ORDER BY create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
+1
-1
@@ -62,5 +62,5 @@ public interface ILawsNewsFeedService extends IService<LawsNewsFeed> {
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
LawsNewsFeed queryById(String id);
|
||||
LawsNewsFeed queryById(String id, String type);
|
||||
}
|
||||
|
||||
+5
-2
@@ -208,13 +208,16 @@ public class LawsNewsFeedServiceImpl extends ServiceImpl<LawsNewsFeedMapper, Law
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public LawsNewsFeed queryById(String id) {
|
||||
public LawsNewsFeed queryById(String id, String type) {
|
||||
LawsNewsFeed lawsNewsFeed = getById(id);
|
||||
if (Objects.isNull(lawsNewsFeed)) {
|
||||
throw new JeroBootException(ResultCommon.NO_CORRESPONDING_DATA_FOUND);
|
||||
}
|
||||
// 阅读次数加1
|
||||
lawsNewsFeed.setReadCount(lawsNewsFeed.getReadCount() + 1);
|
||||
if ("query".equals(type)) {
|
||||
lawsNewsFeed.setReadCount(lawsNewsFeed.getReadCount() + 1);
|
||||
updateById(lawsNewsFeed);
|
||||
}
|
||||
return lawsNewsFeed;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user