| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.business.model.dto.CompanyCreatOrUpdateRequest; |
| | | import com.doumee.service.business.CompanyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @author AA |
| | |
| | | @ApiOperation("新建") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("company:company:create") |
| | | public ApiResponse create(@RequestBody Company company) { |
| | | public ApiResponse create(@RequestBody @Valid CompanyCreatOrUpdateRequest company) { |
| | | return ApiResponse.success(companyService.create(company)); |
| | | } |
| | | |
| | |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(companyService.findById(id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param pageWrap 分页对象 |
| | | * @return PageData<Company> |
| | | */ |
| | | @ApiOperation("平台查询企业信息-分页查询") |
| | | @PostMapping("/findPlatformPage") |
| | | @RequiresPermissions("company:company:query") |
| | | public ApiResponse<PageData<Company>> findPlatformPage(@RequestBody PageWrap<Company> pageWrap){ |
| | | return ApiResponse.success(companyService.findPlatformPage(pageWrap)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 主键查询 |
| | | * |
| | | * @param companyId 主键 |
| | | * @return Company |
| | | */ |
| | | @ApiOperation("根据企业企业id 查询企业用户") |
| | | @PostMapping("/findPlatformById") |
| | | @RequiresPermissions("company:company:query") |
| | | public ApiResponse<Company> findPlatformById(@RequestParam Integer companyId){ |
| | | return ApiResponse.success(companyService.findPlatformById(companyId)); |
| | | } |
| | | } |