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

#163 | Fixed response type of search assignment endpoint #167

Merged
merged 1 commit into from
Sep 12, 2023
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
Expand Up @@ -2,9 +2,11 @@

import com.ays.assignment.model.enums.AssignmentStatus;
import com.ays.common.model.dto.response.BaseResponse;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.experimental.SuperBuilder;
import org.locationtech.jts.geom.Point;

/**
* This class represents the response for a user with assignment.
Expand All @@ -17,8 +19,21 @@ public class AssignmentSearchResponse extends BaseResponse {

private String id;
private String description;
private Double longitude;
private Double latitude;
private Location location;
private AssignmentStatus status;

@Getter
@Builder
public static class Location {
private Double longitude;
private Double latitude;
}

public void setLocation(Point point) {
this.location = Location.builder()
.longitude(point.getX())
.latitude(point.getY())
.build();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
public interface AssignmentToAssignmentSearchResponseMapper extends BaseMapper<Assignment, AssignmentSearchResponse> {

@Override
@Mapping(target = "longitude", source = "source.point.x")
@Mapping(target = "latitude", source = "source.point.y")
@Mapping(target = "location.longitude", source = "source.point.x")
@Mapping(target = "location.latitude", source = "source.point.y")
AhmetAksunger marked this conversation as resolved.
Show resolved Hide resolved
AssignmentSearchResponse map(Assignment source);

/**
Expand Down