-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[FEAT] 방문 기업 조회 API 구현
- Loading branch information
Showing
5 changed files
with
69 additions
and
0 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
15 changes: 15 additions & 0 deletions
15
src/main/java/danpoong/soenter/domain/enterprise/dto/VisitConverter.java
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,15 @@ | ||
package danpoong.soenter.domain.enterprise.dto; | ||
|
||
import danpoong.soenter.domain.enterprise.entity.Enterprise; | ||
import danpoong.soenter.domain.enterprise.dto.VisitDTO.VisitResponse.GetVisitedEnterpriseResponse; | ||
public class VisitConverter { | ||
public static GetVisitedEnterpriseResponse toVisitedEnterpriseResponse(Enterprise enterprise) { | ||
return GetVisitedEnterpriseResponse.builder() | ||
.enterpriseId(enterprise.getEnterpriseId()) | ||
.enterpriseName(enterprise.getName()) | ||
.city(enterprise.getCity()) | ||
.district(enterprise.getDistrict()) | ||
.website(enterprise.getWebsite()) | ||
.build(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/danpoong/soenter/domain/enterprise/dto/VisitDTO.java
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 @@ | ||
package danpoong.soenter.domain.enterprise.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
public class VisitDTO { | ||
public static class VisitResponse { | ||
@Getter | ||
@Builder | ||
public static class GetVisitedEnterpriseResponse { | ||
private Long enterpriseId; | ||
private String enterpriseName; | ||
private String city; | ||
private String district; | ||
private String website; | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/danpoong/soenter/domain/enterprise/repository/VisitRepository.java
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 |
---|---|---|
@@ -1,7 +1,11 @@ | ||
package danpoong.soenter.domain.enterprise.repository; | ||
|
||
import danpoong.soenter.domain.enterprise.entity.Visit; | ||
import danpoong.soenter.domain.user.entity.User; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.List; | ||
|
||
public interface VisitRepository extends JpaRepository<Visit, Long> { | ||
List<Visit> findByUser(User user); | ||
} |
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