fix: 修复搜索结果中没有key的问题

This commit is contained in:
Kerwin
2025-11-21 14:04:40 +08:00
parent 8e35a6e507
commit 1af7fbd355

View File

@@ -96,7 +96,7 @@ func ToResourceResponseFromMeilisearch(doc interface{}) dto.ResourceResponse {
response.FileSize = fileSizeField.String()
}
if keyField := docValue.FieldByName("Key"); keyField.IsValid() {
// Key字段在ResourceResponse中不存在跳过
response.Key = keyField.String()
}
if categoryField := docValue.FieldByName("Category"); categoryField.IsValid() {
response.CategoryName = categoryField.String()