// var payRoll = require("../json/payRoll.json");

module.exports = (app) => {
  const { router, controller} = app;
  const { auth } = controller;

  const localStrategy = app.passport.authenticate("local", {
    successRedirect: "/doLogin/loginCallback",
    failureRedirect: "/doLogin/loginCallback",
  });
  // router.get("/index", controller.index);
  router.get("/signOut", auth.signOut);

  router.get("/", auth.indexPrefix);

  router.get("/productDes", auth.productDes);

  router.get("/register", auth.register);

  router.get("/mobileRegister", auth.mobileRegister);

  router.get("/mobileRegisterSuccess", auth.mobileRegisterSuccess);

  router.get("/signIn", auth.signIn);

  router.post("/doLogin", localStrategy);

  router.get('/doLogin/loginCallback', auth.loginCallback);

  router.post("/smsCodes", auth.smsCodes);

  router.post("/tenants", auth.tenants);

  router.post("/resetPass", auth.resetPass);

  router.post("/updatePassword", auth.updatePassword);

  router.post("/loadUserInfo", auth.loadUserInfo);

  router.post("/getUploaderToken", auth.getUploaderToken);

  router.post("/delOSSObject", auth.delOSSObject);

  router.post("/smsVerification", auth.smsVerification);

  router.post("/getObjectTokenByID", auth.getObjectTokenByID);

  // router.get(
  // 	'/healthMonitor',
  // 	auth.healthMonitor
  // )

  // router.head(
  // 	'/healthMonitor',
  // 	auth.healthMonitor
  // )

  router.post("/getUserRoles", auth.getUserRoles);

  router.post("/getRoles", auth.getRoles);

  router.post("/updateUserRoles", auth.updateUserRoles);

  router.post("/getTenant", auth.getTenant);

  router.post("/updateTenant", auth.updateTenant);

  router.get("/offer/:requestId", auth.offer);

  router.post("/onboardStatus", auth.onboardStatus);

  router.get("/downloadApp", auth.dowloadApp);

  router.get("/info/policy", auth.softwareLicense);

  // router.get("/payRoll", function (req, res, next) {
  //   res.send(payRoll);
  // });

  router.get("/recharge", auth.recharge);

  router.post("/changePassForRegister", auth.changePassForRegister);

  router.post("/changeTenant", auth.changeTenant);

  router.post("/hr/sendRejectOffer", auth.sendRejectOffer);

  router.post("/hr/acceptOffer", auth.acceptOffer);

  router.post("/imTokens", auth.imTokens);

  router.post("/listChannels", auth.listChannels);

  router.post("/getTastLink", auth.getTastLink);

  router.get("/filemeta", auth.filemeta);

  router.get("/getCustomerQrcode", auth.getCustomerQrcode);

  router.get("/getPositionQrcode", auth.getPositionQrcode);

  router.get("/minishop/:id", auth.weidianTempLate);

  router.get("/wso-workai", auth.workaiSecurityOAuth);

  router.get(
    "/socialwork/freedom-jobs/emps/:id/:verification",
    auth.freedomJobsEmp
  );

  router.get("/socialwork/freedom-jobs/emps/:id", auth.freedomJobsEmp);

  router.get("/getShortToken", auth.getShortToken);

  // router.get("/gainianrenli/*", controller.getImg);
  // router.get("/waifu_img/*", controller.getImg);
  // router.get("/my_img/*", controller.getImg);
  // router.get("/invoice_file_icon/*", controller.getImg);
  // router.get("/gainianrenli/*", controller.getImg);
  // router.get("/claim_icons/*", controller.getImg);
};