ServiceCompanyMappingController.java 2.28 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.service.CancelAuthDTO;
import com.subsidy.dto.service.GetServiceCompaniesDTO;
import com.subsidy.service.ServiceCompanyMappingService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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 io.swagger.annotations.Api;

/**
 * <p>
 * 业务公司 映射表 前端控制器
 * </p>
 *
 * @author Tuyp
 * @since 2024-01-11
 */
@RestController
@Api(tags = "业务公司 映射表")
@RequestMapping("/serviceCompanyMapping")
public class ServiceCompanyMappingController {

    @Autowired
    private ServiceCompanyMappingService serviceCompanyMappingService;

    @PostMapping("getServiceCompanies")
    @ApiOperation("获取某个业务下的公司(筛选可查全部的)   serviceId 业务id pageSize  authStatus  pageNum  companyName")
    public ResponseVO getServiceCompanies(@RequestBody GetServiceCompaniesDTO getServiceCompaniesDTO){
        return ResponseData.generateCreatedResponse(0,serviceCompanyMappingService.getServiceCompanies(getServiceCompaniesDTO));
    }

    @PostMapping("cancelAuth")
    @ApiOperation("取消授权  serviceId companyIds[]")
    public ResponseVO cancelAuth(@RequestBody CancelAuthDTO cancelAuthDTO){
        return ResponseData.generateCreatedResponse(0,serviceCompanyMappingService.cancelAuth(cancelAuthDTO));
    }


    @PostMapping("addAuth")
    @ApiOperation("添加授权  serviceId companyIds[]")
    public ResponseVO addAuth(@RequestBody CancelAuthDTO cancelAuthDTO){
        return ResponseData.generateCreatedResponse(0,serviceCompanyMappingService.addAuth(cancelAuthDTO));
    }

    @PostMapping("serviceCompanies")
    @ApiOperation("获取某个业务管理下的所有公司   companyName  serviceId")
    public ResponseVO serviceCompanies(@RequestBody GetServiceCompaniesDTO getServiceCompaniesDTO){
        return ResponseData.generateCreatedResponse(0,serviceCompanyMappingService.serviceCompanies(getServiceCompaniesDTO));
    }

}