Commit 38135eb8 authored by 刘基明's avatar 刘基明

service规范fix

parent 2de37d0e
...@@ -38,14 +38,14 @@ public class ThemeController { ...@@ -38,14 +38,14 @@ public class ThemeController {
} }
@ApiOperation("系统推荐主题列表") @ApiOperation("系统推荐主题列表")
@RequestMapping(value = "/add") @RequestMapping(value = "/recmend_list")
@ResponseBody @ResponseBody
public List<ThemeEntity> selectHotList(){ public List<ThemeEntity> selectHotList(){
return null; return null;
} }
@ApiOperation("用户关注主题列表") @ApiOperation("用户关注主题列表")
@RequestMapping(value = "/add") @RequestMapping(value = "/interest_list")
@ResponseBody @ResponseBody
public List<ThemeEntity> selectInterestList(){ public List<ThemeEntity> selectInterestList(){
String userId="liujm012"; String userId="liujm012";
......
package com.tanpu.community.controller; package com.tanpu.community.controller;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import com.tanpu.community.api.beans.TopicDTO; import com.tanpu.community.api.beans.TopicDTO;
import com.tanpu.community.controller.convert.TopicConverter; import com.tanpu.community.controller.convert.TopicConverter;
import com.tanpu.community.dao.entity.community.TopicEntity; import com.tanpu.community.dao.entity.community.TopicEntity;
import com.tanpu.community.manager.TopicManager; import com.tanpu.community.manager.TopicManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.Value;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -26,7 +23,7 @@ public class TopicController { ...@@ -26,7 +23,7 @@ public class TopicController {
@Autowired @Autowired
private TopicManager topicManager; private TopicManager topicManager;
@PostMapping(value = "/queryTopicList") @PostMapping(value = "/queryTopicDetailList")
@ApiOperation("查询所有的主题详情") @ApiOperation("查询所有的主题详情")
@ResponseBody @ResponseBody
public List<TopicDTO> getAllTopicList(@RequestBody String content){ public List<TopicDTO> getAllTopicList(@RequestBody String content){
...@@ -37,7 +34,7 @@ public class TopicController { ...@@ -37,7 +34,7 @@ public class TopicController {
return topicDTOS; return topicDTOS;
} }
@PostMapping(value = "/queryTopicList") @PostMapping(value = "/queryTopicNameList")
@ApiOperation("查询所有的主题名称列表") @ApiOperation("查询所有的主题名称列表")
@ResponseBody @ResponseBody
public List<String> getTopicNameList(@RequestBody String content){ public List<String> getTopicNameList(@RequestBody String content){
......
package com.tanpu.community.service; package com.tanpu.community.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.tanpu.community.dao.entity.community.TopicEntity; import com.tanpu.community.dao.entity.community.TopicEntity;
import com.tanpu.community.dao.mapper.community.TopicMapper; import com.tanpu.community.dao.mapper.community.TopicMapper;
import org.springframework.cache.annotation.EnableCaching; import org.springframework.cache.annotation.EnableCaching;
...@@ -29,31 +29,27 @@ public class TopicService { ...@@ -29,31 +29,27 @@ public class TopicService {
public void updateTopicToTop(String topicId){ public void updateTopicToTop(String topicId){
UpdateWrapper<TopicEntity> updateWrapper = new UpdateWrapper<>(); TopicEntity topicEntity = new TopicEntity();
updateWrapper.eq("id",topicId); topicEntity.setIsTop(1);
updateWrapper.set("is_top",1); topicMapper.update(topicEntity,new LambdaUpdateWrapper<TopicEntity>().eq(TopicEntity::getId,topicId));
topicMapper.update(null,updateWrapper);
} }
public void updateTopicNotTop(String topicId){ public void updateTopicNotTop(String topicId){
UpdateWrapper<TopicEntity> updateWrapper = new UpdateWrapper<>(); TopicEntity topicEntity = new TopicEntity();
updateWrapper.eq("id",topicId); topicEntity.setIsTop(0);
updateWrapper.set("is_top",0); topicMapper.update(topicEntity,new LambdaUpdateWrapper<TopicEntity>().eq(TopicEntity::getId,topicId));
topicMapper.update(null,updateWrapper);
} }
public void updateTopicToConceal(String topicId){ public void updateTopicToConceal(String topicId){
UpdateWrapper<TopicEntity> updateWrapper = new UpdateWrapper<>(); TopicEntity topicEntity = new TopicEntity();
updateWrapper.eq("id",topicId); topicEntity.setIsConceal(1);
updateWrapper.set("is_conceal",1); topicMapper.update(topicEntity,new LambdaUpdateWrapper<TopicEntity>().eq(TopicEntity::getId,topicId));
topicMapper.update(null,updateWrapper);
} }
public void updateTopicNotConceal(String topicId){ public void updateTopicNotConceal(String topicId){
UpdateWrapper<TopicEntity> updateWrapper = new UpdateWrapper<>(); TopicEntity topicEntity = new TopicEntity();
updateWrapper.eq("id",topicId); topicEntity.setIsConceal(0);
updateWrapper.set("is_conceal",0); topicMapper.update(topicEntity,new LambdaUpdateWrapper<TopicEntity>().eq(TopicEntity::getId,topicId));
topicMapper.update(null,updateWrapper);
} }
public TopicEntity queryById(String topicId) { public TopicEntity queryById(String topicId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment