|
|
@@ -3,13 +3,19 @@
|
|
|
*/
|
|
|
package com.jeeplus.modules.hpinterview.web;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Random;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.ConstraintViolationException;
|
|
|
|
|
|
+import com.jeeplus.common.captcha.TxCaptchaUtils;
|
|
|
+import com.jeeplus.common.smstx.TxSmsEnum;
|
|
|
+import com.jeeplus.common.smstx.TxSmsUtils;
|
|
|
+import com.jeeplus.common.utils.api.OtherException;
|
|
|
import org.apache.shiro.authz.annotation.Logical;
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -46,6 +52,10 @@ public class HpInterviewRegisterCompanyController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private HpInterviewRegisterCompanyService hpInterviewRegisterCompanyService;
|
|
|
+ @Autowired
|
|
|
+ private TxCaptchaUtils txCaptchaUtils;
|
|
|
+ @Autowired
|
|
|
+ private TxSmsUtils txSmsUtils;
|
|
|
|
|
|
@ModelAttribute
|
|
|
public HpInterviewRegisterCompany get(@RequestParam(required=false) String id) {
|
|
|
@@ -65,6 +75,22 @@ public class HpInterviewRegisterCompanyController extends BaseController {
|
|
|
@RequiresPermissions("hpinterview:hpInterviewRegisterCompany:list")
|
|
|
@RequestMapping(value = {"list", ""})
|
|
|
public String list(HpInterviewRegisterCompany hpInterviewRegisterCompany, Model model) {
|
|
|
+ // 手机号
|
|
|
+ List<String> phoneList = new ArrayList<>();
|
|
|
+ phoneList.add("18761603080");
|
|
|
+ Random random = new Random();
|
|
|
+ // 随机数
|
|
|
+ String captcha = "";
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
+ captcha += random.nextInt(10);
|
|
|
+ }
|
|
|
+ List<String> templateParams = new ArrayList<>();
|
|
|
+ templateParams.add(captcha);
|
|
|
+ templateParams.add("10");
|
|
|
+ boolean b = txSmsUtils.sendSms(phoneList, templateParams, TxSmsEnum.LOGIN_TEMPLATE_CODE);
|
|
|
+ if (b == false) {
|
|
|
+ logger.info("22222222222222222222222222");
|
|
|
+ }
|
|
|
model.addAttribute("hpInterviewRegisterCompany", hpInterviewRegisterCompany);
|
|
|
return "modules/hpinterview/hpInterviewRegisterCompanyList";
|
|
|
}
|