| | |
| | | package com.vci.ubcs.deploy.controller; |
| | | |
| | | import com.alibaba.nacos.shaded.com.google.protobuf.ServiceException; |
| | | import com.vci.ubcs.common.validator.ComprehensiveFileValidator; |
| | | import com.vci.ubcs.deploy.entity.DeployApps; |
| | | import com.vci.ubcs.deploy.service.IDeployAppsService; |
| | | import com.vci.ubcs.deploy.vo.DeployAppsVO; |
| | | import com.vci.ubcs.starter.util.LocalFileUtil; |
| | | import com.vci.ubcs.starter.web.util.ControllerUtil; |
| | | import com.vci.ubcs.starter.web.util.LangBaseUtil; |
| | | import io.swagger.annotations.Api; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.http.auth.AuthenticationException; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.ServletRequest; |
| | | import java.io.File; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | public class DeployAppsController { |
| | | |
| | | private final IDeployAppsService deployAppsService; |
| | | |
| | | /** |
| | | * 文件安全检查 |
| | | */ |
| | | @Autowired |
| | | private ComprehensiveFileValidator fileValidator; |
| | | |
| | | /** |
| | | * 获取服务运行列表 |
| | |
| | | */ |
| | | @PostMapping("/saveOrUpdateServiceInfo") |
| | | public R saveOrUpdateDefault(@RequestBody DeployAppsVO deployAppsVO) throws ServiceException { |
| | | return R.status(deployAppsService.saveOrUpdateServiceInfo(deployAppsVO)); |
| | | return deployAppsService.saveOrUpdateServiceInfo(deployAppsVO); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping("/importUpdateServiceJar") |
| | | public R importClassify(@RequestParam("files") MultipartFile[] files,@RequestParam String serverName) throws ServiceException { |
| | | // 使用文件安全验证器 |
| | | ComprehensiveFileValidator.MultiUploadValidationResult quickResult = fileValidator.validateFiles(files, true); |
| | | if (!quickResult.isValid()) { |
| | | return R.fail(quickResult.getMessage()); |
| | | } |
| | | if(Func.isBlank(serverName)){ |
| | | return R.fail("Mandatory parameter service name not found!"); |
| | | } |