|
@@ -6,22 +6,19 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.gis.common.util.FileUtils;
|
|
|
import com.gis.common.util.Result;
|
|
|
import com.gis.domain.dto.*;
|
|
|
-import com.gis.domain.po.MenuEntity;
|
|
|
-import com.gis.domain.po.SceneEntity;
|
|
|
-import com.gis.domain.po.VideoEntity;
|
|
|
-import com.gis.domain.po.ViewEntity;
|
|
|
-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.domain.po.*;
|
|
|
+import com.gis.domain.vo.*;
|
|
|
import com.gis.service.*;
|
|
|
+import com.gis.service.util.CommentTree;
|
|
|
+import com.gis.service.util.CommentTreeUtil;
|
|
|
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;
|
|
|
-import org.springframework.beans.BeanUtils;
|
|
|
+import org.apache.shiro.authz.annotation.Logical;
|
|
|
+import org.apache.shiro.authz.annotation.RequiresRoles;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import tk.mybatis.mapper.entity.Condition;
|
|
@@ -60,10 +57,12 @@ public class WebController extends BaseController {
|
|
|
@Autowired
|
|
|
private VideoService videoService;
|
|
|
|
|
|
-
|
|
|
@Autowired
|
|
|
private SlideshowService slideshowService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CommentService commentService;
|
|
|
+
|
|
|
@ApiOperation("导航栏")
|
|
|
@GetMapping("navigation")
|
|
|
public Result navigation() {
|
|
@@ -109,11 +108,10 @@ public class WebController extends BaseController {
|
|
|
public Result slideshow() {
|
|
|
|
|
|
SlideshowPageDateDto param = new SlideshowPageDateDto();
|
|
|
-// param.setAuditStatus(1);
|
|
|
param.setStatus(4);
|
|
|
param.setPageSize(10);
|
|
|
startPage(param);
|
|
|
- PageInfo<SlideshowVo> page = new PageInfo<>(slideshowService.search(param));
|
|
|
+ PageInfo<SlideshowVo> page = new PageInfo<>(slideshowService.search(param, null));
|
|
|
return Result.success(page);
|
|
|
}
|
|
|
|
|
@@ -128,7 +126,7 @@ public class WebController extends BaseController {
|
|
|
param.setType("news");
|
|
|
|
|
|
startPage(param);
|
|
|
- PageInfo<NewsVo> page = new PageInfo<>(newsService.search(param));
|
|
|
+ PageInfo<NewsVo> page = new PageInfo<>(newsService.search(param, null));
|
|
|
|
|
|
return Result.success(page);
|
|
|
}
|
|
@@ -144,7 +142,7 @@ public class WebController extends BaseController {
|
|
|
param.setType("notice");
|
|
|
|
|
|
startPage(param);
|
|
|
- PageInfo<NewsVo> page = new PageInfo<>(newsService.search(param));
|
|
|
+ PageInfo<NewsVo> page = new PageInfo<>(newsService.search(param, null));
|
|
|
|
|
|
return Result.success(page);
|
|
|
}
|
|
@@ -161,7 +159,7 @@ public class WebController extends BaseController {
|
|
|
param.setStatus(4);
|
|
|
param.setStatus(5);
|
|
|
startPage(param);
|
|
|
- PageInfo<SpiritVo> page = new PageInfo<>(spiritService.search(param));
|
|
|
+ PageInfo<SpiritVo> page = new PageInfo<>(spiritService.search(param, null));
|
|
|
return Result.success(page);
|
|
|
}
|
|
|
|
|
@@ -204,22 +202,36 @@ public class WebController extends BaseController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @ApiOperation("留言列表")
|
|
|
+ @PostMapping("list")
|
|
|
+ public Result<CommentVo> list(@RequestBody PageDateDto param) {
|
|
|
+ startPage(param);
|
|
|
+
|
|
|
+ List<CommentEntity> all = commentService.search(param, 1);
|
|
|
+ CommentTreeUtil commentTreeUtil = new CommentTreeUtil(all);
|
|
|
+ List<CommentTree> commentTrees = commentTreeUtil.buildTree();
|
|
|
|
|
|
+ PageInfo<CommentTree> page = new PageInfo<>(commentTrees);
|
|
|
+ return Result.success(page);
|
|
|
+ }
|
|
|
|
|
|
- public static void main(String[] args) throws IOException {
|
|
|
- String resourceUrl = FileUtils.getResourceUrl("data/smokeing.json");
|
|
|
|
|
|
- String data = FileUtil.readUtf8String(resourceUrl);
|
|
|
|
|
|
- JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
|
|
|
- JSONObject reportedJaon = jsonObject.getJSONObject("reported");
|
|
|
- String batteryPower = reportedJaon.getString("batteryPower");
|
|
|
- log.info("batteryPower:{}", batteryPower);
|
|
|
- String replace = batteryPower.replace("%", "");
|
|
|
- Integer power = Integer.valueOf(replace);
|
|
|
- System.out.println(power);
|
|
|
- }
|
|
|
+// public static void main(String[] args) throws IOException {
|
|
|
+// String resourceUrl = FileUtils.getResourceUrl("data/smokeing.json");
|
|
|
+//
|
|
|
+// String data = FileUtil.readUtf8String(resourceUrl);
|
|
|
+//
|
|
|
+// JSONObject jsonObject = JSONObject.parseObject(data);
|
|
|
+//
|
|
|
+// JSONObject reportedJaon = jsonObject.getJSONObject("reported");
|
|
|
+// String batteryPower = reportedJaon.getString("batteryPower");
|
|
|
+// log.info("batteryPower:{}", batteryPower);
|
|
|
+// String replace = batteryPower.replace("%", "");
|
|
|
+// Integer power = Integer.valueOf(replace);
|
|
|
+// System.out.println(power);
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|