| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/SysUserCompanyController.java |
| | |
| | | package me.zhengjie.modules.system.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.system.domain.SysUserCompany; |
| | | import me.zhengjie.modules.system.service.SysUserCompanyService; |
| | | import me.zhengjie.modules.system.service.dto.SysUserCompanyDto; |
| | | import me.zhengjie.modules.system.service.dto.SysUserCompanyQueryCriteria; |
| | | import me.zhengjie.modules.system.domain.SysCompany; |
| | | import me.zhengjie.modules.system.service.SysCompanyService; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyDto; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyQueryCriteria; |
| | | import org.springframework.data.domain.Pageable; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.http.HttpStatus; |
| | |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "公司管理管理") |
| | | @RequestMapping("/api/sysUserCompany") |
| | | public class SysUserCompanyController { |
| | | @RequestMapping("/api/sysCompany") |
| | | public class SysCompanyController { |
| | | |
| | | private final SysUserCompanyService sysUserCompanyService; |
| | | private final SysCompanyService sysCompanyService; |
| | | |
| | | @Log("导出数据") |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('sysUserCompany:download')") |
| | | public void exportSystemSetting(HttpServletResponse response, SysUserCompanyQueryCriteria criteria) throws IOException { |
| | | sysUserCompanyService.download(sysUserCompanyService.queryAll(criteria), response); |
| | | @PreAuthorize("@el.check('sysCompany:download')") |
| | | public void exportSystemSetting(HttpServletResponse response, SysCompanyQueryCriteria criteria) throws IOException { |
| | | sysCompanyService.download(sysCompanyService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping |
| | | @Log("查询公司管理") |
| | | @ApiOperation("查询公司管理") |
| | | @PreAuthorize("@el.check('sysUserCompany:list')") |
| | | public ResponseEntity<Object> querySystemSetting(SysUserCompanyQueryCriteria criteria, Pageable pageable){ |
| | | return new ResponseEntity<>(sysUserCompanyService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | @PreAuthorize("@el.check('sysCompany:list')") |
| | | public ResponseEntity<Object> querySystemSetting(SysCompanyQueryCriteria criteria, Pageable pageable){ |
| | | return new ResponseEntity<>(sysCompanyService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/all") |
| | | @Log("查询公司管理") |
| | | @ApiOperation("查询公司管理") |
| | | @PreAuthorize("@el.check('sysUserCompany:list')") |
| | | public ResponseEntity<Object> querySystemSetting(SysUserCompanyQueryCriteria criteria){ |
| | | return new ResponseEntity<>(sysUserCompanyService.queryAll(criteria),HttpStatus.OK); |
| | | @PreAuthorize("@el.check('sysCompany:list')") |
| | | public ResponseEntity<Object> querySystemSetting(SysCompanyQueryCriteria criteria){ |
| | | return new ResponseEntity<>(sysCompanyService.queryAll(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增公司管理") |
| | | @ApiOperation("新增公司管理") |
| | | @PreAuthorize("@el.check('sysUserCompany:add')") |
| | | public ResponseEntity<Object> createSystemSetting(@Validated @RequestBody SysUserCompany resources){ |
| | | return new ResponseEntity<>(sysUserCompanyService.create(resources),HttpStatus.CREATED); |
| | | @PreAuthorize("@el.check('sysCompany:add')") |
| | | public ResponseEntity<Object> createSystemSetting(@Validated @RequestBody SysCompany resources){ |
| | | return new ResponseEntity<>(sysCompanyService.create(resources),HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改公司管理") |
| | | @ApiOperation("修改公司管理") |
| | | @PreAuthorize("@el.check('sysUserCompany:edit')") |
| | | public ResponseEntity<Object> updateSystemSetting(@Validated @RequestBody SysUserCompany resources){ |
| | | sysUserCompanyService.update(resources); |
| | | @PreAuthorize("@el.check('sysCompany:edit')") |
| | | public ResponseEntity<Object> updateSystemSetting(@Validated @RequestBody SysCompany resources){ |
| | | sysCompanyService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除公司管理") |
| | | @ApiOperation("删除公司管理") |
| | | @PreAuthorize("@el.check('sysUserCompany:del')") |
| | | @PreAuthorize("@el.check('sysCompany:del')") |
| | | public ResponseEntity<Object> deleteSystemSetting(@RequestBody Long[] ids) { |
| | | sysUserCompanyService.deleteAll(ids); |
| | | sysCompanyService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | |
| | |
| | | @PostMapping(value = "/getCompName") |
| | | @Log("选择用户改变公司") |
| | | @ApiOperation("选择用户改变公司") |
| | | public ResponseEntity<Object> getCompName(@Validated @RequestBody SysUserCompanyDto resources){ |
| | | return new ResponseEntity<>(sysUserCompanyService.getCompName(resources), HttpStatus.OK); |
| | | public ResponseEntity<Object> getCompName(@Validated @RequestBody SysCompanyDto resources){ |
| | | return new ResponseEntity<>(sysCompanyService.getCompName(resources), HttpStatus.OK); |
| | | } |
| | | } |