Skip to content

Basic core porting#1

Open
helloing0119 wants to merge 17 commits intomasterfrom
basic_core_porting
Open

Basic core porting#1
helloing0119 wants to merge 17 commits intomasterfrom
basic_core_porting

Conversation

@helloing0119
Copy link
Copy Markdown
Owner

[완료 사항]

  • Controllers : Request -> Response
  • Models : Request & Response Verification
  • Hub.ts : Buffer로 전달된 request를 처리하여 response 반환
  • Store.ts : DB 상호작용

[TODO]

  • HTTP 처리
  • 파일 저장 처리

src/lib/Hub.ts Outdated
console.log(error);
return {
ok: false,
body: Buffer.from({errorCode: error}),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buffer.from 파라미터는 string이 들어가야 합니다.

body: Buffer.from(JSON.stringify({errorCode: error})),

src/lib/Hub.ts Outdated
public async handleRequest(request: Buffer): Promise<Response> {
let verifiedRequest;
try {
verifiedRequest = await this._authentication.getVerifiedRequest(request, this._requireAccessToken);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this._requireAccessToken << ???

src/lib/Hub.ts Outdated
console.log(error);
return {
ok:false,
body: Buffer.from({errorCode: error}),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Buffer.from 파라미터는 string이 들어가야 합니다.

body: Buffer.from(JSON.stringify({errorCode: error})),

}
if(query.owner) {
requested = await requested
.Where('col.profile = :owner', {owner: query.owner});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where -> where

}
if(query.objectId) {
requested = await requested
.Where('col.object = :objectId', {objectId: query.objectId});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where -> where

.from(collections, 'col');

if(query.type) {
requested = await requested
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if(query.type) { requested.andWhere('col.type = :type', {type: query.type}); }
와 같이 변경하는것이 맞는 것 같음

line 181 ~ line 191 까지

.Where('col.object = :objectId', {objectId: query.objectId});
}

requested = await requested
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getMany() 를 이런식으로 뒤에 추가해주는건 안될 것 같음
query 중 하나를 픽스해서 where 하나를 필수로 걸고 거기에 getMany() 를 걸어놓고 나머지 조건에 대해서 andWhere()를 거는식으로 해야할듯

Copy link
Copy Markdown

@sweatpotato13 sweatpotato13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

코멘트 내용과 빌드시 에러 나오는건 수정을 해야할 것 같습니다.

커밋 올릴때는 기능 정상 동작 여부와 상관 없이 빌드가 가능한 상태로 올리는것이 좋습니다.

Copy link
Copy Markdown

@sweatpotato13 sweatpotato13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants