-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
10,672 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace VNH.Application.DTOs.Catalog.Forum.Answer | ||
{ | ||
public class AnswerFpkDto | ||
{ | ||
public string AnswerId { get; set; } = string.Empty; | ||
public string UserId { get; set; } = string.Empty; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
VNH.Application/DTOs/Catalog/Forum/Answer/AnswerQuestionDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using VNH.Application.DTOs.Catalog.Users; | ||
|
||
namespace VNH.Application.DTOs.Catalog.Forum.Answer | ||
{ | ||
public class AnswerQuestionDto | ||
{ | ||
|
||
public Guid Id { get; set; } = Guid.NewGuid(); | ||
public Guid? AuthorId { get; set; } | ||
|
||
public string QuestionId { get; set; } = string.Empty; | ||
public UserShortDto? UserShort { get; set; } | ||
public string Content { get; set; } = String.Empty; | ||
public DateTime PubDate { get; set; } | ||
public DateTime? UpdateAt { get; set; } | ||
public bool Confirm { get; set; } = false; | ||
public bool MostConfirm { get; set; } = false; | ||
public List<SubAnswerQuestionDto>? SubAnswer { get; set; } | ||
|
||
} | ||
|
||
public class SubAnswerQuestionDto | ||
{ | ||
public Guid Id { get; set; } = Guid.NewGuid(); | ||
public Guid PreAnswerId { get; set; } | ||
public Guid AuthorId { get; set; } | ||
public string Content { get; set; } = string.Empty; | ||
[Column(TypeName = "datetime")] | ||
public DateTime? PubDate { get; set; } | ||
[Column(TypeName = "datetime")] | ||
public DateTime? UpdateAt { get; set; } | ||
|
||
public UserShortDto? UserShort { get; set; } | ||
|
||
|
||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
VNH.Application/DTOs/Catalog/Forum/Answer/AnswerResponseDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using VNH.Application.DTOs.Catalog.Users; | ||
|
||
namespace VNH.Application.DTOs.Catalog.Forum.Answer | ||
{ | ||
public class AnswerResponseDto | ||
{ | ||
|
||
public string Id { get; set; } = string.Empty; | ||
public string Content { get; set; } = string.Empty; | ||
|
||
public string QuestionId { get; set; } = string.Empty; | ||
|
||
[Column(TypeName = "datetime")] | ||
public DateTime? PubDate { get; set; } | ||
public UserShortDto UserShort { get; set; } = new UserShortDto(); | ||
public bool Confirm { get; set; } | ||
public bool MostConfirm { get; set; } | ||
public List<SubAnswerResponseDto>? SubAnserwer { get; set; } | ||
|
||
} | ||
|
||
public class SubAnswerResponseDto | ||
{ | ||
public Guid Id { get; set; } | ||
public Guid PreAnswerId { get; set; } | ||
public string Content { get; set; } = string.Empty; | ||
[Column(TypeName = "datetime")] | ||
public DateTime? PubDate { get; set; } | ||
|
||
public UserShortDto? UserShort { get; set; } | ||
|
||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
VNH.Application/DTOs/Catalog/Forum/Answer/CreateAnswerDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using VNH.Application.DTOs.Catalog.Users; | ||
|
||
namespace VNH.Application.DTOs.Catalog.Forum.Answer | ||
{ | ||
public class CreateAnswerDto | ||
{ | ||
public Guid Id { get; set; } = Guid.NewGuid(); | ||
public Guid? AuthorId { get; set; } | ||
public string QuestionId { get; set; } = string.Empty; | ||
public string Content { get; set; } = string.Empty; | ||
|
||
} | ||
|
||
public class SubAnswerDto | ||
{ | ||
public Guid Id { get; set; } = Guid.NewGuid(); | ||
public Guid PreAnswerId { get; set; } | ||
|
||
public string Content { get; set; } = string.Empty; | ||
|
||
public Guid AuthorId { get; set; } | ||
|
||
|
||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
VNH.Application/DTOs/Catalog/Forum/Question/CreateQuestionDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace VNH.Application.DTOs.Catalog.Forum.Question | ||
{ | ||
public class CreateQuestionDto | ||
{ | ||
public Guid? Id { get; set; } = Guid.NewGuid(); | ||
|
||
public string? Title { get; set; } = string.Empty; | ||
public string? Content { get; set; } = string.Empty; | ||
public List<string>? Tag { get; set; } | ||
|
||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
VNH.Application/DTOs/Catalog/Forum/Question/QuestionFpkDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace VNH.Application.DTOs.Catalog.Forum.Question | ||
{ | ||
public class QuestionFpkDto | ||
{ | ||
public string QuestionId { get; set; } = string.Empty; | ||
public string UserId { get; set; } = string.Empty; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
VNH.Application/DTOs/Catalog/Forum/Question/QuestionResponseDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
| ||
using VNH.Application.DTOs.Catalog.HashTags; | ||
using VNH.Application.DTOs.Catalog.Users; | ||
|
||
namespace VNH.Application.DTOs.Catalog.Forum.Question | ||
{ | ||
public class QuestionResponseDto | ||
{ | ||
public string Id { get; set; } =string.Empty; | ||
public string Title { get; set; } = string.Empty; | ||
public string Content { get; set; } = string.Empty; | ||
public DateTime? CreateAt { get; set; } | ||
public DateTime? UpdateAt { get; set; } | ||
public List<TagDto> Tags { get; set; } = new List<TagDto>(); | ||
public UserShortDto UserShort { get; set; } = new UserShortDto(); | ||
public int ViewNumber { get; set; } = 0; | ||
public int CommentNumber { get; set; } = 0; | ||
public int SaveNumber { get; set; } = 0; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,3 @@ public class CreatePostDto | |
public List<string>? Tag { get; set; } = new List<string>(); | ||
} | ||
} | ||
|
25 changes: 25 additions & 0 deletions
25
VNH.Application/Interfaces/Catalog/Forum/IAnswerService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using VNH.Application.DTOs.Catalog.Forum.Answer; | ||
using VNH.Application.DTOs.Common.ResponseNotification; | ||
using VNH.Domain; | ||
|
||
namespace VNH.Application.Interfaces.Catalog.Forum | ||
{ | ||
public interface IAnswerService | ||
{ | ||
|
||
Task<ApiResult<List<AnswerQuestionDto>>> GetAnswer(string questionId); | ||
Task<ApiResult<List<AnswerQuestionDto>>> CreateAnswer(AnswerQuestionDto answer); | ||
Task<ApiResult<List<AnswerQuestionDto>>> UpdateAnswer(AnswerQuestionDto answer); | ||
Task<ApiResult<string>> DeteleAnswer(string id); | ||
|
||
|
||
Task<ApiResult<string>> CreateSubAnswer(SubAnswerQuestionDto subAnswer); | ||
|
||
Task<ApiResult<SubAnswerQuestionDto>> UpdateSubAnswer(SubAnswerQuestionDto answer); | ||
Task<ApiResult<string>> DeteleSubAnswer(string id); | ||
|
||
Task<ApiResult<int>> ConfirmOrNoConfirm(AnswerFpkDto answerFpk); | ||
|
||
|
||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
VNH.Application/Interfaces/Catalog/Forum/IQuestionService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
| ||
|
||
using VNH.Application.DTOs.Catalog.Forum.Question; | ||
using VNH.Application.DTOs.Catalog.HashTags; | ||
using VNH.Application.DTOs.Catalog.Posts; | ||
using VNH.Application.DTOs.Common.ResponseNotification; | ||
|
||
namespace VNH.Application.Interfaces.Catalog.Forum | ||
{ | ||
public interface IQuestionService | ||
{ | ||
Task<ApiResult<QuestionResponseDto>> Create(CreateQuestionDto requestDto, string name); | ||
Task<ApiResult<QuestionResponseDto>> Update(CreateQuestionDto requestDto, string name); | ||
|
||
Task<ApiResult<QuestionResponseDto>> Detail(string Id); | ||
Task<ApiResult<List<QuestionResponseDto>>> GetAll(); | ||
Task<ApiResult<string>> Delete(string id, string email); | ||
Task<ApiResult<int>> AddOrRemoveSaveQuestion(QuestionFpkDto questionFpk); | ||
|
||
Task<ApiResult<bool>> GetSave(QuestionFpkDto questionFpk); | ||
|
||
Task<ApiResult<List<string>>> GetAllTag(int numberTag); | ||
Task<ApiResult<List<QuestionResponseDto>>> GetQuestionByTag(string tag); | ||
|
||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using AutoMapper; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using VNH.Application.DTOs.Catalog.Forum.Answer; | ||
using VNH.Domain; | ||
|
||
namespace VNH.Application.Mappers | ||
{ | ||
public class AnswerMapper : Profile | ||
{ | ||
|
||
public AnswerMapper() { | ||
CreateMap<AnswerQuestionDto,Answer>().ReverseMap(); | ||
|
||
CreateMap<SubAnswerQuestionDto, SubAnswer>().ReverseMap(); | ||
|
||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using AutoMapper; | ||
|
||
using VNH.Application.DTOs.Catalog.Forum.Question; | ||
using VNH.Domain; | ||
|
||
namespace VNH.Application.Mappers | ||
{ | ||
public class QuestionMapper : Profile | ||
|
||
{ | ||
public QuestionMapper() | ||
{ | ||
|
||
CreateMap<CreateQuestionDto, Question>().ReverseMap(); | ||
|
||
CreateMap<QuestionResponseDto, Question>().ReverseMap(); | ||
|
||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.