Commit 03571466 authored by kinky2014's avatar kinky2014

修改气瓶单位视频接口

parent aae26323
package com.yeejoin.amos.boot.module.cylinder.api.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
*
* <pre>
* 通用视频协议枚举
* </pre>
*
*/
@Getter
@AllArgsConstructor
public enum CommonVideoEnum {
HLS("2", "hls");
private String code;
private String name;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public static CommonVideoEnum getEnum(String code)
{
for (CommonVideoEnum status : CommonVideoEnum.values())
{
if (status.getCode().equals(code))
{
return status;
}
}
return null;
}
}
package com.yeejoin.amos.boot.module.cylinder.flc.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@ApiModel(value = "CommonVideoDto", description = "通用视频信息")
public class CommonVideoDto {
private String key;
private String url;
private String type;
private String title;
}
...@@ -21,6 +21,10 @@ public class CylinderUnitVideoDto extends BaseDto { ...@@ -21,6 +21,10 @@ public class CylinderUnitVideoDto extends BaseDto {
*/ */
private String url; private String url;
/** /**
*视频标题
*/
private String title;
/**
*appkey *appkey
*/ */
private String appKey; private String appKey;
......
...@@ -31,6 +31,11 @@ public class CylinderUnitVideo extends BaseEntity{/** ...@@ -31,6 +31,11 @@ public class CylinderUnitVideo extends BaseEntity{/**
@TableField("url") @TableField("url")
private String url; private String url;
/** /**
*视频标题
*/
@TableField("title")
private String title;
/**
*appkey *appkey
*/ */
@TableField("app_key") @TableField("app_key")
......
package com.yeejoin.amos.boot.module.cylinder.flc.api.service; package com.yeejoin.amos.boot.module.cylinder.flc.api.service;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CommonVideoDto;
import java.util.List; import java.util.List;
/** /**
...@@ -11,5 +13,5 @@ import java.util.List; ...@@ -11,5 +13,5 @@ import java.util.List;
*/ */
public interface ICylinderUnitVideoService { public interface ICylinderUnitVideoService {
List<String> getUnitVideoUrl(Long unitSeq); List<CommonVideoDto> getUnitVideoUrl(Long unitSeq);
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.cylinder.flc.biz.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.cylinder.flc.biz.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CommonVideoDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit; import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnit;
import com.yeejoin.amos.boot.module.cylinder.flc.api.service.ICylinderInfoService; import com.yeejoin.amos.boot.module.cylinder.flc.api.service.ICylinderInfoService;
...@@ -128,7 +129,7 @@ public class CylinderUnitController extends BaseController { ...@@ -128,7 +129,7 @@ public class CylinderUnitController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getUnitVideoUrl") @GetMapping(value = "/getUnitVideoUrl")
@ApiOperation(httpMethod = "GET", value = "根据气瓶企业seq查询视频链接", notes = "根据气瓶企业seq查询视频链接") @ApiOperation(httpMethod = "GET", value = "根据气瓶企业seq查询视频链接", notes = "根据气瓶企业seq查询视频链接")
public ResponseModel<List<String>> getUnitVideoUrl(@RequestParam Long unitSeq) { public ResponseModel<List<CommonVideoDto>> getUnitVideoUrl(@RequestParam Long unitSeq) {
return ResponseHelper.buildResponse(icylinderUnitVideoService.getUnitVideoUrl(unitSeq)); return ResponseHelper.buildResponse(icylinderUnitVideoService.getUnitVideoUrl(unitSeq));
} }
} }
...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.cylinder.flc.biz.service.impl; ...@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.cylinder.flc.biz.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yeejoin.amos.boot.module.cylinder.api.enums.CommonVideoEnum;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CommonVideoDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitVideoDto; import com.yeejoin.amos.boot.module.cylinder.flc.api.dto.CylinderUnitVideoDto;
import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnitVideo; import com.yeejoin.amos.boot.module.cylinder.flc.api.entity.CylinderUnitVideo;
import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderUnitVideoMapper; import com.yeejoin.amos.boot.module.cylinder.flc.api.mapper.CylinderUnitVideoMapper;
...@@ -40,8 +42,8 @@ public class CylinderUnitVideoServiceImpl extends BaseService<CylinderUnitVideoD ...@@ -40,8 +42,8 @@ public class CylinderUnitVideoServiceImpl extends BaseService<CylinderUnitVideoD
private static final String CODE_404 = "404"; private static final String CODE_404 = "404";
private static final String CODE_20001 = "20001"; private static final String CODE_20001 = "20001";
@Override @Override
public List<String> getUnitVideoUrl(Long unitSeq) { public List<CommonVideoDto> getUnitVideoUrl(Long unitSeq) {
List<String> result = new ArrayList<String>(); List<CommonVideoDto> result = new ArrayList<CommonVideoDto>();
LambdaQueryWrapper<CylinderUnitVideo> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CylinderUnitVideo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CylinderUnitVideo::getUnitSeq,unitSeq); wrapper.eq(CylinderUnitVideo::getUnitSeq,unitSeq);
CylinderUnitVideo cylinderUnitVideo = this.getBaseMapper().selectOne(wrapper); CylinderUnitVideo cylinderUnitVideo = this.getBaseMapper().selectOne(wrapper);
...@@ -86,7 +88,12 @@ public class CylinderUnitVideoServiceImpl extends BaseService<CylinderUnitVideoD ...@@ -86,7 +88,12 @@ public class CylinderUnitVideoServiceImpl extends BaseService<CylinderUnitVideoD
String dataS = videoJsonObject.get("data").toString(); String dataS = videoJsonObject.get("data").toString();
JSONObject dd = JSON.parseObject(dataS); JSONObject dd = JSON.parseObject(dataS);
String url = dd.get("url").toString(); String url = dd.get("url").toString();
result.add(url); CommonVideoDto commonVideoDto = new CommonVideoDto();
commonVideoDto.setUrl(url);
commonVideoDto.setKey(channelNo);
commonVideoDto.setType(CommonVideoEnum.getEnum(cylinderUnitVideo.getProtocol()).getName());
commonVideoDto.setTitle(cylinderUnitVideo.getTitle());
result.add(commonVideoDto);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment