mirror of
https://gitee.com/open-visual/face-search.git
synced 2025-07-25 19:41:42 +08:00
update:fix 由于接口创建导致属性信息为空的BUG
This commit is contained in:
parent
ef0fda8eb1
commit
1352ef80a0
@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import org.hibernate.validator.constraints.Length;
|
import org.hibernate.validator.constraints.Length;
|
||||||
|
|
||||||
import javax.validation.constraints.Min;
|
import javax.validation.constraints.Min;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
@ -33,10 +34,10 @@ public class CollectVo<ExtendsVo extends CollectVo<ExtendsVo>> extends BaseVo {
|
|||||||
private Integer shardsNum;
|
private Integer shardsNum;
|
||||||
/**自定义的样本字段**/
|
/**自定义的样本字段**/
|
||||||
@ApiModelProperty(value="自定义的样本属性字段", position = 5,required = false)
|
@ApiModelProperty(value="自定义的样本属性字段", position = 5,required = false)
|
||||||
private List<FiledColumn> sampleColumns;
|
private List<FiledColumn> sampleColumns = new ArrayList<>();
|
||||||
/**自定义的人脸字段**/
|
/**自定义的人脸字段**/
|
||||||
@ApiModelProperty(value="自定义的人脸属性字段", position = 6,required = false)
|
@ApiModelProperty(value="自定义的人脸属性字段", position = 6,required = false)
|
||||||
private List<FiledColumn> faceColumns;
|
private List<FiledColumn> faceColumns = new ArrayList<>();
|
||||||
/**启用binlog同步**/
|
/**启用binlog同步**/
|
||||||
@ApiModelProperty(value="启用binlog同步。扩展字段,暂不支持该功能。", position = 7,required = false)
|
@ApiModelProperty(value="启用binlog同步。扩展字段,暂不支持该功能。", position = 7,required = false)
|
||||||
private Boolean syncBinLog;
|
private Boolean syncBinLog;
|
||||||
@ -101,7 +102,9 @@ public class CollectVo<ExtendsVo extends CollectVo<ExtendsVo>> extends BaseVo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ExtendsVo setSampleColumns(List<FiledColumn> sampleColumns) {
|
public ExtendsVo setSampleColumns(List<FiledColumn> sampleColumns) {
|
||||||
|
if(null != sampleColumns){
|
||||||
this.sampleColumns = sampleColumns;
|
this.sampleColumns = sampleColumns;
|
||||||
|
}
|
||||||
return (ExtendsVo) this;
|
return (ExtendsVo) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +113,9 @@ public class CollectVo<ExtendsVo extends CollectVo<ExtendsVo>> extends BaseVo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public ExtendsVo setFaceColumns(List<FiledColumn> faceColumns) {
|
public ExtendsVo setFaceColumns(List<FiledColumn> faceColumns) {
|
||||||
|
if(null != faceColumns){
|
||||||
this.faceColumns = faceColumns;
|
this.faceColumns = faceColumns;
|
||||||
|
}
|
||||||
return (ExtendsVo) this;
|
return (ExtendsVo) this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,22 +18,25 @@ public class ValueUtil {
|
|||||||
public static List<FiledColumn> getFaceColumns(Collection collection){
|
public static List<FiledColumn> getFaceColumns(Collection collection){
|
||||||
if(null != collection.getSchemaInfo() && !collection.getSchemaInfo().isEmpty()) {
|
if(null != collection.getSchemaInfo() && !collection.getSchemaInfo().isEmpty()) {
|
||||||
CollectRepVo collectVo = JsonUtil.toEntity(collection.getSchemaInfo(), CollectRepVo.class);
|
CollectRepVo collectVo = JsonUtil.toEntity(collection.getSchemaInfo(), CollectRepVo.class);
|
||||||
|
if (null != collectVo && null != collectVo.getFaceColumns()) {
|
||||||
return collectVo.getFaceColumns();
|
return collectVo.getFaceColumns();
|
||||||
}else{
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
public static List<FiledColumn> getSampleColumns(Collection collection){
|
public static List<FiledColumn> getSampleColumns(Collection collection){
|
||||||
if(null != collection.getSchemaInfo() && !collection.getSchemaInfo().isEmpty()){
|
if(null != collection.getSchemaInfo() && !collection.getSchemaInfo().isEmpty()){
|
||||||
CollectRepVo collectVo = JsonUtil.toEntity(collection.getSchemaInfo(), CollectRepVo.class);
|
CollectRepVo collectVo = JsonUtil.toEntity(collection.getSchemaInfo(), CollectRepVo.class);
|
||||||
|
if (null != collectVo && null != collectVo.getSampleColumns()) {
|
||||||
return collectVo.getSampleColumns();
|
return collectVo.getSampleColumns();
|
||||||
}else{
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
public static FieldKeyValues getFieldKeyValues(Map<String, Object> map , List<FiledColumn> columns){
|
public static FieldKeyValues getFieldKeyValues(Map<String, Object> map , List<FiledColumn> columns){
|
||||||
|
columns = null != columns ? columns : new ArrayList<>();
|
||||||
Map<String, String> keyMap = new HashMap<>();
|
Map<String, String> keyMap = new HashMap<>();
|
||||||
for(FiledColumn column : columns){
|
for(FiledColumn column : columns){
|
||||||
for(String dataKey : map.keySet()){
|
for(String dataKey : map.keySet()){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user