From 6095f2174f94f9c10abaa0995d614c7b0e8029af Mon Sep 17 00:00:00 2001 From: chenchun Date: Mon, 12 Aug 2024 17:43:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E5=BA=94=E7=94=A8=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/Assignment/AssignmentGetListInput.cs | 8 +++ .../Assignment/AssignmentGetListOutputDto.cs | 8 +++ .../IServices/ISettingService.cs | 5 -- .../{ => Analyses}/AccessLogService.cs | 0 .../Services/AssignmentService.cs | 51 +++++++++++++++++++ .../Services/SettingService.cs | 11 ---- 6 files changed, 67 insertions(+), 16 deletions(-) create mode 100644 Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Assignment/AssignmentGetListInput.cs create mode 100644 Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Assignment/AssignmentGetListOutputDto.cs rename Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/{ => Analyses}/AccessLogService.cs (100%) create mode 100644 Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AssignmentService.cs diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Assignment/AssignmentGetListInput.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Assignment/AssignmentGetListInput.cs new file mode 100644 index 00000000..4a0c8910 --- /dev/null +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Assignment/AssignmentGetListInput.cs @@ -0,0 +1,8 @@ +using Volo.Abp.Application.Dtos; + +namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Assignment; + +public class AssignmentGetListInput +{ + +} \ No newline at end of file diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Assignment/AssignmentGetListOutputDto.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Assignment/AssignmentGetListOutputDto.cs new file mode 100644 index 00000000..27f02734 --- /dev/null +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/Dtos/Assignment/AssignmentGetListOutputDto.cs @@ -0,0 +1,8 @@ +using Volo.Abp.Application.Dtos; + +namespace Yi.Framework.Bbs.Application.Contracts.Dtos.Assignment; + +public class AssignmentGetListOutputDto:EntityDto +{ + +} \ No newline at end of file diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/IServices/ISettingService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/IServices/ISettingService.cs index 51668a61..ba722425 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/IServices/ISettingService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application.Contracts/IServices/ISettingService.cs @@ -7,10 +7,5 @@ namespace Yi.Framework.Bbs.Application.Contracts.IServices /// public interface ISettingService : IApplicationService { - /// - /// 获取配置标题 - /// - /// - Task GetTitleAsync(); } } diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AccessLogService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Analyses/AccessLogService.cs similarity index 100% rename from Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AccessLogService.cs rename to Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/Analyses/AccessLogService.cs diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AssignmentService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AssignmentService.cs new file mode 100644 index 00000000..d276e478 --- /dev/null +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/AssignmentService.cs @@ -0,0 +1,51 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Users; +using Yi.Framework.Bbs.Application.Contracts.Dtos.Assignment; +using Yi.Framework.Bbs.Domain.Managers; + +namespace Yi.Framework.Bbs.Application.Services; + +/// +/// 任务系统 +/// +[Authorize] +public class AssignmentService : ApplicationService +{ + private readonly AssignmentManager _assignmentManager; + + public AssignmentService(AssignmentManager assignmentManager) + { + _assignmentManager = assignmentManager; + } + + /// + /// 接收任务 + /// + /// + [HttpPost("assignment/accept/{id}")] + public async Task AcceptAsync(Guid id) + { + await _assignmentManager.AcceptAsync(CurrentUser.GetId(), id); + } + + /// + /// 接收任务奖励 + /// + /// + [HttpPost("assignment/receive-rewards/{id}")] + public async Task ReceiveRewardsAsync(Guid id) + { + await _assignmentManager.ReceiveRewardsAsync(id); + } + + /// + /// 查询任务 + /// + public async Task> GetListAsync(AssignmentGetListInput input) + { + throw new NotImplementedException(); + } +} \ No newline at end of file diff --git a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/SettingService.cs b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/SettingService.cs index 14298787..cb30eeb1 100644 --- a/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/SettingService.cs +++ b/Yi.Abp.Net8/module/bbs/Yi.Framework.Bbs.Application/Services/SettingService.cs @@ -9,15 +9,6 @@ namespace Yi.Framework.Bbs.Application.Services public class SettingService : ApplicationService, ISettingService { - /// - /// 获取配置标题 - /// - /// - /// - public Task GetTitleAsync() - { - return Task.FromResult("你好世界"); - } /// /// 获取头像文件 @@ -25,9 +16,7 @@ namespace Yi.Framework.Bbs.Application.Services /// public List GetIcon() { - return Directory.GetFiles("wwwroot/icon").Select(x => "wwwroot/icon/"+ Path.GetFileName(x)).ToList(); - } } }