-
Notifications
You must be signed in to change notification settings - Fork 3
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 #76 from HongDam-org/feat/plan-group-api
[FEAT] 누락된 api 구현
- Loading branch information
Showing
27 changed files
with
504 additions
and
21 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
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
19 changes: 19 additions & 0 deletions
19
.../src/main/java/com/twtw/backend/domain/group/controller/advice/GroupControllerAdvice.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,19 @@ | ||
package com.twtw.backend.domain.group.controller.advice; | ||
|
||
import com.twtw.backend.domain.group.exception.IllegalGroupMemberException; | ||
import com.twtw.backend.global.advice.ErrorResponse; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
import org.springframework.web.bind.annotation.RestControllerAdvice; | ||
|
||
@RestControllerAdvice | ||
public class GroupControllerAdvice { | ||
|
||
@ExceptionHandler(IllegalGroupMemberException.class) | ||
public ResponseEntity<ErrorResponse> invalidFriendMember(final IllegalGroupMemberException e) { | ||
return ResponseEntity.status(HttpStatus.BAD_REQUEST) | ||
.body(new ErrorResponse(e.getMessage())); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
backend/src/main/java/com/twtw/backend/domain/group/dto/request/OutGroupRequest.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,14 @@ | ||
package com.twtw.backend.domain.group.dto.request; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.UUID; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class OutGroupRequest { | ||
private UUID groupId; | ||
} |
16 changes: 16 additions & 0 deletions
16
backend/src/main/java/com/twtw/backend/domain/group/dto/request/UpdateLocationRequest.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,16 @@ | ||
package com.twtw.backend.domain.group.dto.request; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.UUID; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class UpdateLocationRequest { | ||
private UUID groupId; | ||
private Double longitude; | ||
private Double latitude; | ||
} |
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
10 changes: 10 additions & 0 deletions
10
...nd/src/main/java/com/twtw/backend/domain/group/exception/IllegalGroupMemberException.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,10 @@ | ||
package com.twtw.backend.domain.group.exception; | ||
|
||
public class IllegalGroupMemberException extends IllegalArgumentException { | ||
|
||
private static final String MESSAGE = "그룹에 포함되지 않은 멤버입니다."; | ||
|
||
public IllegalGroupMemberException() { | ||
super(MESSAGE); | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
backend/src/main/java/com/twtw/backend/domain/location/dto/response/AverageCoordinate.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,16 @@ | ||
package com.twtw.backend.domain.location.dto.response; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class AverageCoordinate { | ||
private Double longitude; | ||
private Double latitude; | ||
private Double distance; | ||
} |
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
9 changes: 8 additions & 1 deletion
9
backend/src/main/java/com/twtw/backend/domain/location/mapper/LocationMapper.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,14 +1,21 @@ | ||
package com.twtw.backend.domain.location.mapper; | ||
|
||
import com.twtw.backend.domain.location.dto.request.LocationRequest; | ||
import com.twtw.backend.domain.location.dto.response.AverageCoordinate; | ||
import com.twtw.backend.domain.location.dto.response.LocationResponse; | ||
|
||
import org.mapstruct.Mapper; | ||
import org.mapstruct.Mapping; | ||
import org.mapstruct.MappingConstants; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Mapper(componentModel = MappingConstants.ComponentModel.SPRING) | ||
public interface LocationMapper { | ||
LocationResponse toResponse(LocationRequest locationRequest, LocalDateTime time); | ||
@Mapping(target = "longitude", source = "locationRequest.longitude") | ||
@Mapping(target = "latitude", source = "locationRequest.latitude") | ||
LocationResponse toResponse( | ||
LocationRequest locationRequest, | ||
AverageCoordinate averageCoordinate, | ||
LocalDateTime time); | ||
} |
Oops, something went wrong.