Class RatingQuestionsAndAnswersController

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

@RestController public class RatingQuestionsAndAnswersController extends Object
Class ReviewFeedbackController

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

Author:
Infosys Equinox
  • Constructor Details

  • Method Details

    • createQuestionsAndAnswers

      @ResponseStatus(CREATED) @PostMapping("/{itemId}/questions") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'ratingsreviews\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/create/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/moderator\',\'ratingsreviews\', #collectionId)") public org.springframework.http.ResponseEntity<RatingQuestionsAndAnswersResponse> createQuestionsAndAnswers(@RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestHeader(required=true) long collectionId, @PathVariable(required=true) String itemId, @RequestHeader(value="x-auth-token",required=true) String authToken, @RequestBody(required=true) RatingQuestionsAnswersRequest request)
      method CreateReviewFeedback This method is used to Creates the Questions and Answers based on the ratings and reviews .
      Parameters:
      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.
      request - Holds the value for request.
      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.
      itemId - itemId
      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.
      Returns:
      ResponseEntity returns in the form of ResponseEntity.
    • getQuestionsAndAnswersById

      @ResponseStatus(OK) @GetMapping("/questions/{questionId}") @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<GetByIdQuestionAndAnswersResponse> getQuestionsAndAnswersById(@RequestHeader(required=true) long collectionId, @RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestHeader(value="x-auth-token",required=true) String authToken, @PathVariable("questionId") long id)
      method getRatingReviewById This method is used to get the RatingReview by Id.
      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.
      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.
      id - holds the value for identifier.
      Returns:
      ResponseEntity gives output in the form of ResponseEntity.
    • getAllQuestions

      @ResponseStatus(OK) @GetMapping("/questions") @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<RatingQuestionsAnswersResponse> getAllQuestions(@RequestHeader(required=true) long collectionId, @RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestHeader(value="x-auth-token",required=true) String authToken, @RequestHeader(required=false) String itemId, @RequestParam(required=false) String filters, @RequestParam(required=false,defaultValue="1") int page, @RequestParam(required=false,defaultValue="10") int size)
      method getRatingReviewById This method is used to get the RatingReview by Id.
      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.
      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.
      itemId - holds the value for products.
      filters - filters
      page - page
      size - size
      Returns:
      ResponseEntity gives output in the form of ResponseEntity.
    • getAllAnswers

      @ResponseStatus(OK) @GetMapping("/questionsandanswers/{questionId}/answers") @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<RatingAnswersResponse> getAllAnswers(@RequestHeader(required=true) long collectionId, @RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestHeader(value="x-auth-token",required=true) String authToken, @PathVariable("questionId") long id, @RequestParam(required=false) com.skava.core.qdsl.sort.EcomSorts sort, @RequestParam(required=false) String filters, @RequestParam(required=false,defaultValue="1") int page, @RequestParam(required=false,defaultValue="10") int size)
      method getAllAnswers This method is used to get all answers by questionId.
      Parameters:
      id - questionId
      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.
      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.
      filters - filters
      sort - holds the value for sort .
      page - page
      size - size
      Returns:
      ResponseEntity gives output in the form of ResponseEntity.
    • deleteQuestionsById

      @ResponseStatus(OK) @DeleteMapping("/questions/{questionId}") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'ratingsreviews\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/delete/ratingsreviews\',\'ratingsreviews\', #collectionId)") public org.springframework.http.ResponseEntity<GetByIdQuestionAndAnswersResponse> deleteQuestionsById(@RequestHeader(required=true) long collectionId, @RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestHeader(value="x-auth-token",required=true) String authToken, @PathVariable("questionId") long id)
      method DeleteQuestionById This method is used to delete the RatingReviews by Id.
      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.
      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.
      id - Holds the value of identifier.
      Returns:
      ResponseEntity Holds the output response of the method in the form of ResponseEntity
    • createAnswerForQuestion

      @ResponseStatus(CREATED) @PostMapping("/{questionId}/answers") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'ratingsreviews\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/create/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/moderator\',\'ratingsreviews\', #collectionId)") public org.springframework.http.ResponseEntity<RatingQuestionsAndAnswersResponse> createAnswerForQuestion(@RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestHeader(required=true) long collectionId, @PathVariable(required=true) long questionId, @RequestHeader(value="x-auth-token",required=true) String authToken, @RequestBody(required=true) RatingAnswersRequest request)
      method CreateAnswerForQuestion This method is used to Creates the Answers For Question based on the Question Id.
      Parameters:
      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.
      request - Holds the value for request.
      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.
      questionId - questionId
      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.
      Returns:
      ResponseEntity returns in the form of ResponseEntity.
    • updateAnswerForQuestion

      @ResponseStatus(OK) @PutMapping("/{questionId}/answers") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'ratingsreviews\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/create/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/moderator\',\'ratingsreviews\', #collectionId)") public org.springframework.http.ResponseEntity<List<GetAnswersResponse>> updateAnswerForQuestion(@RequestHeader(required=true) long collectionId, @RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestHeader(value="x-auth-token",required=true) String authToken, @PathVariable long questionId, @RequestBody(required=true) RatingAnswersRequest request)
      Parameters:
      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.
      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.
      questionId - - questionId.
      request - - Holds the value for request.
      Returns:
      - ResponseEntity gives output in the form of ResponseEntity.
    • updateQuestionStatus

      @ResponseStatus(ACCEPTED) @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'ratingsreviews\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/update/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/moderator\',\'ratingsreviews\', #collectionId)") @PatchMapping("questions") public org.springframework.http.ResponseEntity<PatchQuestionStatusResponse> updateQuestionStatus(@RequestHeader(value="x-auth-token",required=true) String authToken, @RequestHeader(value="x-version-id",required=false) String versionId, @RequestHeader(value="x-store-id",required=false) String storeId, @RequestHeader(required=true) long collectionId, @RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestBody(required=true) List<PatchUpdateQARequest> request)
      /** method updateQuestionStatus This method is used to Update the status of a Question.
      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.
      versionId - holds the identfier of the version.
      questionIds - Holdes the identifier for question.
      request - Holds the information about the request.
      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.
      Returns:
      ResponseEntity holds the value of the response entity
    • updateAnswerStatus

      @ResponseStatus(ACCEPTED) @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'ratingsreviews\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/update/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/moderator\',\'ratingsreviews\', #collectionId)") @PatchMapping("questions/{questionId}/answers") public org.springframework.http.ResponseEntity<PatchAnswerStatusResponse> updateAnswerStatus(@RequestHeader(value="x-auth-token",required=true) String authToken, @RequestHeader(value="x-store-id",required=false) String storeId, @RequestHeader(required=true) long collectionId, @RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @PathVariable long questionId, @RequestHeader(value="x-version-id",required=false) String versionId, @RequestBody(required=true) List<PatchUpdateQARequest> request)
      method UpdateAnswerStatus This method is used to Update the Answer.
      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.
      versionId - holds the identfier of the version.
      questionId - - questionId
      answerIds - - answerIds
      request - Holds the information about the request.
      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.
      Returns:
      ResponseEntity holds the value of the response entity
    • createVotes

      @ResponseStatus(CREATED) @PostMapping("/votes") @PreAuthorize("hasRoleForServiceAndCollection(\'ROLE_GUEST\',\'ratingsreviews\', #collectionId) or hasRoleForServiceAndCollection(\'ROLE_REG_USER\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/create/ratingsreviews\',\'ratingsreviews\', #collectionId) or hasPrivilegeForServiceAndCollection( \'ratingsreviews/manage/moderator\',\'ratingsreviews\', #collectionId)") public org.springframework.http.ResponseEntity<VotesResponse> createVotes(@RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, @RequestHeader(required=true) long collectionId, @RequestHeader(value="x-auth-token",required=true) String authToken, @RequestBody(required=true) VotesRequest request)
      method CreateAnswerForQuestion This method is used to Creates the Answers For Question based on the Question Id.
      Parameters:
      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.
      request - Holds the value for request.
      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.
      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.
      Returns:
      ResponseEntity returns in the form of ResponseEntity.
    • getVotes

      @ResponseStatus(OK) @GetMapping("/votes/{answerId}") @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<GetVotesResponse> getVotes(@RequestHeader(required=true) long collectionId, @RequestParam(required=false,defaultValue="en_US") @IgnoreAudit String locale, long questionId, @PathVariable long answerId, long userId, @RequestHeader(value="x-auth-token",required=true) String authToken, VoteType voteType)
      method GetVotesResponseById This method is used to get the votes for answers by Id.
      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.
      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.
      questionId - - questionId.
      answerId - - answerId
      userId - - userId
      voteType - - Hold the value of vote type
      Returns:
      ResponseEntity gives output in the form of ResponseEntity.
    • initBinder

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