Class NoteController

java.lang.Object
com.skava.price.web.NoteController

@RestController @RequestMapping("/projects/{projectId}/notes") public class NoteController extends Object
The Class NoteController. This controller class contains service end-points that are used to perform actions as follows, Create Note,Get All Note and Get Note By id,
Since:
8.0
Author:
Infosys Equinox
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<Note>
    createNote(long collectionId, String versionId, String locale, String authToken, long projectId, NoteRequest request)
    This method is used to create Note based on given NoteRequest.
    org.springframework.http.ResponseEntity<NotesAPIResponse>
    findAllNote(long collectionId, String versionId, String locale, String authToken, long projectId, com.skava.core.qdsl.sort.EcomSorts sort, String filters, int page, int size)
    This method is used to find all Notes based on given NoteRequest.
    org.springframework.http.ResponseEntity<Note>
    getNoteById(long collectionId, String versionId, String locale, String authToken, long projectId, long id)
    This method is used to load single Note based on given NoteRequest.
    void
    initBinder(org.springframework.web.bind.WebDataBinder binder)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NoteController

      public NoteController()
  • Method Details

    • createNote

      @ResponseStatus(CREATED) @PostMapping @PreAuthorize("hasPrivilegeForServiceAndCollection(\'price/create/pricelist\', \'price\', #collectionId) or hasPrivilegeForServiceAndCollection(\'price/view/pricelist\',\'price\', #collectionId)") @Audit public org.springframework.http.ResponseEntity<Note> createNote(@RequestHeader(value="x-collection-id",required=true) @AuditField(field="collectionId") long collectionId, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="versionId") String versionId, @RequestParam(value="locale",required=false) @IgnoreAudit String locale, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="authToken") String authToken, @PathVariable(value="projectId",required=true) @AuditField(field="projectId") long projectId, @RequestBody(required=true) @AuditField(field="request") NoteRequest request)
      This method is used to create Note based on given NoteRequest.
      Parameters:
      collectionId - This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier.
      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.
      versionId - This field holds a API version information.
      locale - Response would be rendered in the mentioned locale.
      projectId - This field holds a valid project identifier of this microservice and requested operation will be performed on this project identifier.
      request - It contains the attributes required for the creation of Note.
      Returns:
      It returns the NoteAPIResponse.
    • findAllNote

      @ResponseStatus(OK) @GetMapping @PreAuthorize("hasPrivilegeForServiceAndCollection(\'price/view/pricelist\',\'price\', #collectionId)") public org.springframework.http.ResponseEntity<NotesAPIResponse> findAllNote(@RequestHeader(value="x-collection-id",required=true) long collectionId, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") String versionId, @RequestParam(value="locale",required=false) String locale, @RequestHeader(value="x-auth-token",required=true) String authToken, @PathVariable(value="projectId",required=true) long projectId, @RequestParam(value="sort",required=false) com.skava.core.qdsl.sort.EcomSorts sort, @RequestParam(value="filters",required=false) String filters, @RequestParam(value="page",required=false,defaultValue="1") int page, @RequestParam(value="size",required=false,defaultValue="10") int size)
      This method is used to find all Notes based on given NoteRequest.
      Parameters:
      collectionId - This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier.
      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.
      versionId - This field holds a API version information.
      locale - Response would be rendered in the mentioned locale.
      projectId - This field holds a valid project identifier of this microservice and requested operation will be performed on this project identifier.
      sort - It contains the parameters for sorting. Example Format : {"sort":[{"field":"status","direction":"ASC"}, {"field":"status","direction":"DESC"}]}
      filters - This field holds the simple query criteria (can be multiple) based on the available fields to limit returned results
      page - This parameter will be available for all the services that supports pagination. This parameter is used to mention the starting index of the items which going to responded by the API.
      size - This parameter will be available for all the services that supports pagination. This parameter is used to mention the number of maximum items that needs to be responded for the request.
      Returns:
      It returns the NoteAPIResponse.
    • getNoteById

      @ResponseStatus(OK) @GetMapping("/{noteId}") @PreAuthorize("hasPrivilegeForServiceAndCollection(\'price/view/pricelist\',\'price\', #collectionId)") public org.springframework.http.ResponseEntity<Note> getNoteById(@RequestHeader(value="x-collection-id",required=true) long collectionId, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") String versionId, @RequestParam(value="locale",required=false) String locale, @RequestHeader(value="x-auth-token",required=true) String authToken, @PathVariable(value="projectId",required=true) long projectId, @PathVariable(value="noteId",required=true) long id)
      This method is used to load single Note based on given NoteRequest.
      Parameters:
      collectionId - This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier.
      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.
      versionId - This field holds a API version information.
      locale - Response would be rendered in the mentioned locale.
      projectId - This field holds a valid project identifier of this microservice and requested operation will be performed on this project identifier.
      id - It refers to load of Note.
      Returns:
      It returns the NoteAPIResponse.
    • initBinder

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