|
@@ -12,6 +12,7 @@ import com.redxun.common.base.search.QueryFilterBuilder;
|
|
|
import com.redxun.common.model.JPaasUser;
|
|
|
import com.redxun.common.utils.ExceptionUtil;
|
|
|
import com.redxun.common.utils.SysUserUtil;
|
|
|
+import com.redxun.knowledge.entity.dao.Banner;
|
|
|
import com.redxun.knowledge.entity.dao.News;
|
|
|
import com.redxun.knowledge.entity.vo.NewsPcVo;
|
|
|
import com.redxun.knowledge.service.NewsServiceImpl;
|
|
@@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
|
@Slf4j
|
|
@@ -71,6 +73,25 @@ public class NewsController extends BaseController<News> {
|
|
|
return jsonResult;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "删除新闻")
|
|
|
+ @GetMapping("deleteNews")
|
|
|
+ public JsonResult deleteBanner(@RequestParam("newsId") String newsId){
|
|
|
+ newsService.delete(newsId);
|
|
|
+ return JsonResult.Success("删除成功!");
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation(value = "上线/下线")
|
|
|
+ @GetMapping("updateStatus/{newsId}/{status}")
|
|
|
+ public JsonResult updateStatus(@PathVariable("newsId") String newsId,
|
|
|
+ @PathVariable("status") Integer status){
|
|
|
+ News news = new News();
|
|
|
+ news.setPkId(newsId);
|
|
|
+ news.setEnabled(status);
|
|
|
+ news.setUpdateTime(new Date());
|
|
|
+ newsService.updateById(news);
|
|
|
+ return JsonResult.Success();
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation(value = "上升/下降")
|
|
|
@GetMapping("/goUpOrDownUp/{newsId}/{status}")
|
|
|
public JsonResult goUpOrDownUp(@PathVariable("newsId") String newsId,
|