mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-10 19:51:00 +00:00
(fix)(semantic) Modify data type of s2_collect in schema-mysql.sql and fixed startup problem when database data is empty (#442)
Co-authored-by: jolunoluo
This commit is contained in:
@@ -474,7 +474,7 @@ CREATE TABLE `s2_collect` (
|
||||
`type` varchar(20) NOT NULL,
|
||||
`username` varchar(20) NOT NULL,
|
||||
`collect_id` bigint NOT NULL,
|
||||
`create_time` TIMESTAMP,
|
||||
`update_time` TIMESTAMP,
|
||||
`create_time` datetime,
|
||||
`update_time` datetime,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
@@ -3,6 +3,7 @@ package com.tencent.supersonic.semantic.model.application;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.common.pojo.JoinCondition;
|
||||
import com.tencent.supersonic.common.pojo.ModelRela;
|
||||
@@ -45,9 +46,10 @@ public class ModelRelaServiceImpl
|
||||
public List<ModelRela> getModelRela(List<Long> modelIds) {
|
||||
QueryWrapper<ModelRelaDO> wrapper = new QueryWrapper<>();
|
||||
if (CollectionUtils.isEmpty(modelIds)) {
|
||||
wrapper.lambda().in(ModelRelaDO::getFromModelId, modelIds).or()
|
||||
.in(ModelRelaDO::getToModelId, modelIds);
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
wrapper.lambda().in(ModelRelaDO::getFromModelId, modelIds).or()
|
||||
.in(ModelRelaDO::getToModelId, modelIds);
|
||||
return list(wrapper).stream().map(this::convert).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user