Skip to content
This repository has been archived by the owner on Dec 24, 2018. It is now read-only.

파일데이터 조회시 서버를 거칠것인지 아니면 카우치디비에서 바로 줄것인지. #47

Open
swimyoung opened this issue Oct 30, 2014 · 2 comments
Labels

Comments

@swimyoung
Copy link
Contributor

파일데이터 조회할때 Attachment를 예를들면

도메인:5984/도큐먼트아이디/어테치먼트아이디

로 카우치 디비에 바로 요청을 날리면 파일데이터를 받을 수 있음.

서버에 파일조회를 요청할시 우리가 카우치디비에 요청을 날리고 파일데이터를 가져와서 파일데이터를 날릴지

아니면 파일데이터에 접근가능한 URL을 날릴지.

만약 URL을 날린다면 카우치디비 도메인과 도큐먼트아이디 어태치먼트아이디를 공개해도 되는지.

@swimyoung swimyoung self-assigned this Oct 30, 2014
@swimyoung
Copy link
Contributor Author

카우치디비에서 파일데이터를 가져올때는
도큐먼트아이디/어테치먼트아이디 로 불러온다.

이를 토대로 클라이언트에서는
URI : 도메인/user/app/file?attachment=aqwqwtqasd123rasqwe&documentId=kabsasfasfasf

이런식으로 서버에 던지면
서버에서는 이두 파라미터를 가지고 카우치디비에 파일을 요청하고 가져온 파일을 클라리언트에 전송한다.

이런 방법 어떨까 ? ....

@DevSusu
Copy link
Contributor

DevSusu commented Nov 18, 2014

Does this match what you were thinking

    /**
     * Returns the Resource. it is keeped inside the html for just resource url.
     * Specially, this doesn't need Auth
     * 
     * @author susu Date Nov 7, 2014 12:27:41 AM
     * @param userId
     *            User HashId
     * @param docId
     *            Id of the Documnet where Resource is stored
     * @param attachmentId
     *            Resource's Id inside the document
     * @return Need to Decide how are we going to return image resources
     * @throws Exception
     */
    @RequestMapping(value = "user/file", method = RequestMethod.GET)
    //@ApiOperation(httpMethod = "GET", value = "Gets User's Media resources")
    public ResponseEntity<byte[]> getResource(HttpServletResponse httpResponse,
            @RequestParam(required = true) String userId,
            @RequestParam(required = true) String docId,
            @RequestParam(required = true) String attachmentId)
            throws Exception {
        return restApiService.getAttachment(userId, docId, attachmentId);
    }

@swimyoung swimyoung removed their assignment Apr 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants