-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from f-lab-edu/feature/32-search
[#32] 공간 검색 기능
- Loading branch information
Showing
41 changed files
with
1,611 additions
and
890 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
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
31 changes: 31 additions & 0 deletions
31
src/main/java/com/modoospace/config/elacticsearch/RestClientConfig.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,31 @@ | ||
package com.modoospace.config.elacticsearch; | ||
|
||
import org.elasticsearch.client.RestHighLevelClient; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.data.elasticsearch.client.ClientConfiguration; | ||
import org.springframework.data.elasticsearch.client.RestClients; | ||
import org.springframework.data.elasticsearch.config.AbstractElasticsearchConfiguration; | ||
|
||
@Configuration | ||
public class RestClientConfig extends AbstractElasticsearchConfiguration { | ||
|
||
@Value("${spring.elasticsearch.host}") | ||
private String host; | ||
@Value("${spring.elasticsearch.port}") | ||
private int port; | ||
@Value("${spring.elasticsearch.username}") | ||
private String username; | ||
@Value("${spring.elasticsearch.password}") | ||
private String password; | ||
|
||
@Override | ||
public RestHighLevelClient elasticsearchClient() { | ||
final ClientConfiguration clientConfiguration = ClientConfiguration.builder() | ||
.connectedTo(host + ":" + port) | ||
.withBasicAuth(username, password) | ||
.build(); | ||
|
||
return RestClients.create(clientConfiguration).rest(); | ||
} | ||
} |
36 changes: 0 additions & 36 deletions
36
src/main/java/com/modoospace/config/redis/EmbeddedRedisConfig.java
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
src/main/java/com/modoospace/space/controller/AdminSpaceController.java
This file was deleted.
Oops, something went wrong.
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
65 changes: 65 additions & 0 deletions
65
src/main/java/com/modoospace/space/controller/dto/address/AddressCreateUpdateRequest.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,65 @@ | ||
package com.modoospace.space.controller.dto.address; | ||
|
||
import com.modoospace.space.domain.Address; | ||
import javax.validation.constraints.NotEmpty; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class AddressCreateUpdateRequest { | ||
|
||
@NotEmpty | ||
private String depthFirst; // 시도 | ||
|
||
@NotEmpty | ||
private String depthSecond; // 구 | ||
|
||
@NotEmpty | ||
private String depthThird; // 동 | ||
|
||
@NotEmpty | ||
private String addressNo; // 지번 | ||
|
||
@NotEmpty | ||
private String roadName; // 도로명 | ||
|
||
@NotEmpty | ||
private String buildingNo; // 건물번호 | ||
|
||
private String detailAddress; // 나머지 주소 | ||
|
||
private String x; // 경도 | ||
|
||
private String y; // 위도 | ||
|
||
@Builder | ||
public AddressCreateUpdateRequest(String depthFirst, String depthSecond, String depthThird, | ||
String addressNo, String roadName, String buildingNo, String detailAddress, String x, | ||
String y) { | ||
this.depthFirst = depthFirst; | ||
this.depthSecond = depthSecond; | ||
this.depthThird = depthThird; | ||
this.addressNo = addressNo; | ||
this.roadName = roadName; | ||
this.buildingNo = buildingNo; | ||
this.detailAddress = detailAddress; | ||
this.x = x; | ||
this.y = y; | ||
} | ||
|
||
public Address toEntity() { | ||
return Address.builder() | ||
.depthFirst(depthFirst) | ||
.depthSecond(depthSecond) | ||
.depthThird(depthThird) | ||
.addressNo(addressNo) | ||
.roadName(roadName) | ||
.buildingNo(buildingNo) | ||
.detailAddress(detailAddress) | ||
.x(x) | ||
.y(y) | ||
.build(); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
src/main/java/com/modoospace/space/controller/dto/address/AddressResponse.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,50 @@ | ||
package com.modoospace.space.controller.dto.address; | ||
|
||
import com.modoospace.space.domain.Address; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class AddressResponse { | ||
|
||
private String depthFirst; // 시도 | ||
private String depthSecond; // 구 | ||
private String depthThird; // 동 | ||
private String noAddress; // 지번주소 | ||
private String roadAddress; // 도로명주소 | ||
|
||
@Builder | ||
public AddressResponse(String depthFirst, String depthSecond, String depthThird, | ||
String noAddress, | ||
String roadAddress) { | ||
this.depthFirst = depthFirst; | ||
this.depthSecond = depthSecond; | ||
this.depthThird = depthThird; | ||
this.noAddress = noAddress; | ||
this.roadAddress = roadAddress; | ||
} | ||
|
||
public static AddressResponse of(Address address) { | ||
return AddressResponse.builder() | ||
.depthFirst(address.getDepthFirst()) | ||
.depthSecond(address.getDepthSecond()) | ||
.depthThird(address.getDepthThird()) | ||
.noAddress(getNoAddress(address)) | ||
.roadAddress(getRoadAddress(address)) | ||
.build(); | ||
} | ||
|
||
private static String getNoAddress(Address address) { | ||
return address.getDepthFirst() + " " + address.getDepthSecond() + " " | ||
+ address.getDepthThird() + " " + address.getAddressNo() + " " | ||
+ address.getDetailAddress(); | ||
} | ||
|
||
private static String getRoadAddress(Address address) { | ||
return address.getDepthFirst() + " " + address.getDepthSecond() + " " | ||
+ address.getRoadName() + " " + address.getBuildingNo() + " " | ||
+ address.getDetailAddress(); | ||
} | ||
} |
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
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
Oops, something went wrong.