feat: 集成Eino文档解析与嵌入功能

新增Eino相关依赖,支持docx、pdf、xlsx等格式的文档加载与解析,并集成了Dashscope嵌入模型。同时修复了部分DAO查询中的OmitEmpty配置。
This commit is contained in:
2026-03-28 18:24:16 +08:00
parent a23db30957
commit 21ec536c57
7 changed files with 12 additions and 10 deletions

View File

@@ -79,7 +79,7 @@ func (d *assetDao) List(ctx context.Context, req *dto.ListAssetReq, fields ...st
// buildListFilter 构建列表查询的过滤条件
func (d *assetDao) buildListFilter(ctx context.Context, req *dto.ListAssetReq) *gdb.Model {
model := gfdb.DB(ctx).Model(ctx, public.TableNameAsset).Cache(ctx)
model := gfdb.DB(ctx).Model(ctx, public.TableNameAsset).Cache(ctx).OmitEmpty()
if !g.IsEmpty(req.Keyword) {
model.WhereLike(entity.AssetCol.Name, "%"+req.Keyword+"%")
}

View File

@@ -60,7 +60,7 @@ func (d *assetSku) GetOne(ctx context.Context, req *dto.GetAssetSkuReq, fields .
// GetListByAssetIdExcludeCurrentSku 根据资产ID获取SKU列表并且排除当前SKU
func (d *assetSku) GetListByAssetIdExcludeCurrentSku(ctx context.Context, assetId int64, req *dto.ListAssetSkuReq, fields ...string) (res []entity.AssetSku, total int, err error) {
model := gfdb.DB(ctx).Model(ctx, public.TableNameAssetSku).Fields(fields)
model := gfdb.DB(ctx).Model(ctx, public.TableNameAssetSku).Fields(fields).OmitEmpty()
model.Where(entity.AssetSkuCol.AssetId, assetId)
model.WhereNot(entity.AssetSkuCol.Id, req.Id)
if req.Page != nil {
@@ -92,7 +92,7 @@ func (d *assetSku) List(ctx context.Context, req *dto.ListAssetSkuReq, fields ..
// buildListFilter 构建列表查询的过滤条件
func (d *assetSku) buildListFilter(ctx context.Context, req *dto.ListAssetSkuReq) *gdb.Model {
model := gfdb.DB(ctx).Model(ctx, public.TableNameAssetSku).Cache(ctx)
model := gfdb.DB(ctx).Model(ctx, public.TableNameAssetSku).Cache(ctx).OmitEmpty()
if !g.IsEmpty(req.Keyword) {
model.WhereLike(entity.AssetCol.Name, "%"+req.Keyword+"%")
model.WhereOrLike(entity.AssetSkuCol.SkuName, "%"+req.Keyword+"%")

View File

@@ -81,7 +81,7 @@ func (d *category) List(ctx context.Context, req *dto.ListCategoryReq, fields ..
// buildListFilter 构建列表查询的过滤条件
func (d *category) buildListFilter(ctx context.Context, req *dto.ListCategoryReq) *gdb.Model {
model := gfdb.DB(ctx).Model(ctx, public.TableNameCategory).Cache(ctx)
model := gfdb.DB(ctx).Model(ctx, public.TableNameCategory).Cache(ctx).OmitEmpty()
if !g.IsEmpty(req.Keyword) {
model.WhereLike(entity.CategoryCol.Name, "%"+req.Keyword+"%")
}