refactor(项目设置): 公共脚本执行接口参数优化
This commit is contained in:
parent
57f3493219
commit
4439aa2cd7
|
@ -196,7 +196,7 @@ public class ApiExecuteService {
|
|||
* @return
|
||||
*/
|
||||
public String runScript(CustomFunctionRunRequest runRequest) {
|
||||
String reportId = IDGenerator.nextStr();
|
||||
String reportId = runRequest.getReportId();
|
||||
String testId = runRequest.getProjectId();
|
||||
// 生成执行脚本
|
||||
MsCommentScriptElement msCommentScriptElement = BeanUtils.copyBean(new MsCommentScriptElement(), runRequest);
|
||||
|
|
|
@ -6,6 +6,7 @@ import io.metersphere.project.dto.customfunction.request.CustomFunctionRunReques
|
|||
import io.metersphere.project.dto.environment.KeyValueParam;
|
||||
import io.metersphere.sdk.constants.PermissionConstants;
|
||||
import io.metersphere.system.base.BaseTest;
|
||||
import io.metersphere.system.uid.IDGenerator;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -55,6 +56,7 @@ public class ApiTestControllerTests extends BaseTest {
|
|||
baseResourcePoolTestService.initProjectResourcePool();
|
||||
|
||||
CustomFunctionRunRequest request = new CustomFunctionRunRequest();
|
||||
request.setReportId(IDGenerator.nextStr());
|
||||
request.setProjectId(DEFAULT_PROJECT_ID);
|
||||
request.setType(ScriptLanguageType.BEANSHELL.getValue());
|
||||
request.setScript("""
|
||||
|
|
|
@ -20,6 +20,11 @@ public class CustomFunctionRunRequest implements Serializable {
|
|||
@Size(max = 50)
|
||||
private String type;
|
||||
|
||||
@Schema(description = "报告ID")
|
||||
@NotBlank
|
||||
@Size(max = 50)
|
||||
private String reportId;
|
||||
|
||||
@Schema(description = "参数列表")
|
||||
private List<KeyValueParam> params;
|
||||
|
||||
|
|
Loading…
Reference in New Issue