refactor(vo): 重构VO对象结构,统一字段命名和接口实现
重构所有VO对象,统一字段命名规范,移除冗余字段,优化接口实现 新增Voable接口用于VO对象转换 调整BaseViewModel和ProjectBasedViewModel接口定义 更新相关服务和控制器以适应VO对象变更
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
package com.ecep.contract.util;
|
||||
|
||||
import com.ecep.contract.constant.ServiceConstant;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ParamUtils {
|
||||
public static Map<String, Object> between(String key, LocalDate begin, LocalDate end) {
|
||||
return Map.of(key, Map.of(
|
||||
"begin", begin,
|
||||
"end", end
|
||||
));
|
||||
"end", end));
|
||||
}
|
||||
|
||||
public static Map<String, Object> equal(String key, Object value) {
|
||||
@@ -61,6 +64,11 @@ public class ParamUtils {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder greaterThan(String key, LocalDate value) {
|
||||
params.put(key, Map.of("greaterThan", value));
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder equals(String key, Object value) {
|
||||
params.put(key, value);
|
||||
return this;
|
||||
@@ -71,9 +79,29 @@ public class ParamUtils {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder search(String searchText) {
|
||||
params.put(ServiceConstant.KEY_SEARCH_TEXT, searchText);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Map<String, Object> build() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public Builder and(Consumer<Builder> consumer) {
|
||||
Builder builder = new Builder();
|
||||
consumer.accept(builder);
|
||||
params.put("and", builder);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder or(Consumer<Builder> consumer) {
|
||||
Builder builder = new Builder();
|
||||
consumer.accept(builder);
|
||||
params.put("or", builder);
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user