Commit 013fb11f authored by Quxl's avatar Quxl

x

parent 42259c4a
...@@ -10,7 +10,9 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -10,7 +10,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.common.jdbc.JdbcTemplate; import com.egolm.common.jdbc.JdbcTemplate;
import com.egolm.film.api.service.AdminTokenService;
import com.egolm.film.api.service.ReviewService; import com.egolm.film.api.service.ReviewService;
import com.egolm.film.bean.Fc_admin;
import com.egolm.film.bean.Fc_member_film; import com.egolm.film.bean.Fc_member_film;
import com.egolm.film.config.XRException; import com.egolm.film.config.XRException;
...@@ -28,10 +30,14 @@ public class WebUtilController { ...@@ -28,10 +30,14 @@ public class WebUtilController {
@Autowired @Autowired
ReviewService service; ReviewService service;
@Autowired
AdminTokenService tokenService;
@ResponseBody @ResponseBody
@PostMapping("tryNextRound") @PostMapping("tryNextRound")
@ApiOperation("尝试进入下一轮评选") @ApiOperation("尝试进入下一轮评选")
public Object tryNextRound(Integer review_id) { public Object tryNextRound(Integer review_id) {
this.verifyAuth();
service.tryNextRound(review_id); service.tryNextRound(review_id);
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
...@@ -40,6 +46,7 @@ public class WebUtilController { ...@@ -40,6 +46,7 @@ public class WebUtilController {
@PostMapping("initAllReview") @PostMapping("initAllReview")
@ApiOperation("初始化所有审片流程") @ApiOperation("初始化所有审片流程")
public Object initAllReview() { public Object initAllReview() {
this.verifyAuth();
jdbcTemplate.executeUpdate("delete from fc_review"); jdbcTemplate.executeUpdate("delete from fc_review");
jdbcTemplate.executeUpdate("delete from fc_review_record"); jdbcTemplate.executeUpdate("delete from fc_review_record");
jdbcTemplate.executeUpdate("delete from fc_review_record_ext"); jdbcTemplate.executeUpdate("delete from fc_review_record_ext");
...@@ -68,4 +75,11 @@ public class WebUtilController { ...@@ -68,4 +75,11 @@ public class WebUtilController {
} }
return Rjx.jsonOk(); return Rjx.jsonOk();
} }
private void verifyAuth() {
Fc_admin admin = (Fc_admin)tokenService.getTokenObj();
if(!admin.getUsername().equals("admin")) {
throw new XRException("权限错误");
}
}
} }
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