对比新文件 |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.dto.CompanyUserDTO; |
| | | import com.doumee.dao.business.model.dto.CompanyUserQueryDTO; |
| | | import com.doumee.service.business.CompanyUserService; |
| | | 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 java.util.List; |
| | | |
| | | /** |
| | | * @author AA |
| | | * @since 2023/09/08 10:27 |
| | | */ |
| | | @Api(tags = "绯荤粺-浼佷笟鐢ㄦ埛绠$悊") |
| | | @RestController |
| | | @RequestMapping("/companyUser") |
| | | public class CompanyUserController extends BaseController { |
| | | |
| | | @Autowired |
| | | private CompanyUserService companyUserService; |
| | | |
| | | |
| | | /** |
| | | * 鍒嗛〉鏌ヨ |
| | | * |
| | | * @param pageWrap 鍒嗛〉瀵硅薄 |
| | | * @return PageData<Company> |
| | | */ |
| | | @ApiOperation("鍒嗛〉鏌ヨ") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("company:company:query") |
| | | public ApiResponse<PageData<CompanyUserDTO>> findPage(PageWrap<CompanyUserQueryDTO> pageWrap){ |
| | | return ApiResponse.success(companyUserService.findPage(pageWrap)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 鏉′欢鏌ヨ鍗曟潯璁板綍 |
| | | * |
| | | * @param userId 瀹炰綋瀵硅薄 |
| | | * @return Company |
| | | */ |
| | | @ApiOperation("鍒嗛〉鏌ヨ") |
| | | @PostMapping("/findByUserId") |
| | | @RequiresPermissions("company:company:query") |
| | | public ApiResponse<CompanyUserDTO> findByUserId(@RequestParam("userId") Integer userId){ |
| | | |
| | | CompanyUserDTO company = new CompanyUserDTO(); |
| | | company.setId(userId); |
| | | return ApiResponse.success(companyUserService.findOne(company)); |
| | | } |
| | | |
| | | /** |
| | | * 鏉′欢鏌ヨ |
| | | * |
| | | * @param companyId 瀹炰綋瀵硅薄 |
| | | * @return List<Company> |
| | | */ |
| | | @ApiOperation("鍒嗛〉鏌ヨ") |
| | | @GetMapping("/findListByCompanyID") |
| | | @RequiresPermissions("company:company:query") |
| | | public ApiResponse<List<CompanyUserDTO>> findListByCompanyID(@RequestParam("companyId") Integer companyId){ |
| | | CompanyUserDTO company = new CompanyUserDTO(); |
| | | company.setCompanyId(companyId); |
| | | return ApiResponse.success(companyUserService.findListByCompanyID(company)); |
| | | |
| | | } |
| | | |
| | | } |