import Router from "@koa/router";
import adminRouter from "./admin";
import miniApprouter from "./miniapp";
const router = new Router();

// 使用管理员路由
router.use(adminRouter.routes(), adminRouter.allowedMethods());
//小程序路由
router.use("/miniapp", miniApprouter.routes(), miniApprouter.allowedMethods());

//用户
const ApiController = require("../controller/ApiController");
const TencentController = require("../controller/TencentController");
//支付回调
router.post("/callback", ApiController.callPay);
router.get("/callback", ApiController.callPay);

//登陆验证
router.post("/checkUserToken", ApiController.checkUserToken);

//第三方登陆
router.post("/thirdLogin", ApiController.thirdLogin);

// WebGame：校验登录URL签名（客户端判断权限）
router.post("/webgame/auth", ApiController.webgameAuth);
router.get("/webgame/auth", ApiController.webgameAuth);

// WebGame：获取带签名的 gameUrl
router.post("/webgame/gameUrl", ApiController.webgameGameUrl);

//获取区服列表
router.get("/serverList", ApiController.getServerList);
router.post("/serverList", ApiController.getServerList);

//获取订单信息
router.post("/createOrder", ApiController.createOrder);

router.post("/useCDKV2", ApiController.useCDKV2);

//进去区服
router.post("/enterServer", ApiController.enterServer);

//获取最近登陆区服信息
router.post("/getLastServerList", ApiController.getLastServerList);

//获取全部区服
router.get("/getAllServerList", ApiController.getAllServerList);

//获取公告
router.get("/getNotice", ApiController.getNotice);

router.get("/maintenance", ApiController.maintenance);

router.get("/maintenanceAll", ApiController.maintenanceAll);

router.post("/sendMail", ApiController.sendMail);

router.post("/sendAllMail", ApiController.sendAllMail);

router.post("/banUser", ApiController.banUser);

// WebGame：封禁/解封/禁言接口（SDK平台回调）
router.post("/webgame/punish", ApiController.webgamePunish);

router.post("/getQuickSign", ApiController.getQuickSign);

router.post("/uicFilter4399", ApiController.uicFilter4399);

router.post("/roleList4399", ApiController.roleList4399);

router.post("/cdkBy4399", ApiController.cdkBy4399);

router.post("/roleListYfy", ApiController.roleListYfy);
router.get("/roleListYfy", ApiController.roleListYfy);

//qq
router.post("/uicFilter", TencentController.uicFilter);

router.post("/getInfo", TencentController.getInfo);

router.post("/isLogin", TencentController.isLogin);

router.post("/getDaWanKaInfo", TencentController.getDaWanKaInfo);

router.post("/getBlueVipInfo", TencentController.getBlueVipInfo);

router.post("/reportDaWanKaPay", TencentController.reportDaWanKaPay);

router.post("/buyGood", TencentController.buyGood);

router.post("/qqCallback", TencentController.qqCallPay);
router.get("/qqCallback", TencentController.qqCallPay);

router.get("/qqServerList", TencentController.qqServerList);

router.get("/qqRoleList", TencentController.qqRoleList);

router.get("/qqGift", TencentController.qqGift);

router.post("/qqReport", TencentController.qqReport);

// mianyou开服同步
router.post("/mianyou/syncServer", ApiController.mianyouSyncServer);

// WebGame通用接口
router.get("/webGame/getUserRoleList", ApiController.getUserRoleList);
router.post("/webgame/loginUrl", ApiController.webgameLoginUrl);
router.get("/webgame/roleList", ApiController.webgameRoleList);
router.post("/webgame/createOrder", ApiController.webgameCreateOrder);
router.post("/webgame/payCallback", ApiController.webgamePayCallback);
router.post("/webgame/chatMonitor", ApiController.webgameChatMonitor);

module.exports = router;