飘窗
This commit is contained in:
parent
00db43b01b
commit
7f2aa1d450
@ -7,6 +7,8 @@ const (
|
|||||||
TypeVehicle = "vehicle"
|
TypeVehicle = "vehicle"
|
||||||
TypeChatBubble = "chat_bubble"
|
TypeChatBubble = "chat_bubble"
|
||||||
TypeBadge = "badge"
|
TypeBadge = "badge"
|
||||||
|
// TypeFloatingScreen 是用户单选佩戴的飘窗皮肤;素材消费方读取装备快照,
|
||||||
|
// 商店和背包仍复用通用资源 SKU、entitlement 与 equipment 契约。
|
||||||
TypeFloatingScreen = "floating_screen"
|
TypeFloatingScreen = "floating_screen"
|
||||||
TypeGift = "gift"
|
TypeGift = "gift"
|
||||||
// TypeGiftTraySkin 复用 VIP 权益的稳定编码;目录素材与 gift 礼物本体分开,
|
// TypeGiftTraySkin 复用 VIP 权益的稳定编码;目录素材与 gift 礼物本体分开,
|
||||||
|
|||||||
@ -106,7 +106,8 @@ type ResourceShopPurchaseReceipt struct {
|
|||||||
|
|
||||||
func ResourceTypeSellableInShop(value string) bool {
|
func ResourceTypeSellableInShop(value string) bool {
|
||||||
switch NormalizeResourceType(value) {
|
switch NormalizeResourceType(value) {
|
||||||
case TypeAvatarFrame, TypeProfileCard, TypeVehicle, TypeChatBubble, TypeBadge, TypeMicSeatIcon, TypeMicSeatAnimation:
|
// 飘窗是有期限的用户装扮,购买后下发 entitlement;不能按 gift 等消耗品处理。
|
||||||
|
case TypeAvatarFrame, TypeProfileCard, TypeVehicle, TypeChatBubble, TypeBadge, TypeFloatingScreen, TypeMicSeatIcon, TypeMicSeatAnimation:
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
|||||||
@ -1021,7 +1021,9 @@ func (r *Repository) pruneExpiredUserResourceEquipment(ctx context.Context, user
|
|||||||
|
|
||||||
func isEquipableResourceType(resourceType string) bool {
|
func isEquipableResourceType(resourceType string) bool {
|
||||||
switch resourcedomain.NormalizeResourceType(resourceType) {
|
switch resourcedomain.NormalizeResourceType(resourceType) {
|
||||||
case resourcedomain.TypeAvatarFrame, resourcedomain.TypeProfileCard, resourcedomain.TypeVehicle, resourcedomain.TypeChatBubble, resourcedomain.TypeBadge, resourcedomain.TypeMicSeatAnimation, resourcedomain.TypeVIPTrialCard:
|
// 飘窗与头像框等用户装扮保持同一资源类型单选槽,切换时事务会替换同类型旧装备;
|
||||||
|
// badge 的多选和 VIP 体验卡的专用状态机仍由各自分支处理。
|
||||||
|
case resourcedomain.TypeAvatarFrame, resourcedomain.TypeProfileCard, resourcedomain.TypeVehicle, resourcedomain.TypeChatBubble, resourcedomain.TypeBadge, resourcedomain.TypeFloatingScreen, resourcedomain.TypeMicSeatAnimation, resourcedomain.TypeVIPTrialCard:
|
||||||
return true
|
return true
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
|||||||
@ -743,7 +743,9 @@ func resourceShopPurchaseOrderSelectSQL() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func resourceShopItemsWhereSQL(query resourcedomain.ListResourceShopItemsQuery) (string, []any) {
|
func resourceShopItemsWhereSQL(query resourcedomain.ListResourceShopItemsQuery) (string, []any) {
|
||||||
where := `WHERE si.app_code = ? AND r.resource_type IN ('avatar_frame', 'profile_card', 'vehicle', 'chat_bubble', 'badge', 'mic_seat_icon', 'mic_seat_animation')`
|
// 固定类型白名单只增加一个等值分支,仍由 resource_shop_items 的 App/SKU 索引驱动并按
|
||||||
|
// (app_code, resource_id) 关联 resources,不引入全表扫描或额外查询。
|
||||||
|
where := `WHERE si.app_code = ? AND r.resource_type IN ('avatar_frame', 'profile_card', 'vehicle', 'chat_bubble', 'badge', 'floating_screen', 'mic_seat_icon', 'mic_seat_animation')`
|
||||||
args := []any{query.AppCode}
|
args := []any{query.AppCode}
|
||||||
if query.ActiveOnly {
|
if query.ActiveOnly {
|
||||||
nowMs := time.Now().UnixMilli()
|
nowMs := time.Now().UnixMilli()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user