ServiceCompanyFilesController.java 2.15 KB
package com.subsidy.controller;


import com.subsidy.common.ResponseData;
import com.subsidy.common.ResponseVO;
import com.subsidy.dto.company.CompanyFilesDTO;
import com.subsidy.dto.company.GetServiceCompaniesDTO;
import com.subsidy.dto.service.CancelAuthDTO;
import com.subsidy.model.ServiceCompanyFilesDO;
import com.subsidy.service.ServiceCompanyFilesService;
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("/serviceCompanyFiles")
public class ServiceCompanyFilesController {

    @Autowired
    private ServiceCompanyFilesService serviceCompanyFilesService;

    @PostMapping("companyFiles")
    @ApiOperation("查看业务合同/业务材料  pageSize pageNum  fileName serviceCompanyId  fileType  0:业务合同 1:业务材料 ")
    public ResponseVO companyFiles(@RequestBody CompanyFilesDTO companyFilesDTO){
        return ResponseData.generateCreatedResponse(0,serviceCompanyFilesService.companyFiles(companyFilesDTO));
    }

    @PostMapping("deleteFile")
    @ApiOperation("删除协议/材料 id companyFiles返回的id")
    public ResponseVO deleteFile(@RequestBody ServiceCompanyFilesDO serviceCompanyFilesDO){
        return ResponseData.generateCreatedResponse(0,serviceCompanyFilesService.deleteFile(serviceCompanyFilesDO));
    }

    @PostMapping("uploadFile")
    @ApiOperation("上传新文件 serviceCompanyId  fileType  0:业务合同 1:业务材料 fileName fileAddress ")
    public ResponseVO uploadFile(@RequestBody ServiceCompanyFilesDO serviceCompanyFilesDO){
        return ResponseData.generateCreatedResponse(0,serviceCompanyFilesService.uploadFile(serviceCompanyFilesDO));
    }

}