forked from codesquad-members-2023/second-hand
-
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.
[BE] 요청한 주소와 비슷한 주소 검색 기능 구현Dev (#369)
- Loading branch information
Showing
4 changed files
with
49 additions
and
9 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
27 changes: 27 additions & 0 deletions
27
be/src/main/java/codesquad/secondhand/dto/ResponseSetDto.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,27 @@ | ||
package codesquad.secondhand.dto; | ||
|
||
import java.util.Set; | ||
|
||
import codesquad.secondhand.exception.code.Code; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class ResponseSetDto<T> { | ||
private final boolean success; | ||
private final int status; | ||
private final int code; | ||
private final String message; | ||
private final Set<T> data; | ||
|
||
public ResponseSetDto(Code code, Set<T> data) { | ||
this.success = code.isSuccess(); | ||
this.status = code.getStatus(); | ||
this.code = code.getCode(); | ||
this.message = code.getMessage(); | ||
this.data = data; | ||
} | ||
|
||
public static <T> codesquad.secondhand.dto.ResponseSetDto<T> of(Code code, Set<T> data) { | ||
return new codesquad.secondhand.dto.ResponseSetDto<>(code, data); | ||
} | ||
} |
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