Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master check #32

Open
wants to merge 23 commits into
base: 11.Post_Extension
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
ab613e7
Merge pull request #24 from LuongXuanNhat/11.Post_Extension
LuongXuanNhat Oct 30, 2023
fa098c1
Merge pull request #25 from LuongXuanNhat/11.Post_Extension
LuongXuanNhat Nov 4, 2023
921203c
Merge pull request #26 from LuongXuanNhat/11.Post_Extension
LuongXuanNhat Nov 10, 2023
99ab056
Merge pull request #27 from LuongXuanNhat/11.Post_Extension
LuongXuanNhat Nov 16, 2023
aa232ad
Create Api Document: Add, Delete,Update,ListALl, Detail
vuanh25 Nov 17, 2023
c8a0d21
#29.1 | Fix conflic
LuongXuanNhat Nov 18, 2023
ee64a08
#29.2 | Continues fix bug conflic
LuongXuanNhat Nov 18, 2023
861d0ee
29.3 | Fix conflic 2
LuongXuanNhat Nov 18, 2023
cacce55
update updateDocs, deletet,detail, addSaveDocsOrRemove
vuanh25 Nov 19, 2023
81a0cd3
Merge pull request #30 from LuongXuanNhat/anhvu1
LuongXuanNhat Nov 19, 2023
0770741
#29.4 -> 30 | Update code docs, update tags code
LuongXuanNhat Nov 19, 2023
b27b491
#31 | Chat Realtime success
LuongXuanNhat Nov 20, 2023
dea306e
Create Question, Answer for Question
vuanh25 Nov 21, 2023
1d6d24c
Create Question,Answer for question
vuanh25 Nov 21, 2023
734aff5
31 | Search post
LuongXuanNhat Nov 21, 2023
6b10971
Merge pull request #34 from LuongXuanNhat/Question_Answer
LuongXuanNhat Nov 21, 2023
e0a80cb
#33 | Accept
LuongXuanNhat Nov 21, 2023
f70fd9b
#33.1 | Fix conflic
LuongXuanNhat Nov 21, 2023
8be707c
Merge pull request #35 from LuongXuanNhat/12.ChatRealTime
LuongXuanNhat Nov 21, 2023
e95fef0
#34 | Delete data
LuongXuanNhat Nov 22, 2023
3343632
# 35 | update code
LuongXuanNhat Nov 23, 2023
fa924f6
#35.1 | Update chat post
LuongXuanNhat Nov 24, 2023
6fe80fa
#35.2 | Update discover , get data like/number/saveCount
LuongXuanNhat Nov 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions VNH.Application/Common/Contants/SystemConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ public static class SystemConstants
public const string Token = "Token";
public const string BaseAddress = "BaseAddress";
// public const string UrlWeb = "https://vuanhpham25-001-site1.gtempurl.com/";
public const string UrlWeb = "https://localhost:7138/";
// public const string ConnectString = "Data Source=SQL5111.site4now.net;Initial Catalog=db_aa121e_vuanhpham25;User Id=db_aa121e_vuanhpham25_admin;Password=30102002Mai";
public const string UrlWeb = "https://localhost:7138/";
// public const string ConnectString = "Data Source=SQL5111.site4now.net;Initial Catalog=db_aa121e_vuanhpham25;UserShort Id=db_aa121e_vuanhpham25_admin;Password=30102002Mai";
public const string ConnectString = "Data Source=.;Initial Catalog=VietNamHistory_2;Integrated Security=True;Encrypt=true;TrustServerCertificate=true;";
}
}
14 changes: 14 additions & 0 deletions VNH.Application/DTOs/Catalog/Document/CreateDocumentDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Microsoft.AspNetCore.Http;
namespace VNH.Application.DTOs.Catalog.Document
{
public class CreateDocumentDto
{

public Guid? Id { get; set; } = Guid.NewGuid();
public string? SubId { get; set; }
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;
public IFormFile? FileName { get; set; }

}
}
14 changes: 14 additions & 0 deletions VNH.Application/DTOs/Catalog/Document/DocumentFpkDto.cs
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.Document
{
public class DocumentFpkDto
{
public string DocumentId { get; set; } = string.Empty;
public string UserId { get; set; } = string.Empty;
}
}
26 changes: 26 additions & 0 deletions VNH.Application/DTOs/Catalog/Document/DocumentReponseDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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.Document
{
public class DocumentReponseDto
{
public Guid? Id { get; set; }
public string? SubId { get; set; }
public string Title { get; set; } = string.Empty;
public string Description { get; set; } = string.Empty;

public string FileName { get; set; } = string.Empty;

public DateTime? CreatedAt { get; set; }
public DateTime? UpdatedAt { get; set; }
public UserShortDto UserShort { get; set; } = new UserShortDto();
public int ViewNumber { get; set; } = 0;
public int DownloadNumber { get; set; } = 0;
public int PageNumber { get; set; } = 0;
}
}
14 changes: 14 additions & 0 deletions VNH.Application/DTOs/Catalog/Forum/Answer/AnswerFpkDto.cs
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 VNH.Application/DTOs/Catalog/Forum/Answer/AnswerQuestionDto.cs
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 VNH.Application/DTOs/Catalog/Forum/Answer/AnswerResponseDto.cs
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 VNH.Application/DTOs/Catalog/Forum/Answer/CreateAnswerDto.cs
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 VNH.Application/DTOs/Catalog/Forum/Question/CreateQuestionDto.cs
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 VNH.Application/DTOs/Catalog/Forum/Question/QuestionFpkDto.cs
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 VNH.Application/DTOs/Catalog/Forum/Question/QuestionResponseDto.cs
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;

}
}
22 changes: 19 additions & 3 deletions VNH.Application/DTOs/Catalog/Posts/CommentPostDto.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
namespace VNH.Application.DTOs.Catalog.Posts
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System.ComponentModel.DataAnnotations.Schema;
using VNH.Application.DTOs.Catalog.Users;

