src/main/java/uth/bio/phosphpred/web/rest/UploadResource.java
@PostMapping("/uploads")
    @Timed
    public ResponseEntity<UploadDTO> createUpload(@Valid @RequestBody UploadDTO upload) throws URISyntaxException {
        log.debug("REST request to upload Fasta: {}", upload);
        if (!uploadService.save(upload)) {
            return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "idexists", "File could not be written to the server, please try again later")).body(null);
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("Upload_id", upload.getId().toString());
        AuditEvent event = new AuditEvent("ANONYMOUS", "REQUEST_TO_UPLOAD", map);
        auditEventPublisher.publish(event);
        return ResponseEntity.created(new URI("/api/uploads/" + 1L))
            .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, "1"))
            .body(upload);
    }
/**
     * POST  /uploads : Receive a new upload.
     *
     * @param upload the upload to create
     * @return the ResponseEntity with status 201 (Created) and with body the new upload, or with status 400 (Bad Request) if the upload has already an ID
     * @throws URISyntaxException if the Location URI syntax is incorrect
     */
POST  /uploads : Receive a new upload.
@param upload the upload to create
@return the ResponseEntity with status 201 (Created) and with body the new upload, or with status 400 (Bad Request) if the upload has already an ID
@throws URISyntaxException if the Location URI syntax is incorrect
POST / uploads : Receive a new upload . @param upload the upload to create @return the ResponseEntity with status 201 ( Created ) and with body the new upload or with status 400 ( Bad Request ) if the upload has already an ID @throws URISyntaxException if the Location URI syntax is incorrect
@PostMapping("/uploads")
    @Timed
    public ResponseEntity<UploadDTO> createUpload(@Valid @RequestBody UploadDTO upload) throws URISyntaxException {
        log.debug("REST request to upload Fasta: {}", upload);
        if (!uploadService.save(upload)) {
            return ResponseEntity.badRequest().headers(HeaderUtil.createFailureAlert(ENTITY_NAME, "idexists", "File could not be written to the server, please try again later")).body(null);
        }
        HashMap<String, Object> map = new HashMap<>();
        map.put("Upload_id", upload.getId().toString());
        AuditEvent event = new AuditEvent("ANONYMOUS", "REQUEST_TO_UPLOAD", map);
        auditEventPublisher.publish(event);
        return ResponseEntity.created(new URI("/api/uploads/" + 1L))
            .headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, "1"))
            .body(upload);
    }
@ PostMapping ( "/uploads" ) @ Timed public ResponseEntity < UploadDTO > createUpload ( @ Valid @ RequestBody UploadDTO upload ) throws URISyntaxException { log . debug ( "REST request to upload Fasta: {}" , upload ) ; if ( ! uploadService . save ( upload ) ) { return ResponseEntity . badRequest ( ) . headers ( HeaderUtil . createFailureAlert ( ENTITY_NAME , "idexists" , "File could not be written to the server, please try again later" ) ) . body ( null ) ; } HashMap < String , Object > map = new HashMap < > ( ) ; map . put ( "Upload_id" , upload . getId ( ) . toString ( ) ) ; AuditEvent event = new AuditEvent ( "ANONYMOUS" , "REQUEST_TO_UPLOAD" , map ) ; auditEventPublisher . publish ( event ) ; return ResponseEntity . created ( new URI ( "/api/uploads/" + 1L ) ) . headers ( HeaderUtil . createEntityCreationAlert ( ENTITY_NAME , "1" ) ) . body ( upload ) ; }
POST  /uploads : Receive a new upload.
POST / uploads : Receive a new upload .