diff --git a/Kx.SeaTime.sln.DotSettings.user b/Kx.SeaTime.sln.DotSettings.user index 473b539..7ee2977 100644 --- a/Kx.SeaTime.sln.DotSettings.user +++ b/Kx.SeaTime.sln.DotSettings.user @@ -1,4 +1,8 @@  ForceIncluded + ForceIncluded + ForceIncluded + ForceIncluded ForceIncluded - ForceIncluded \ No newline at end of file + ForceIncluded + ForceIncluded \ No newline at end of file diff --git a/Service/Application.Domain.Entity/game/user/game_account.cs b/Service/Application.Domain.Entity/game/user/game_account.cs index 7ec66e3..75bc79e 100644 --- a/Service/Application.Domain.Entity/game/user/game_account.cs +++ b/Service/Application.Domain.Entity/game/user/game_account.cs @@ -1,4 +1,4 @@ -using SqlSugar; +using SqlSugar; using System; namespace Application.Domain.Entity @@ -72,4 +72,4 @@ namespace Application.Domain.Entity [SugarColumn(Length = 50, IsNullable = true)] public string? openId { get; set; } } -} \ No newline at end of file +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user.cs b/Service/Application.Domain.Entity/game/user/unit_user.cs index 4d6f46b..0d71309 100644 --- a/Service/Application.Domain.Entity/game/user/unit_user.cs +++ b/Service/Application.Domain.Entity/game/user/unit_user.cs @@ -1,4 +1,4 @@ -using SqlSugar; +using SqlSugar; using System; namespace Application.Domain.Entity @@ -83,11 +83,5 @@ namespace Application.Domain.Entity /// [SugarColumn(IsNullable = true)] public DateTime? addTime { get; set; } - - /// - /// 最后更新时间 - /// - [SugarColumn(IsNullable = true)] - public DateTime? upTime { get; set; } } } diff --git a/Service/Application.Domain.Entity/game/user/unit_user_acc.cs b/Service/Application.Domain.Entity/game/user/unit_user_acc.cs new file mode 100644 index 0000000..7f67896 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_acc.cs @@ -0,0 +1,39 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_acc + { + /// + /// userId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string userId { get; set; } + + /// + /// 海贝 + /// + [SugarColumn(IsNullable = true)] + public long? cowry { get; set; } + + /// + /// 金 + /// + [SugarColumn(IsNullable = true)] + public long? gold { get; set; } + + /// + /// 师德 + /// + [SugarColumn(IsNullable = true)] + public long? teach { get; set; } + + /// + /// 声望 + /// + [SugarColumn(IsNullable = true)] + public long? renown { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user_acc_log.cs b/Service/Application.Domain.Entity/game/user/unit_user_acc_log.cs new file mode 100644 index 0000000..48124dc --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_acc_log.cs @@ -0,0 +1,63 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_acc_log + { + /// + /// accId + /// + [SugarColumn(IsPrimaryKey = true, Length = 36)] + public string accId { get; set; } + + /// + /// userId + /// + [SugarColumn(Length = 36, IsNullable = true)] + public string? userId { get; set; } + + /// + /// accType + /// + [SugarColumn(Length = 255, IsNullable = true)] + public string? accType { get; set; } + + /// + /// code + /// + [SugarColumn(Length = 255, IsNullable = true)] + public string? code { get; set; } + + /// + /// name + /// + [SugarColumn(Length = 255, IsNullable = true)] + public string? name { get; set; } + + /// + /// amount + /// + [SugarColumn(Length = 18, IsNullable = true)] + public decimal? amount { get; set; } + + /// + /// addTime + /// + [SugarColumn(IsNullable = true)] + public DateTime? addTime { get; set; } + + /// + /// endTime + /// + [SugarColumn(IsNullable = true)] + public DateTime? endTime { get; set; } + + /// + /// remark + /// + [SugarColumn(Length = 255, IsNullable = true)] + public string? remark { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user_attr.cs b/Service/Application.Domain.Entity/game/user/unit_user_attr.cs new file mode 100644 index 0000000..c42fab1 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_attr.cs @@ -0,0 +1,63 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_attr + { + /// + /// userId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string userId { get; set; } + + /// + /// lev + /// + [SugarColumn(IsNullable = true)] + public int? lev { get; set; } + + /// + /// minAtk + /// + [SugarColumn(IsNullable = true)] + public int? minAtk { get; set; } + + /// + /// maxAtk + /// + [SugarColumn(IsNullable = true)] + public int? maxAtk { get; set; } + + /// + /// defense + /// + [SugarColumn(IsNullable = true)] + public int? defense { get; set; } + + /// + /// agility + /// + [SugarColumn(IsNullable = true)] + public int? agility { get; set; } + + /// + /// upBlood + /// + [SugarColumn(IsNullable = true)] + public int? upBlood { get; set; } + + /// + /// upMorale + /// + [SugarColumn(IsNullable = true)] + public int? upMorale { get; set; } + + /// + /// levUpdate + /// + [SugarColumn(IsNullable = true)] + public long? levUpdate { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user_blood.cs b/Service/Application.Domain.Entity/game/user/unit_user_blood.cs new file mode 100644 index 0000000..b7e98f5 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_blood.cs @@ -0,0 +1,21 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_blood + { + /// + /// userId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string userId { get; set; } + + /// + /// blood + /// + [SugarColumn(IsNullable = true)] + public int? blood { get; set; } + } +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/game/user/unit_user_copper.cs b/Service/Application.Domain.Entity/game/user/unit_user_copper.cs new file mode 100644 index 0000000..091ff36 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_copper.cs @@ -0,0 +1,21 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_copper + { + /// + /// userId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string userId { get; set; } + + /// + /// 铜 + /// + [SugarColumn(IsNullable = true)] + public long? copper { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user_equ.cs b/Service/Application.Domain.Entity/game/user/unit_user_equ.cs new file mode 100644 index 0000000..805a411 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_equ.cs @@ -0,0 +1,267 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_equ + { + /// + /// ueId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string ueId { get; set; } + + /// + /// userId + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? userId { get; set; } + + /// + /// owerId + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? owerId { get; set; } + + /// + /// equId + /// + [SugarColumn(IsNullable = true)] + public int? equId { get; set; } + + /// + /// equName + /// + [SugarColumn(IsNullable = true)] + public string? equName { get; set; } + + /// + /// unitEquName + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? unitEquName { get; set; } + + /// + /// lev + /// + [SugarColumn(IsNullable = true)] + public int? lev { get; set; } + + /// + /// quality + /// + [SugarColumn(IsNullable = true)] + public int? quality { get; set; } + + /// + /// qualityName + /// + [SugarColumn(Length = 255, IsNullable = true)] + public string? qualityName { get; set; } + + /// + /// qualityAttr + /// + [SugarColumn(Length = 2000, IsNullable = true)] + public string? qualityAttr { get; set; } + + /// + /// sex + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? sex { get; set; } + + /// + /// code + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? code { get; set; } + + /// + /// img + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? img { get; set; } + + /// + /// sign + /// + [SugarColumn(Length = 100, IsNullable = true)] + public string? sign { get; set; } + + /// + /// minAtk + /// + [SugarColumn(IsNullable = true)] + public int? minAtk { get; set; } + + /// + /// maxAtk + /// + [SugarColumn(IsNullable = true)] + public int? maxAtk { get; set; } + + /// + /// Defense + /// + [SugarColumn(IsNullable = true)] + public int? Defense { get; set; } + + /// + /// Agility + /// + [SugarColumn(IsNullable = true)] + public int? Agility { get; set; } + + /// + /// Blood + /// + [SugarColumn(IsNullable = true)] + public int? Blood { get; set; } + + /// + /// Morale + /// + [SugarColumn(IsNullable = true)] + public int? Morale { get; set; } + + /// + /// suitCode + /// + [SugarColumn(Length = 255, IsNullable = true)] + public string? suitCode { get; set; } + + /// + /// durability + /// + [SugarColumn(IsNullable = true)] + public int? durability { get; set; } + + /// + /// maxdurability + /// + [SugarColumn(IsNullable = true)] + public int? maxdurability { get; set; } + + /// + /// isIntensify + /// + [SugarColumn(IsNullable = true)] + public int? isIntensify { get; set; } + + /// + /// intensifyLev + /// + [SugarColumn(IsNullable = true)] + public int? intensifyLev { get; set; } + + /// + /// holeCount + /// + [SugarColumn(IsNullable = true)] + public int? holeCount { get; set; } + + /// + /// opTime + /// + [SugarColumn(IsNullable = true)] + public int? opTime { get; set; } + + /// + /// useEndTime + /// + [SugarColumn(IsNullable = true)] + public DateTime? useEndTime { get; set; } + + /// + /// weight + /// + [SugarColumn(IsNullable = true)] + public int? weight { get; set; } + + /// + /// isLock + /// + [SugarColumn(IsNullable = true)] + public int? isLock { get; set; } + + /// + /// sysPrice + /// + [SugarColumn(Length = 10, IsNullable = true)] + public decimal? sysPrice { get; set; } + + /// + /// canEqualUp + /// + [SugarColumn(IsNullable = true)] + public int? canEqualUp { get; set; } + + /// + /// EquAttr + /// + [SugarColumn(IsNullable = true)] + public string? EquAttr { get; set; } + + /// + /// EquMent + /// + [SugarColumn(IsNullable = true)] + public string? EquMent { get; set; } + + /// + /// EquAwaken + /// + [SugarColumn(IsNullable = true)] + public string? EquAwaken { get; set; } + + /// + /// GemMent + /// + [SugarColumn(IsNullable = true)] + public string? GemMent { get; set; } + + /// + /// isDeal + /// + [SugarColumn(IsNullable = true)] + public int? isDeal { get; set; } + + /// + /// isGive + /// + [SugarColumn(IsNullable = true)] + public int? isGive { get; set; } + + /// + /// score + /// + [SugarColumn(IsNullable = true)] + public int? score { get; set; } + + /// + /// start + /// + [SugarColumn(IsNullable = true)] + public int? start { get; set; } + + /// + /// exp + /// + [SugarColumn(IsNullable = true)] + public int? exp { get; set; } + + /// + /// startAttr + /// + [SugarColumn(IsNullable = true)] + public string? startAttr { get; set; } + + /// + /// swallow + /// + [SugarColumn(IsNullable = true)] + public string? swallow { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user_exp.cs b/Service/Application.Domain.Entity/game/user/unit_user_exp.cs new file mode 100644 index 0000000..dc993d0 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_exp.cs @@ -0,0 +1,27 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_exp + { + /// + /// userId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string userId { get; set; } + + /// + /// exp + /// + [SugarColumn(IsNullable = true)] + public long? exp { get; set; } + + /// + /// upExp + /// + [SugarColumn(IsNullable = true)] + public long? upExp { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user_friend.cs b/Service/Application.Domain.Entity/game/user/unit_user_friend.cs new file mode 100644 index 0000000..963098e --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_friend.cs @@ -0,0 +1,45 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_friend + { + /// + /// fId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string fId { get; set; } + + /// + /// sId + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? sId { get; set; } + + /// + /// mId + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? mId { get; set; } + + /// + /// near + /// + [SugarColumn(IsNullable = true)] + public int? near { get; set; } + + /// + /// status + /// + [SugarColumn(IsNullable = true)] + public int? status { get; set; } + + /// + /// addTime + /// + [SugarColumn(IsNullable = true)] + public DateTime? addTime { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user_goods.cs b/Service/Application.Domain.Entity/game/user/unit_user_goods.cs new file mode 100644 index 0000000..55b2775 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_goods.cs @@ -0,0 +1,75 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_goods + { + /// + /// ugId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string ugId { get; set; } + + /// + /// userId + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? userId { get; set; } + + /// + /// goodsId + /// + [SugarColumn(IsNullable = true)] + public int? goodsId { get; set; } + + /// + /// goodsName + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? goodsName { get; set; } + + /// + /// lev + /// + [SugarColumn(IsNullable = true)] + public int? lev { get; set; } + + /// + /// code + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? code { get; set; } + + /// + /// count + /// + [SugarColumn(Length = 65, IsNullable = true)] + public decimal? count { get; set; } + + /// + /// weight + /// + [SugarColumn(IsNullable = true)] + public int? weight { get; set; } + + /// + /// sysPrice + /// + [SugarColumn(Length = 18, IsNullable = true)] + public decimal? sysPrice { get; set; } + + /// + /// 0不可交易1可交易 + /// + [SugarColumn(IsNullable = true)] + public int? isDeal { get; set; } + + /// + /// 0不可赠送 1可赠送 + /// + [SugarColumn(IsNullable = true)] + public int? isGive { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user_morale.cs b/Service/Application.Domain.Entity/game/user/unit_user_morale.cs new file mode 100644 index 0000000..76fdd35 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_morale.cs @@ -0,0 +1,21 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_morale + { + /// + /// userId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string userId { get; set; } + + /// + /// morale + /// + [SugarColumn(IsNullable = true)] + public long? morale { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user_online.cs b/Service/Application.Domain.Entity/game/user/unit_user_online.cs new file mode 100644 index 0000000..47add64 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_online.cs @@ -0,0 +1,33 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_online + { + /// + /// userId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string userId { get; set; } + + /// + /// mapId + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? mapId { get; set; } + + /// + /// ip + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? ip { get; set; } + + /// + /// upTime + /// + [SugarColumn(IsNullable = true)] + public long? upTime { get; set; } + } +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/game/user/unit_user_vigour.cs b/Service/Application.Domain.Entity/game/user/unit_user_vigour.cs new file mode 100644 index 0000000..9a1d366 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_vigour.cs @@ -0,0 +1,33 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_vigour + { + /// + /// 活力表 + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string userId { get; set; } + + /// + /// 当前活力 + /// + [SugarColumn(IsNullable = true)] + public long? vitality { get; set; } + + /// + /// 最大活力 + /// + [SugarColumn(IsNullable = true)] + public long? upVitality { get; set; } + + /// + /// 更新时间 + /// + [SugarColumn(IsNullable = true)] + public string? upTime { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/game/user/unit_user_weight.cs b/Service/Application.Domain.Entity/game/user/unit_user_weight.cs new file mode 100644 index 0000000..1719900 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_weight.cs @@ -0,0 +1,27 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_weight + { + /// + /// userId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string userId { get; set; } + + /// + /// onWeight + /// + [SugarColumn(IsNullable = true)] + public int? onWeight { get; set; } + + /// + /// maxWeight + /// + [SugarColumn(IsNullable = true)] + public int? maxWeight { get; set; } + } +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/game/user/unit_user_weight_log.cs b/Service/Application.Domain.Entity/game/user/unit_user_weight_log.cs new file mode 100644 index 0000000..c2544a2 --- /dev/null +++ b/Service/Application.Domain.Entity/game/user/unit_user_weight_log.cs @@ -0,0 +1,57 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Game")] + public class unit_user_weight_log + { + /// + /// logId + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string logId { get; set; } + + /// + /// userId + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? userId { get; set; } + + /// + /// goodsId + /// + [SugarColumn(IsNullable = true)] + public int? goodsId { get; set; } + + /// + /// goodsName + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? goodsName { get; set; } + + /// + /// weight + /// + [SugarColumn(IsNullable = true)] + public int? weight { get; set; } + + /// + /// count + /// + [SugarColumn(IsNullable = true)] + public int? count { get; set; } + + /// + /// sum + /// + [SugarColumn(IsNullable = true)] + public int? sum { get; set; } + + /// + /// addTime + /// + [SugarColumn(IsNullable = true)] + public DateTime? addTime { get; set; } + } +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/resource/base/MapNear.cs b/Service/Application.Domain.Entity/resource/base/MapNear.cs new file mode 100644 index 0000000..dd11f9d --- /dev/null +++ b/Service/Application.Domain.Entity/resource/base/MapNear.cs @@ -0,0 +1,8 @@ +namespace Application.Domain.Entity; + +public class MapNear +{ + public string mapId { get; set; } + public string Name { get; set; } + public string positition { get; set; } +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/resource/game/game_area.cs b/Service/Application.Domain.Entity/resource/game/game_area.cs index 0135b34..603519b 100644 --- a/Service/Application.Domain.Entity/resource/game/game_area.cs +++ b/Service/Application.Domain.Entity/resource/game/game_area.cs @@ -1,4 +1,4 @@ -using SqlSugar; +using SqlSugar; using System; namespace Application.Domain.Entity diff --git a/Service/Application.Domain.Entity/resource/game/game_city.cs b/Service/Application.Domain.Entity/resource/game/game_city.cs new file mode 100644 index 0000000..fd4239d --- /dev/null +++ b/Service/Application.Domain.Entity/resource/game/game_city.cs @@ -0,0 +1,69 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Resource")] + public class game_city + { + /// + /// cityId + /// + [SugarColumn(IsPrimaryKey = true)] + public int cityId { get; set; } + + /// + /// cityName + /// + [SugarColumn(Length = 20, IsNullable = true)] + public string? cityName { get; set; } + + /// + /// parent + /// + [SugarColumn(IsNullable = true)] + public int? parent { get; set; } + + /// + /// type + /// + [SugarColumn(Length = 20, IsNullable = true)] + public string? type { get; set; } + + /// + /// toMap + /// + [SugarColumn(Length = 20, IsNullable = true)] + public string? toMap { get; set; } + + /// + /// 城市范围x起始坐标 + /// + [SugarColumn(IsNullable = true)] + public int? x_s { get; set; } + + /// + /// 城市范围x结束坐标 + /// + [SugarColumn(IsNullable = true)] + public int? x_e { get; set; } + + /// + /// 城市范围y起始坐标 + /// + [SugarColumn(IsNullable = true)] + public int? y_s { get; set; } + + /// + /// 城市范围y结束坐标 + /// + [SugarColumn(IsNullable = true)] + public int? y_e { get; set; } + + /// + /// sort + /// + [SugarColumn(IsNullable = true)] + public int? sort { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/resource/game/game_city_map.cs b/Service/Application.Domain.Entity/resource/game/game_city_map.cs new file mode 100644 index 0000000..5490879 --- /dev/null +++ b/Service/Application.Domain.Entity/resource/game/game_city_map.cs @@ -0,0 +1,117 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Resource")] + public class game_city_map + { + /// + /// mapId + /// + [SugarColumn(IsPrimaryKey = true, Length = 20)] + public string mapId { get; set; } + + /// + /// mapName + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? mapName { get; set; } + + /// + /// x + /// + [SugarColumn(IsNullable = true)] + public int? x { get; set; } + + /// + /// y + /// + [SugarColumn(IsNullable = true)] + public int? y { get; set; } + + /// + /// code + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? code { get; set; } + + /// + /// cityId + /// + [SugarColumn(IsNullable = true)] + public int? cityId { get; set; } + + /// + /// isPk + /// + [SugarColumn(IsNullable = true)] + public int? isPk { get; set; } + + /// + /// show + /// + [SugarColumn(IsNullable = true)] + public int? show { get; set; } + + /// + /// isHome + /// + [SugarColumn(IsNullable = true)] + public int? isHome { get; set; } + + /// + /// 是否可采集 0不可采集 2可采集 + /// + [SugarColumn(IsNullable = true)] + public int? isRes { get; set; } + + /// + /// isBus + /// + [SugarColumn(IsNullable = true)] + public int? isBus { get; set; } + + /// + /// retMap + /// + [SugarColumn(Length = 20, IsNullable = true)] + public string? retMap { get; set; } + + /// + /// near + /// + [SugarColumn(IsNullable = true,IsJson = true)] + public List near { get; set; } + + /// + /// tips + /// + [SugarColumn(Length = 255, IsNullable = true)] + public string? tips { get; set; } + + /// + /// 是否查看附近的人0不显示 1显示 + /// + [SugarColumn(IsNullable = true)] + public int? lookUser { get; set; } + + /// + /// 附近人显示方式0不限制1当前区 + /// + [SugarColumn(IsNullable = true)] + public int? lookArea { get; set; } + + /// + /// 进入权限0不限制,1验证 + /// + [SugarColumn(IsNullable = true)] + public int? inRole { get; set; } + + /// + /// 锁定时间 + /// + [SugarColumn(IsNullable = true)] + public int? lockTime { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/resource/game/game_city_map_res.cs b/Service/Application.Domain.Entity/resource/game/game_city_map_res.cs new file mode 100644 index 0000000..4c38dca --- /dev/null +++ b/Service/Application.Domain.Entity/resource/game/game_city_map_res.cs @@ -0,0 +1,57 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Resource")] + public class game_city_map_res + { + /// + /// 资源id + /// + [SugarColumn(IsPrimaryKey = true, Length = 50)] + public string resId { get; set; } + + /// + /// 地图id + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? mapId { get; set; } + + /// + /// 资源名称 + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? resName { get; set; } + + /// + /// 对应物品ID + /// + [SugarColumn(IsNullable = true)] + public int? goodsId { get; set; } + + /// + /// 获取资源数量 + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? count { get; set; } + + /// + /// 采集需要数量 + /// + [SugarColumn(IsNullable = true)] + public int? needVigour { get; set; } + + /// + /// 成功率 + /// + [SugarColumn(Length = 18, IsNullable = true)] + public decimal? okRadio { get; set; } + + /// + /// 采集锁定时间 + /// + [SugarColumn(IsNullable = true)] + public int? gatherTime { get; set; } + } +} diff --git a/Service/Application.Domain.Entity/resource/game/game_city_npc.cs b/Service/Application.Domain.Entity/resource/game/game_city_npc.cs new file mode 100644 index 0000000..65aa42e --- /dev/null +++ b/Service/Application.Domain.Entity/resource/game/game_city_npc.cs @@ -0,0 +1,63 @@ +using SqlSugar; +using System; + +namespace Application.Domain.Entity +{ + [Tenant("Kg.SeaTime.Resource")] + public class game_city_npc + { + /// + /// npcId + /// + [SugarColumn(IsPrimaryKey = true)] + public int npcId { get; set; } + + /// + /// areaId + /// + [SugarColumn(Length = 255, IsNullable = true)] + public string? areaId { get; set; } + + /// + /// mapId + /// + [SugarColumn(Length = 20, IsNullable = true)] + public string? mapId { get; set; } + + /// + /// npcName + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? npcName { get; set; } + + /// + /// tips + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? tips { get; set; } + + /// + /// code + /// + [SugarColumn(Length = 50, IsNullable = true)] + public string? code { get; set; } + + /// + /// story + /// + [SugarColumn(IsNullable = true)] + public string? story { get; set; } + + /// + /// status + /// + [SugarColumn(IsNullable = true)] + public int? status { get; set; } + + /// + /// bus + /// + [SugarColumn(IsNullable = true)] + public string? bus { get; set; } + } +} \ No newline at end of file diff --git a/Service/Application.Domain.Entity/resource/game/game_notice.cs b/Service/Application.Domain.Entity/resource/game/game_notice.cs index 0a2fcd1..25b37c0 100644 --- a/Service/Application.Domain.Entity/resource/game/game_notice.cs +++ b/Service/Application.Domain.Entity/resource/game/game_notice.cs @@ -1,4 +1,4 @@ -using SqlSugar; +using SqlSugar; using System; namespace Application.Domain.Entity diff --git a/Service/Application.Domain/GlobalUsings.cs b/Service/Application.Domain/GlobalUsings.cs index 1470963..9a7ca0e 100644 --- a/Service/Application.Domain/GlobalUsings.cs +++ b/Service/Application.Domain/GlobalUsings.cs @@ -1,4 +1,5 @@ global using Photon.Core; global using SqlSugar; global using Application.Domain.Entity; -global using Photon.Core.Redis; \ No newline at end of file +global using Photon.Core.Redis; +global using Photon.Core.Assist; \ No newline at end of file diff --git a/Service/Application.Domain/Services/Interface/Map/IGameMapService.cs b/Service/Application.Domain/Services/Interface/Map/IGameMapService.cs new file mode 100644 index 0000000..e430396 --- /dev/null +++ b/Service/Application.Domain/Services/Interface/Map/IGameMapService.cs @@ -0,0 +1,21 @@ +namespace Application.Domain; + +public interface IGameMapService +{ + #region 城市地图数据 + + Task GetCityInfo(int cityId); + Task GetMapInfo(string mapId); + Task GetMapCityByMapId(string mapId); + Task> GetMapNpc(string mapId); + Task GetNpcInfo(int npcId); + #endregion + + #region 用户地图 + + Task GetUserOnMapId(string userId); + Task GetUserOnMap(string userId); + Task UpdateUserOnMap(string userId, string ip, string mapId); + + #endregion +} \ No newline at end of file diff --git a/Service/Application.Domain/Services/Interface/User/IUnitUserService.cs b/Service/Application.Domain/Services/Interface/User/IUnitUserService.cs index e425968..9b957cd 100644 --- a/Service/Application.Domain/Services/Interface/User/IUnitUserService.cs +++ b/Service/Application.Domain/Services/Interface/User/IUnitUserService.cs @@ -9,6 +9,7 @@ public interface IUnitUserService Task GetUserInfoByUserNo(string userNo); Task GetUserInfoByToken(string token); + #endregion #region 用户注册 diff --git a/Service/Application.Domain/Services/Service/Map/GameMapService.cs b/Service/Application.Domain/Services/Service/Map/GameMapService.cs new file mode 100644 index 0000000..bc44d5d --- /dev/null +++ b/Service/Application.Domain/Services/Service/Map/GameMapService.cs @@ -0,0 +1,128 @@ +namespace Application.Domain; + +public class GameMapService : IGameMapService, ITransient +{ + private readonly ISqlSugarClient _dbClient; + private readonly IRedisCache _redisClient; + + public GameMapService(ISqlSugarClient dbClient, IRedisCache redisClient) + { + _dbClient = dbClient; + _redisClient = redisClient; + } + + #region 城市地图数据 + + public async Task GetCityInfo(int cityId) + { + string key = string.Format(BaseCache.BaseCacheKeys, "MapCityData", "CityData"); + var data = await _redisClient.GetHashAsync(key, cityId.ToString()); + if (data == null) + { + var db = _dbClient.AsTenant().GetConnectionWithAttr(); + data = await db.Queryable().Where(it => it.cityId == cityId).SingleAsync(); + await _redisClient.AddHashAsync(key, cityId.ToString(), data); + } + + return data; + } + + public async Task GetMapInfo(string mapId) + { + string key = string.Format(BaseCache.BaseCacheKeys, "MapCityData", "MapData"); + var data = await _redisClient.GetHashAsync(key, mapId); + if (data == null) + { + var db = _dbClient.AsTenant().GetConnectionWithAttr(); + data = await db.Queryable().Where(it => it.mapId == mapId).SingleAsync(); + await _redisClient.AddHashAsync(key, mapId, data); + } + + return data; + } + + public async Task GetMapCityByMapId(string mapId) + { + var data = await GetMapInfo(mapId); + if (data != null) + { + return (int)data.cityId; + } + else + { + return 0; + } + } + + public async Task> GetMapNpc(string mapId) + { + string key = string.Format(BaseCache.BaseCacheKeys, "MapCityData", "NpcData"); + var data = await _redisClient.GetHashAsync>(key, mapId); + if (data == null) + { + var db = _dbClient.AsTenant().GetConnectionWithAttr(); + data = await db.Queryable().Where(it => it.mapId == mapId && it.status == 1).ToListAsync(); + await _redisClient.AddHashAsync(key, mapId, data); + } + + return data; + } + public async Task GetNpcInfo(int npcId) + { + string key = string.Format(BaseCache.BaseCacheKeys, "MapCityData", "NpcInfo"); + var data = await _redisClient.GetHashAsync(key, npcId.ToString()); + if (data == null) + { + var db = _dbClient.AsTenant().GetConnectionWithAttr(); + data = await db.Queryable().Where(it => it.npcId == npcId).SingleAsync(); + await _redisClient.AddHashAsync(key, npcId.ToString(),data); + } + return data; + } + + #endregion + + #region 用户地图 + + public async Task GetUserOnMapId(string userId) + { + var data = await GetUserOnMap(userId); + if (data == null) + { + return "16_27"; + } + + return data.mapId; + } + + public async Task GetUserOnMap(string userId) + { + string key = string.Format(UserCache.BaseCacheKey, "UserOnline"); + if (await _redisClient.HExistsHashAsync(key, userId)) + { + return await _redisClient.GetHashAsync(key, userId); + } + + var db = _dbClient.AsTenant().GetConnectionWithAttr(); + var data = await db.Queryable().Where(it => it.userId == userId).SingleAsync(); + await _redisClient.AddHashAsync(key, userId, data); + return data; + } + + public async Task UpdateUserOnMap(string userId, string ip, string mapId) + { + unit_user_online onLine = new unit_user_online(); + onLine.userId = userId; + onLine.mapId = mapId; + onLine.ip = ip; + onLine.upTime = TimeAssist.GetTimeStampNum; + string key = string.Format(UserCache.BaseCacheKey, "UserOnline"); + if (await _redisClient.AddHashAsync(key, userId, onLine)) + { + var db = _dbClient.AsTenant().GetConnectionWithAttr(); + await db.Updateable(onLine).ExecuteCommandAsync(); + } + } + + #endregion +} \ No newline at end of file diff --git a/Service/Application.Domain/Services/Service/User/UnitUserService.cs b/Service/Application.Domain/Services/Service/User/UnitUserService.cs index 732f12f..9aa9411 100644 --- a/Service/Application.Domain/Services/Service/User/UnitUserService.cs +++ b/Service/Application.Domain/Services/Service/User/UnitUserService.cs @@ -14,11 +14,13 @@ public class UnitUserService : IUnitUserService, ITransient } #region 用户信息 + public async Task> GetUserDataByAccId(string accId) { var db = _dbClient.AsTenant().GetConnectionWithAttr(); return await db.Queryable().Where(it => it.accId == accId).ToListAsync(); } + public async Task GetUserInfoByUserId(string userId) { string key = string.Format(UserCache.BaseCacheKeys, "UserInfo", "UserId"); @@ -35,6 +37,7 @@ public class UnitUserService : IUnitUserService, ITransient return data; } + public async Task GetUserInfoByUserNo(string userNo) { string key = string.Format(UserCache.BaseCacheKeys, "UserInfo", "UserNo"); @@ -68,6 +71,7 @@ public class UnitUserService : IUnitUserService, ITransient return data; } + private async Task ClearUserInfo(int type, string id) { unit_user result = new unit_user(); @@ -81,17 +85,17 @@ public class UnitUserService : IUnitUserService, ITransient result = await GetUserInfoByToken(id); break; } - await _redisClient.DelHashAsync(string.Format(UserCache.BaseCacheKeys, "UserInfo","UserId"), result.userId); - await _redisClient.DelHashAsync(string.Format(UserCache.BaseCacheKeys, "UserInfo","UserNo"), result.userNo); - await _redisClient.DelHashAsync(string.Format(UserCache.BaseCacheKeys, "UserInfo","Sid"), result.token); + + await _redisClient.DelHashAsync(string.Format(UserCache.BaseCacheKeys, "UserInfo", "UserId"), result.userId); + await _redisClient.DelHashAsync(string.Format(UserCache.BaseCacheKeys, "UserInfo", "UserNo"), result.userNo); + await _redisClient.DelHashAsync(string.Format(UserCache.BaseCacheKeys, "UserInfo", "Sid"), result.token); } + #endregion #region 用户注册 - - public async Task Register(int areaId, string accId) { unit_user result = new unit_user(); @@ -114,7 +118,6 @@ public class UnitUserService : IUnitUserService, ITransient result.regOk = 0; result.isSystem = 0; result.addTime = DateTime.Now; - result.upTime = DateTime.Now; bool isok = db.Insertable(result).ExecuteCommand() > 0; if (!isok) { @@ -131,6 +134,7 @@ public class UnitUserService : IUnitUserService, ITransient return result; } + public async Task RegisterUserInfo(string userId, string nick, string sex) { var db = _dbClient.AsTenant().GetConnectionWithAttr(); @@ -140,17 +144,74 @@ public class UnitUserService : IUnitUserService, ITransient .Where(it => it.userId == userId).ExecuteCommandAsync() > 0; if (result) { - //注册配置信息 + await ClearUserInfo(0, userId);//清理个人信息表缓存 + //注册账户 + unit_user_acc acc = new unit_user_acc(); + acc.userId = userId; + acc.cowry = 0; + acc.gold = 0; + acc.teach = 0; + acc.renown = 0; + db.Insertable(acc).AddQueue(); + //注册游戏货币 + unit_user_copper copper = new unit_user_copper(); + copper.userId = userId; + copper.copper = 0; + db.Insertable(copper).AddQueue(); + //注册个人基础属性 + unit_user_attr userAttr = GameTool.GetAttrData(1); + userAttr.userId = userId; + db.Insertable(userAttr).AddQueue(); + + //注册个人血量 + unit_user_blood blood = new unit_user_blood(); + blood.userId = userId; + blood.blood = userAttr.upBlood; + db.Insertable(blood).AddQueue(); + //注册士气 + unit_user_morale morale = new unit_user_morale(); + morale.userId = userId; + morale.morale = userAttr.upMorale; + db.Insertable(morale).AddQueue(); + //注册等级经验 + unit_user_exp exp = new unit_user_exp(); + exp.userId = userId; + exp.exp = 0; + exp.upExp = GameTool.GetUserUpExp(1); + db.Insertable(exp).AddQueue(); + //注册负重 + unit_user_weight weight = new unit_user_weight(); + weight.userId = userId; + weight.onWeight = 0; + weight.maxWeight = 100; + db.Insertable(weight).AddQueue(); + //注册活力 + unit_user_vigour vitality = new unit_user_vigour(); + vitality.userId = userId; + vitality.vitality = 50; + vitality.upVitality = 50; + vitality.upTime = TimeAssist.GetDateTimeYMDString(0); + db.Insertable(vitality).AddQueue(); + //注册在线 + unit_user_online online = new unit_user_online(); + online.userId = userId; + online.ip = ""; + online.mapId = "16_27"; + online.upTime = TimeAssist.GetTimeStampNum; + db.Insertable(online).AddQueue(); + + await db.SaveQueuesAsync(false); - await ClearUserInfo(0, userId); } + return result; } + private async Task GetUserNo() { int No = 0; diff --git a/Service/Application.Domain/Tool/GameTool.cs b/Service/Application.Domain/Tool/GameTool.cs new file mode 100644 index 0000000..0c0cb61 --- /dev/null +++ b/Service/Application.Domain/Tool/GameTool.cs @@ -0,0 +1,41 @@ +using Photon.Core.Assist; + +namespace Application.Domain; + +public class GameTool +{ + /// + /// 获取等级基础属性 + /// + /// + /// + public static unit_user_attr GetAttrData(int lev) + { + unit_user_attr data = new unit_user_attr(); + data.lev = lev; + data.minAtk = lev + 2; + data.maxAtk = lev + Convert.ToInt32(lev * 0.05) + 4; + data.defense = lev; + data.agility = lev; + data.upBlood = ((lev - 1) * 5) + 80; + data.upMorale = 100 + (lev / 5) * 10; + data.levUpdate = TimeAssist.GetTimeStampNum; + return data; + } + /// + /// 获取等级升级经验 + /// + /// + /// + public static long GetUserUpExp(int lev) + { + long result = 50 * ((lev * lev * lev) + (5 * lev)) - 80; + return result; + } + + public static bool AreaVerify( int area,string areas) + { + List onArea = new List() {"0",area.ToString() }; + return onArea.Any(it => areas.Contains(it)); + } +} \ No newline at end of file diff --git a/Service/Application.Service.Pub/Jwt/JwtTool.cs b/Service/Application.Service.Pub/Jwt/JwtTool.cs new file mode 100644 index 0000000..fb133d2 --- /dev/null +++ b/Service/Application.Service.Pub/Jwt/JwtTool.cs @@ -0,0 +1,55 @@ +using System.IdentityModel.Tokens.Jwt; +using System.Text; +using Microsoft.IdentityModel.Tokens; + +namespace Application.Service.Pub; + +public class JwtTool +{ + public static async Task ParseWithValidationAsync( + string jwtToken, + TokenValidationParameters validationParameters) + { + if (string.IsNullOrWhiteSpace(jwtToken)) + throw new ArgumentNullException(nameof(jwtToken)); + if (validationParameters == null) + throw new ArgumentNullException(nameof(validationParameters)); + + var handler = new JwtSecurityTokenHandler(); + + // 异步验证并解析 + return await handler.ValidateTokenAsync(jwtToken, validationParameters); + } + + public static async Task ParseWithSecretKeyAsync(string jwtToken, string secretKey) + { + var validationParams = new TokenValidationParameters + { + // 必须配置:密钥 + IssuerSigningKey = (SecurityKey) new SymmetricSecurityKey(Encoding.ASCII.GetBytes(secretKey)), + // 验证签名(必须开启) + ValidateIssuerSigningKey = true, + + // 根据你的 JWT 配置开启/关闭 + ValidateIssuer = false, // 是否验证签发者 + ValidateAudience = false, // 是否验证受众 + ValidateLifetime = false // 是否验证过期时间(默认开启) + }; + + var result = await ParseWithValidationAsync(jwtToken, validationParams); + + return result.IsValid ? result.SecurityToken as JwtSecurityToken : null; + } + + public static async Task< object> GetJwtData(string jwtToken, string secretKey,string key) + { + var token = await ParseWithSecretKeyAsync(jwtToken,secretKey); + var data = token.Payload; + if (data.TryGetValue(key, out object result)) + { + return result; + } + + return null; + } +} \ No newline at end of file diff --git a/Service/Application.Web/Common/ComHelper.cs b/Service/Application.Web/Common/ComHelper.cs new file mode 100644 index 0000000..49f81bf --- /dev/null +++ b/Service/Application.Web/Common/ComHelper.cs @@ -0,0 +1,25 @@ +namespace Application.Web; + +public class ComHelper +{ + public static string GetClientUserIp(HttpContext context) + { + var ip = context.Request.Headers["X-Forwarded-For"].FirstOrDefault(); + if (string.IsNullOrEmpty(ip)) + { + ip = context.Connection.RemoteIpAddress.ToString(); + ip = ip.Replace("::ffff:", ""); + } + if (ip.Contains(",")) + { + ip = ip.Split(',')[0]; + } + //var ip = context.Request.Cookies["kxUserIp"]; + //if (string.IsNullOrEmpty(ip)) + //{ + // ip = "0.0.0.0"; + //} + + return ip; + } +} \ No newline at end of file diff --git a/Service/Application.Web/Common/StateHelper.cs b/Service/Application.Web/Common/StateHelper.cs index 58a8164..e54ef62 100644 --- a/Service/Application.Web/Common/StateHelper.cs +++ b/Service/Application.Web/Common/StateHelper.cs @@ -18,12 +18,20 @@ return token.Claims["userId"]; } } - public static string sid + public static string accId { get { var token = App.HttpContext.GetTokenInfo(); - return token.Claims["token"]; + return token.Claims["accId"]; + } + } + public static int areaId + { + get + { + var token = App.HttpContext.GetTokenInfo(); + return Convert.ToInt32(token.Claims["areaId"]) ; } } } diff --git a/Service/Application.Web/Controllers/Login/LoginController.cs b/Service/Application.Web/Controllers/Login/LoginController.cs index b599e2a..95084ef 100644 --- a/Service/Application.Web/Controllers/Login/LoginController.cs +++ b/Service/Application.Web/Controllers/Login/LoginController.cs @@ -154,6 +154,11 @@ namespace Application.Web.Controllers.Login return PoAction.Message("当前区繁忙,无法进入!"); } + if (areaInfo.opTime > DateTime.Now) + { + return PoAction.Message("暂未开放本区服!"); + } + //判断是否已经注册 var userData = await _userService.GetUserDataByAccId(accInfo.accId); if (userData.Any(it => it.areaId == area)) @@ -170,7 +175,7 @@ namespace Application.Web.Controllers.Login Dictionary loadData = new Dictionary(); loadData.Add("userId", userInfo.userId); loadData.Add("accId", userInfo.accId); - + loadData.Add("areaId", userInfo.areaId); string Key = App.Configuration["JwtTokenOptions:SecurityKey"].ToString(); string Issuer = App.Configuration["JwtTokenOptions:Issuer"].ToString(); string Audience = App.Configuration["JwtTokenOptions:Audience"].ToString(); @@ -222,7 +227,7 @@ namespace Application.Web.Controllers.Login Dictionary loadData = new Dictionary(); loadData.Add("userId", userInfo.userId); loadData.Add("accId", userInfo.accId); - + loadData.Add("areaId", userInfo.areaId); string Key = App.Configuration["JwtTokenOptions:SecurityKey"].ToString(); string Issuer = App.Configuration["JwtTokenOptions:Issuer"].ToString(); string Audience = App.Configuration["JwtTokenOptions:Audience"].ToString(); @@ -238,16 +243,18 @@ namespace Application.Web.Controllers.Login { return PoAction.Message("刷新失败"); } - + string Key = App.Configuration["JwtTokenOptions:SecurityKey"].ToString(); string Issuer = App.Configuration["JwtTokenOptions:Issuer"].ToString(); string Audience = App.Configuration["JwtTokenOptions:Audience"].ToString(); - var data = JwtHelper.GetTokenPload(parms.token,Key); + string accId = string.Empty; - if (data.TryGetValue("accId", out object _accId)) + var tokenData = await JwtTool.GetJwtData(parms.token, Key, "accId"); + if (tokenData != null) { - accId = _accId.ToString(); + accId = tokenData.ToString(); } + var userInfo = await _userService.GetUserInfoByToken(parms.refToken); if (userInfo == null) { @@ -258,12 +265,14 @@ namespace Application.Web.Controllers.Login { return PoAction.Message("刷新失败,数据信息不合法!"); } + Dictionary loadData = new Dictionary(); loadData.Add("userId", userInfo.userId); loadData.Add("accId", userInfo.accId); + loadData.Add("areaId", userInfo.areaId); string token = JwtHelper.CreateToken(Key, Issuer, Audience, loadData, TokenConfig.TokenTime); return PoAction.Ok(new - { token = token, refToken = userInfo.token, userId = userInfo.userId }); + { token = token, refToken = userInfo.token, userId = userInfo.userId }); } /// @@ -284,6 +293,7 @@ namespace Application.Web.Controllers.Login { return PoAction.Message("昵称需要1-12字符之间哦!"); } + string sex = parms.sex == 0 ? "女" : "男"; string userId = StateHelper.userId; var userInfo = await _userService.GetUserInfoByUserId(userId); diff --git a/Service/Application.Web/Controllers/Map/MapController.cs b/Service/Application.Web/Controllers/Map/MapController.cs new file mode 100644 index 0000000..eb75aac --- /dev/null +++ b/Service/Application.Web/Controllers/Map/MapController.cs @@ -0,0 +1,61 @@ +using Microsoft.AspNetCore.Mvc; + +namespace Application.Web.Controllers.Map; + +/// +/// 地图接口 +/// +[ApiExplorerSettings(GroupName = "Map")] +[Route("Map/[controller]/[action]")] +[ApiController] +[Authorize] +public class MapController : ControllerBase +{ + private readonly IUnitUserService _userService; + private readonly IGameMapService _mapService; + + public MapController(IUnitUserService userService, IGameMapService mapService) + { + _userService = userService; + _mapService = mapService; + } + + /// + /// 获取地图主页信息 + /// + /// + /// + [HttpGet] + public async Task GetMapData(string? map) + { + string userId = StateHelper.userId; + var onMap = await _mapService.GetUserOnMap(userId); + game_city_map mapInfo = new game_city_map(); + if (string.IsNullOrEmpty(map)) + { + mapInfo = await _mapService.GetMapInfo(onMap.mapId); + } + else + { + mapInfo = await _mapService.GetMapInfo(map); + } + + //NPC信息 + + var npcData = await _mapService.GetMapNpc(mapInfo.mapId); + npcData = npcData.FindAll(it => GameTool.AreaVerify(StateHelper.areaId,it.areaId)); + //城市信息 + var cityInfo = await _mapService.GetCityInfo((int)mapInfo.cityId); + + #region 更新在线 + + string ip = ComHelper.GetClientUserIp(HttpContext); + await _mapService.UpdateUserOnMap(userId, ip, mapInfo.mapId); + + #endregion + + object ret = new { mapInfo, cityInfo, npcData }; + + return PoAction.Ok(ret); + } +} \ No newline at end of file diff --git a/Service/Application.Web/Program.cs b/Service/Application.Web/Program.cs index d0710cf..6671f31 100644 --- a/Service/Application.Web/Program.cs +++ b/Service/Application.Web/Program.cs @@ -28,6 +28,12 @@ groups.Add("User", new OpenApiInfo Version = "v1", Description = "航海时代用户相关接口。", }); +groups.Add("Map", new OpenApiInfo +{ + Title = "用户地图文档", + Version = "v1", + Description = "航海时代用户地图相关接口。", +}); builder.Services.InjectJwt(builder.Configuration, new OpenApiInfo { @@ -94,7 +100,8 @@ if (app.Environment.IsDevelopment()) #region 测试swagger配置 app.UseJwtSwagger("swagger", "航海时代接口文档",new List { new JwtGroupConfig(){ groupId="Login", groupName="登录接口文档"}, - new JwtGroupConfig(){ groupId="User", groupName="用户接口文档"} + new JwtGroupConfig(){ groupId="User", groupName="用户接口文档"}, + new JwtGroupConfig(){ groupId="Map", groupName="用户地图文档"} }); #endregion diff --git a/Web/nuxt.config.ts b/Web/nuxt.config.ts index dbaa11c..ad7069e 100644 --- a/Web/nuxt.config.ts +++ b/Web/nuxt.config.ts @@ -1,7 +1,12 @@ // https://nuxt.com/docs/api/configuration/nuxt-config export default defineNuxtConfig({ srcDir: 'src/', - + components: { + dirs: [ + // 自动递归 components 下所有子文件夹 + { path: '~/components', pathPrefix: false } + ] + }, future: { compatibilityVersion: 4, }, diff --git a/Web/src/components/Abar.vue b/Web/src/components/Base/Abar.vue similarity index 100% rename from Web/src/components/Abar.vue rename to Web/src/components/Base/Abar.vue diff --git a/Web/src/components/Abutton.vue b/Web/src/components/Base/Abutton.vue similarity index 80% rename from Web/src/components/Abutton.vue rename to Web/src/components/Base/Abutton.vue index 2791b29..d487b6e 100644 --- a/Web/src/components/Abutton.vue +++ b/Web/src/components/Base/Abutton.vue @@ -1,5 +1,5 @@ @@ -15,7 +15,7 @@ const handleClick = (): any => {