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

[refactor] 디렉토리 구조 수정 #8

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.programmers.signalbuddy.domain.bookmark.controller;

public class BookmarkController {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.programmers.signalbuddy.domain.bookmark;
package org.programmers.signalbuddy.domain.bookmark.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand All @@ -15,7 +15,7 @@
import lombok.ToString;
import org.locationtech.jts.geom.Point;
import org.programmers.signalbuddy.domain.basetime.BaseTimeEntity;
import org.programmers.signalbuddy.domain.member.Member;
import org.programmers.signalbuddy.domain.member.entity.Member;

@Entity(name = "bookmarks")
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.programmers.signalbuddy.domain.bookmark.repository;

import org.programmers.signalbuddy.domain.bookmark.entity.Bookmark;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface BookmarkRepository extends JpaRepository<Bookmark, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.programmers.signalbuddy.domain.bookmark.service;

import lombok.RequiredArgsConstructor;
import org.programmers.signalbuddy.domain.bookmark.repository.BookmarkRepository;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class BookmarkService {

private final BookmarkRepository bookmarkRepository;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.programmers.signalbuddy.domain.comment.controller;

public class CommentController {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.programmers.signalbuddy.domain.comment;
package org.programmers.signalbuddy.domain.comment.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand All @@ -7,16 +7,15 @@
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.programmers.signalbuddy.domain.basetime.BaseTimeEntity;
import org.programmers.signalbuddy.domain.feedback.Feedback;
import org.programmers.signalbuddy.domain.member.Member;
import org.programmers.signalbuddy.domain.feedback.entity.Feedback;
import org.programmers.signalbuddy.domain.member.entity.Member;

@Entity(name = "comments")
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.programmers.signalbuddy.domain.comment.repository;

import org.programmers.signalbuddy.domain.comment.entity.Comment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface CommentRepository extends JpaRepository<Comment, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.programmers.signalbuddy.domain.comment.service;

import lombok.RequiredArgsConstructor;
import org.programmers.signalbuddy.domain.comment.repository.CommentRepository;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class CommentService {

private final CommentRepository commentRepository;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.programmers.signalbuddy.domain.crossroad.controller;

public class CrossroadController {

}
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package org.programmers.signalbuddy.domain.crossroad;
package org.programmers.signalbuddy.domain.crossroad.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Index;
import jakarta.persistence.Table;
import java.time.LocalDate;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.programmers.signalbuddy.domain.crossroad.repository;

import org.programmers.signalbuddy.domain.crossroad.Crossroad;
import org.programmers.signalbuddy.domain.crossroad.entity.Crossroad;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.programmers.signalbuddy.domain.feedback.controller;

public class FeedbackController {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.programmers.signalbuddy.domain.feedback;
package org.programmers.signalbuddy.domain.feedback.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand All @@ -14,7 +14,7 @@
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.programmers.signalbuddy.domain.basetime.BaseTimeEntity;
import org.programmers.signalbuddy.domain.member.Member;
import org.programmers.signalbuddy.domain.member.entity.Member;

@Entity(name = "feedbacks")
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.programmers.signalbuddy.domain.feedback.repository;

import org.programmers.signalbuddy.domain.feedback.entity.Feedback;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface FeedbackRepository extends JpaRepository<Feedback, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.programmers.signalbuddy.domain.feedback.service;

import lombok.RequiredArgsConstructor;
import org.programmers.signalbuddy.domain.feedback.repository.FeedbackRepository;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class FeedbackService {

private final FeedbackRepository feedbackRepository;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.programmers.signalbuddy.domain.like.controller;

public class LikeController {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.programmers.signalbuddy.domain.like;
package org.programmers.signalbuddy.domain.like.entity;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
Expand All @@ -12,8 +12,8 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.programmers.signalbuddy.domain.feedback.Feedback;
import org.programmers.signalbuddy.domain.member.Member;
import org.programmers.signalbuddy.domain.feedback.entity.Feedback;
import org.programmers.signalbuddy.domain.member.entity.Member;

@Entity(name = "likes")
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.programmers.signalbuddy.domain.like.repository;

import org.programmers.signalbuddy.domain.like.entity.Like;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface LikeRepository extends JpaRepository<Like, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.programmers.signalbuddy.domain.like.service;

import lombok.RequiredArgsConstructor;
import org.programmers.signalbuddy.domain.like.repository.LikeRepository;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class LikeService {

private final LikeRepository likeRepository;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.programmers.signalbuddy.domain.member.controller;

import lombok.RequiredArgsConstructor;
import org.programmers.signalbuddy.domain.member.entity.dto.MemberResponse;
import org.programmers.signalbuddy.domain.member.service.MemberService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("members")
@RequiredArgsConstructor
public class MemberController {

private final MemberService memberService;

@GetMapping("{id}")
public ResponseEntity<MemberResponse> getMember(@PathVariable Long id) {
final MemberResponse member = memberService.getMember(id);
return ResponseEntity.ok(member);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.programmers.signalbuddy.domain.member;
package org.programmers.signalbuddy.domain.member.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand All @@ -14,6 +14,7 @@
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.programmers.signalbuddy.domain.basetime.BaseTimeEntity;
import org.programmers.signalbuddy.domain.member.MemberStatus;

@Entity(name = "members")
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.programmers.signalbuddy.domain.member.entity.dto;

import org.programmers.signalbuddy.domain.member.MemberStatus;

public class MemberResponse {

private Long memberId;

private String email;

private String nickname;

private String profileImageUrl;

private String role;

private MemberStatus memberStatus;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.programmers.signalbuddy.domain.member.repository;

import org.programmers.signalbuddy.domain.member.entity.Member;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface MemberRepository extends JpaRepository<Member, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.programmers.signalbuddy.domain.member.service;

import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import org.programmers.signalbuddy.domain.member.entity.Member;
import org.programmers.signalbuddy.domain.member.entity.dto.MemberResponse;

@Mapper
public interface MemberMapper {

MemberMapper INSTANCE = Mappers.getMapper(MemberMapper.class);

MemberResponse toDto(Member member);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package org.programmers.signalbuddy.domain.member.service;

import lombok.RequiredArgsConstructor;
import org.programmers.signalbuddy.domain.member.entity.dto.MemberResponse;
import org.programmers.signalbuddy.domain.member.repository.MemberRepository;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class MemberService {

private final MemberRepository memberRepository;

public MemberResponse getMember(Long id) {
return memberRepository.findById(id).map(MemberMapper.INSTANCE::toDto)
.orElseThrow(() -> new RuntimeException("Not Yet"));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package org.programmers.signalbuddy.domain.social.controller;

public class SocialProviderController {

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.programmers.signalbuddy.domain.social;
package org.programmers.signalbuddy.domain.social.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
Expand All @@ -13,7 +13,7 @@
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.programmers.signalbuddy.domain.basetime.BaseTimeEntity;
import org.programmers.signalbuddy.domain.member.Member;
import org.programmers.signalbuddy.domain.member.entity.Member;

@Entity
@Getter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.programmers.signalbuddy.domain.social.repository;

import org.programmers.signalbuddy.domain.social.entity.SocialProvider;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface SocialProviderRepository extends JpaRepository<SocialProvider, Long> {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package org.programmers.signalbuddy.domain.social.service;

import lombok.RequiredArgsConstructor;
import org.programmers.signalbuddy.domain.social.repository.SocialProviderRepository;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class SocialProviderService {

private final SocialProviderRepository socialProviderRepository;
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.GeometryFactory;
import org.locationtech.jts.geom.Point;
import org.programmers.signalbuddy.domain.crossroad.Crossroad;
import org.programmers.signalbuddy.domain.crossroad.entity.Crossroad;
import org.programmers.signalbuddy.domain.crossroad.repository.CrossroadRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase;
Expand Down
2 changes: 1 addition & 1 deletion submodule
Loading