| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.sinata.common.enums.EnumRemoteSet; |
| | | import com.sinata.rest.common.ApiUtils; |
| | | import com.sinata.rest.core.aliyun.sms.AliSmsApi; |
| | | import com.sinata.rest.core.aliyun.sms.HwSmsApi; |
| | | import com.sinata.rest.core.util.ToolUtil; |
| | | import com.sinata.rest.modular.member.model.MemUser; |
| | | import com.sinata.rest.modular.member.service.IMemUserService; |
| | | import com.sinata.rest.modular.system.model.RemoteSet; |
| | | import com.sinata.rest.modular.system.model.SmsRecord; |
| | | import com.sinata.rest.modular.system.service.IRemoteSetService; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.time.LocalDateTime; |
| | | import java.util.Objects; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.time.LocalDateTime; |
| | | |
| | | @Slf4j |
| | | @RestController |
| | |
| | | @Autowired |
| | | IRemoteSetService remoteSetService; |
| | | |
| | | @Autowired |
| | | IMemUserService memUserService; |
| | | private static final String note = "发送验证码 type = 1 注册; type = 2 登录 type = 3 修改密码 type = 4 修改手机号 type = 5修改交易密码"; |
| | | |
| | | @GetMapping(value = "/send") |
| | |
| | | if (StringUtils.isEmpty(phone)) { |
| | | return ApiUtils.returnNG(null, "发送失败"); |
| | | } |
| | | LambdaQueryWrapper<MemUser> userWrapper = new LambdaQueryWrapper<>(); |
| | | userWrapper.eq(MemUser::getPhone, phone); |
| | | MemUser user = memUserService.getOne(userWrapper); |
| | | if (Objects.isNull(user)) { |
| | | return ApiUtils.returnNG(null, "手机号不存在,请注册"); |
| | | } |
| | | // 条件查询 |
| | | LambdaQueryWrapper<SmsRecord> wrapper = new LambdaQueryWrapper(); |
| | | wrapper.eq(SmsRecord::getCodeType, type).eq(SmsRecord::getPhone, phone); |