| | |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:company:create") |
| | | public ApiResponse create(@RequestBody Company company) { |
| | | return ApiResponse.success(companyService.create(company)); |
| | | companyService.create(company); |
| | | companyService.startSignAuth(company.getId()); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("根据ID删除") |
| | |
| | | @RequiresPermissions("business:company:update") |
| | | public ApiResponse updateById(@RequestBody Company company) { |
| | | companyService.updateById(company); |
| | | companyService.startSignAuth(company.getId()); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("分页查询") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:company:query") |
| | | public ApiResponse<PageData<Company>> findPage (@RequestBody PageWrap<Company> pageWrap) { |
| | | //权限范围内 |
| | | return ApiResponse.success(companyService.findPage(pageWrap)); |
| | | } |
| | | @ApiOperation("查询全部数据(账号分配企业使用)") |
| | | @PostMapping("/pageAll") |
| | | @RequiresPermissions("business:companypermission:create") |
| | | public ApiResponse<PageData<Company>> findPageAll (@RequestBody PageWrap<Company> pageWrap) { |
| | | pageWrap.getModel().setQueryFlag(Constants.ONE);//查询全部 |
| | | return ApiResponse.success(companyService.findPage(pageWrap)); |
| | | } |
| | | |
| | |
| | | @ApiOperation("根据ID查询") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:company:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | public ApiResponse<Company> findById(@PathVariable Integer id) { |
| | | |
| | | return ApiResponse.success(companyService.findById(id)); |
| | | } |
| | | } |