|
@@ -2,8 +2,20 @@ package com.gis.web.controller;
|
|
|
|
|
|
|
|
|
import com.gis.common.util.Result;
|
|
|
+import com.gis.domain.dto.GoodsPageDateDto;
|
|
|
+import com.gis.domain.dto.NewsPageDateRequest;
|
|
|
+import com.gis.domain.dto.SlideshowPageDateDto;
|
|
|
+import com.gis.domain.dto.SpiritPageDateDto;
|
|
|
+import com.gis.domain.po.MenuEntity;
|
|
|
import com.gis.domain.po.ViewEntity;
|
|
|
-import com.gis.service.ViewService;
|
|
|
+import com.gis.domain.vo.GoodsVo;
|
|
|
+import com.gis.domain.vo.NewsVo;
|
|
|
+import com.gis.domain.vo.SlideshowVo;
|
|
|
+import com.gis.domain.vo.SpiritVo;
|
|
|
+import com.gis.service.*;
|
|
|
+import com.gis.service.util.MenuTree;
|
|
|
+import com.gis.service.util.MenuTreeUtil;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
@@ -11,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by owen on 2020/6/10 0010 10:44
|
|
@@ -24,9 +37,35 @@ public class WebController extends BaseController {
|
|
|
@Autowired
|
|
|
private ViewService viewService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private GoodsService goodsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SpiritService spiritService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private NewsService newsService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private MenuService menuService;
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private SlideshowService slideshowService;
|
|
|
+
|
|
|
+ @ApiOperation("导航栏")
|
|
|
+ @GetMapping("navigation")
|
|
|
+ public Result navigation() {
|
|
|
+ List<MenuEntity> entities = menuService.findAll();
|
|
|
+
|
|
|
+ MenuTreeUtil menuTreeUtil = new MenuTreeUtil(entities);
|
|
|
+ List<MenuTree> tree = menuTreeUtil.buildTree();
|
|
|
+ return Result.success(tree);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
- @ApiOperation("保存访问量")
|
|
|
+ @ApiOperation("保存访问")
|
|
|
@GetMapping("setCount")
|
|
|
public Result setCount(HttpServletRequest request) {
|
|
|
|
|
@@ -38,7 +77,7 @@ public class WebController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- @ApiOperation("访问量")
|
|
|
+ @ApiOperation("获取访问量")
|
|
|
@GetMapping("count")
|
|
|
public Result count() {
|
|
|
long count = viewService.count();
|
|
@@ -46,6 +85,90 @@ public class WebController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @ApiOperation("轮播图")
|
|
|
+ @GetMapping("slideshow")
|
|
|
+ public Result slideshow() {
|
|
|
+
|
|
|
+ SlideshowPageDateDto param = new SlideshowPageDateDto();
|
|
|
+ param.setAuditStatus(1);
|
|
|
+ param.setPageSize(10);
|
|
|
+ startPage(param);
|
|
|
+ PageInfo<SlideshowVo> page = new PageInfo<>(slideshowService.search(param));
|
|
|
+ return Result.success(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("史馆动态-新闻")
|
|
|
+ @GetMapping("news")
|
|
|
+ public Result news() {
|
|
|
+
|
|
|
+ NewsPageDateRequest param = new NewsPageDateRequest();
|
|
|
+ param.setStatus(4);
|
|
|
+ param.setPageSize(10);
|
|
|
+ param.setType("news");
|
|
|
+
|
|
|
+ startPage(param);
|
|
|
+ PageInfo<NewsVo> page = new PageInfo<>(newsService.search(param));
|
|
|
+
|
|
|
+ return Result.success(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("史馆动态-公告")
|
|
|
+ @GetMapping("notice")
|
|
|
+ public Result notice() {
|
|
|
+
|
|
|
+ NewsPageDateRequest param = new NewsPageDateRequest();
|
|
|
+ param.setStatus(4);
|
|
|
+ param.setPageSize(10);
|
|
|
+ param.setType("notice");
|
|
|
+
|
|
|
+ startPage(param);
|
|
|
+ PageInfo<NewsVo> page = new PageInfo<>(newsService.search(param));
|
|
|
+
|
|
|
+ return Result.success(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 图片只显示前7个
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @ApiOperation("特有精神")
|
|
|
+ @GetMapping("spirit")
|
|
|
+ public Result spirit() {
|
|
|
+ SpiritPageDateDto param = new SpiritPageDateDto();
|
|
|
+ param.setStatus(4);
|
|
|
+ param.setStatus(5);
|
|
|
+ startPage(param);
|
|
|
+ PageInfo<SpiritVo> page = new PageInfo<>(spiritService.search(param));
|
|
|
+ return Result.success(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "精品典藏", notes = "type:类型:1:图片, 2:视频,3:模型")
|
|
|
+ @GetMapping("goods/{type}")
|
|
|
+ public Result<GoodsVo> goodsList(@PathVariable Integer type) {
|
|
|
+ GoodsPageDateDto param = new GoodsPageDateDto();
|
|
|
+ param.setType(type);
|
|
|
+ param.setStatus(4);
|
|
|
+ param.setPageSize(5);
|
|
|
+ startPage(param);
|
|
|
+
|
|
|
+ PageInfo<GoodsVo> page = new PageInfo<>(goodsService.search(param));
|
|
|
+ return Result.success(page);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation(value = "数字史馆")
|
|
|
+ @GetMapping("scene")
|
|
|
+ public Result<GoodsVo> scene(@PathVariable Integer type) {
|
|
|
+
|
|
|
+ return Result.success();
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
|