|
@@ -150,16 +150,15 @@ func UpdateImage(c *gin.Context, apictx *ApiSession) (interface{}, error) {
|
|
|
if searchMat.RawImage.Url != matImage.RawImage.Url {
|
|
|
// 先删除
|
|
|
// 这里原本可能没有图片特征
|
|
|
- _, err := RomoveFassiImage(matImage.Id.Hex())
|
|
|
- if err != nil {
|
|
|
- log.Error("更新时删除fassi image 错误:", err)
|
|
|
- }
|
|
|
+ RomoveFassiImage(matImage.Id.Hex())
|
|
|
+
|
|
|
// 再新增
|
|
|
err = AddFassiImage(matImage.Id, matImage.RawImage.Url)
|
|
|
if err != nil {
|
|
|
log.Error("更新时添加fassi image 错误:", err)
|
|
|
return nil, errors.New("更新图片搜索特征错误,请重试!")
|
|
|
}
|
|
|
+ fmt.Println("更新fassi image ", matImage.Id.Hex())
|
|
|
}
|
|
|
|
|
|
return repo.RepoUpdateSetDoc(apictx.CreateRepoCtx(), repo.CollectionMatImages, matImage.Id.Hex(), &matImage)
|