|
@@ -35,6 +35,9 @@ public class WebController extends BaseController {
|
|
|
@Autowired
|
|
|
WorkService workService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ SceneService sceneService;
|
|
|
+
|
|
|
@ApiOperation(value = "作品列表", position = 1)
|
|
|
@GetMapping("listTree/{workId}")
|
|
|
public Result listTree(@PathVariable Long workId) {
|
|
@@ -44,8 +47,22 @@ public class WebController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation("作品详情")
|
|
|
- @GetMapping("detail/{workId}/{password}")
|
|
|
- public Result detail(@PathVariable Long workId, @PathVariable String password) {
|
|
|
+ @GetMapping("detail/{workId}")
|
|
|
+ public Result detail(@PathVariable Long workId) {
|
|
|
+ WorkEntity entity = workService.findById(workId);
|
|
|
+ if (entity == null) {
|
|
|
+ log.error("对象不存在, 场景码:{}", workId);
|
|
|
+ return Result.failure("对象不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ return Result.success(entity);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("检验密码")
|
|
|
+ @PostMapping("checkPwd")
|
|
|
+ public Result checkPwd(Long workId, String password) {
|
|
|
WorkEntity entity = workService.findById(workId);
|
|
|
if (entity == null) {
|
|
|
log.error("对象不存在, 场景码:{}", workId);
|
|
@@ -54,12 +71,19 @@ public class WebController extends BaseController {
|
|
|
|
|
|
String dbPassword = entity.getPassword();
|
|
|
if (!dbPassword.equals(password)) {
|
|
|
- return Result.failure("场景密码有误");
|
|
|
+ return Result.failure("密码有误");
|
|
|
}
|
|
|
return Result.success(entity);
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @ApiOperation(value = "初始场景-获取", position = 3)
|
|
|
+ @GetMapping("getIndex/{workId}")
|
|
|
+ public Result getIndex(@PathVariable Long workId) {
|
|
|
+ return sceneService.getVoIndex(workId);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "检查token是否有效" , position = 3)
|