From 148a074fea18dc8fca0d897173a8b67308065ba0 Mon Sep 17 00:00:00 2001 From: tuyp Date: Fri, 2 Jun 2023 18:40:18 +0800 Subject: [PATCH] 补贴培训第一次上课熬夜改数据 --- src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java | 21 +++++++++------------ src/main/java/com/subsidy/controller/VodPlayHistoryController.java | 20 +++++++++++--------- src/main/java/com/subsidy/jobs/WarningJob.java | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java | 4 ++++ src/main/java/com/subsidy/service/VodPlayHistoryService.java | 5 ++++- src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java | 42 +++++++++++++++++++++--------------------- src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------- src/main/java/com/subsidy/util/ConstantUtils.java | 4 ++-- src/main/java/com/subsidy/util/SMSUtils.java | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------- src/main/java/com/subsidy/vo/vod/VodPlayStateVO.java | 2 ++ src/main/resources/code.properties | 2 +- src/main/resources/mapper/VodDictMapper.xml | 1 + src/main/resources/mapper/VodPlayHistoryMapper.xml | 15 +++++++++++++++ 13 files changed, 302 insertions(+), 89 deletions(-) create mode 100644 src/main/java/com/subsidy/jobs/WarningJob.java diff --git a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java index a51f550..7ac9569 100644 --- a/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java +++ b/src/main/java/com/subsidy/common/interceptor/AuthenticationInterceptor.java @@ -93,30 +93,27 @@ public class AuthenticationInterceptor implements HandlerInterceptor { Localstorage.setUser(administerDO); return true; } - } else if(ConstantUtils.MOBILE_TERMINATE.equals(type)) { + } else if (ConstantUtils.MOBILE_TERMINATE.equals(type)) { MemberDO memberDO = memberMapper.selectById(claimMap.get("id").asLong()); - if (timeRequired !=null){ + if (timeRequired != null) { Calendar calendar = Calendar.getInstance(); + int hour = calendar.get(Calendar.HOUR_OF_DAY); - if (hour<6){ -// OprMemDictDO oprMemDictDO = new OprMemDictDO(); -// oprMemDictDO.setUserId(memberDO.getId()); -// oprMemDictDO.setOprType("登出"); -// oprMemDictDO.setResult(1); -// oprMemDictMapper.insert(oprMemDictDO); + int minute = calendar.get(Calendar.MINUTE); + if (hour < 6 || (hour >= 23 && minute >= 30)) { throw new HttpException(17001); } } - if(memberDO != null) { + if (memberDO != null) { Localstorage.setUser(memberDO); return true; } int count = memberTokensMapper.selectCount(new QueryWrapper() - .lambda() - .eq(MemberTokensDO::getMemberId,memberDO.getId())); - if (count==0){ + .lambda() + .eq(MemberTokensDO::getMemberId, memberDO.getId())); + if (count == 0) { throw new HttpException(1011); } diff --git a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java index 40f6584..abe0560 100644 --- a/src/main/java/com/subsidy/controller/VodPlayHistoryController.java +++ b/src/main/java/com/subsidy/controller/VodPlayHistoryController.java @@ -14,10 +14,7 @@ import com.subsidy.service.VodPlayHistoryService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** *

@@ -48,7 +45,6 @@ public class VodPlayHistoryController { @ApiOperation("记录学生看视频位置 classId班级id vodId 视频id memberId 成员id " + "playLength 播放时长 playRecord 位点 suspendLength") @TimeRequired -// @LoginRequired public ResponseVO insertHistoryNew(@RequestBody String param){ InsertHistoryNewDTO insertHistoryNewDTO = JSON.parseObject(param, InsertHistoryNewDTO.class); return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.insertHistoryNew(insertHistoryNewDTO)); @@ -82,10 +78,16 @@ public class VodPlayHistoryController { vodPlayHistoryService.playLengthFix(remainSecondsDTO); } - @PostMapping("testPlays") - @ApiOperation("解决有交叉时间的数据") - public ResponseVO testPlays(@RequestBody VodPlayHistoryDO vodPlayHistoryDO){ - return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.testPlays(vodPlayHistoryDO)); + @GetMapping("testPlays") + @ApiOperation("解决有交叉时间的数据 classId") + public ResponseVO testPlays(@RequestParam("classId") Long classId ){ + return ResponseData.generateCreatedResponse(0,vodPlayHistoryService.testPlays(classId)); + } + + @PostMapping("warning") + @ApiOperation("短信报警") + public void warning(){ + vodPlayHistoryService.warning(); } } diff --git a/src/main/java/com/subsidy/jobs/WarningJob.java b/src/main/java/com/subsidy/jobs/WarningJob.java new file mode 100644 index 0000000..305796f --- /dev/null +++ b/src/main/java/com/subsidy/jobs/WarningJob.java @@ -0,0 +1,97 @@ +package com.subsidy.jobs; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.subsidy.mapper.ClassMemberMappingMapper; +import com.subsidy.mapper.VodDictMapper; +import com.subsidy.mapper.VodPlayHistoryMapper; +import com.subsidy.model.ClassMemberMappingDO; +import com.subsidy.util.SMSUtils; +import com.subsidy.vo.vod.VodPlayStateVO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Scheduled; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; + +@Component +public class WarningJob { + + /** + * 每天定时查看是否有问题数据,有问题的话并发送短信 + */ + @Autowired + private VodPlayHistoryMapper vodPlayHistoryMapper; + + @Autowired + private ClassMemberMappingMapper classMemberMappingMapper; + + @Autowired + private VodDictMapper vodDictMapper; + + @Autowired + private SMSUtils smsUtils; + + @Value("${spring.profiles.active}") + private String env; + + /** + * POST-2:班级基本信息信息采集接口 + */ + @Scheduled(cron = "0 0 1 * * ?") + public void classBaseInfo() throws IOException { + if ("prod".equals(env)) { + + List result = new ArrayList<>(); + + //查看当天产生视频学习的班级 + List classIds = vodPlayHistoryMapper.dailyVodRecord(); + for (Long classId : classIds) { + + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classId)); + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId)); + for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) { + VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 + VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 + if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) { + result.add(vodPlayStateVO.getClassId()); + break; + } + } + } + } + +// List telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); +// telephones.stream().forEach(x -> { +// smsUtils.sendVerifySMS("SMS_460945631", x, result.toString()); +// }); + + smsUtils.sendVerifySMS("SMS_460945631", "15201936167", result.toString()); + + + StringBuffer stringBuffer = new StringBuffer(); + for (int i = 0; i < result.size(); i++) { + stringBuffer.append(result); + if (i == result.size()-1){ + stringBuffer.append("n"); + } + } + +// List strings = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); +// List telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); +// for (String telephone : telephones){ +// smsUtils.sendVerifySMS("SMS_460945631", telephone, stringBuffer.toString()); +// } + smsUtils.sendWarning("SMS_460945631", "15201936167", stringBuffer.toString()); + } + } + + +} diff --git a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java index 9331a52..bc4971b 100644 --- a/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java +++ b/src/main/java/com/subsidy/mapper/VodPlayHistoryMapper.java @@ -112,4 +112,8 @@ public interface VodPlayHistoryMapper extends BaseMapper { double getSubsidyStudyTotal(); int getStudyHistoryNum(); + + //查看当天产生视频学习的班级 + List dailyVodRecord(); + } diff --git a/src/main/java/com/subsidy/service/VodPlayHistoryService.java b/src/main/java/com/subsidy/service/VodPlayHistoryService.java index 02cef99..ebe8b5f 100644 --- a/src/main/java/com/subsidy/service/VodPlayHistoryService.java +++ b/src/main/java/com/subsidy/service/VodPlayHistoryService.java @@ -33,5 +33,8 @@ public interface VodPlayHistoryService extends IService { void playLengthFix(RemainSecondsDTO remainSecondsDTO); - HashSet testPlays(VodPlayHistoryDO vodPlayHistoryDO); + HashSet testPlays(Long classId); + + void warning(); + } diff --git a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java index 7b20d9d..8e6320f 100644 --- a/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java @@ -102,27 +102,27 @@ public class RenSheJuServiceImpl implements RenSheJuService { System.out.println(JSONObject.fromObject(classBaseInfoDTO).toString()); - RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classBaseInfoDTO).toString()); - Request request = new Request.Builder() - .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClass") - .method("POST", body) - .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") - .addHeader("Content-Type", "application/json") - .build(); - Response response = client.newCall(request).execute(); - - RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); - RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); - renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2); - renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString()); - if (200 == response.code()) { - renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); - } else { - renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); - } - renshejuHistoryMapper.insert(renshejuHistoryDO); - return rensheResponseVO; -// return null; +// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classBaseInfoDTO).toString()); +// Request request = new Request.Builder() +// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClass") +// .method("POST", body) +// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)") +// .addHeader("Content-Type", "application/json") +// .build(); +// Response response = client.newCall(request).execute(); +// +// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class); +// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); +// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2); +// renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString()); +// if (200 == response.code()) { +// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString()); +// } else { +// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR); +// } +// renshejuHistoryMapper.insert(renshejuHistoryDO); +// return rensheResponseVO; + return null; } else { RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO(); renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2); diff --git a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java index 02122fb..cd7f585 100644 --- a/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java +++ b/src/main/java/com/subsidy/service/impl/VodPlayHistoryServiceImpl.java @@ -13,6 +13,7 @@ import com.subsidy.service.VodPlayHistoryService; import com.subsidy.util.ConstantUtils; import com.subsidy.util.DateFormatUtil; import com.subsidy.util.RedisUtil; +import com.subsidy.util.SMSUtils; import com.subsidy.vo.vod.VodPlayStateVO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; @@ -57,6 +58,9 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl testPlays(VodPlayHistoryDO vodPlayHistoryDO) { - - String classIds = "402"; - - String[] classIdArr = classIds.split(","); + public HashSet testPlays(Long classId) { +// String[] classIdArr = classIds.split(","); HashSet result = new HashSet<>(); - for (String classId : classIdArr) { - List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() - .lambda() - .eq(ClassMemberMappingDO::getClassId, classId)); - for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { - List vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId)); - for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) { - VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 - VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 - if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) { - //这一条数据有问题 - System.out.println("111111111111111111111" + vodPlayStateVO); - //查看这个人 这个课程 当天的全部数据 按照createDate升序排序 +// for (String classId : classIdArr) { + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classId)); + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId)); + for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) { + VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 + VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 + if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) { + //这一条数据有问题 + System.out.println("111111111111111111111" + vodPlayStateVO); + //查看这个人 这个课程 当天的全部数据 按照createDate升序排序 // List vodPlayHistoryDOS = this.baseMapper.getVodPlayDay(Long.valueOf(classId), classMemberMappingDO.getMemberId(), vodPlayStateVO.getStartDate()); // //从第一条开始看,顺延减去第二条的playlength得到第二条的create_date 以此类推 // for (int l = 0; l < vodPlayHistoryDOS.size() - 1; l++) { @@ -663,15 +664,58 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl result = new ArrayList<>(); + + //查看当天产生视频学习的班级 + List classIds = vodPlayHistoryMapper.dailyVodRecord(); + for (Long classId : classIds) { + + List classMemberMappingDOS = classMemberMappingMapper.selectList(new QueryWrapper() + .lambda() + .eq(ClassMemberMappingDO::getClassId, classId)); + for (ClassMemberMappingDO classMemberMappingDO : classMemberMappingDOS) { + List vodPlayStateVOS = vodDictMapper.testPlays(classMemberMappingDO.getMemberId(), Long.valueOf(classId)); + for (int i = 0; i < vodPlayStateVOS.size() - 1; i++) { + VodPlayStateVO vodPlayStateVO = vodPlayStateVOS.get(i + 1); //后面 + VodPlayStateVO vodPlayStateVO1 = vodPlayStateVOS.get(i); //前面 + if (vodPlayStateVO1.getEndDate().getTime() > vodPlayStateVO.getStartDate().getTime()) { + if (!result.contains(vodPlayStateVO1.getClassId())){ + result.add(vodPlayStateVO.getClassId()); + } + } + break; + } + } + } +// +// StringBuffer stringBuffer = new StringBuffer(); +// for (int i = 0; i < result.size(); i++) { +// stringBuffer.append(result); +// if (i == result.size()-1){ +// stringBuffer.append("n"); +// } +// } + + if (result.size()>0){ + List telephones = Arrays.asList(new String[]{"15201936167", "18201963812", "18217669021"}); + for (String telephone : telephones){ + smsUtils.sendWarning("SMS_460945631", telephone, result.toString()); + } + } + } + //19为基数的话,3次签到6.5到8,4次签到4.8-6, // 5次4-6,6次3.2-6,7次及以上2.5-6吧 //int randNumber =rand.nextInt(MAX - MIN + 1) + MIN; @@ -712,9 +756,15 @@ public class VodPlayHistoryServiceImpl extends ServiceImpl list = new ArrayList(); + list.add(1L); + list.add(2L); + System.out.println(list.toString()); + + // while (true) { +// System.out.println(getRandom1_2()); +// } // System.out.println(LocalDateTime.now()); // System.out.println(LocalDateTime.now().minusMinutes(3)); diff --git a/src/main/java/com/subsidy/util/ConstantUtils.java b/src/main/java/com/subsidy/util/ConstantUtils.java index 0e3c58e..d19e82f 100644 --- a/src/main/java/com/subsidy/util/ConstantUtils.java +++ b/src/main/java/com/subsidy/util/ConstantUtils.java @@ -65,12 +65,12 @@ public class ConstantUtils { /** * 短信 RAM账号AccessKey ID */ - public static final String ACCESS_KEY_ID = "LTAIOrpFKrDqsQ2c"; + public static final String ACCESS_KEY_ID = "LTAI5tPAH7P7WQVeowo517BE"; /** * 短信 RAM账号AccessKey Secret */ - public static final String SECRET = "1Qp8huLETbWiBBJvHXJ7MOIhtKuA1G"; + public static final String SECRET = "0ueqhIfdAZyw5lWlBVSLpAxTtx37RY"; /** * 腾讯云点播视频转码模板 diff --git a/src/main/java/com/subsidy/util/SMSUtils.java b/src/main/java/com/subsidy/util/SMSUtils.java index ccb28ba..2ef8917 100644 --- a/src/main/java/com/subsidy/util/SMSUtils.java +++ b/src/main/java/com/subsidy/util/SMSUtils.java @@ -76,27 +76,69 @@ public class SMSUtils { * @param telephone 手机号 * @return */ - public static String sendVerifySMS(String templateId,String telephone,String param){ - DefaultProfile profile = DefaultProfile.getProfile(ConstantUtils.REGION_ID, ConstantUtils.ACCESS_KEY_ID, ConstantUtils.SECRET); - IAcsClient client = new DefaultAcsClient(profile); + public String sendVerifySMS(String templateId,String telephone,String param){ - CommonRequest request = new CommonRequest(); - request.setSysMethod(MethodType.POST); - request.setSysDomain("dysmsapi.aliyuncs.com"); - request.setSysVersion("2017-05-25"); - request.setSysAction("SendSms"); - request.putQueryParameter("RegionId",ConstantUtils.REGION_ID); - request.putQueryParameter("PhoneNumbers",telephone); - request.putQueryParameter("SignName",ConstantUtils.VERIFY_NAME); - request.putQueryParameter("TemplateCode",templateId); -// if (StringUtils.isEmpty(param)){ -// request.putQueryParameter("TemplateParam","{ \"code\":\""+verifyCode +"\"}"); -// } - request.putQueryParameter("TemplateParam",param); - CommonResponse response = null; try { - response = client.getCommonResponse(request); - return ConstantUtils.SUCCESS_SEND_OUT; + System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); + System.setProperty("sun.net.client.defaultReadTimeout", "10000"); + + //初始化acsClient,暂不支持region化 + IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunSmsProperties.getAccessKeyId(), aliyunSmsProperties.getAccessKeySecret()); + DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", aliyunSmsProperties.getProduct(), aliyunSmsProperties.getDomain()); + IAcsClient acsClient = new DefaultAcsClient(profile); + + //组装请求对象-具体描述见控制台-文档部分内容 + SendSmsRequest request = new SendSmsRequest(); + //必填:待发送手机号 + request.setPhoneNumbers(telephone); + //必填:短信签名-可在短信控制台中找到 + request.setSignName("有课互联"); + //必填:短信模板-可在短信控制台中找到 + request.setTemplateCode(templateId); + //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 + request.setTemplateParam("{\"code\":\""+ param +"\"}"); + + //hint 此处可能会抛出异常,注意catch + SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request); + if(sendSmsResponse != null && sendSmsResponse.getCode().equals("OK")) { + return ConstantUtils.SUCCESS_SEND_OUT; + } + + throw new Exception(sendSmsResponse.getMessage()); + } catch(Exception e) { + e.printStackTrace(); + return ConstantUtils.FAIL_SEND_OUT; + } + } + + public String sendWarning(String templateId,String telephone,String param){ + try { + System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); + System.setProperty("sun.net.client.defaultReadTimeout", "10000"); + + //初始化acsClient,暂不支持region化 + IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", aliyunSmsProperties.getAccessKeyId(), aliyunSmsProperties.getAccessKeySecret()); + DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", aliyunSmsProperties.getProduct(), aliyunSmsProperties.getDomain()); + IAcsClient acsClient = new DefaultAcsClient(profile); + + //组装请求对象-具体描述见控制台-文档部分内容 + SendSmsRequest request = new SendSmsRequest(); + //必填:待发送手机号 + request.setPhoneNumbers(telephone); + //必填:短信签名-可在短信控制台中找到 + request.setSignName("有课互联科技"); + //必填:短信模板-可在短信控制台中找到 + request.setTemplateCode(templateId); + //可选:模板中的变量替换JSON串,如模板内容为"亲爱的${name},您的验证码为${code}"时,此处的值为 + request.setTemplateParam("{\"ids\":\""+ param +"\"}"); + + //hint 此处可能会抛出异常,注意catch + SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request); + if(sendSmsResponse != null && sendSmsResponse.getCode().equals("OK")) { + return ConstantUtils.SUCCESS_SEND_OUT; + } + + throw new Exception(sendSmsResponse.getMessage()); } catch(Exception e) { e.printStackTrace(); return ConstantUtils.FAIL_SEND_OUT; @@ -109,7 +151,7 @@ public class SMSUtils { * @param telephone 手机号 * @return */ - public static String sendNoticeSMS(String templateId,String telephone,String param){ + public static String sendNoticeSMS(String templateId,String telephone,String param){ DefaultProfile profile = DefaultProfile.getProfile(ConstantUtils.REGION_ID, ConstantUtils.ACCESS_KEY_ID, ConstantUtils.SECRET); IAcsClient client = new DefaultAcsClient(profile); diff --git a/src/main/java/com/subsidy/vo/vod/VodPlayStateVO.java b/src/main/java/com/subsidy/vo/vod/VodPlayStateVO.java index a6e4f4e..cfb19a6 100644 --- a/src/main/java/com/subsidy/vo/vod/VodPlayStateVO.java +++ b/src/main/java/com/subsidy/vo/vod/VodPlayStateVO.java @@ -10,6 +10,8 @@ public class VodPlayStateVO { private Long id; + private Long classId; + private Long memberId; private Date startDate; diff --git a/src/main/resources/code.properties b/src/main/resources/code.properties index ab9016c..b602b12 100644 --- a/src/main/resources/code.properties +++ b/src/main/resources/code.properties @@ -67,7 +67,7 @@ meishu.code-message[15002]=类型已存在证书,删除失败 meishu.code-message[16001]=该条件已存在 -meishu.code-message[17001]=系统不支持00:00:00~06:00:00学习 +meishu.code-message[17001]=系统不支持23:30:00~06:00:00学习 meishu.code-message[18001]=已超过当日验证次数上线 diff --git a/src/main/resources/mapper/VodDictMapper.xml b/src/main/resources/mapper/VodDictMapper.xml index 3a8574b..caed48e 100644 --- a/src/main/resources/mapper/VodDictMapper.xml +++ b/src/main/resources/mapper/VodDictMapper.xml @@ -99,6 +99,7 @@ + + + -- libgit2 0.25.0