import { Application } from 'egg';

export default (app: Application) => {
  const { controller, router } = app;
  const tokenParser = app.middleware.tokenParser();

  router.get('/api', controller.home.index);
  router.post('/api/login/account', controller.login.login);
  router.post('/api/login/changeMyPass', tokenParser, controller.login.changeMyPass);
  router.post('/api/currentUser', tokenParser, controller.login.currentUser);
  router.get('/api/login/channel', controller.login.channelLogin);
  router.post('/api/upload/hotupdate', tokenParser, controller.upload.upload);
  router.post('/api/upload/uploadjson', tokenParser, controller.upload.uploadJson);
  router.post('/api/upload/reloadresource', tokenParser, controller.upload.reloadResource);
  
  router.post('/api/gmaccount/getgmlist', tokenParser, controller.gmaccount.getGmList);
  router.post('/api/gmaccount/createaccount', tokenParser,controller.gmaccount.createGmAccount);
  router.post('/api/gmaccount/savegmgrouptouser', tokenParser,controller.gmaccount.saveGmGroupToUser);
  router.post('/api/gmaccount/getgrouplist', tokenParser,controller.gmaccount.getGroupList);
  router.post('/api/gmaccount/getapilist', tokenParser,controller.gmaccount.getApiList);
  router.post('/api/gmaccount/creategmgroup', tokenParser,controller.gmaccount.createGmGroup);
  router.post('/api/gmaccount/savegmgroup', tokenParser,controller.gmaccount.saveGmGroup);
  router.post('/api/gmaccount/saveapitogroup', tokenParser,controller.gmaccount.saveGmApiToGroup);
  
  
  router.post('/api/users/getuserlist', tokenParser,controller.users.getuserlist);
  router.post('/api/users/fixsms', tokenParser, controller.users.fixSms);
  router.post('/api/users/getrolelist', tokenParser,controller.users.getrolelist);
  router.post('/api/users/getpaystatic', controller.users.getpaystatic);
  router.post('/api/users/deleterole', tokenParser,controller.users.deleteRole);
  router.post('/api/users/setwar', tokenParser, controller.users.setWar);
  router.post('/api/users/setcreatetime', tokenParser, controller.users.setCreateTime);
  router.post('/api/users/getherolist', tokenParser,controller.users.getHeroList);
  router.post('/api/users/getitemlist', tokenParser, controller.users.getItemList);
  router.post('/api/users/getguildlist', tokenParser, controller.users.getGuildList);
  router.post('/api/users/getmembersbyguildcode', tokenParser, controller.users.getMembersByGuildCode);
  router.post('/api/users/deleteitem', tokenParser, controller.users.deleteItem);
  router.post('/api/users/getgiftcodelist', tokenParser,  controller.users.getGiftCodeList);
  router.post('/api/users/createandgenerategift', tokenParser, controller.users.createAndGenerateGift)
  router.post('/api/users/updategiftcode', tokenParser, controller.users.updateGiftCode);
  router.post('/api/users/generategiftcode', tokenParser, controller.users.generateGiftCode);
  router.post('/api/users/cancelgiftCode', tokenParser, controller.users.cancelGiftCode);
  router.post('/api/users/getgiftcodedetaillist', tokenParser, controller.users.getGiftCodeDetailList);
  router.get('/api/users/getgiftcodedetailfile/:id/:fileType/:filename', controller.users.getGiftCodeDetailFile);

  router.post('/api/game/getregions', tokenParser, controller.game.getRegions);
  router.post('/api/game/createregion', tokenParser, controller.game.createRegion);
  router.post('/api/game/getservers', tokenParser, controller.game.getServers);
  router.post('/api/game/getOnlineUsersByServer', controller.game.getOnlineUsersByServer);
  router.post('/api/game/getregionstategy', tokenParser, controller.game.getRegionStategy);
  router.post('/api/game/getwhitelist', tokenParser, controller.game.getWhiteList);
  router.post('/api/game/updatewhitelist', tokenParser, controller.game.updateWhiteList);
  router.post('/api/game/deletewhitelist', tokenParser, controller.game.deleteWhiteList);
  router.post('/api/game/stopserverregister', tokenParser, controller.game.stopServerRegister);
  router.post('/api/game/swicthserverstatus', tokenParser, controller.game.switchServerStatus);
  router.post('/api/game/switchserverreview', tokenParser, controller.game.switchServerReview);
  router.post('/api/game/getorderlist', tokenParser, controller.game.getOrderlist);
  router.post('/api/game/getsurveylist', tokenParser, controller.game.getSurveylist);
  router.post('/api/game/getchannelinfo', controller.game.getChannelInfo);
  router.post('/api/game/updatechannel', controller.game.updateChannel);
  router.post('/api/game/gethiddendata', controller.game.getHiddenData);
  router.post('/api/game/getexisthiddendata', controller.game.getExistHiddenData);
  router.post('/api/game/getgvgservergroup', controller.game.getGVGServerGroup);
  router.post('/api/game/getgvgconfig', controller.game.getGVGConfig);

  router.post('/api/dic/getdicgoods', tokenParser, controller.game.getDicGoods);
  router.post('/api/dic/getdichero', tokenParser, controller.game.getDicHero);
  router.post('/api/dic/getdicrmb', tokenParser, controller.game.getDicRMB);
  router.post('/api/dic/getdicactivitytype', tokenParser, controller.game.getDicActivityType);
  router.post('/api/dic/getdictasktype', tokenParser, controller.game.getDicTaskType);
  router.post('/api/dic/getservername', tokenParser, controller.game.getServerName)

  router.post('/api/game/getnoticelist', tokenParser, controller.game.getNoticeList);
  router.post('/api/game/updatenotice', tokenParser, controller.game.updateNotice);
  router.post('/api/game/delnotice', tokenParser, controller.game.delNotice);
  router.post('/api/game/getmarqueelist', tokenParser, controller.game.getMarqueeList);
  router.post('/api/game/updatemarquee', tokenParser, controller.game.updateMarquee);
  router.post('/api/game/getaccuse', tokenParser, controller.game.getAccuse);
  router.post('/api/game/getpvpconfig', controller.game.getPvpConfig);

  router.post('/api/activity/getactivitylist', tokenParser, controller.activity.getActivityList);
  router.post('/api/activity/getallactivities', tokenParser, controller.activity.getAllActivities);
  router.post('/api/activity/getactivitygrouplist', tokenParser, controller.activity.getActivityGroupList);
  router.post('/api/activity/getallactivitygroups', tokenParser, controller.activity.getAllActivityGroups);
  router.post('/api/activity/updateactivity', tokenParser, controller.activity.updateActivity);
  router.post('/api/activity/switchactivity', tokenParser, controller.activity.switchActivity);
  router.post('/api/activity/deleteactivity', tokenParser, controller.activity.deleteActivity);
  router.post('/api/activity/updategroup', tokenParser, controller.activity.updateActivityGroup);
  router.post('/api/activity/creategroup', tokenParser, controller.activity.createGroup);
  router.post('/api/activity/deletegroup', tokenParser, controller.activity.deleteGroup);
  router.post('/api/activity/getactivitygrouptypelist', tokenParser, controller.activity.getActivityGroupTypeList);
  router.post('/api/activity/getallactivitygrouptypes', tokenParser, controller.activity.getAllActivityGroupTypes);
  router.post('/api/activity/saveactivitygrouptypelist', tokenParser, controller.activity.updateActivityGroupType);
  router.post('/api/activity/deleteactivitygrouptype', tokenParser, controller.activity.deleteActivityGroupType);
  router.post('/api/activity/createdefaultactivitygrouptype', tokenParser, controller.activity.createDefaultActivityGroupType)
  router.post('/api/activity/getactivitytaskpoint', tokenParser, controller.activity.getActivityTaskPoint);
  router.post('/api/activity/createtasktoactivity', tokenParser, controller.activity.createTaskToActivity);
  router.post('/api/activity/updateactivitytaskpoint', tokenParser, controller.activity.updateActivityTaskPoint);
  router.post('/api/activity/delactivitytaskpoint', tokenParser, controller.activity.delActivityTaskPoint);
  // router.post('/api/activity/getactivitylist', tokenParser, controller.activity.getActivityList);

  router.post('/api/mail/getcreatesinglemail', tokenParser, controller.mail.getSingleMail);
  router.post('/api/mail/getcreatesinglemailtxt', tokenParser, controller.mail.getSingleMailTxt);
  router.post('/api/mail/getcreateservermail', tokenParser, controller.mail.getServerMail);
  router.post('/api/mail/getcreateservermailtxt', tokenParser, controller.mail.getServerMailTxt);
  router.post('/api/mail/getviewsinglemail', tokenParser, controller.mail.getSingleMail);
  router.post('/api/mail/getviewsinglemailtxt', tokenParser, controller.mail.getSingleMailTxt);
  router.post('/api/mail/getviewservermail', tokenParser, controller.mail.getServerMail);
  router.post('/api/mail/getviewservermailtxt', tokenParser, controller.mail.getServerMailTxt);
  router.post('/api/mail/findrolebyidorname', tokenParser, controller.mail.findRoleByIdOrName);
  router.post('/api/mail/updatesinglemail', tokenParser, controller.mail.updateGMMail);
  router.post('/api/mail/updatesinglemailtxt', tokenParser, controller.mail.updateGMMail);
  router.post('/api/mail/updateservermail', tokenParser, controller.mail.updateGMMail);
  router.post('/api/mail/updateservermailtxt', tokenParser, controller.mail.updateGMMail);

  router.post('/api/log/getgmlog', tokenParser, controller.log.getGmLog);
  router.post('/api/log/getuserlog', tokenParser, controller.log.getUserLog);
  router.post('/api/log/getgachalog', controller.log.getGachaLog);
};
