Package com.infoclinika.mssharing.model.helper.RestHelper

Examples of com.infoclinika.mssharing.model.helper.RestHelper.UserDetails


    private StoredObjectPaths storedObjectPaths;

    @ResponseBody
    @RequestMapping(value = "/authenticate", method = RequestMethod.POST)
    public AuthenticateDTO authenticate(@RequestBody UserNamePassDTO credentials) {
        final UserDetails userDetails = restHelper.getUserDetailsByEmail(credentials.username);
        if (userDetails == null
                || !passwordEncoder.matches(credentials.password, userDetails.passwordHash)
                || !userDetails.emailVerified) {
            return new AuthenticateDTO("", new UploadConfigDTO("", "", ""));
        }
View Full Code Here


    }

    @ResponseBody
    @RequestMapping("/getInstruments")
    public List<InstrumentDTO> getInstruments(@RequestParam("token") String restToken) {
        UserDetails userDetails = getUserAndCheckToken(restToken);
        Set<InstrumentLineItem> instrumentLineItems = dashboardReader.readInstrumentWhereUserIsOperator(userDetails.id);
        return toListDto(instrumentLineItems, TO_INSTRUMENT);
    }
View Full Code Here

    }

    @ResponseBody
    @RequestMapping("/getInstrumentFiles/{id}")
    public Set<FileDTO> getInstrumentFiles(@PathVariable("id") long instrumentId, @RequestParam("token") String restToken) {
        UserDetails userDetails = getUserAndCheckToken(restToken);
        Set<FileLine> fileLines = dashboardReader.readFilesByInstrument(userDetails.id, instrumentId);
        return toSetDto(fileLines, TO_FILE_DTO);
    }
View Full Code Here

    }

    @ResponseBody
    @RequestMapping("/getUnfinishedUploads")
    public List<FileDTO> getUnfinishedUploads(@RequestParam("token") String restToken) {
        UserDetails userDetails = getUserAndCheckToken(restToken);
        Set<FileLine> fileLines = dashboardReader.readUnfinishedFiles(userDetails.id);
        return toListDto(fileLines, TO_FILE_DTO);
    }
View Full Code Here

    }

    @ResponseBody
    @RequestMapping(value = "/deleteUpload", method = RequestMethod.POST)
    public DeleteUploadDTO deleteUpload(@RequestParam("fileId") long fileId, @RequestParam("token") String restToken) {
        UserDetails userDetails = getUserAndCheckToken(restToken);
        instrumentManagement.cancelUpload(userDetails.id, fileId);
        return new DeleteUploadDTO(true);
    }
View Full Code Here

    @ResponseBody
    @RequestMapping(value = "/uploadRequest", method = RequestMethod.POST)
    public UploadFilesDTOResponse save(@RequestBody UploadFilesDTORequest uploadFilesRequest,
                                       @RequestParam("token") String restToken) {
        UserDetails userDetails = getUserAndCheckToken(restToken);
        if (!userDetails.hasLaboratories) {
            throw new AccessDenied("permission denied");
        }
        final long userId = userDetails.id;
        final long instrumentId = uploadFilesRequest.instrument;
View Full Code Here

    @ResponseBody
    @RequestMapping(value = "/completeUploadFileRequest", method = RequestMethod.POST)
    public CompleteUploadDTO completeUploadFileRequest(@RequestBody ConfirmMultipartUploadDTO request,
                                                       @RequestParam("token") String restToken) {
        UserDetails userDetails = getUserAndCheckToken(restToken);
        instrumentManagement.completeMultipartUpload(userDetails.id, request.fileId, request.remoteDestination);
        return new CompleteUploadDTO(true);
    }
View Full Code Here

        instrumentManagement.completeMultipartUpload(userDetails.id, request.fileId, request.remoteDestination);
        return new CompleteUploadDTO(true);
    }

    private UserDetails getUserAndCheckToken(String restToken) throws AccessDenied {
        UserDetails userDetails = restHelper.checkToken(restToken);
        if (userDetails == null) {
            throw new AccessDenied("permission denied");
        }
        return userDetails;
    }
View Full Code Here

TOP

Related Classes of com.infoclinika.mssharing.model.helper.RestHelper.UserDetails

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.