feat: 添加搜索收藏微服务
This commit is contained in:
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user