getChild実装 WIP
This commit is contained in:
parent
16f2ed9c20
commit
9b0b710c73
|
@ -36,7 +36,21 @@ public class ChildDataImpl implements ChildData {
|
|||
|
||||
@Override
|
||||
public CompletableFuture<ChildModel> getChild(String childId) {
|
||||
return null;
|
||||
return CompletableFuture.supplyAsync(() -> {
|
||||
Call<ChildResponse> call = kidShiftApiService.getChild(childId);
|
||||
try {
|
||||
Response<ChildResponse> response = call.execute();
|
||||
if (response.isSuccessful()) {
|
||||
assert response.body() != null;
|
||||
logger.info("子供取得成功(childId: " + response.body().getId() + ")");
|
||||
return ChildModelConverter.childResponseToChildModel(response.body());
|
||||
} else {
|
||||
throw new RuntimeException("HTTP Status: " + response.code());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -137,6 +137,15 @@ public interface KidShiftApiService {
|
|||
@Headers(AuthorizationInterceptor.HEADER_PLACEHOLDER)
|
||||
Call<ChildListResponse> getChildList();
|
||||
|
||||
/**
|
||||
* 子供情報取得
|
||||
* @param id 子供ID
|
||||
* @return ChildResponse
|
||||
*/
|
||||
@GET("/child/{id}")
|
||||
@Headers(AuthorizationInterceptor.HEADER_PLACEHOLDER)
|
||||
Call<ChildResponse> getChild(@Path("id") String id);
|
||||
|
||||
/**
|
||||
* 子供追加
|
||||
* @param request ChildAddRequest
|
||||
|
|
Loading…
Reference in New Issue
Block a user