Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonPazniak committed Dec 20, 2023
1 parent 03ca536 commit a5f420f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.moviePocket.controller.android;

import com.fasterxml.jackson.databind.JsonNode;
import com.moviePocket.service.inter.android.AndroidService;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -21,7 +21,7 @@ public AndroidController(AndroidService androidService) {
}

@GetMapping(path = "/")
public ResponseEntity<JSONObject> existTracingByIdMovie(@RequestParam("url") String url) {
public ResponseEntity<JsonNode> existTracingByIdMovie(@RequestParam("url") String url) {
return androidService.getData(url);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.moviePocket.service.impl.android;

import com.fasterxml.jackson.databind.JsonNode;
import com.moviePocket.service.inter.android.AndroidService;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
Expand All @@ -18,7 +18,7 @@ public AndroidServiceImpl(@Value("${api.key}") String apiKey) {
this.apiKey = apiKey;
}

public ResponseEntity<JSONObject> getData(String url) {
public ResponseEntity<JsonNode> getData(String url) {
HttpHeaders headers = new HttpHeaders();
headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
url += apiKey;
Expand All @@ -30,7 +30,7 @@ public ResponseEntity<JSONObject> getData(String url) {
url,
HttpMethod.GET,
requestEntity,
JSONObject.class
JsonNode.class
);
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.moviePocket.service.inter.android;

import org.json.JSONObject;
import com.fasterxml.jackson.databind.JsonNode;
import org.springframework.http.ResponseEntity;

public interface AndroidService {
ResponseEntity<JSONObject> getData(String url);
ResponseEntity<JsonNode> getData(String url);

}

0 comments on commit a5f420f

Please sign in to comment.