|
@ -23,12 +23,13 @@ public class KCPlayerService implements IKCPlayerService{ |
|
|
/** |
|
|
/** |
|
|
* 获取云点播签名 |
|
|
* 获取云点播签名 |
|
|
* @return 返回签名 |
|
|
* @return 返回签名 |
|
|
|
|
|
* @param id |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public String getSignature() { |
|
|
public String getSignature(Long id) { |
|
|
String signature; |
|
|
String signature; |
|
|
//查询redis
|
|
|
//查询redis
|
|
|
Object o = redisUtil.get(Constant.Redis.KC_PLAYER_SIGNATURE); |
|
|
Object o = redisUtil.get(Constant.Redis.KC_PLAYER_SIGNATURE + id); |
|
|
if(ObjectUtil.isNotNull(o)){ |
|
|
if(ObjectUtil.isNotNull(o)){ |
|
|
return (String) o; |
|
|
return (String) o; |
|
|
} |
|
|
} |
|
@ -39,10 +40,10 @@ public class KCPlayerService implements IKCPlayerService{ |
|
|
// 签名有效期:2天
|
|
|
// 签名有效期:2天
|
|
|
sign.setSignValidDuration(3600 * 24 * 2); |
|
|
sign.setSignValidDuration(3600 * 24 * 2); |
|
|
try { |
|
|
try { |
|
|
signature = sign.getUploadSignature(); |
|
|
signature = sign.getUploadSignature(id); |
|
|
log.info("获取云点播签名成功:{}",signature); |
|
|
log.info("获取云点播签名成功:{}",signature); |
|
|
//存入redis
|
|
|
//存入redis
|
|
|
redisUtil.set(Constant.Redis.KC_PLAYER_SIGNATURE,signature,3600 * 24); |
|
|
redisUtil.set(Constant.Redis.KC_PLAYER_SIGNATURE + id,signature,3600 * 24); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
log.error("获取云点播签名失败",e); |
|
|
log.error("获取云点播签名失败",e); |
|
|
throw new BaseException(CodeEnum.SYS_ERROR); |
|
|
throw new BaseException(CodeEnum.SYS_ERROR); |
|
|