添加项目文件。
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using MongoRepository;
|
||||
using MongoRepository.Attributes;
|
||||
using MongoRepository.Config;
|
||||
|
||||
namespace Domain.Admin.Admin
|
||||
{
|
||||
[BsonCollection("admin_operation_log", ServiceDatabases.Admin)]
|
||||
[BsonIgnoreExtraElements]
|
||||
public class AdminOperationLog : MongoBaseEntity
|
||||
{
|
||||
[BsonElement("adminid")]
|
||||
public string? AdminId { get; set; }
|
||||
|
||||
[BsonElement("adminname")]
|
||||
public string? AdminName { get; set; }
|
||||
|
||||
[BsonElement("module")]
|
||||
public int Module { get; set; }
|
||||
|
||||
[BsonElement("actiontype")]
|
||||
public string? ActionType { get; set; }
|
||||
|
||||
[BsonElement("description")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
[BsonElement("httpmethod")]
|
||||
public string? HttpMethod { get; set; }
|
||||
|
||||
[BsonElement("requestpath")]
|
||||
public string? RequestPath { get; set; }
|
||||
|
||||
[BsonElement("requestparams")]
|
||||
public string? RequestParams { get; set; }
|
||||
|
||||
[BsonElement("response")]
|
||||
public string? Response { get; set; }
|
||||
|
||||
[BsonElement("ip")]
|
||||
public string? Ip { get; set; }
|
||||
|
||||
[BsonElement("status")]
|
||||
public int Status { get; set; } = 1;
|
||||
|
||||
[BsonElement("operatetime")]
|
||||
[BsonDateTimeOptions(Kind = DateTimeKind.Local, DateOnly = false)]
|
||||
public DateTime OperateTime { get; set; } = DateTime.Now;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Domain.Admin.Admin.ENum
|
||||
{
|
||||
public enum EnumNavigationCategory
|
||||
{
|
||||
[Description("后台菜单")]
|
||||
System,
|
||||
|
||||
[Description("前台菜单")]
|
||||
Customer
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace Domain.Admin.Admin.ENum
|
||||
{
|
||||
public enum EnumOperationModule
|
||||
{
|
||||
[Description("用户管理")]
|
||||
User = 1,
|
||||
|
||||
[Description("系统用户")]
|
||||
SystemUser = 2,
|
||||
|
||||
[Description("角色管理")]
|
||||
Role = 3,
|
||||
|
||||
[Description("菜单管理")]
|
||||
Navigation = 4,
|
||||
|
||||
[Description("字典管理")]
|
||||
Dictionary = 5,
|
||||
|
||||
[Description("游戏配置")]
|
||||
GameConfig = 6,
|
||||
|
||||
[Description("房间管理")]
|
||||
Room = 7,
|
||||
|
||||
[Description("客服管理")]
|
||||
Customer = 8,
|
||||
|
||||
[Description("靓号管理")]
|
||||
BeautifulNumber = 9,
|
||||
|
||||
[Description("公告管理")]
|
||||
Notice = 10,
|
||||
|
||||
[Description("任务管理")]
|
||||
Task = 11,
|
||||
|
||||
[Description("其他")]
|
||||
Other = 99
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Domain.Admin.Admin.ENum
|
||||
{
|
||||
|
||||
public enum EnumResource
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Description("菜单")]
|
||||
Navigation,
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Description("资源")]
|
||||
Resource,
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[Description("代码块")]
|
||||
Block
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using Domain.Admin.Admin;
|
||||
|
||||
namespace Domain.Admin.Admin
|
||||
{
|
||||
public interface IAdminOperationLogService
|
||||
{
|
||||
Task<bool> AddLog(AdminOperationLog log);
|
||||
|
||||
Task<(List<AdminOperationLog> list, long count)> QueryPage(Param.OperationLogQueryParam param);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
namespace Domain.Admin.Admin.Param
|
||||
{
|
||||
public class OperationLogQueryParam
|
||||
{
|
||||
public int PageIndex { get; set; } = 1;
|
||||
|
||||
public int PageSize { get; set; } = 20;
|
||||
|
||||
public string? AdminId { get; set; }
|
||||
|
||||
public string? AdminName { get; set; }
|
||||
|
||||
public int? Module { get; set; }
|
||||
|
||||
public DateTime? StartTime { get; set; }
|
||||
|
||||
public DateTime? EndTime { get; set; }
|
||||
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
|
||||
public class AddOperationLogParam
|
||||
{
|
||||
public string? AdminId { get; set; }
|
||||
|
||||
public string? AdminName { get; set; }
|
||||
|
||||
public int Module { get; set; }
|
||||
|
||||
public string? ActionType { get; set; }
|
||||
|
||||
public string? Description { get; set; }
|
||||
|
||||
public string? HttpMethod { get; set; }
|
||||
|
||||
public string? RequestPath { get; set; }
|
||||
|
||||
public string? RequestParams { get; set; }
|
||||
|
||||
public string? Response { get; set; }
|
||||
|
||||
public string? Ip { get; set; }
|
||||
|
||||
public int Status { get; set; } = 1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using MongoRepository;
|
||||
using MongoRepository.Attributes;
|
||||
using MongoRepository.Config;
|
||||
|
||||
namespace Domain.Admin.Admin
|
||||
{
|
||||
[BsonCollection("system_user_dic", ServiceDatabases.Admin)]
|
||||
[BsonIgnoreExtraElements]
|
||||
public class SystemDic :MongoBaseEntity
|
||||
{
|
||||
|
||||
public string ParentId { set; get; } = "";
|
||||
|
||||
[BsonElement("rolename")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[BsonElement("order")]
|
||||
public int Order { get; set; }
|
||||
|
||||
[BsonElement("icon")]
|
||||
public string? Icon { get; set; }
|
||||
|
||||
[BsonElement("value")]
|
||||
public string? Value { get; set; }
|
||||
[BsonElement("code")]
|
||||
public string? Code { get; set; }
|
||||
|
||||
[BsonElement("remark")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
|
||||
|
||||
[BsonElement("remark1")]
|
||||
public string? Remark1 { get; set; }
|
||||
|
||||
public void Init()
|
||||
{
|
||||
Id = ObjectId.GenerateNewId().ToString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
using Domain.Admin.Admin.ENum;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using MongoRepository;
|
||||
using MongoRepository.Attributes;
|
||||
using MongoRepository.Config;
|
||||
|
||||
namespace Domain.Admin.Admin
|
||||
{
|
||||
[BsonCollection("system_user_nav", ServiceDatabases.Admin)]
|
||||
[BsonIgnoreExtraElements]
|
||||
public class SystemNavigation :MongoBaseEntity
|
||||
{
|
||||
|
||||
[BsonElement("parentId")]
|
||||
public string ParentId { set; get; } = "";
|
||||
|
||||
[BsonElement("name")]
|
||||
public string? Name { get; set; }
|
||||
|
||||
[BsonElement("order")]
|
||||
public int Order { get; set; }
|
||||
|
||||
[BsonElement("icon")]
|
||||
public string? Icon { get; set; }
|
||||
|
||||
[BsonElement("url")]
|
||||
public string? Url { get; set; }
|
||||
|
||||
[BsonElement("category")]
|
||||
public EnumNavigationCategory Category { get; set; }
|
||||
|
||||
[BsonElement("target")]
|
||||
public string? Target { get; set; }
|
||||
|
||||
[BsonElement("isresource")]
|
||||
public EnumResource IsResource { get; set; }
|
||||
public void Init()
|
||||
{
|
||||
Id = ObjectId.GenerateNewId().ToString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
using Common.CommonModel;
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using MongoRepository;
|
||||
using MongoRepository.Attributes;
|
||||
using MongoRepository.Config;
|
||||
|
||||
namespace Domain.Admin.Admin
|
||||
{
|
||||
[BsonCollection("system_user", ServiceDatabases.Admin)]
|
||||
[BsonIgnoreExtraElements]
|
||||
public class SystemUser:MongoBaseEntity
|
||||
{
|
||||
[BsonElement("username")]
|
||||
public string? UserName { get; set; }
|
||||
|
||||
|
||||
[BsonElement("displayname")]
|
||||
public string? DisplayName { get; set; }
|
||||
|
||||
[BsonElement("icon")]
|
||||
public string? Icon { get; set; }
|
||||
|
||||
[BsonElement("password")]
|
||||
public string? Password { get; set; }
|
||||
|
||||
|
||||
[BsonElement("registertime")]
|
||||
[BsonDateTimeOptions(Kind = DateTimeKind.Local, DateOnly = false)]
|
||||
public DateTime RegisterTime { get; set; } = DateTime.Now;
|
||||
|
||||
[BsonElement("state")]
|
||||
public int State { get; set; } = 1;
|
||||
|
||||
[BsonElement("systemrole")]
|
||||
public BaseIdName SystemRole { get; set; }
|
||||
|
||||
|
||||
public void Init()
|
||||
{
|
||||
Id = ObjectId.GenerateNewId().ToString();
|
||||
State = 1;
|
||||
RegisterTime=DateTime.Now;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
using MongoDB.Bson;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using MongoRepository;
|
||||
using MongoRepository.Attributes;
|
||||
using MongoRepository.Config;
|
||||
|
||||
namespace Domain.Admin.Admin
|
||||
{
|
||||
[BsonCollection("system_user_role", ServiceDatabases.Admin)]
|
||||
[BsonIgnoreExtraElements]
|
||||
public class SystemUserRole:MongoBaseEntity
|
||||
{
|
||||
[BsonElement("rolename")]
|
||||
public string? RoleName { get; set; }
|
||||
|
||||
[BsonElement("description")]
|
||||
public string? Description { get; set; }
|
||||
|
||||
|
||||
[BsonElement("navIds")]
|
||||
public List<string> NavIds { get; set; } = new List<string>();
|
||||
|
||||
public void Init()
|
||||
{
|
||||
Id = ObjectId.GenerateNewId().ToString();
|
||||
NavIds = new List<string>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.3" />
|
||||
<PackageReference Include="MongoDB.Bson" Version="3.6.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Infrastructure\MongoRepository\MongoRepository.csproj" />
|
||||
<ProjectReference Include="..\..\CustomerSrc\CustomerService.Domain\CustomerService.Domain.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,50 @@
|
||||
using AdminDomain.BeautifulNumber;
|
||||
using Common.Utils;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
using MongoRepository;
|
||||
using MongoRepository.Attributes;
|
||||
using MongoRepository.Config;
|
||||
|
||||
namespace AdminDomain.Entity
|
||||
{
|
||||
[BsonCollection("beautiful_number_config", ServiceDatabases.Admin)]
|
||||
[BsonIgnoreExtraElements]
|
||||
public class BeautifulNumberConfig : MongoBaseEntity
|
||||
{
|
||||
public string Number { get; set; }
|
||||
public string RuleName { get; set; }
|
||||
|
||||
public string Level { get; set; }
|
||||
|
||||
public long Price { get; set; }
|
||||
|
||||
public BeautifulNumberStatus Status { get; set; }= BeautifulNumberStatus.Available;
|
||||
|
||||
public long SaleTime { get; set; } = 0;
|
||||
|
||||
public string BuyerUserId { get; set; }
|
||||
|
||||
public string UserId { get; set; }
|
||||
|
||||
public string Remark { get; set; }
|
||||
|
||||
public long CreateTime { get; set; } = DateTime.Now.ToTimeStamp();
|
||||
}
|
||||
|
||||
[BsonCollection("beautiful_number_rule", ServiceDatabases.Admin)]
|
||||
[BsonIgnoreExtraElements]
|
||||
public class BeautifulNumberRule : MongoBaseEntity
|
||||
{
|
||||
|
||||
public string RuleName { get; set; }
|
||||
|
||||
|
||||
public string Level { get; set; }
|
||||
|
||||
public long Price { get; set; }
|
||||
|
||||
public int Sort { get; set; }
|
||||
|
||||
public bool IsEnable { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace AdminDomain.BeautifulNumber
|
||||
{
|
||||
public enum BeautifulNumberRuleEnum
|
||||
{
|
||||
[Description("普通号")]
|
||||
Normal = 0,
|
||||
|
||||
[Description("3连号")]
|
||||
TripleRepeat = 1,
|
||||
|
||||
[Description("4连号")]
|
||||
QuadrupleRepeat = 2,
|
||||
|
||||
[Description("5连号")]
|
||||
QuintupleRepeat = 3,
|
||||
|
||||
[Description("6连号")]
|
||||
SextupleRepeat = 4,
|
||||
|
||||
[Description("7连号")]
|
||||
SeptupleRepeat = 5,
|
||||
|
||||
[Description("4顺子")]
|
||||
Straight4 = 10,
|
||||
|
||||
[Description("5顺子")]
|
||||
Straight5 = 11,
|
||||
|
||||
[Description("6顺子")]
|
||||
Straight6 = 12,
|
||||
|
||||
[Description("双连2组")]
|
||||
DoubleRepeat2 = 20,
|
||||
|
||||
[Description("双连3组")]
|
||||
DoubleRepeat3 = 21,
|
||||
|
||||
[Description("双连4组")]
|
||||
DoubleRepeat4 = 22,
|
||||
|
||||
[Description("混搭")]
|
||||
Mixed = 30,
|
||||
|
||||
[Description("5连+3任意")]
|
||||
QuintupleWithAny = 31,
|
||||
|
||||
[Description("3任意+5连")]
|
||||
AnyWithQuintuple = 32,
|
||||
|
||||
[Description("夹心3连")]
|
||||
SandwichTriple = 40,
|
||||
|
||||
[Description("间隔2连")]
|
||||
Alternating2 = 41,
|
||||
|
||||
[Description("对称3连")]
|
||||
SymmetricTriple = 42
|
||||
}
|
||||
|
||||
public enum BeautifulNumberLevel
|
||||
{
|
||||
[Description("D")]
|
||||
D = 0,
|
||||
|
||||
[Description("C")]
|
||||
C = 1,
|
||||
|
||||
[Description("B")]
|
||||
B = 2,
|
||||
|
||||
[Description("A")]
|
||||
A = 3,
|
||||
|
||||
[Description("S")]
|
||||
S = 4
|
||||
}
|
||||
|
||||
public enum BeautifulNumberStatus
|
||||
{
|
||||
[Description("未售")]
|
||||
Available = 0,
|
||||
|
||||
[Description("已售")]
|
||||
Sold = 1,
|
||||
|
||||
[Description("冻结")]
|
||||
Frozen = 2,
|
||||
|
||||
[Description("普通号")]
|
||||
Normal = 3
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using AdminDomain.Customer.Param;
|
||||
using CustomerService.Domain.Entity;
|
||||
|
||||
namespace AdminDomain.Customer
|
||||
{
|
||||
public interface ICustomerService
|
||||
{
|
||||
Task<(bool isOk, string msg, CustomerEntity? customer)> AddCustomer(AddCustomerParam param);
|
||||
Task<(bool isOk, string msg)> UpdateCustomer(UpdateCustomerParam param);
|
||||
Task<(bool isOk, string msg)> DeleteCustomer(string id);
|
||||
Task<(bool isOk, string msg, List<CustomerEntity>? customers, int total)> GetCustomerList(GetCustomerListParam param);
|
||||
Task<(bool isOk, string msg, CustomerEntity? customer)> GetCustomerById(string id);
|
||||
Task<(bool isOk, string msg, ConversationEntity? conversation)> GetConversationById(string id);
|
||||
Task<(bool isOk, string msg, List<ConversationEntity>? conversations, int total)> GetConversationList(GetConversationListParam param);
|
||||
Task<(bool isOk, string msg)> DeleteConversation(string conversationId);
|
||||
Task<(bool isOk, string msg, List<MessageEntity>? messages)> GetChatLog(string conversationId);
|
||||
Task<(bool isOk, string msg)> DeleteMessage(string id);
|
||||
Task<(bool isOk, string msg)> DeleteAllMessages(string conversationId);
|
||||
Task<(bool isOk, string msg)> DeleteMessagesBatch(List<string> ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
|
||||
namespace AdminDomain.Customer.Param
|
||||
{
|
||||
public class AddCustomerParam
|
||||
{
|
||||
public string UserId { get; set; } = "";
|
||||
public string UserName { get; set; } = "";
|
||||
public string? Avatar { get; set; }
|
||||
}
|
||||
|
||||
public class UpdateCustomerParam
|
||||
{
|
||||
public string Id { get; set; } = "";
|
||||
public string UserName { get; set; } = "";
|
||||
public string? Avatar { get; set; }
|
||||
public int Status { get; set; }
|
||||
}
|
||||
|
||||
public class GetCustomerListParam
|
||||
{
|
||||
public int PageIndex { get; set; } = 1;
|
||||
public int PageSize { get; set; } = 10;
|
||||
public string? UserName { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
|
||||
public class GetConversationListParam
|
||||
{
|
||||
public int PageIndex { get; set; } = 1;
|
||||
public int PageSize { get; set; } = 10;
|
||||
public string? UserId { get; set; }
|
||||
public string? CustomerId { get; set; }
|
||||
public int? Status { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
|
||||
namespace Domain.Admin.Notices;
|
||||
|
||||
public class NoticeDto
|
||||
{
|
||||
public string Id { get; set; }
|
||||
|
||||
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; }
|
||||
}
|
||||
|
||||
public class NoticeListItemDto
|
||||
{
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Title { get; set; }
|
||||
|
||||
public string? Recommend { get; set; }
|
||||
|
||||
public string? TopImage { get; set; }
|
||||
|
||||
public long CreateTime { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user