添加项目文件。

This commit is contained in:
2026-10-12 16:22:04 +08:00
parent 7c68a0ca0a
commit aad11be43d
1000 changed files with 120807 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common.Utils;
using CommonDomain.Enum;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
namespace UserDomain.Entity
{
[BsonCollection("kill_fish_log{yyyyMMdd}", ServiceDatabases.Fish)]
[BsonIgnoreExtraElements]
public class KillFishLog : MongoBaseEntity
{
public string UserId { get; set; }
public GameTypeEnum GameType { get; set; } = GameTypeEnum.风雷之渊;
public int RoomLevel { get; set; } = 0;
public int RoomPartition { get; set; } = 0;
public int RoomNumber { get; set; } = 0;
public string FishNumber { get; set; }
public int Cost { get; set; }
public double Income { get; set; }
public double Factor { get; set; }
public long CreateTime { get; set; } = DateTime.Now.ToTimeStamp();
}
}
@@ -0,0 +1,47 @@
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;
}
}
+27
View File
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
namespace UserDomain.Entity
{
[BsonCollection("notice", ServiceDatabases.User)]
[BsonIgnoreExtraElements]
public class Notice : MongoBaseEntity
{
public string Title { get; set; }
public string Content { get; set; }
public string Recommend { get; set; }
public string TopImage { get; set; }
public List<string> ContentImages { get; set; }
public long CreateTime { get; set; }
}
}
+38
View File
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
namespace UserDomain.Entity
{
[BsonCollection("order", ServiceDatabases.User)]
[BsonIgnoreExtraElements]
public class Order : MongoBaseEntity
{
public string UserId { get; set; } = "";
public int Type { get; set; }
public string ProductId { get; set; } = "";
public string ProductName { get; set; } = "";
public double Price { get; set; }
public int State { get; set; } = 1;
public long PayTime { get; set; } = 0;
}
}
@@ -0,0 +1,25 @@
using CommonDomain.BaseModel;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
namespace UserDomain.Entity
{
[BsonCollection("scratch_card_record", ServiceDatabases.User)]
[BsonIgnoreExtraElements]
public class ScratchCardRecord : MongoBaseEntity
{
public string UserId { get; set; } = string.Empty;
public int PrizeType { get; set; }
public string PrizeName { get; set; } = string.Empty;
public int Count { get; set; }
public BaseProduct? BaseProduct { get; set; }
public long DrawTime { get; set; } = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
}
}
@@ -0,0 +1,30 @@
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
namespace UserDomain.Entity
{
[BsonCollection("user_battle_order", ServiceDatabases.User)]
[BsonIgnoreExtraElements]
public class UserBattleOrder : MongoBaseEntity
{
public string UserId { get; set; }
public int Level { get; set; } = 1;
public long Exp { get; set; } = 0;
public List<int> PurchasedAdvances { get; set; } = new List<int>();
public List<int> NormalReceivedLevels { get; set; } = new List<int>();
public List<int> LuxuryReceivedLevels { get; set; } = new List<int>();
public List<int> SupremeReceivedLevels { get; set; } = new List<int>();
public long StartTime { get; set; }
public long EndTime { get; set; }
}
}
+31
View File
@@ -0,0 +1,31 @@
using System.ComponentModel.DataAnnotations.Schema;
using Common.Utils;
using CommonDomain.BaseModel;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
namespace UserDomain.Entity
{
[BsonCollection("user_email", ServiceDatabases.User)]
[BsonIgnoreExtraElements]
public class UserEmail : MongoBaseEntity
{
public string UserId { get; set; }
public string Title { get; set; }
public string Content { get; set; }
public long SendTime { get; set; }=DateTime.Now.ToTimeStamp();
public long ReadTime { get; set; }=0;
public bool IsRead { get; set; }=false;
public bool IsReward { get; set; }=false;
public int RewardDiamond { get; set; }=0;
public long RewardGold { get; set; }=0;
[Column(TypeName = "jsonb")]
public List<BaseProductCount> RewardItems { get; set; } = new List<BaseProductCount>();
public long ExpireTime { get; set; } = 0;
}
}
+362
View File
@@ -0,0 +1,362 @@
using System.ComponentModel.DataAnnotations.Schema;
using Common.Utils;
using CommonDomain;
using CommonDomain.BaseModel;
using CommonDomain.Enum;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
using XAct;
namespace UserDomain.Entity
{
[BsonCollection("user", ServiceDatabases.User)]
[BsonIgnoreExtraElements]
public class UserEntity : MongoBaseEntity
{
[Column(TypeName = "jsonb")]
public UserBaseInfo BaseInfo= new UserBaseInfo();
[Column(TypeName = "jsonb")]
public RealNameInfo RealName { get; set; }
[Column(TypeName = "jsonb")]
public SafeBoxInfo SafeBox { get; set; } = new SafeBoxInfo();
public SignInfo Sign { get; set; }
public List<BaseUserProp> CannonList { get; set; }=new List<BaseUserProp>();
public BaseUserProp CannonUsing { get; set; }
public BaseUserProp WingUsing { get; set; }
public List<BaseUserProp> WingList { get; set; } = new List<BaseUserProp>();
public BaseUserProp GodWarUsing { get; set; }
public List<BaseUserProp> GodWarList { get; set; } = new List<BaseUserProp>();
[Column(TypeName = "jsonb")]
public List<BaseProductCount> Props { get; set; } = new List<BaseProductCount>();
[Column(TypeName = "jsonb")]
public Assets Assets { get; set; } = new Assets();
public long CreateTime { get; set; } = 0;
public string RegisterIp { get; set; } = "";
[Column(TypeName = "jsonb")]
public BanInfo BanInfo { get; set; }
[Column(TypeName = "jsonb")]
public StaticInfo Static { get; set; } = new StaticInfo();
[Column(TypeName = "jsonb")]
public PlayerFactor PlayerFactor { get; set; } = new PlayerFactor();
public int UserType { get; set; } = 1;
public FishingReturnInfo FishingReturn { get; set; } = new FishingReturnInfo();
public void Init(GameConfig gameConfig, ActivityConfig activityConfig)
{
CreateTime = DateTime.Now.ToTimeStamp();
CreateInfo = new OptionUserInfo(BaseInfo.Number, BaseInfo.UserName);
Static.ReliefGoldCount = activityConfig?.ReliefConfig.Count ?? 3;
Sign = new SignInfo();
Assets.Gold = activityConfig?.RegisterConfig.InitGold ?? 0;
Assets.Diamond = activityConfig?.RegisterConfig.InitDiamond ?? 0;
BaseInfo.AvatarUrl = "UI_touxiang_01_11 ";
BaseInfo.AvatarFrame = "五一专属头像框";
PlayerFactor = new PlayerFactor()
{
IsBlack = false,
CompensateQuota=0,
PenaltyQuota=0,
AdditionalFactor=1,
StartingBonus = activityConfig?.RegisterConfig.InitGold ?? 0,
ViolateValue = 1,
CompensateRate = gameConfig.KillConfig.CompensateRate,
PenaltyRate = gameConfig.KillConfig.PenaltyRate,
};
if (activityConfig?.RegisterConfig.InitProductList!=null && activityConfig.RegisterConfig.InitProductList.Count > 0)
{
foreach (var product in activityConfig.RegisterConfig.InitProductList.Where(c=> ProductType.MoreProductTypeList.Contains(c.Type)))
{
Props.Add(product);
}
foreach (var item in activityConfig.RegisterConfig.InitProductList.Where(c => !ProductType.MoreProductTypeList.Contains(c.Type)))
{
var propConfig = gameConfig.PropConfig.FirstOrDefault(c => c.Number == item.Number);
BaseUserProp baseUserProp = null;
if (propConfig != null)
{
baseUserProp = new BaseUserProp
{
Number = item.Number,
Type = item.Type,
Name = item.Name,
ImageUrl = item.ImageUrl,
Desc = item.Desc,
Level = item.Level
};
if (propConfig.Day > 0)
{
baseUserProp.IsTrial = true;
baseUserProp.TrialEndTime = DateTime.Now.AddDays(propConfig.Day).ToTimeStamp();
}
}
if (item.Type== ProductTypeEnum.战神 && baseUserProp != null)
{
GodWarList.Add(baseUserProp);
}
else if (item.Type == ProductTypeEnum.翅膀 && baseUserProp != null)
{
WingList.Add(baseUserProp);
}
else if (item.Type == ProductTypeEnum.炮台 && baseUserProp != null)
{
CannonList.Add(baseUserProp);
if (CannonUsing == null)
CannonUsing = baseUserProp;
}
}
}
}
public List<int> VipLevelVerify(GameConfig config)
{
if (config?.VipLevelConfigs == null)
return null;
var vipExp = Math.Max(0D, Static.TotalRecharge * 10) + Math.Max(0L, Assets.VipExpExtra);
Assets.VipExp = (long)vipExp;
var level = config.VipLevelConfigs.FirstOrDefault(c => vipExp >= c.ExpMin && vipExp < c.ExpMax);
if (level == null)
return null;
var oldLevel = Assets.VipLevel;
if (level.Level != oldLevel)
{
if (level.Level > oldLevel)
{
Assets.VipLevel = level.Level;
Assets.VipSignInAdd = level.SignInAdd;
var newLevels = config.VipLevelConfigs
.Where(c => c.Level > oldLevel && c.Level <= level.Level)
.Select(c => c.Level)
.ToList();
foreach (var lvl in newLevels)
{
if (!Assets.VipGift.Contains(lvl))
Assets.VipGift.Add(lvl);
}
return newLevels;
}
else
{
Assets.VipLevel = level.Level;
Assets.VipSignInAdd = level.SignInAdd;
}
}
return null;
}
public (bool isLevel, long gold, int diamond, List<BaseProductCount> list) LevelVerify(long addExp, List<UserLevelConfig> levelConfig)
{
Assets.Exp += addExp;
var config = levelConfig.FirstOrDefault(c => Assets.Exp >= c.ExpMin && Assets.Exp < c.ExpMax);
if (config == null)
return (false, 0, 0, null);
if (config.Level != Assets.Level)
{
Assets.Level = config.Level;
return (true, config.Gold, config.Diamond, config.ProductList);
}
return (false, 0, 0, null);
}
}
[BsonIgnoreExtraElements]
public class SignInfo
{
public bool IsSign { get; set; } = false;
public long SignTime { get; set; } = 0;
}
[BsonIgnoreExtraElements]
public class PlayerFactor
{
public bool IsIgnore { get; set; } = false;
public bool IsBlack { get; set; } = false;
public double ViolateValue { get; set; } = 1;
public CompensateRateParam CompensateRate { get; set; } = new CompensateRateParam();
public CompensateRateParam PenaltyRate { get; set; } = new CompensateRateParam();
public int CompensateQuota { get; set; } = 0;
public long CompensateStartGold { get; set; } = 0;
public long CompensateTargetGold { get; set; } = 0;
public int PenaltyQuota { get; set; } = 0;
public long StartingBonus { get; set; } = 0;
public double MissRate { get; set; } = 0;
public double AdditionalFactor { get; set; } = 1;
}
[BsonIgnoreExtraElements]
public class StaticInfo
{
public long LastLoginTime { get; set; } = 0;
public string LastLoginIp { get; set; } = "";
public long OnlineTime { get; set; } = 0;
public long GameTime { get; set; } = 0;
public string RoomNumber { get; set; } = "";
public int CurrentGameType { get; set; } = 0;
public double TotalRecharge { get; set; } = 0;
public long TotalRechargeGold { get; set; } = 0;
public long TotalConsumeGold { get; set; } = 0;
public int TotalConsumeDiamond { get; set; } = 0;
public int ReliefGoldCount {get; set; } = 0;
}
[BsonIgnoreExtraElements]
public class BanInfo
{
public bool IsBan { get; set; } = false;
public long BanTime { get; set; } = 0;
public string BanReason { get; set; } = "";
public int BanDays { get; set; } = 0;
public long BanEndTime { get; set; } = 0;
}
[BsonIgnoreExtraElements]
public class UserBaseInfo
{
public string UserName { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
public string Number { get; set; } = string.Empty;
public string AvatarUrl { get; set; } = string.Empty;
public string AvatarFrame { get; set; } = string.Empty;
public string Mobile { get; set; } = string.Empty;
public string WXOpenId { get; set; } = string.Empty;
public string Channel { get; set; } = string.Empty;
public bool IsRedName { get; set; } = false;
}
[BsonIgnoreExtraElements]
public class Assets
{
public bool IsDealer { get; set; } = false;
public double ViolateRate { get; set; } = 1;
public int Diamond { get; set; } = 0;
public long Gold { get; set; } = 0;
public int Level { get; set; } = 0;
public long Exp { get; set; } = 0;
public long VipExp { get; set; } = 0;
public long VipExpExtra { get; set; } = 0;
public double VipSignInAdd { get; set; } = 0;
public int VipLevel { get; set; } = 0;
public List<int> VipGift { get; set; } = new List<int>();
public bool IsVipDayGift { get; set; } = false;
}
[BsonIgnoreExtraElements]
public class RealNameInfo
{
public string RealName { get; set; } = string.Empty;
public string IDCard { get; set; } = string.Empty;
}
[BsonIgnoreExtraElements]
public class SafeBoxInfo
{
public long Amount { get; set; } = 0;
public string Password { get; set; } = "";
public long SaveTime { get; set; } = 0;
}
[BsonIgnoreExtraElements]
public class BaseUserProp : BaseProduct
{
public bool IsTrial { get; set; } = false;
public long TrialEndTime { get; set; } = 0;
}
[BsonIgnoreExtraElements]
public class FishingReturnInfo
{
public long TodayConsume { get; set; } = 0;
public long YesterdayConsume { get; set; } = 0;
public bool IsClaimed { get; set; } = false;
public string LastFishingDate { get; set; } = "";
[BsonIgnore]
public long CanClaimGold { get; set; } = 0;
}
}
+60
View File
@@ -0,0 +1,60 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
namespace UserDomain.Entity
{
[BsonCollection("user_feedback", ServiceDatabases.User)]
[BsonIgnoreExtraElements]
public class UserFeedback : MongoBaseEntity
{
[BsonElement("userid")]
public string? UserId { get; set; }
[BsonElement("usernumber")]
public string? UserNumber { get; set; }
[BsonElement("username")]
public string? UserName { get; set; }
[BsonElement("type")]
public int Type { get; set; } = 1;
[BsonElement("title")]
public string? Title { get; set; }
[BsonElement("content")]
public string? Content { get; set; }
[BsonElement("images")]
public string? Images { get; set; }
[BsonElement("qq")]
public string? QQ { get; set; }
[BsonElement("contact")]
public string? Contact { get; set; }
[BsonElement("status")]
public int Status { get; set; } = 0;
[BsonElement("reply")]
public string? Reply { get; set; }
[BsonElement("replytime")]
[BsonDateTimeOptions(Kind = DateTimeKind.Local, DateOnly = false)]
public DateTime? ReplyTime { get; set; }
[BsonElement("replyadminid")]
public string? ReplyAdminId { get; set; }
[BsonElement("replyadminname")]
public string? ReplyAdminName { get; set; }
[BsonElement("submittime")]
[BsonDateTimeOptions(Kind = DateTimeKind.Local, DateOnly = false)]
public DateTime SubmitTime { get; set; } = DateTime.Now;
}
}
+53
View File
@@ -0,0 +1,53 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
namespace UserDomain.Entity
{
[BsonCollection("user_login_log", ServiceDatabases.User)]
[BsonIgnoreExtraElements]
public class UserLoginLog : MongoBaseEntity
{
[BsonElement("userid")]
public string? UserId { get; set; }
[BsonElement("usernumber")]
public string? UserNumber { get; set; }
[BsonElement("username")]
public string? UserName { get; set; }
[BsonElement("logintype")]
public int LoginType { get; set; } = 1;
[BsonElement("status")]
public int Status { get; set; } = 1;
[BsonElement("ip")]
public string? Ip { get; set; }
[BsonElement("iplocation")]
public string? IpLocation { get; set; }
[BsonElement("devicetype")]
public string? DeviceType { get; set; }
[BsonElement("deviceid")]
public string? DeviceId { get; set; }
[BsonElement("platform")]
public int Platform { get; set; } = 1;
[BsonElement("clientversion")]
public string? ClientVersion { get; set; }
[BsonElement("failreason")]
public string? FailReason { get; set; }
[BsonElement("logintime")]
[BsonDateTimeOptions(Kind = DateTimeKind.Local, DateOnly = false)]
public DateTime LoginTime { get; set; } = DateTime.Now;
}
}
+43
View File
@@ -0,0 +1,43 @@
using Common.Utils;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
using UserDomain.Enum;
namespace UserDomain.Entity
{
[BsonCollection("user_reward", ServiceDatabases.User)]
[BsonIgnoreExtraElements]
public class UserReward : MongoBaseEntity
{
public string UserId { get; set; }
public int Type { get; set; }
public RewardSource Source { get; set; }
public int CurrencyType { get; set; }
public long BeforeCount { get; set; }
public long ChangeCount { get; set; }
public long AfterCount { get; set; }
public string OtherId { get; set; }=string.Empty;
public string OtherUserId { get; set; } = string.Empty;
public string Remark { get; set; } = string.Empty;
public string RoomName { get; set; } = string.Empty;
public string RoomInfo { get; set; } = string.Empty;
public int Tax { get; set; }=0;
public long CreateTime { get; set; }=DateTime.Now.ToTimeStamp();
}
}
+39
View File
@@ -0,0 +1,39 @@
using System.ComponentModel.DataAnnotations.Schema;
using CommonDomain.BaseModel;
using CommonDomain.Enum;
using MongoDB.Bson.Serialization.Attributes;
using MongoRepository;
using MongoRepository.Attributes;
using MongoRepository.Config;
using UserDomain.Enum;
namespace UserDomain.Entity
{
[BsonCollection("user_task", ServiceDatabases.User)]
[BsonIgnoreExtraElements]
public class UserTask : MongoBaseEntity
{
public string UserId { get; set; }
public string Number { get; set; }
public string Remark { get; set; }
public TaskType TaskType { get; set; }
public TaskEvent TaskEvent { get; set; }
public int TaskCount { get; set; }
public double Count { get; set; }
public bool IsFinish { get; set; }=false;
public string OtherId { get; set; }
public bool IsGet { get; set; }=false;
public long TaskAddTime { get; set; }
public long TaskEndTime { get; set; }=0;
public long TaskFinishTime { get; set; } = 0;
public long Exp { get; set; }
}
}