refactor(项目管理): 误报类型枚举

This commit is contained in:
WangXu10 2024-02-04 21:04:03 +08:00 committed by Craftsman
parent 6aa7112d16
commit a834a563fb
3 changed files with 22 additions and 5 deletions

View File

@ -1,5 +1,9 @@
package io.metersphere.project.dto;
import io.metersphere.project.enums.FakeErrorType;
import io.metersphere.sdk.constants.TemplateScene;
import io.metersphere.system.valid.EnumValue;
import io.metersphere.validation.groups.Created;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
@ -29,7 +33,8 @@ public class FakeErrorDTO implements Serializable {
@NotBlank(message = "{fake_error.type.not_blank}")
private String type;
@Schema(description = "匹配规则-内容类型/header/data/body", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(description = "匹配规则-内容类型", requiredMode = Schema.RequiredMode.REQUIRED)
@EnumValue(enumClass = FakeErrorType.class, groups = {Created.class})
@NotBlank(message = "{fake_error.resp_type.not_blank}")
private String respType;

View File

@ -0,0 +1,12 @@
package io.metersphere.project.enums;
/**
* @author: LAN
* @date: 2024/1/12 11:03
* @version: 1.0
*/
public enum FakeErrorType {
RESPONSE_HEADERS,
RESPONSE_DATA,
RESPONSE_CODE
}

View File

@ -133,9 +133,9 @@
const currentList = ref<FakeTableListItem[]>([]);
const tableStore = useTableStore();
const headerOptions = computed(() => [
{ label: 'Response Headers', value: 'headers' },
{ label: 'Response Data', value: 'data' },
{ label: 'Response Code', value: 'code' },
{ label: 'Response Headers', value: 'RESPONSE_HEADERS' },
{ label: 'Response Data', value: 'RESPONSE_DATA' },
{ label: 'Response Code', value: 'RESPONSE_CODE' },
]);
const relationOptions = computed(() => [
{ label: '包含', value: 'contain' },
@ -452,7 +452,7 @@
type: 'select',
options: headerOptions.value,
className: 'w-[205px]',
defaultValue: 'headers',
defaultValue: 'RESPONSE_HEADERS',
},
{
filed: 'relation', // -