JJuOn

Add new routes

......@@ -7,6 +7,7 @@ const notify = require("./notify");
const user = require("./user");
const profile = require("./profile");
const challenge = require("./challenge");
const session = require("./session");
api.use("/auth", auth.routes());
api.use("/friend", friend.routes());
......@@ -14,5 +15,6 @@ api.use("/notify", notify.routes());
api.use("/user", user.routes());
api.use("/profile", profile.routes());
api.use("/challenge",challenge.routes());
api.use("/session",session.routes());
module.exports = api;
......
const Router = require('koa-router');
const session = new Router();
const sessionCtrl = require('./session.ctrl');
session.post("/createproblem/:how",sessionCtrl.createProblem);
module.exports = session;
\ No newline at end of file
/* POST /api/session/createproblem/:how
{
problemList:[Number]
}
*/
exports.createProblem = async (ctx)=>{
try{
const how=ctx.params.how;
if(how==='self'){
}
else if(how==='recommend'){
}
}
catch(e){
ctx.throw(500,e);
}
};
\ No newline at end of file