mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-12 20:51:48 +00:00
(improvement)(headless) add sql variable for model sql (#740)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -27,6 +27,8 @@ public class ModelDetail {
|
||||
|
||||
private List<Field> fields = Lists.newArrayList();
|
||||
|
||||
private List<SqlVariable> sqlVariables = Lists.newArrayList();
|
||||
|
||||
public String getSqlQuery() {
|
||||
if (StringUtils.isNotBlank(sqlQuery) && sqlQuery.endsWith(";")) {
|
||||
sqlQuery = sqlQuery.substring(0, sqlQuery.length() - 1);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.tencent.supersonic.headless.api.pojo;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.headless.api.pojo.enums.VariableValueType;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SqlVariable {
|
||||
private String name;
|
||||
private VariableValueType valueType;
|
||||
private List<Object> defaultValues = Lists.newArrayList();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.tencent.supersonic.headless.api.pojo.enums;
|
||||
|
||||
public enum VariableValueType {
|
||||
STRING,
|
||||
NUMBER,
|
||||
EXPR
|
||||
}
|
||||
Reference in New Issue
Block a user