|
@@ -6,6 +6,7 @@ import com.backendsys.modules.material.service.MaterialCategoryService;
|
|
import com.backendsys.utils.response.PageEntity;
|
|
import com.backendsys.utils.response.PageEntity;
|
|
import com.backendsys.utils.response.PageInfoResult;
|
|
import com.backendsys.utils.response.PageInfoResult;
|
|
import com.backendsys.utils.v2.PageUtils;
|
|
import com.backendsys.utils.v2.PageUtils;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -18,7 +19,7 @@ public class MaterialCategoryImpl implements MaterialCategoryService {
|
|
private MaterialCategoryDao materialCategoryDao;
|
|
private MaterialCategoryDao materialCategoryDao;
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 获取素材分类列表
|
|
|
|
|
|
+ * 获取素材分类列表 (全部/分页)
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public PageEntity selectMaterialCategoryList(MaterialCategory materialCategory) {
|
|
public PageEntity selectMaterialCategoryList(MaterialCategory materialCategory) {
|
|
@@ -28,11 +29,27 @@ public class MaterialCategoryImpl implements MaterialCategoryService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 获取素材分类列表 (下拉)
|
|
|
|
|
|
+ * 获取素材分类列表 (下拉)(将 { is_share } 的记录独立出来)
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public List<MaterialCategory> selectMaterialCategoryPopover(MaterialCategory materialCategory) {
|
|
public List<MaterialCategory> selectMaterialCategoryPopover(MaterialCategory materialCategory) {
|
|
- return materialCategoryDao.selectMaterialCategoryList(materialCategory);
|
|
|
|
|
|
+
|
|
|
|
+ // [DB] 查询非共享的素材分类 { is_share = -1 }
|
|
|
|
+ materialCategory.setIs_share(-1);
|
|
|
|
+ List<MaterialCategory> list = materialCategoryDao.selectMaterialCategoryList(materialCategory);
|
|
|
|
+ System.out.println("list = " + list);
|
|
|
|
+ System.out.println("-----------------");
|
|
|
|
+
|
|
|
|
+ // [DB] 查询共享的素材分类 { is_share = 1, lora_id = null }
|
|
|
|
+ materialCategory.setLora_id(null);
|
|
|
|
+ materialCategory.setIs_share(1);
|
|
|
|
+ List<MaterialCategory> list_of_share = materialCategoryDao.selectMaterialCategoryList(materialCategory);
|
|
|
|
+ System.out.println("list_of_share = " + list_of_share);
|
|
|
|
+
|
|
|
|
+ // 将共享分类追加到非共享分类后面
|
|
|
|
+ list.addAll(list_of_share);
|
|
|
|
+
|
|
|
|
+ return list;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|