Commit afddff05 by rongkailun

【新增】法律法规首页接口新增

parent e88d22a5
......@@ -136,5 +136,33 @@ public class PolicyController extends AbstractController {
return R.error(e.getMessage());
}
}
@Login
@PostMapping("/api/policyList")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R policyList() {
try {
QueryWrapper<PolicyEntity> policyEntityQueryWrapper = new QueryWrapper<>();
policyEntityQueryWrapper.eq("class","法律法规");
policyEntityQueryWrapper.gt("levels","0");
policyEntityQueryWrapper.eq("status ","1");
policyEntityQueryWrapper.orderByDesc("levels");
policyEntityQueryWrapper.orderByDesc("releasedate ");
policyEntityQueryWrapper.orderByDesc("id");
return R.ok().put("data",policyService.list(policyEntityQueryWrapper));
} catch (Exception e) {
log.error("policyList error: {}", e);
return R.error(e.getMessage());
}
}
@Login
@GetMapping("/api/info/{id}")
// @RequiresPermissions("generator:indexcarouselmanage:pictureImageList")
public R getDetail(@PathVariable("id") Integer id){
PolicyEntity policy = policyService.getById(id);
return R.ok().put("policy", policy);
}
}
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