|
@@ -9,8 +9,12 @@ import com.aliyuncs.exceptions.ClientException;
|
|
|
import com.aliyuncs.profile.DefaultProfile;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.usky.common.core.bean.ApiResult;
|
|
|
+import com.usky.common.core.exception.BusinessException;
|
|
|
import com.usky.common.redis.core.RedisHelper;
|
|
|
import com.usky.system.domain.SysMobileTenantConfig;
|
|
|
+import com.usky.system.domain.SysUser;
|
|
|
+import com.usky.system.mapper.SysUserMapper;
|
|
|
+import com.usky.system.service.ISysUserService;
|
|
|
import com.usky.system.service.SysMobileTenantConfigService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -38,8 +42,16 @@ public class SendSmsController {
|
|
|
@Autowired
|
|
|
private RedisHelper redisHelper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService sysUserService;
|
|
|
+
|
|
|
@GetMapping("/noteSending")
|
|
|
- public ApiResult<Void> noteSending(@RequestParam String phone) {
|
|
|
+ public ApiResult<Void> noteSending(@RequestParam Integer tenantId,@RequestParam String phone) {
|
|
|
+ SysUser loginUser = sysUserService.getAppUserInfo(null, tenantId, phone);
|
|
|
+ if(loginUser == null){
|
|
|
+ throw new BusinessException("手机号未注册");
|
|
|
+ }
|
|
|
+
|
|
|
DefaultProfile profile = DefaultProfile.getProfile("cn-beijing", "LTAI9WERPIFIlHDg", "p7SQ0rYpraebcdoJ0l3tOtYmmgrR4q");
|
|
|
String code = String.valueOf(new Random().nextInt(1000000));
|
|
|
redisHelper.set(phone,code,300,TimeUnit.SECONDS);//key为手机号,value为验证码存储
|