Skip to content
Open
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 @@ -8,10 +8,8 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RestController;
import org.sunbird.common.model.SBApiResponse;
import org.sunbird.common.util.Constants;
import org.sunbird.course.service.ExploreCourseService;

/**
Expand All @@ -33,13 +31,6 @@ public ResponseEntity<SBApiResponse> getPublicCourseList() {
return new ResponseEntity<>(response, response.getResponseCode());
}

@GetMapping("/ngo/course/v1/explore")
public ResponseEntity<SBApiResponse> getPublicCourseListWrapper(
@RequestHeader(Constants.X_AUTH_TOKEN) String authToken) {
SBApiResponse response = courseService.getExploreCourseListWithToken(authToken);
return new ResponseEntity<>(response, response.getResponseCode());
}

@GetMapping("course/v1/refreshCache")
public ResponseEntity<SBApiResponse> refreshCourseListInCache() {
SBApiResponse response = courseService.refreshCache();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public interface ExploreCourseService {
*/
public SBApiResponse getExploreCourseList();

public SBApiResponse getExploreCourseListWithToken(String authToken);

/**
* Refreshes the cache by re-reading the details from DB.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,6 @@ public class ExploreCourseServiceImpl implements ExploreCourseService {
@Autowired
AccessTokenValidator accessTokenValidator;

@Override
public SBApiResponse getExploreCourseListWithToken(String authToken) {
SBApiResponse response = ProjectUtil.createDefaultResponse(Constants.API_GET_EXPLORE_COURSE_DETAIL);
String userId = accessTokenValidator.fetchUserIdFromAccessToken(authToken, response);
if (StringUtils.isBlank(userId)) {
response.getParams().setStatus(Constants.FAILED);
response.getParams().setErrmsg(Constants.USER_ID_DOESNT_EXIST);
response.setResponseCode(HttpStatus.UNAUTHORIZED);
return response;
}
return getExploreCourseList();
}

@Override
public SBApiResponse getExploreCourseList() {
SBApiResponse response = ProjectUtil.createDefaultResponse(Constants.API_GET_EXPLORE_COURSE_DETAIL);
Expand Down