174 lines
6.2 KiB
C#
174 lines
6.2 KiB
C#
using System.Collections.Generic;
|
|
using Common.Utils;
|
|
using CommonDomain.BaseModel;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
using MongoRepository;
|
|
using MongoRepository.Attributes;
|
|
|
|
namespace CommonDomain
|
|
{
|
|
[BsonCollection("activity_config", "data_0524")]
|
|
[BsonIgnoreExtraElements]
|
|
public class ActivityConfig : MongoBaseEntity
|
|
{
|
|
public BattleOrderConfig BattleOrderConfig { get; set; } = new BattleOrderConfig();
|
|
|
|
public ReliefConfig ReliefConfig { get; set; } = new ReliefConfig();
|
|
|
|
public SignActivityConfig SignActivityConfig { get; set; } = new SignActivityConfig();
|
|
|
|
public List<GoldShopConfig> GoldShopConfigs { get; set; } = new List<GoldShopConfig>();
|
|
|
|
public List<DiamondShopConfig> DiamondShopConfigs { get; set; } = new List<DiamondShopConfig>();
|
|
|
|
public RegisterConfig RegisterConfig { get; set; } = new RegisterConfig();
|
|
|
|
public FishingReturnConfig FishingReturnConfig { get; set; } = new FishingReturnConfig();
|
|
|
|
|
|
public LotteryActivityConfig LotteryActivityConfig { get; set; } = new LotteryActivityConfig();
|
|
|
|
public RankingRewardConfig RankingRewardConfig { get; set; } = new RankingRewardConfig();
|
|
|
|
public bool AutoStopExpired(long now)
|
|
{
|
|
var lottery = LotteryActivityConfig;
|
|
if (lottery != null && lottery.IsOpen && lottery.EndTime > 0 && now >= lottery.EndTime)
|
|
{
|
|
lottery.IsOpen = false;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
public class SignActivityConfig
|
|
{
|
|
public bool IsOpen { get; set; } = true;
|
|
|
|
/// <summary>勾选=不可中断(漏签不回退,按累计次数循环);未勾选=可中断(漏签重置回第1天)</summary>
|
|
public bool CannotInterrupt { get; set; } = false;
|
|
|
|
public List<SignConfig> Days { get; set; } = new List<SignConfig>();
|
|
}
|
|
|
|
public class RankingRewardConfig
|
|
{
|
|
public bool IsEnabled { get; set; }
|
|
public bool IsMaintaining { get; set; }
|
|
public string MaintainingMessage { get; set; } = "当前排行榜正在维护中,请稍后再试";
|
|
public List<RankingRewardGroup> Groups { get; set; } = new();
|
|
}
|
|
|
|
public class RankingRewardGroup
|
|
{
|
|
public int RankingType { get; set; }
|
|
public string Name { get; set; } = "";
|
|
public List<RankingRewardItem> Rewards { get; set; } = new();
|
|
}
|
|
|
|
public class RankingRewardItem
|
|
{
|
|
public int RankMin { get; set; }
|
|
public int RankMax { get; set; }
|
|
public long Gold { get; set; }
|
|
public int Diamond { get; set; }
|
|
public List<GiftConfig> Items { get; set; } = new();
|
|
}
|
|
}
|
|
|
|
namespace CommonDomain.BaseModel
|
|
{
|
|
[BsonIgnoreExtraElements]
|
|
public class SignConfig
|
|
{
|
|
public int Day { get; set; } = 1;
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Icon { get; set; } = string.Empty;
|
|
public List<GiftConfig> GiftList { get; set; } = new List<GiftConfig>();
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
public class ReliefConfig
|
|
{
|
|
public bool IsOpen { get; set; } = true;
|
|
public long Gold { get; set; } = 10000;
|
|
public int Count { get; set; } = 3;
|
|
public int Limit { get; set; } = 10000;
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
public class GoldShopConfig
|
|
{
|
|
public string Number { get; set; } = string.Empty;
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Icon { get; set; } = string.Empty;
|
|
public long Gold { get; set; } = 0;
|
|
public int Diamond { get; set; } = 0;
|
|
public int DealerDiamond { get; set; } = 0;
|
|
public bool IsFirst { get; set; } = false;
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
public class DiamondShopConfig
|
|
{
|
|
public string Number { get; set; } = string.Empty;
|
|
public string Name { get; set; } = string.Empty;
|
|
public string Icon { get; set; } = string.Empty;
|
|
public int Diamond { get; set; } = 0;
|
|
public double Money { get; set; } = 0;
|
|
public double DealerMoney { get; set; } = 0;
|
|
public bool IsFirst { get; set; } = false;
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
public class RegisterConfig
|
|
{
|
|
public int InitGold { get; set; } = 10000;
|
|
public int InitDiamond { get; set; } = 100;
|
|
public List<BaseProductCount> InitProductList { get; set; } = new List<BaseProductCount>();
|
|
}
|
|
|
|
[BsonIgnoreExtraElements]
|
|
public class BattleOrderConfig
|
|
{
|
|
public bool IsOpen { get; set; } = true;
|
|
public long EndTime { get; set; } = DateTime.Now.Date.AddDays(30).ToTimeStamp();
|
|
public string RuleDesc { get; set; } = string.Empty;
|
|
public string BuyDesc { get; set; } = string.Empty;
|
|
public string AdvanceGiftDesc { get; set; } = string.Empty;
|
|
public List<BattleOrderLevelConfig> LevelConfig { get; set; } = new List<BattleOrderLevelConfig>();
|
|
public List<AdvanceGiftConfig> AdvanceGift { get; set; } = new List<AdvanceGiftConfig>();
|
|
|
|
public class AdvanceGiftConfig
|
|
{
|
|
public int Type { get; set; } = 0;
|
|
public string Name { get; set; } = string.Empty;
|
|
public int Count { get; set; } = 100;
|
|
public string ImageUrl { get; set; } = string.Empty;
|
|
public int PayType { get; set; } = 0;
|
|
public int PayCount { get; set; } = 0;
|
|
public List<GiftConfig> GiftList { get; set; } = new List<GiftConfig>();
|
|
}
|
|
|
|
public class BattleOrderLevelConfig
|
|
{
|
|
public int Level { get; set; } = 0;
|
|
public long Exp { get; set; } = 0;
|
|
public List<GiftConfig> NormalGiftList { get; set; } = new List<GiftConfig>();
|
|
public List<GiftConfig> LuxuryGiftList { get; set; } = new List<GiftConfig>();
|
|
public List<GiftConfig> SupremeGiftList { get; set; } = new List<GiftConfig>();
|
|
public int PayType { get; set; } = 0;
|
|
public int PayCount { get; set; } = 0;
|
|
}
|
|
}
|
|
|
|
public class FishingReturnConfig
|
|
{
|
|
public bool IsEnabled { get; set; } = false;
|
|
public double ReturnRate { get; set; } = 0.001;
|
|
public long DailyMaxReturn { get; set; } = 0;
|
|
}
|
|
}
|