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

service规范fix

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