Commit 589f3680 by 吴迪

修改项目请求方式

parent e74da019
...@@ -108,7 +108,7 @@ public class PolicyController extends AbstractController { ...@@ -108,7 +108,7 @@ public class PolicyController extends AbstractController {
public R delete(@RequestBody Integer[] ids) { public R delete(@RequestBody Integer[] ids) {
try { try {
if (ids.length>0) { if (ids.length > 0) {
for (Integer id : ids) { for (Integer id : ids) {
PolicyEntity policyEntity = policyService.getById(id); PolicyEntity policyEntity = policyService.getById(id);
// NewsMovieEntity newsMovieEntity = (NewsMovieEntity) policyEntity; // NewsMovieEntity newsMovieEntity = (NewsMovieEntity) policyEntity;
...@@ -200,7 +200,7 @@ public class PolicyController extends AbstractController { ...@@ -200,7 +200,7 @@ public class PolicyController extends AbstractController {
@Login @Login
@GetMapping({"/api/info/{id}","/api/info/{id}/{token}"}) @GetMapping({"/api/info/{id}", "/api/info/{id}/{token}"})
// @RequiresPermissions("manage:indexcarouselmanage:pictureImageList") // @RequiresPermissions("manage:indexcarouselmanage:pictureImageList")
public R getDetail(@PathVariable("id") Integer id, @PathVariable(value = "token", required = false) String token) { public R getDetail(@PathVariable("id") Integer id, @PathVariable(value = "token", required = false) String token) {
PolicyEntity policy = policyService.getById(id); PolicyEntity policy = policyService.getById(id);
...@@ -220,21 +220,21 @@ public class PolicyController extends AbstractController { ...@@ -220,21 +220,21 @@ public class PolicyController extends AbstractController {
} }
tokenCount.setCountFlag(tokenCount.getCountFlag() + 1); tokenCount.setCountFlag(tokenCount.getCountFlag() + 1);
tokenCountService.updateById(tokenCount); tokenCountService.updateById(tokenCount);
} else{ } else {
if(StrUtil.equals("0",policy.getStatus())) { if (StrUtil.equals("0", policy.getStatus())) {
return R.error("没有可显示的内容"); return R.error("没有可显示的内容");
} }
//点击量+1 //点击量+1
PolicyEntity policyUpdate = new PolicyEntity(); PolicyEntity policyUpdate = new PolicyEntity();
if(policyUpdate.getHits()!=null){ if (policyUpdate.getHits() != null) {
policyUpdate.setHits(policyUpdate.getHits()+1); policyUpdate.setHits(policyUpdate.getHits() + 1);
} else{ } else {
policyUpdate.setHits(1); policyUpdate.setHits(1);
} }
UpdateWrapper<PolicyEntity> updateWrapper = new UpdateWrapper(); UpdateWrapper<PolicyEntity> updateWrapper = new UpdateWrapper();
updateWrapper.eq("id",id); updateWrapper.eq("id", id);
policyService.update(policyUpdate,updateWrapper); policyService.update(policyUpdate, updateWrapper);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment