feat: 添加搜索收藏微服务

This commit is contained in:
zetaloop
2026-04-24 13:24:58 +08:00
parent 91fdd2a498
commit 53d0e791b4
58 changed files with 6239 additions and 57 deletions
+20
View File
@@ -0,0 +1,20 @@
package logic
import (
"juwan-backend/app/search/rpc/internal/models"
"juwan-backend/app/search/rpc/pb"
)
func entFavoriteToPb(f *models.Favorites) *pb.Favorites {
return &pb.Favorites{
Id: f.ID,
UserId: f.UserID,
TargetType: f.TargetType,
TargetId: f.TargetID,
CreatedAt: f.CreatedAt.Unix(),
}
}
func validTargetType(targetType string) bool {
return targetType == "player" || targetType == "shop"
}