Commit efa10d54 authored by 赵啸非's avatar 赵啸非

添加资源校验

parent 6b31dc60
......@@ -50,6 +50,8 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
@Autowired
private SetupDbService setupDbService;
@Value("${project.publishPath:'/home/publish'}")
private String publishPath;
public SetupProjectController() {
......@@ -118,7 +120,6 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
}
@PostMapping("/dbConnect")
@UnAuth
public String connect(@RequestBody SetupProjectEntity setupProjectEntity) {
......@@ -364,12 +365,6 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
}
/**
* 导入文档生成代码
*
* @param file
* @return
*/
@PostMapping("/importProjectData")
@UnAuth
public String importDoc(MultipartFile file) {
......@@ -379,10 +374,8 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
String busiDesc = "导入" + getModuleDesc();
int code = VALUE_RESULT_SUCCESS;
try {
//解压
this.service.unProjectZip(file, context);
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
......@@ -401,20 +394,29 @@ public class SetupProjectController extends BaseCRUDJsonBodyMappingController<Se
*/
@GetMapping("/check")
@UnAuth
public Rest<Boolean> check() {
public Rest<HashMap<String, Object>> check() {
Boolean bool = false;
HashMap<String, Object> data = new HashMap<>();
data.put("resource", false);
data.put("project", false);
try {
//todo 检测是否初始安装,是否已经安装了base-manager,如果没有则进入引导界面进行安装
SetupProjectQuery setupProjectQuery = new SetupProjectQuery();
setupProjectQuery.setProjectCode(ProductDisEnum.基础服务.getValue());
SetupProjectEntity setupProjectEntity = this.service.selectOne(setupProjectQuery);
if(ObjectUtils.isEmpty(setupProjectEntity)) throw new AppException("基础服务不存在");
if(setupProjectEntity.getProjectStatus()>ProjectStatusEnum.未部署.getValue()){
bool=true;
return Rest.ok("项目工程已部署", bool);
if (ObjectUtils.isEmpty(setupProjectEntity)) throw new AppException("基础服务不存在");
//判断资源文件是否已经上传
String projectPath = this.publishPath + "/temp/project/";
boolean exist = FileUtil.exist(projectPath);
if (exist) {
data.put("resource", true);
}
if (setupProjectEntity.getProjectStatus() > ProjectStatusEnum.未部署.getValue()) {
bool = true;
data.put("project", bool);
return Rest.ok("项目工程已部署", data);
}
return Rest.ok("项目工程未部署,进入引导界面", bool);
return Rest.ok("项目工程未部署,进入引导界面", data);
} catch (Exception e) {
log.error("检测异常", e);
return Rest.fail(e.getMessage());
......
......@@ -9,8 +9,8 @@ spring:
active: @profiles.active@
servlet:
multipart:
max-file-size: 1000MB
max-request-size: 1000MB
max-file-size: 2048MB
max-request-size: 2048MB
# redis:
# host: @profiles.redis.uri@
# port: @profiles.redis.port@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment