初始化

This commit is contained in:
中青华年 2025-04-21 22:24:29 +08:00
parent bcf8893b00
commit 9dec34e158
6 changed files with 109 additions and 0 deletions

View File

@ -0,0 +1,15 @@
package com.yang.test.domain;
import lombok.Data;
/**
* Mbti
*/
@Data
public class Option {
private Integer id;
private String code;
private String name;
private Integer questionId;
private String characterType;
}

View File

@ -0,0 +1,17 @@
package com.yang.test.domain;
import lombok.Data;
import java.util.List;
/**
* Mbti
*/
@Data
public class Question {
private Integer id;
private String name;
private String type;
private String testId;
private List<Option> options;
}

View File

@ -0,0 +1,32 @@
package com.yang.test.domain;
import lombok.Data;
@Data
public class Result<T> {
private Integer code;
private String message;
private T data;
public static <T> Result<T> success(T data) {
Result<T> result = new Result<>();
result.setCode(0);
result.setMessage("操作成功");
result.setData(data);
return result;
}
public static <T> Result<T> error(String message) {
Result<T> result = new Result<>();
result.setCode(-1);
result.setMessage(message);
return result;
}
public static <T> Result<T> error(Integer code, String message) {
Result<T> result = new Result<>();
result.setCode(code);
result.setMessage(message);
return result;
}
}

View File

@ -0,0 +1,12 @@
package com.yang.test.domain;
import lombok.Data;
/**
* Mbti
*/
@Data
public class Test {
private String id;
private String name;
}

View File

@ -0,0 +1,18 @@
package com.yang.test.domain.VO;
import com.yang.test.domain.Option;
import lombok.Data;
import java.util.List;
/**
* Mbti
*/
@Data
public class QuestionVO {
private Integer id;
private String name;
private String type;
private String infoname;
private List<Option> option;
}

View File

@ -0,0 +1,15 @@
package com.yang.test.domain.VO;
import lombok.Data;
import java.util.List;
/**
* Mbti
*/
@Data
public class TestQuestionsVO {
private String id;
private String name;
private List<QuestionVO> list;
}