11111
parent
408a24d8ea
commit
038a85babe
|
@ -18,7 +18,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Tag(name = "客户端版本添加请求对象")
|
@Tag(name = "规则版本添加请求对象")
|
||||||
public class VersionAddReq {
|
public class VersionAddReq {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,4 +13,6 @@ public class ENGINE_PHONE_TEST_V1 {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.rule.server.controller;
|
package com.muyu.rule.server.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.rule.common.domain.DataValue;
|
import com.muyu.rule.common.domain.DataValue;
|
||||||
import com.muyu.rule.common.domain.RuleEngineVersion;
|
import com.muyu.rule.common.domain.RuleEngineVersion;
|
||||||
|
@ -38,6 +39,29 @@ import java.util.Map;
|
||||||
@Tag(name = "规则版本控制层", description = "规则版本管理,查看等相关操作")
|
@Tag(name = "规则版本控制层", description = "规则版本管理,查看等相关操作")
|
||||||
public class RuleEngineVersionController {
|
public class RuleEngineVersionController {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存代码
|
||||||
|
* @param ruleEngineVersion
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/saveCode")
|
||||||
|
public Result saveCode(@RequestBody RuleEngineVersion ruleEngineVersion){
|
||||||
|
|
||||||
|
UpdateWrapper<RuleEngineVersion> updateWrapper = new UpdateWrapper<>();
|
||||||
|
|
||||||
|
updateWrapper.eq(ruleEngineVersion.getRuleId(),ruleEngineVersion.getVersionClazz());
|
||||||
|
|
||||||
|
|
||||||
|
versionService.Upload(ruleEngineVersion.getVersionClazz(),ruleEngineVersion.getClassName());
|
||||||
|
|
||||||
|
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RuleEngineVersionService versionService;
|
private RuleEngineVersionService versionService;
|
||||||
|
|
||||||
|
@ -121,6 +145,25 @@ public Result testValue(@PathVariable("versionClazz") String versionClazz,@Reque
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping("/test")
|
@PostMapping("/test")
|
||||||
public Result test(){
|
public Result test(){
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ public interface RuleEngineVersionService extends IService<RuleEngineVersion> {
|
||||||
|
|
||||||
void disable(Long id);
|
void disable(Long id);
|
||||||
|
|
||||||
String dataGenerate(String dataSource);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -66,13 +66,8 @@ public class RuleEngineServiceImpl extends ServiceImpl<RuleEngineVersionMapper,
|
||||||
this.updateOpen(id, SystemYesNo.NO.getCode());
|
this.updateOpen(id, SystemYesNo.NO.getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String dataGenerate(String dataSource) {
|
|
||||||
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* bucket名称
|
* bucket名称
|
||||||
*
|
*
|
||||||
|
@ -81,6 +76,7 @@ public class RuleEngineServiceImpl extends ServiceImpl<RuleEngineVersionMapper,
|
||||||
private static String bucketName = "zcz-vfd-1000";
|
private static String bucketName = "zcz-vfd-1000";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 上传
|
||||||
* @param versionClazz java源代码
|
* @param versionClazz java源代码
|
||||||
* @param className 类的名
|
* @param className 类的名
|
||||||
*/
|
*/
|
||||||
|
@ -112,9 +108,9 @@ public class RuleEngineServiceImpl extends ServiceImpl<RuleEngineVersionMapper,
|
||||||
|
|
||||||
// String filePath ="home/"+ossFilePath;
|
// String filePath ="home/"+ossFilePath;
|
||||||
String filePath = engineConfig.getServerPath() + ossFilePath;
|
String filePath = engineConfig.getServerPath() + ossFilePath;
|
||||||
|
//下载容器
|
||||||
OssUtil.downloadFileForBucket(bucketName, ossFilePath, filePath);
|
OssUtil.downloadFileForBucket(bucketName, ossFilePath, filePath);
|
||||||
|
//编译
|
||||||
SourceCodeComplier.javaCompilerPath(engineConfig.getServerPath());
|
SourceCodeComplier.javaCompilerPath(engineConfig.getServerPath());
|
||||||
|
|
||||||
//对class文件进行自定义类加载规则引擎
|
//对class文件进行自定义类加载规则引擎
|
||||||
|
|
Loading…
Reference in New Issue