namespace VNH.Application.DTOs.Catalog.Posts
{
public class CommentPostDto
{
public Guid Id { get; set; } = Guid.NewGuid();
public Guid? UserId { get; set; }
public string PostId { get; set; } = String.Empty;
public Guid UserId { get; set; }
public UserShortDto? UserShort { get; set; }
public string Content { get; set; } = String.Empty;
public DateTime CreatedAt { get; set; }
public DateTime CreatedAt { get; set; } = DateTime.Now;
public DateTime? UpdatedAt { get; set; }
public List<SubCommentDto>? SubComment { get; set; }
}
public class SubCommentDto
{
public Guid Id { get; set; }
public string? Content { get; set; }
[Column(TypeName = "datetime")]
public DateTime? CreatedAt { get; set; }
[Column(TypeName = "datetime")]
public DateTime? UpdatedAt { get; set; }
public UserShortDto? UserShort { get; set; }
}
}
5 changes: 2 additions & 3 deletions VNH.Application/DTOs/Catalog/Posts/CreatePostDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ public class CreatePostDto
public string? Id { get; set; } = Guid.NewGuid().ToString();
public string Title { get; set; } = string.Empty;
public string Content { get; set; } = string.Empty;
public IFormFile? Image { get; set; }
public IFormFile? Image { get; set; }
public Guid TopicId { get; set; }
public List<string>? Tag { get; set; }
public List<string>? Tag { get; set; } = new List<string>();
}
}

8 changes: 1 addition & 7 deletions VNH.Application/DTOs/Catalog/Posts/PostFpkDto.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VNH.Application.DTOs.Catalog.Posts
namespace VNH.Application.DTOs.Catalog.Posts
{
public class PostFpkDto
{
Expand Down
8 changes: 2 additions & 6 deletions VNH.Application/DTOs/Catalog/Posts/PostResponseDto.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System.ComponentModel.DataAnnotations.Schema;
using VNH.Application.DTOs.Catalog.HashTags;
using VNH.Application.DTOs.Catalog.HashTags;
using VNH.Application.DTOs.Catalog.Users;
using VNH.Domain;

namespace VNH.Application.DTOs.Catalog.Posts
{
Expand All @@ -16,7 +12,7 @@ public class PostResponseDto
public string Image { get; set; } = string.Empty;
public DateTime? CreatedAt { get; set; }
public DateTime? UpdatedAt { get; set; }
public string TopicName { get; set; } = string.Empty;
public string? TopicName { get; set; } = string.Empty;
public List<TagDto> Tags { get; set; } = new List<TagDto>();
public UserShortDto UserShort { get; set; } = new UserShortDto();
public int ViewNumber { get; set; } = 0;
Expand Down
2 changes: 1 addition & 1 deletion VNH.Application/DTOs/Catalog/Posts/ReportPostDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public class ReportPostDto
public string PostId { get; set; }
public Guid UserId { get; set; }
public Guid ReportId { get; set; }
public string Description { get; set; } = string.Empty;
public string? Description { get; set; } = string.Empty;
public DateTime ReportDate { get; set; } = DateTime.Now;
public bool Checked { get; set; } = false;
}
Expand Down
2 changes: 1 addition & 1 deletion VNH.Application/DTOs/Catalog/Users/UserShortDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace VNH.Application.DTOs.Catalog.Users
public class UserShortDto
{
public Guid Id { get; set; }
public string FullName { get; set; }
public string FullName { get; set; } = string.Empty;
public string? Image { get; set; } = string.Empty;
}
}
20 changes: 20 additions & 0 deletions VNH.Application/Interfaces/Catalog/Documents/IDocumentService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using VNH.Application.DTOs.Catalog.Document;
using VNH.Application.DTOs.Catalog.Posts;
using VNH.Application.DTOs.Common.ResponseNotification;

namespace VNH.Application.Interfaces.Documents
{
public interface IDocumentService
{
Task<ApiResult<DocumentReponseDto>> Create(CreateDocumentDto requestDto, string name);
Task<ApiResult<DocumentReponseDto>> Update(CreateDocumentDto requestDto, string name);
Task<ApiResult<DocumentReponseDto>> Detail(string Id);
Task<ApiResult<List<DocumentReponseDto>>> GetAll();
Task<ApiResult<string>> Delete(string id, string email);

Task<ApiResult<bool>> GetSave(DocumentFpkDto docsFpk);

Task<ApiResult<int>> AddOrRemoveSaveDocs(DocumentFpkDto docsFpk);

}
}
25 changes: 25 additions & 0 deletions VNH.Application/Interfaces/Catalog/Forum/IAnswerService.cs
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);


}
}
Loading
Loading