|
@@ -53,16 +53,18 @@ public class WebController extends BaseController {
|
|
|
|
|
|
|
|
|
|
|
|
- /** 每次浏览作品都需要调用次接口 */
|
|
|
- @ApiOperation(value = "检查作品是否可用", notes = "true:可用, false:不可用")
|
|
|
+ /** 每次浏览作品都需要调用次接口。 浏览量只统计预览跟正式发布的数据 */
|
|
|
+ @ApiOperation(value = "检查作品是否可用", notes = "true:可用, false:不可用, visit有值表示要添加浏览量")
|
|
|
@GetMapping("checkWork/{workId}")
|
|
|
- public Result checkWork(@PathVariable Long workId) {
|
|
|
+ public Result checkWork(@PathVariable Long workId, String visit) {
|
|
|
WorkEntity entity = workService.findById(workId);
|
|
|
Boolean flag = false;
|
|
|
if (entity != null) {
|
|
|
log.info("作品不存在");
|
|
|
flag = true;
|
|
|
- workService.addVisit(workId);
|
|
|
+ if (visit != null) {
|
|
|
+ workService.addVisit(workId);
|
|
|
+ }
|
|
|
}
|
|
|
return Result.success(flag);
|
|
|
}
|