Class RatingsSummaryController

java.lang.Object
com.skava.ratingandreviews.web.RatingsSummaryController

@RestController @RequestMapping("/ratingssummary") public class RatingsSummaryController extends Object
Class RatingSummaryController

This class is the Rest Controller class. All the RatingSummary API calls are mapped to this class. It is the starting point of all the RatingSummmary API calls.

Author:
Infosys Equinox
  • Constructor Details

    • RatingsSummaryController

      @Autowired public RatingsSummaryController(FindAllSummaryService findAllSummaryService)
  • Method Details

    • getRatingsSummaryAll

      @ResponseStatus(OK) @GetMapping("") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'ratingsreviews\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/view/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/moderator\',\'ratingsreviews\', #collectionId)") public org.springframework.http.ResponseEntity<RatingsSummarysResponse> getRatingsSummaryAll(@RequestHeader(value="x-version-id",required=false) String versionId, @RequestHeader(required=true) long collectionId, @RequestHeader(value="x-auth-token",required=true) String authToken, @RequestHeader(value="x-store-id",required=false) String storeId, @RequestParam(required=false) com.skava.core.qdsl.sort.EcomSorts sort, @RequestParam(required=false) String filters, @RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestParam(required=false,defaultValue="1") int page, @RequestParam(required=false,defaultValue="10") int size)
      method CreateRatingReviews Creates the RatingReview
      Parameters:
      authToken - This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments, while being more compact when compared to XML-based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met: Token validation against the secret key Expiry time should be in the future Necessary privileges are available for the user to perform the action on the subjected resource.
      sort - Holds the value for sort
      filters - Holds the value for filter.
      versionId - Holdes the identifier of the version.
      storeId - It contains the storeId associated with ratingandreviews.
      collectionId - This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties c an be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.
      locale - API Response and error messages will be responded in the mentioned locale. Indicates the locale in which the API response and the error messages will be responded. The locale should be mentioned in the Java standard locale format.
      page - Page denotes the requested page number.
      size - Size denotes the number of records a page can have.
      Returns:
      ResponseEntity gives the response in the form of ResponseEntity.
    • initBinder

      @InitBinder public void initBinder(org.springframework.web.bind.WebDataBinder binder)
      Parameters:
      binder - The Web data binder