-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207 from boostcamp-2020/develop
4주차 배포 Hotfix
- Loading branch information
Showing
106 changed files
with
2,274 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Context } from 'koa'; | ||
import { postMms } from 'services/mms'; | ||
|
||
const post = async (ctx: Context) => { | ||
const { accountObjId, mmsObj, client } = ctx.request.body; | ||
try { | ||
const newMms = await postMms(accountObjId, mmsObj, client); | ||
ctx.status = 200; | ||
ctx.body = newMms; | ||
} catch (e) { | ||
ctx.body = { success: false, message: e }; | ||
} | ||
}; | ||
|
||
export default { post }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,33 @@ | ||
import Koa from 'koa'; | ||
import { Context } from 'koa'; | ||
import * as userService from 'services/user'; | ||
|
||
export const titleByAccountId = async (ctx: Koa.Context) => { | ||
export const titleByAccountId = async (ctx: Context) => { | ||
const { accountId } = ctx.query; | ||
const title = await userService.titleByAccountId(accountId); | ||
ctx.status = 200; | ||
ctx.response.body = title; | ||
}; | ||
|
||
export const getUserList = async (ctx: Context) => { | ||
const userList = await userService.getUserList(); | ||
ctx.status = 200; | ||
ctx.body = userList; | ||
}; | ||
|
||
export const getUserByAccessToken = async (ctx: Context) => { | ||
ctx.status = 200; | ||
ctx.body = ctx.request.body.user; | ||
}; | ||
export const getInvitation = async (ctx: Context) => { | ||
const { user } = ctx.request.body; | ||
const accounts = await userService.getInvitation(user); | ||
const invitations = accounts.map((account: any, idx) => ({ | ||
accountObjId: account._id, | ||
title: account.title, | ||
ownerName: account.ownerName, | ||
host: user.invitations[idx].host, | ||
})); | ||
ctx.body = invitations; | ||
}; | ||
|
||
export default titleByAccountId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import Router from 'koa-router'; | ||
import methodController from 'controllers/method'; | ||
import koaCompose from 'koa-compose'; | ||
import { titleIsUnclassified } from 'middlewares'; | ||
|
||
const router = new Router(); | ||
|
||
router.get('/', methodController.get); | ||
router.post('/', methodController.post); | ||
router.post('/', koaCompose([titleIsUnclassified, methodController.post])); | ||
router.delete('/:methodObjId', methodController.del); | ||
router.put('/:methodObjId', methodController.put); | ||
router.put( | ||
'/:methodObjId', | ||
koaCompose([titleIsUnclassified, methodController.put]), | ||
); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Router from 'koa-router'; | ||
import mmsController from 'controllers/mms'; | ||
|
||
const router = new Router(); | ||
|
||
router.post('/', mmsController.post); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Router from 'koa-router'; | ||
import { getInvitation } from 'controllers/user'; | ||
|
||
const router = new Router(); | ||
|
||
router.get('/', getInvitation); | ||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,12 @@ | ||
import Router from 'koa-router'; | ||
import * as userController from 'controllers/user'; | ||
import accountRouter from './account'; | ||
|
||
const router = new Router(); | ||
|
||
router.get('/userInfo', userController.getUserByAccessToken); | ||
router.get('/titleByAccountId', userController.titleByAccountId); | ||
router.get('/', userController.getUserList); | ||
router.use('/accounts', accountRouter.routes()); | ||
|
||
export default router; |
Oops, something went wrong.