Skip to content

Commit

Permalink
Merge pull request #24 from KYJKY/master
Browse files Browse the repository at this point in the history
개별 Profile 가져오는 API 추가
  • Loading branch information
KYJKY authored Nov 6, 2024
2 parents 8869cce + 2ba53c8 commit 613ab6b
Show file tree
Hide file tree
Showing 95 changed files with 3,163 additions and 2,413 deletions.
17 changes: 8 additions & 9 deletions Contracts/Repository/IRepositoryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
using System.Text;
using System.Threading.Tasks;

namespace Contracts.Repository
namespace Contracts.Repository;

public interface IRepositoryBase<T>
{
public interface IRepositoryBase<T>
{
IQueryable<T> FindAll(bool trackChanges);
IQueryable<T> FindByCondition(Expression<Func<T, bool>> expression, bool trackChanges);
void Create(T entity);
void Update(T entity);
void Delete(T entity);
}
IQueryable<T> FindAll(bool trackChanges);
IQueryable<T> FindByCondition(Expression<Func<T, bool>> expression, bool trackChanges);
void Create(T entity);
void Update(T entity);
void Delete(T entity);
}
21 changes: 10 additions & 11 deletions Contracts/Repository/IRepositoryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
using System.Text;
using System.Threading.Tasks;

namespace Contracts.Repository
namespace Contracts.Repository;

public interface IRepositoryManager
{
public interface IRepositoryManager
{
ICommentRepository Comment { get; }
ILikeRepository Like { get; }
IPostPhotoRepository PostPhoto { get; }
IPostRepository Post { get; }
IProfileRepository Profile { get; }
IUserRepository User { get; }
Task SaveAsync();
}
ICommentRepository Comment { get; }
ILikeRepository Like { get; }
IPostPhotoRepository PostPhoto { get; }
IPostRepository Post { get; }
IProfileRepository Profile { get; }
IUserRepository User { get; }
Task SaveAsync();
}
13 changes: 6 additions & 7 deletions Contracts/Repository/Models/ICommentRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
using System.Text;
using System.Threading.Tasks;

namespace Contracts.Repository.Models
namespace Contracts.Repository.Models;

public interface ICommentRepository
{
public interface ICommentRepository
{
Task<IEnumerable<Comment>> GetAllComment(bool trackChanges);
Task<IEnumerable<Comment>> GetCommentByPostId(int postId, bool trackChange);
void CreateComment(Comment comment);
}
Task<IEnumerable<Comment>> GetAllComment(bool trackChanges);
Task<IEnumerable<Comment>> GetCommentByPostId(int postId, bool trackChange);
void CreateComment(Comment comment);
}
15 changes: 7 additions & 8 deletions Contracts/Repository/Models/ILikeRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
using System.Text;
using System.Threading.Tasks;

namespace Contracts.Repository.Models
namespace Contracts.Repository.Models;

public interface ILikeRepository
{
public interface ILikeRepository
{
Task<IEnumerable<Like>> GetAllLike(bool trackChanges);
Task<IEnumerable<Like>> GetLikeByPostId(int postId, bool trackChange);
Task<int> GetLikeCountByPostId(int postId, bool trackChange);
void CreateLike(Like like);
}
Task<IEnumerable<Like>> GetAllLike(bool trackChanges);
Task<IEnumerable<Like>> GetLikeByPostId(int postId, bool trackChange);
Task<int> GetLikeCountByPostId(int postId, bool trackChange);
void CreateLike(Like like);
}
15 changes: 7 additions & 8 deletions Contracts/Repository/Models/IPostPhotoRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
using System.Text;
using System.Threading.Tasks;

namespace Contracts.Repository.Models
namespace Contracts.Repository.Models;

public interface IPostPhotoRepository
{
public interface IPostPhotoRepository
{
Task<IEnumerable<PostPhoto>> GetAllPostPhoto(bool trackChanges);
Task<IEnumerable<PostPhoto>> GetPostPhotoByPostId(int postId, bool trackChange);
void CreatePostPhoto(PostPhoto postphoto);
Task<int> GetLatestPostPhotoId();
}
Task<IEnumerable<PostPhoto>> GetAllPostPhoto(bool trackChanges);
Task<IEnumerable<PostPhoto>> GetPostPhotoByPostId(int postId, bool trackChange);
void CreatePostPhoto(PostPhoto postphoto);
Task<int> GetLatestPostPhotoId();
}
15 changes: 7 additions & 8 deletions Contracts/Repository/Models/IPostRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@
using System.Text;
using System.Threading.Tasks;

namespace Contracts.Repository.Models
namespace Contracts.Repository.Models;

public interface IPostRepository
{
public interface IPostRepository
{
Task<IEnumerable<Post>> GetAllPost(bool trackChanges);
Task<Post> GetPostById(int postId, bool trackChanges);
Task<IEnumerable<Post>> GetSearchPost(double x, double y, double range, bool trackChanges);
void CreatePost(Post post);
}
Task<IEnumerable<Post>> GetAllPost(bool trackChanges);
Task<Post> GetPostById(int postId, bool trackChanges);
Task<IEnumerable<Post>> GetSearchPost(double x, double y, double range, bool trackChanges);
void CreatePost(Post post);
}
11 changes: 6 additions & 5 deletions Contracts/Repository/Models/IProfileRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
using System.Text;
using System.Threading.Tasks;

namespace Contracts.Repository.Models
namespace Contracts.Repository.Models;

public interface IProfileRepository
{
public interface IProfileRepository
{
Task<IEnumerable<Profile>> GetAllProfile(bool trackChanges);
}
Task<IEnumerable<Profile>> GetAllProfile(bool trackChanges);
void CreateProfile(Profile profile);
Task<Profile> GetProfileByUserId(string userId, bool trackChanges);
}
11 changes: 5 additions & 6 deletions Contracts/Repository/Models/IUserRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
using System.Text;
using System.Threading.Tasks;

namespace Contracts.Repository.Models
namespace Contracts.Repository.Models;

public interface IUserRepository
{
public interface IUserRepository
{
Task<IEnumerable<User>> GetAllUser(bool trackChanges);
Task<User> GetUserByEmail(string email, bool tackChanges);
}
Task<IEnumerable<User>> GetAllUser(bool trackChanges);
Task<User> GetUserByEmail(string email, bool tackChanges);
}
13 changes: 6 additions & 7 deletions EveryPinApi.Entites/Code/CodePlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@
using System.Text;
using System.Threading.Tasks;

namespace Entites.Code
namespace Entites.Code;

public enum CodePlatform
{
public enum CodePlatform
{
NONE = -1,
KAKAO = 1,
GOOGLE = 2
}
NONE = -1,
KAKAO = 1,
GOOGLE = 2
}
13 changes: 6 additions & 7 deletions EveryPinApi.Entites/ErrorModel/ErrorDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
using System.Text.Json;
using System.Threading.Tasks;

namespace Entites.ErrorModel
namespace Entites.ErrorModel;

public class ErrorDetails
{
public class ErrorDetails
{
public int StatusCode { get; set; }
public string? Message { get; set; }
public override string ToString() => JsonSerializer.Serialize(this);
}
public int StatusCode { get; set; }
public string? Message { get; set; }
public override string ToString() => JsonSerializer.Serialize(this);
}
11 changes: 5 additions & 6 deletions EveryPinApi.Entites/Exceptions/CommentNotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
using System.Text;
using System.Threading.Tasks;

namespace Entites.Exceptions
namespace Entites.Exceptions;

public sealed class CommentNotFoundException : NotFoundException
{
public sealed class CommentNotFoundException : NotFoundException
public CommentNotFoundException(int postId)
: base($"Post ID [{postId}]에 해당하는 [Comment] 객체가 데이터베이스에 존재하지 않습니다.")
{
public CommentNotFoundException(int postId)
: base($"Post ID [{postId}]에 해당하는 [Comment] 객체가 데이터베이스에 존재하지 않습니다.")
{
}
}
}
11 changes: 5 additions & 6 deletions EveryPinApi.Entites/Exceptions/LikeNotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
using System.Text;
using System.Threading.Tasks;

namespace Entites.Exceptions
namespace Entites.Exceptions;

public sealed class LikeNotFoundException : NotFoundException
{
public sealed class LikeNotFoundException : NotFoundException
public LikeNotFoundException(int postId)
: base($"Post ID [{postId}]에 해당하는 [Like] 객체가 데이터베이스에 존재하지 않습니다.")
{
public LikeNotFoundException(int postId)
: base($"Post ID [{postId}]에 해당하는 [Like] 객체가 데이터베이스에 존재하지 않습니다.")
{
}
}
}
14 changes: 6 additions & 8 deletions EveryPinApi.Entites/Exceptions/NotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@
using System.Text;
using System.Threading.Tasks;

namespace Entites.Exceptions
{
public abstract class NotFoundException : Exception
{
protected NotFoundException(string message)
: base(message)
{ }
}
namespace Entites.Exceptions;

public abstract class NotFoundException : Exception
{
protected NotFoundException(string message)
: base(message)
{ }
}
11 changes: 5 additions & 6 deletions EveryPinApi.Entites/Exceptions/PostNotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
using System.Text;
using System.Threading.Tasks;

namespace Entites.Exceptions
namespace Entites.Exceptions;

public sealed class PostNotFoundException : NotFoundException
{
public sealed class PostNotFoundException : NotFoundException
public PostNotFoundException(int postId)
: base($"Post ID [{postId}]에 해당하는 값이 데이터베이스에 존재하지 않습니다.")
{
public PostNotFoundException(int postId)
: base($"Post ID [{postId}]에 해당하는 값이 데이터베이스에 존재하지 않습니다.")
{
}
}
}
11 changes: 5 additions & 6 deletions EveryPinApi.Entites/Exceptions/PostPhotoNotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
using System.Text;
using System.Threading.Tasks;

namespace Entites.Exceptions
namespace Entites.Exceptions;

public sealed class PostPhotoNotFoundException : NotFoundException
{
public sealed class PostPhotoNotFoundException : NotFoundException
public PostPhotoNotFoundException(int postId)
: base($"Post ID [{postId}]에 해당하는 [PostPhoto] 객체가 데이터베이스에 존재하지 않습니다.")
{
public PostPhotoNotFoundException(int postId)
: base($"Post ID [{postId}]에 해당하는 [PostPhoto] 객체가 데이터베이스에 존재하지 않습니다.")
{
}
}
}
13 changes: 6 additions & 7 deletions EveryPinApi.Entites/Exceptions/UserNotFoundException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
using System.Text;
using System.Threading.Tasks;

namespace Entites.Exceptions
namespace Entites.Exceptions;

public sealed class UserNotFoundException : NotFoundException
{
public sealed class UserNotFoundException : NotFoundException
public UserNotFoundException(string userEmail)
: base($"Email [{userEmail}]에 해당하는 유저 정보가 데이터베이스에 존재하지 않습니다.")
{
public UserNotFoundException(string userEmail)
: base($"Email [{userEmail}]에 해당하는 유저 정보가 데이터베이스에 존재하지 않습니다.")
{

}

}
}
17 changes: 8 additions & 9 deletions EveryPinApi.Entites/Models/CodeOAuthPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
using System.Text;
using System.Threading.Tasks;

namespace Entites.Models
namespace Entites.Models;

public class CodeOAuthPlatform
{
public class CodeOAuthPlatform
{
[Column("PlatformCodeId")]
public int Id { get; set; }
[Required]
public string? PlatformName { get; set; }
public ICollection<User>? User { get; set; } = new List<User>();
}
[Column("PlatformCodeId")]
public int Id { get; set; }
[Required]
public string? PlatformName { get; set; }
public ICollection<User>? User { get; set; } = new List<User>();
}
25 changes: 12 additions & 13 deletions EveryPinApi.Entites/Models/Comment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,20 @@
using System.Text;
using System.Threading.Tasks;

namespace Entites.Models
namespace Entites.Models;

public class Comment
{
public class Comment
{
[Column("CommentId")]
public int CommentId { get; set; }
[Column("CommentId")]
public int CommentId { get; set; }

public int? PostId { get; set; }
public Post? Post { get; set; }
public int? PostId { get; set; }
public Post? Post { get; set; }

[ForeignKey(nameof(User))]
public required string UserId { get; set; }
public User? User { get; set; }
[ForeignKey(nameof(User))]
public required string UserId { get; set; }
public User? User { get; set; }

public string? CommentMessage { get; set; }
public DateTime? CreatedDate { get; set; } = DateTime.Now;
}
public string? CommentMessage { get; set; }
public DateTime? CreatedDate { get; set; } = DateTime.Now;
}
Loading

0 comments on commit 613ab6b

Please sign in to comment.