阿里云视频点播功能
This commit is contained in:
		| @@ -15,12 +15,14 @@ import com.stdiet.custom.domain.SysCustomerPhysicalSigns; | ||||
| import com.stdiet.custom.service.ISysCustomerHealthyService; | ||||
| import com.stdiet.custom.service.ISysCustomerPhysicalSignsService; | ||||
| import com.stdiet.custom.service.ISysCustomerService; | ||||
| import com.stdiet.custom.service.ISysPhysicalSignsService; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.security.access.prepost.PreAuthorize; | ||||
| import org.springframework.web.bind.annotation.*; | ||||
|  | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
| import java.util.regex.Pattern; | ||||
|  | ||||
| /** | ||||
|  * 客户体征信息Controller | ||||
| @@ -40,6 +42,9 @@ public class SysCustomerController extends BaseController { | ||||
|     @Autowired | ||||
|     private ISysCustomerHealthyService sysCustomerHealthyService; | ||||
|  | ||||
|     @Autowired | ||||
|     private ISysPhysicalSignsService sysPhysicalSignsService; | ||||
|  | ||||
|     /** | ||||
|      * 查询客户信息列表 | ||||
|      */ | ||||
| @@ -56,6 +61,20 @@ public class SysCustomerController extends BaseController { | ||||
|                 sysCustomer.setChannels(remark.split("\\|")); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         //体征查询 | ||||
|         if(StringUtils.isNotEmpty(sysCustomer.getPhysicalSignsId())){ | ||||
|             //判断是否数字ID | ||||
|             Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$"); | ||||
|             if(pattern.matcher(sysCustomer.getPhysicalSignsId()).matches()){ | ||||
|                 List<Long> signIdList = new ArrayList<>(); | ||||
|                 signIdList.add(Long.parseLong(sysCustomer.getPhysicalSignsId())); | ||||
|                 sysCustomer.setSignIdList(signIdList); | ||||
|             }else { | ||||
|                 sysCustomer.setSignIdList(sysPhysicalSignsService.getSignIdByName(sysCustomer.getPhysicalSignsId())); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         list = sysCustomerService.selectSysCustomerList(sysCustomer); | ||||
|         if (list != null && list.size() > 0) { | ||||
|             for (SysCustomer sysCus : list) { | ||||
|   | ||||
| @@ -1,11 +1,15 @@ | ||||
| package com.stdiet.web.controller.custom; | ||||
|  | ||||
| import com.aliyun.vod20170321.models.GetPlayInfoResponseBody; | ||||
| import com.aliyun.vod20170321.models.GetVideoInfoResponseBody; | ||||
| import com.aliyun.vod20170321.models.GetVideoListResponseBody; | ||||
| import com.itextpdf.io.util.DateTimeUtil; | ||||
| import com.stdiet.common.core.controller.BaseController; | ||||
| import com.stdiet.common.core.domain.AjaxResult; | ||||
| import com.stdiet.common.core.page.TableDataInfo; | ||||
| import com.stdiet.common.enums.BusinessType; | ||||
| import com.stdiet.common.exception.file.FileNameLengthLimitExceededException; | ||||
| import com.stdiet.common.utils.AliyunVideoUtils; | ||||
| import com.stdiet.common.utils.DateUtils; | ||||
| import com.stdiet.common.utils.StringUtils; | ||||
| import com.stdiet.common.utils.file.FileUploadUtils; | ||||
| @@ -15,6 +19,7 @@ import com.stdiet.common.utils.sign.AesUtils; | ||||
| import com.stdiet.custom.domain.*; | ||||
| import com.stdiet.custom.dto.response.CustomerCaseResponse; | ||||
| import com.stdiet.custom.dto.response.MessageNoticeResponse; | ||||
| import com.stdiet.custom.dto.response.NutritionalVideoResponse; | ||||
| import com.stdiet.custom.page.WxLogInfo; | ||||
| import com.stdiet.custom.service.*; | ||||
| import org.aspectj.weaver.loadtime.Aj; | ||||
| @@ -353,4 +358,62 @@ public class WechatAppletController extends BaseController { | ||||
|         sysMessageNotice.setId(id); | ||||
|         return toAjax(sysMessageNoticeService.updateSysMessageNotice(sysMessageNotice)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * 更新用户通知消息已读状态 | ||||
|      */ | ||||
|     @GetMapping(value = "/getVideoList") | ||||
|     public AjaxResult getVideoList(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,  @RequestParam(value = "pageSize", defaultValue = "10") int pageSize) { | ||||
|         AjaxResult result = AjaxResult.success(); | ||||
|         int total = 0; | ||||
|         List<NutritionalVideoResponse> nutritionalVideoList = new ArrayList<>(); | ||||
|         try{ | ||||
|             GetVideoListResponseBody videoListResponseBody = AliyunVideoUtils.getVideoListByPage(null, "Normal", pageNum, pageSize); | ||||
|             if(videoListResponseBody != null){ | ||||
|                 total = videoListResponseBody.total; | ||||
|                 for (GetVideoListResponseBody.GetVideoListResponseBodyVideoListVideo video : videoListResponseBody.videoList.video) { | ||||
|                     NutritionalVideoResponse nutritionalVideoResponse = new NutritionalVideoResponse(); | ||||
|                     nutritionalVideoResponse.setCoverURL(video.getCoverURL()); | ||||
|                     nutritionalVideoResponse.setTitle(video.getTitle()); | ||||
|                     nutritionalVideoResponse.setVideoId(video.getVideoId()); | ||||
|                     nutritionalVideoResponse.setDescription(video.getDescription()); | ||||
|                     nutritionalVideoResponse.setTags(video.getTags()); | ||||
|                     nutritionalVideoList.add(nutritionalVideoResponse); | ||||
|                 } | ||||
|             } | ||||
|         }catch (Exception e){ | ||||
|             e.printStackTrace(); | ||||
|         } | ||||
|         result.put("total", total); | ||||
|         result.put("nutritionalVideoList", nutritionalVideoList); | ||||
|         return result; | ||||
|     } | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * 根据视频id获取播放链接 | ||||
|      */ | ||||
|     @GetMapping(value = "/getVideoDetailById") | ||||
|     public AjaxResult getVideoDetailById(@RequestParam(value = "videoId") String videoId) { | ||||
|         AjaxResult result = AjaxResult.success(); | ||||
|         NutritionalVideoResponse nutritionalVideoResponse = new NutritionalVideoResponse(); | ||||
|         try{ | ||||
|             GetPlayInfoResponseBody playInfoResponseBody = AliyunVideoUtils.getVideoVisitDetail(videoId); | ||||
|             GetVideoInfoResponseBody videoInfoResponseBody = AliyunVideoUtils.getVideoById(videoId); | ||||
|             List<GetPlayInfoResponseBody.GetPlayInfoResponseBodyPlayInfoListPlayInfo> playList = playInfoResponseBody.playInfoList.playInfo; | ||||
|             if(playList != null && playList.size() > 0){ | ||||
|                 nutritionalVideoResponse.setPlayUrl(playList.get(0).getPlayURL()); | ||||
|             } | ||||
|             if(videoInfoResponseBody != null){ | ||||
|                 nutritionalVideoResponse.setDescription(videoInfoResponseBody.video.description); | ||||
|                 nutritionalVideoResponse.setTags(videoInfoResponseBody.video.tags); | ||||
|                 nutritionalVideoResponse.setTitle(videoInfoResponseBody.video.title); | ||||
|                 nutritionalVideoResponse.setCreateTime(videoInfoResponseBody.video.creationTime); | ||||
|             } | ||||
|         }catch (Exception e){ | ||||
|             e.printStackTrace(); | ||||
|         } | ||||
|         result.put("videoDetail", nutritionalVideoResponse); | ||||
|         return result; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user