mirror of
https://github.com/tencentmusic/supersonic.git
synced 2026-04-18 12:24:21 +08:00
support query rule management (#853)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package com.tencent.supersonic.headless.api.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ActionInfo {
|
||||
|
||||
private List<Object> out;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.tencent.supersonic.headless.api.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class RuleInfo {
|
||||
|
||||
private Mode mode;
|
||||
private List<Object> parameters;
|
||||
|
||||
public enum Mode {
|
||||
/**
|
||||
* BEFORE, some days ago
|
||||
* RECENT, the last few days
|
||||
* EXIST, there was some information
|
||||
*/
|
||||
BEFORE, RECENT, EXIST
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.enums;
|
||||
|
||||
public enum QueryRuleType {
|
||||
|
||||
ADD_DATE,
|
||||
ADD_SELECT
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class QueryRuleFilter {
|
||||
|
||||
private List<Integer> statusList;
|
||||
|
||||
private List<Long> ruleIds;
|
||||
|
||||
private List<Long> dataSetIds;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.request;
|
||||
|
||||
import com.tencent.supersonic.headless.api.pojo.ActionInfo;
|
||||
import com.tencent.supersonic.headless.api.pojo.RuleInfo;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.QueryRuleType;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class QueryRuleReq extends SchemaItem {
|
||||
|
||||
/**
|
||||
* dataSetID
|
||||
*/
|
||||
private Long dataSetId;
|
||||
|
||||
/**
|
||||
* 规则的优先级, 1-低,2-中,3-高
|
||||
*/
|
||||
private Integer priority = 1;
|
||||
|
||||
/**
|
||||
* 规则类型
|
||||
*/
|
||||
@NotNull
|
||||
private QueryRuleType ruleType;
|
||||
|
||||
/**
|
||||
* 具体规则信息
|
||||
*/
|
||||
@NotNull
|
||||
private RuleInfo rule;
|
||||
|
||||
/**
|
||||
* 规则输出信息
|
||||
*/
|
||||
private ActionInfo action;
|
||||
|
||||
|
||||
/**
|
||||
* 扩展信息
|
||||
*/
|
||||
private Map<String, String> ext = new HashMap<>();
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.response;
|
||||
|
||||
import com.tencent.supersonic.headless.api.pojo.ActionInfo;
|
||||
import com.tencent.supersonic.headless.api.pojo.RuleInfo;
|
||||
import com.tencent.supersonic.headless.api.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.QueryRuleType;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
public class QueryRuleResp extends SchemaItem {
|
||||
|
||||
/**
|
||||
* dataSetID
|
||||
*/
|
||||
private Long dataSetId;
|
||||
|
||||
/**
|
||||
* 规则的优先级, 1-低,2-中,3-高
|
||||
*/
|
||||
private Integer priority = 1;
|
||||
|
||||
/**
|
||||
* 规则类型
|
||||
*/
|
||||
@NotNull
|
||||
private QueryRuleType ruleType;
|
||||
|
||||
/**
|
||||
* 具体规则信息
|
||||
*/
|
||||
@NotNull
|
||||
private RuleInfo rule;
|
||||
|
||||
/**
|
||||
* 规则输出信息
|
||||
*/
|
||||
private ActionInfo action;
|
||||
|
||||
|
||||
/**
|
||||
* 扩展信息
|
||||
*/
|
||||
private Map<String, String> ext;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user