package com.red.circle.other.infra.database.mongo.entity.game.rank;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;

/**
 * 游戏排行榜实体.
 *
 * @author system
 */
@Data
@Document(collection = "game_ranking")
@CompoundIndexes({
    @CompoundIndex(
        name = "idx_unique_game_ranking", 
        def = "{'sysOrigin': 1, 'gameOrigin': 1, 'gameId': 1, 'periodType': 1}", 
        unique = true
    ),
    @CompoundIndex(
        name = "idx_period_amount", 
        def = "{'periodType': 1, 'totalPrizeAmount': -1}"
    )
})
public class GameRanking {

    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * 归属系统
     */
    private String sysOrigin;

    /**
     * 游戏源
     */
    private String gameOrigin;

    /**
     * 游戏ID
     */
    private String gameId;

    /**
     * 游戏名称
     */
    private String gameName;

    /**
     * 游戏封面
     */
    private String gameCover;

    private String gameUrl;

    /**
     * 周期类型：ALL-全部，WEEK-本周，MONTH-本月
     */
    private String periodType;

    /**
     * 总中奖金额
     */
    private Long totalPrizeAmount;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;
}
