48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using System.Collections.Generic;
|
|
using CommonDomain.BaseModel;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using MongoDB.Bson.Serialization.Options;
|
|
using MongoRepository;
|
|
using MongoRepository.Attributes;
|
|
using MongoRepository.Config;
|
|
|
|
namespace UserDomain.Entity
|
|
{
|
|
[BsonCollection("lottery_record", ServiceDatabases.User)]
|
|
public class LotteryRecord : MongoBaseEntity
|
|
{
|
|
public string ActivityCycleKey { get; set; } = string.Empty;
|
|
|
|
public string UserId { get; set; } = string.Empty;
|
|
|
|
public string PrizeId { get; set; } = string.Empty;
|
|
|
|
public string Level { get; set; } = string.Empty;
|
|
|
|
public long Cost { get; set; } = 0;
|
|
|
|
public long DrawTime { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
|
|
}
|
|
|
|
[BsonCollection("lottery_user_status", ServiceDatabases.User)]
|
|
public class LotteryUserStatus : MongoBaseEntity
|
|
{
|
|
public string ActivityCycleKey { get; set; } = string.Empty;
|
|
|
|
public long ActivityStartTime { get; set; }
|
|
|
|
public long ActivityEndTime { get; set; }
|
|
|
|
public string UserId { get; set; } = string.Empty;
|
|
|
|
public List<string> DrawnPrizeIds { get; set; } = new List<string>();
|
|
|
|
public int TotalDrawCount { get; set; } = 0;
|
|
|
|
[BsonDictionaryOptions(DictionaryRepresentation.ArrayOfDocuments)]
|
|
public Dictionary<int, int> DrawCountByPool { get; set; } = new Dictionary<int, int>();
|
|
|
|
public bool IsFinished { get; set; } = false;
|
|
}
|
|
}
|