import { Application } from 'egg';

export default (app: Application) => {
  const { controller, router } = app;
  const tokenParser = app.middleware.tokenParser();
  router.get('/dev', controller.home.dev);
  router.get('/dev/smscode', controller.account.getSmsCode);
  router.get('/', controller.home.index);
  router.post('/user/devicelogin', controller.account.deviceLogin);
  router.post('/user/getsms', controller.account.getSms);
  router.post('/user/smslogin', controller.account.smsLogin);
  router.post('/user/setpassword', tokenParser, controller.account.setPassword);
  router.post('/user/pwlogin', controller.account.pwLogin);
  router.post('/user/checkrole', tokenParser, controller.account.checkRole);
  router.post('/user/createrole', tokenParser, controller.account.createRole);
  router.post('/user/bind', tokenParser, controller.account.bind);
  router.post('/user/authentication', tokenParser, controller.account.authentication);
  router.post('/game/getserverlist', tokenParser, controller.game.getServerList);
  router.post('/game/getnotice', tokenParser, controller.game.getnotice);
  router.post('/web/reloadresource', app.middleware.gmTokenParser(), controller.game.reloadResource);
};
