| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.page.PageDTO; |
| | | import com.ruoyi.company.api.domain.dto.MgtCompanyDTO; |
| | | import com.ruoyi.company.api.domain.query.MgtCompanyQuery; |
| | | import com.ruoyi.company.api.domain.vo.MgtCompanyVO; |
| | | import com.ruoyi.company.service.CompanyService; |
| | |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.io.IOException; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | public R<MgtCompanyVO> queryCompanyDetail(@Parameter(name = "id",description = "企业id",required = true) @PathVariable Long id) { |
| | | return R.ok(companyService.queryCompanyDetail(id)); |
| | | } |
| | | @Operation(summary = "新增企业") |
| | | @PostMapping("/save") |
| | | public R<?> saveCompany(@Valid @RequestBody MgtCompanyDTO dto) { |
| | | companyService.saveCompany(dto); |
| | | return R.ok(); |
| | | } |
| | | @Operation(summary = "编辑企业") |
| | | @PostMapping("/edit") |
| | | public R<?> editCompany(@Valid @RequestBody MgtCompanyDTO dto) { |
| | | companyService.editCompany(dto); |
| | | return R.ok(); |
| | | } |
| | | @Operation(summary = "删除企业") |
| | | @DeleteMapping("/{id}") |
| | | public R<?> deleteCompany(@Parameter(name = "id",description = "企业id",required = true) @PathVariable Long id) { |
| | | companyService.deleteCompany(id); |
| | | return R.ok(); |
| | | } |
| | | @Operation(summary = "导出") |
| | | @PostMapping("/export") |
| | | public void export(@RequestBody MgtCompanyQuery query){ |
| | | try { |
| | | companyService.export(query); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | |
| | | } |