|
@@ -1,6 +1,8 @@
|
|
package com.gis.web.controller;
|
|
package com.gis.web.controller;
|
|
|
|
|
|
|
|
+import com.gis.common.exception.BaseRuntimeException;
|
|
import com.gis.common.util.Result;
|
|
import com.gis.common.util.Result;
|
|
|
|
+import com.gis.domain.entity.SceneCountEntity;
|
|
import com.gis.service.SceneCountService;
|
|
import com.gis.service.SceneCountService;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -18,18 +20,49 @@ import org.springframework.web.bind.annotation.RestController;
|
|
*/
|
|
*/
|
|
@Api(tags = "场景数据统计-大场景")
|
|
@Api(tags = "场景数据统计-大场景")
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("api/count")
|
|
|
|
|
|
+@RequestMapping("/api/count")
|
|
public class SceneCountController {
|
|
public class SceneCountController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
SceneCountService entityService;
|
|
SceneCountService entityService;
|
|
|
|
|
|
|
|
+ @ApiOperation("添加场景码统计")
|
|
|
|
+ @GetMapping("addCode")
|
|
|
|
+ public Result saveVisit(String code, String remark){
|
|
|
|
+ BaseRuntimeException.isBlank(code, null, "场景码不能为空");
|
|
|
|
+ BaseRuntimeException.isBlank(remark, null, "场景描述不能为空");
|
|
|
|
+
|
|
|
|
+ SceneCountEntity entity = entityService.findBySceneCode(code);
|
|
|
|
+ if (entity != null){
|
|
|
|
+ return Result.failure("场景码已存在,不能重复添加");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ entity = new SceneCountEntity();
|
|
|
|
+ entity.setSceneCode(code);
|
|
|
|
+ entity.setRemark(remark);
|
|
|
|
+ entity.setType("bigScene");
|
|
|
|
+ entity.setVisitSum(0);
|
|
|
|
+ entity.setStarSum(0);
|
|
|
|
+ entity.setShareSum(0);
|
|
|
|
+ entity.setVisitSum(0);
|
|
|
|
+
|
|
|
|
+ entityService.save(entity);
|
|
|
|
+
|
|
|
|
+ return Result.success(entity);
|
|
|
|
+ }
|
|
|
|
+
|
|
@ApiOperation("访问量")
|
|
@ApiOperation("访问量")
|
|
@GetMapping("saveVisit/{sceneCode}")
|
|
@GetMapping("saveVisit/{sceneCode}")
|
|
public Result saveVisit(@PathVariable String sceneCode){
|
|
public Result saveVisit(@PathVariable String sceneCode){
|
|
return entityService.saveVisit(sceneCode);
|
|
return entityService.saveVisit(sceneCode);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "v1.1-保存-访问量", notes = "需要数据库初始化数据、类型")
|
|
|
|
+ @GetMapping("/saveVisitByType/{sceneCode}/{type}")
|
|
|
|
+ public Result saveVisitByType(@PathVariable String sceneCode, @PathVariable String type){
|
|
|
|
+ return entityService.saveVisit(sceneCode, type);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 2022-3-25
|
|
* 2022-3-25
|
|
@@ -62,4 +95,11 @@ public class SceneCountController {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @ApiOperation("v1.1-详情")
|
|
|
|
+ @GetMapping("/detailByType/{sceneCode}/{type}")
|
|
|
|
+ public Result detailByType(@PathVariable String sceneCode, @PathVariable String type){
|
|
|
|
+ return entityService.detail(sceneCode, type);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|