feat:第一次提交
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
using NapCatRobotClient.Service.Group.TextProcess;
|
||||
|
||||
namespace NapCatRobotClient.Service.Group.Service
|
||||
{
|
||||
public class GroupService : IGroupService, IScoped
|
||||
{
|
||||
private static string GroupQQ = App.Configuration["QQConfig:XiuXianGroupId"];
|
||||
|
||||
/// <summary>
|
||||
/// 处理群消息
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<bool> ProcessGroupRequest(string message)
|
||||
{
|
||||
JObject json = JObject.Parse(message);
|
||||
string groupId = json["group_id"]?.ToString() ?? string.Empty;
|
||||
string groupMsg = json["message"]?.ToString() ?? string.Empty;
|
||||
if (GroupQQ == groupId && string.IsNullOrWhiteSpace(groupMsg) is false)
|
||||
{
|
||||
_ = WantedPriceProcess.ProcessGroupRequest(groupId, message);
|
||||
|
||||
_ = InertOrUpdateGoodsInfoProcess.ProcessGroupRequest(groupId, message);
|
||||
|
||||
_= LingTianProcess.ProcessGroupRequest(groupId, message);
|
||||
}
|
||||
|
||||
return await Task.FromResult(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace NapCatRobotClient.Service.Group.Service
|
||||
{
|
||||
public interface IGroupService
|
||||
{
|
||||
/// <summary>
|
||||
/// 处理群消息
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <returns></returns>
|
||||
public Task<bool> ProcessGroupRequest(string message);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user