-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 1,添加修改问卷,删除问卷接口,修改创建问卷 部分逻辑 2,添加修改问卷,删除问卷接口单元测试 * feat: 1,添加修改问卷,删除问卷接口,修改创建问卷 部分逻辑 2,添加修改问卷,删除问卷接口单元测试 * style:代码格式化调整 * style:代码格式化调整 * feat:新增发布问卷接口,同时修改了创建问卷接口 * feat:新增问卷列表查询接口及相关单元测试 * feat:修改变量名 --------- Co-authored-by: kui <[email protected]>
- Loading branch information
Showing
13 changed files
with
369 additions
and
65 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
survey-common/src/main/java/com/xiaojusurvey/engine/common/constants/SurveyConstant.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.xiaojusurvey.engine.common.constants; | ||
|
||
/** | ||
* Survey 常量 | ||
* | ||
* @author [email protected] | ||
* @Date 2024/8/3 12:24 | ||
*/ | ||
public class SurveyConstant { | ||
|
||
public static final String OPT_OR = "$or"; | ||
public static final String OPT_NE = "$ne"; | ||
public static final String OPT_REGEX = "$regex"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
survey-core/src/main/java/com/xiaojusurvey/engine/core/survey/dto/BaseQuery.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.xiaojusurvey.engine.core.survey.dto; | ||
|
||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* 查询基础条件 | ||
* | ||
* @author [email protected] | ||
* @Date 2024/8/1 21:14 | ||
*/ | ||
@Data | ||
public class BaseQuery implements Serializable { | ||
|
||
private static final long serialVersionUID = 3378327499951251208L; | ||
private int pageSize = 10; | ||
private int curPage = 1; | ||
|
||
|
||
} |
36 changes: 36 additions & 0 deletions
36
survey-core/src/main/java/com/xiaojusurvey/engine/core/survey/dto/FilterItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.xiaojusurvey.engine.core.survey.dto; | ||
|
||
import lombok.Data; | ||
|
||
/** | ||
* TODO | ||
* | ||
* @author [email protected] | ||
* @Date 2024/8/1 20:59 | ||
*/ | ||
@Data | ||
public class FilterItem { | ||
/** | ||
* 比较符 | ||
*/ | ||
private String comparator; | ||
|
||
private FilterCondition condition; | ||
|
||
|
||
@Data | ||
public static class FilterCondition { | ||
/** | ||
* 字段名 | ||
*/ | ||
private String field; | ||
/** | ||
* 比较符 | ||
*/ | ||
private String comparator; | ||
/** | ||
* 筛选条件 | ||
*/ | ||
private String value; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
survey-core/src/main/java/com/xiaojusurvey/engine/core/survey/dto/OrderItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.xiaojusurvey.engine.core.survey.dto; | ||
|
||
import lombok.Data; | ||
|
||
/** | ||
* 排序条件 | ||
* | ||
* @author [email protected] | ||
* @Date 2024/8/1 20:59 | ||
*/ | ||
@Data | ||
public class OrderItem { | ||
/** | ||
* 字段名 | ||
*/ | ||
private String field; | ||
/** | ||
* 升序降序 1-升序,-1-降序 | ||
*/ | ||
private int value = 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
survey-core/src/main/java/com/xiaojusurvey/engine/core/survey/param/SurveyListParam.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.xiaojusurvey.engine.core.survey.param; | ||
|
||
import com.xiaojusurvey.engine.core.survey.dto.BaseQuery; | ||
import com.xiaojusurvey.engine.core.survey.dto.FilterItem; | ||
import com.xiaojusurvey.engine.core.survey.dto.OrderItem; | ||
import lombok.Data; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* 问卷查询 | ||
* | ||
* @author [email protected] | ||
* @Date 2024/8/1 21:05 | ||
*/ | ||
@Data | ||
public class SurveyListParam extends BaseQuery implements Serializable { | ||
|
||
private static final long serialVersionUID = -6294820920444326423L; | ||
private FilterItem[] filter; | ||
|
||
private OrderItem[] order; | ||
|
||
@NotBlank(message = "空间id不能为空") | ||
private String workspaceId; | ||
/** | ||
* 所有者 | ||
*/ | ||
private String username; | ||
|
||
/** | ||
* 所有者Id | ||
*/ | ||
private String userId; | ||
|
||
} |
27 changes: 27 additions & 0 deletions
27
survey-core/src/main/java/com/xiaojusurvey/engine/core/survey/vo/SurveyListVO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.xiaojusurvey.engine.core.survey.vo; | ||
|
||
import lombok.Data; | ||
|
||
import java.io.Serializable; | ||
import java.util.List; | ||
|
||
/** | ||
* 问卷列表 | ||
* | ||
* @author [email protected] | ||
* @Date 2024/8/1 21:36 | ||
*/ | ||
@Data | ||
public class SurveyListVO implements Serializable { | ||
|
||
private static final long serialVersionUID = 2263256769125151536L; | ||
/** | ||
* 问卷列表 | ||
*/ | ||
private List<SurveyVO> data; | ||
|
||
/** | ||
* 总数量 | ||
*/ | ||
private Long count; | ||
} |
Oops, something went wrong.