Blame view

ServiceCompanyMappingController.java 2.28 KB
涂亚平 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.company.GetServiceCompaniesDTO;
import com.subsidy.dto.service.CancelAuthDTO;
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));
    }



}