Skip to content

Commit

Permalink
Merge pull request #31 from LuongXuanNhat/master_check
Browse files Browse the repository at this point in the history
Master check
  • Loading branch information
LuongXuanNhat authored Nov 21, 2023
2 parents 99ab056 + 8be707c commit 85ca78c
Show file tree
Hide file tree
Showing 99 changed files with 16,022 additions and 656 deletions.
2 changes: 1 addition & 1 deletion VNH.Application/Common/Contants/SystemConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public static class SystemConstants
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 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;

}
}
20 changes: 18 additions & 2 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? 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: 8 additions & 0 deletions VNH.Application/DTOs/Catalog/Posts/PostFpkDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace VNH.Application.DTOs.Catalog.Posts
{
public class PostFpkDto
{
public string PostId { get; set; } = string.Empty;
public string UserId { get; set; } = string.Empty;
}
}
4 changes: 2 additions & 2 deletions VNH.Application/DTOs/Catalog/Posts/ReportPostDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ 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 DateTime ReportDate { get; set; }
public string? Description { get; set; } = string.Empty;
public DateTime ReportDate { get; set; } = DateTime.Now;
public bool Checked { get; set; } = false;
}
}
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;
}
}
13 changes: 13 additions & 0 deletions VNH.Application/Interfaces/Catalog/Chats/ICommentService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VNH.Application.Interfaces.Catalog.Chats
{
public interface ICommentService
{

}
}
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

0 comments on commit 85ca78c

Please sign in to comment.