From 099b42dcf718e0d5f845b1a6a3cc50084278bf14 Mon Sep 17 00:00:00 2001 From: twy <2301620162@qq.com> Date: Fri, 28 Jul 2023 14:28:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=AD=98=E6=94=BE=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=E5=8F=8Amd=E7=94=9F=E6=88=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/UserLiveController.java | 9 ++----- .../iformall/domain/po/WxCUserAuthority.java | 4 ++- .../com/iformall/domain/po/WxCVideoTable.java | 10 ++++--- .../com/iformall/domain/po/WxCVoiceTable.java | 3 ++- .../impl/WxCUserAuthorityServiceImpl.java | 8 +++--- .../service/impl/WxCVideoServiceImpl.java | 26 ++++++++++++++----- .../service/impl/WxCVoiceServiceImpl.java | 4 +-- .../main/resources/mapper/WxCVideoMapper.xml | 4 ++- 8 files changed, 42 insertions(+), 26 deletions(-) diff --git a/suimangCApi/src/main/java/com/iformall/controller/UserLiveController.java b/suimangCApi/src/main/java/com/iformall/controller/UserLiveController.java index 1487836..2308f1a 100644 --- a/suimangCApi/src/main/java/com/iformall/controller/UserLiveController.java +++ b/suimangCApi/src/main/java/com/iformall/controller/UserLiveController.java @@ -160,12 +160,7 @@ public class UserLiveController extends BaseController { //wxCLiveLoginVo.setStatus(0); //wxCLiveLoginVo.setCurrent_time(new Date(System.currentTimeMillis() / 1000)); // wxCLiveLoginVo.setExpire_time(basicLiveInfo.getExpireTime().getTime() / 1000); - //生成一个token - String token = UUID.randomUUID().toString().replace("-",""); - //将token和用户信息绑定放到redis redis--key:user:info:token value:用户信息 - redisTemplate.opsForValue().set("user:login"+token,JSON.toJSONString(wxCLiveLoginVo)); - //返回给前端 - wxCLiveLoginVo.setToken(token); + Map info = new HashMap(); Map data = new HashMap(); Map status = new HashMap<>(); @@ -186,7 +181,7 @@ public class UserLiveController extends BaseController { wxCLiveLoginVo.setData(data); wxCLiveLoginVo.setInfo(info); wxCLiveLoginVos.put("status",status); - wxCLiveLoginVos.put("token",token); + wxCLiveLoginVos.put("token",basicInfo.getToken()); System.out.println("wxCLiveLoginVo.getToken() = " + wxCLiveLoginVo.getToken()); diff --git a/suimangService/src/main/java/com/iformall/domain/po/WxCUserAuthority.java b/suimangService/src/main/java/com/iformall/domain/po/WxCUserAuthority.java index 3bc0c61..d2942a4 100644 --- a/suimangService/src/main/java/com/iformall/domain/po/WxCUserAuthority.java +++ b/suimangService/src/main/java/com/iformall/domain/po/WxCUserAuthority.java @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.ToString; +import java.util.Date; + @TableName(value = "wx_c_voice") @Data @ToString(callSuper = true) @@ -22,7 +24,7 @@ public class WxCUserAuthority { @TableField(exist = false) private String currentTime; @TableField(exist = false) - private String expireTime; + private Date expireTime; } diff --git a/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java b/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java index 710d3cb..0f770ca 100644 --- a/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java +++ b/suimangService/src/main/java/com/iformall/domain/po/WxCVideoTable.java @@ -23,7 +23,7 @@ public class WxCVideoTable extends TenantEntityWithoutFinalTenantId { @TableField(exist = false) private String currentTime; @TableField(exist = false) - private String expireTime; + private Date expireTime; @io.swagger.annotations.ApiModelProperty(value="数字人id",name="id") @@ -37,14 +37,18 @@ public class WxCVideoTable extends TenantEntityWithoutFinalTenantId { private String image; @io.swagger.annotations.ApiModelProperty(value="数字人样例视频链接",name="demo") private String demo; - @io.swagger.annotations.ApiModelProperty(value="数字人样例视频链接",name="model") + @io.swagger.annotations.ApiModelProperty(value="数字人模板视频链接",name="model") private String model; @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息文件链接",name="preinfo") private String preInfo; - @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息文件链接",name="model_path") + @io.swagger.annotations.ApiModelProperty(value="数字人模板文件链接",name="model_path") private String modelPath; @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息文件链接",name="preInfo_path") private String preInfoPath; + @io.swagger.annotations.ApiModelProperty(value="数字人模板md文件校验码",name="model_md5") + private String modelMd5; + @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息md文件校验码",name="preinfo_md5") + private String preInfoMd5; diff --git a/suimangService/src/main/java/com/iformall/domain/po/WxCVoiceTable.java b/suimangService/src/main/java/com/iformall/domain/po/WxCVoiceTable.java index ef77eb6..e926600 100644 --- a/suimangService/src/main/java/com/iformall/domain/po/WxCVoiceTable.java +++ b/suimangService/src/main/java/com/iformall/domain/po/WxCVoiceTable.java @@ -6,6 +6,7 @@ import lombok.Data; import lombok.ToString; import java.util.ArrayList; +import java.util.Date; import java.util.List; @TableName(value = "voice_info") @@ -19,7 +20,7 @@ public class WxCVoiceTable { @TableField(exist = false) private String currentTime; @TableField(exist = false) - private String expireTime; + private Date expireTime; @io.swagger.annotations.ApiModelProperty(value = "地区名称", name = "local_name") private String localelName; diff --git a/suimangService/src/main/java/com/iformall/service/impl/WxCUserAuthorityServiceImpl.java b/suimangService/src/main/java/com/iformall/service/impl/WxCUserAuthorityServiceImpl.java index 53d228b..50b9d7e 100644 --- a/suimangService/src/main/java/com/iformall/service/impl/WxCUserAuthorityServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/impl/WxCUserAuthorityServiceImpl.java @@ -44,8 +44,8 @@ public class WxCUserAuthorityServiceImpl implements WxCUserAuthorityService { data.put("type",wxCUserAuthority.getType()); data.put("resource_id",wxCUserAuthority.getResourceId()); data.put("class",wxCUserAuthority.getClassType()); - data.put("current_time",new Date(System.currentTimeMillis())); - data.put("expire_time",wxCUserAuthority.getExpireTime()); + data.put("current_time",new Date(System.currentTimeMillis()/1000)); + data.put("expire_time",wxCUserAuthority.getExpireTime().getTime()/1000); authorList.add(data); } authorVos.put("authorList",authorList); @@ -68,8 +68,8 @@ public class WxCUserAuthorityServiceImpl implements WxCUserAuthorityService { data.put("class",wxCUserAuthority.getClassType()); } data.put("class", EnumClassType.SHARE.getCode()); - data.put("current_time",new Date(System.currentTimeMillis())); - data.put("expire_time",wxCUserAuthority.getExpireTime()); + data.put("current_time",new Date(System.currentTimeMillis()/1000)); + data.put("expire_time",wxCUserAuthority.getExpireTime().getTime()/1000); } authorVos.put("data",data); diff --git a/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java b/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java index 918febb..6829aab 100644 --- a/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/impl/WxCVideoServiceImpl.java @@ -51,7 +51,7 @@ public class WxCVideoServiceImpl implements WxCVideoService,IExcelExportServer { List authorlist = new ArrayList(); for (WxCVideoTable wxCVideoTable : TemplateVideo) { data.put("username",wxCVideoTable.getUserName()); - data.put("current_time",new Date(System.currentTimeMillis())); + data.put("current_time",new Date(System.currentTimeMillis()/1000)); Map avatar = new HashMap(); avatar.put("avatar_id",wxCVideoTable.getId()); @@ -59,14 +59,26 @@ public class WxCVideoServiceImpl implements WxCVideoService,IExcelExportServer { avatar.put("avatar_image",wxCVideoTable.getImage()); avatar.put("avatar_demo",wxCVideoTable.getDemo()); avatar.put("avatar_model",wxCVideoTable.getModel()); - File modelFile = new File(wxCVideoTable.getModelPath()); + //模板文件和预处理信息存放问题 + try { + File modelFile = new File(wxCVideoTable.getModelPath()); + avatar.put("avatar_model_md5",getFileMD5(modelFile)); + } catch (Exception e) { + e.printStackTrace(); + avatar.put("avatar_model_md5",wxCVideoTable.getModelMd5()); + } - avatar.put("avatar_demo_md5",getFileMD5(modelFile)); - avatar.put("avatar_preinfo",wxCVideoTable.getPreInfo()); - File preinfoFile = new File(wxCVideoTable.getPreInfoPath()); - avatar.put("avatar_preinfo_md5",getFileMD5(preinfoFile)); - avatar.put("expire_time",wxCVideoTable.getExpireTime()); + try { + File preinfoFile = new File(wxCVideoTable.getPreInfoPath()); + avatar.put("avatar_preinfo_md5",getFileMD5(preinfoFile)); + } catch (Exception e) { + e.printStackTrace(); + avatar.put("avatar_preinfo_md5",wxCVideoTable.getPreInfoMd5()); + } + + avatar.put("avatar_preinfo",wxCVideoTable.getPreInfo()); + avatar.put("expire_time",wxCVideoTable.getExpireTime().getTime()/1000); avatar.put("class", wxCVideoTable.getClassType()); authorlist.add(avatar); data.put("authorlist",authorlist); diff --git a/suimangService/src/main/java/com/iformall/service/impl/WxCVoiceServiceImpl.java b/suimangService/src/main/java/com/iformall/service/impl/WxCVoiceServiceImpl.java index c1bf7f2..727516c 100644 --- a/suimangService/src/main/java/com/iformall/service/impl/WxCVoiceServiceImpl.java +++ b/suimangService/src/main/java/com/iformall/service/impl/WxCVoiceServiceImpl.java @@ -51,7 +51,7 @@ public class WxCVoiceServiceImpl implements WxCVoiceService { HashMap voice = new HashMap<>(); data.put("username", wxCVoiceTable.getUserName()); - data.put("current_time", new Date(System.currentTimeMillis())); + data.put("current_time", new Date(System.currentTimeMillis()/1000)); audioList.add(audio); audio.put("LocaleName", wxCVoiceTable.getLocalelName()); @@ -62,7 +62,7 @@ public class WxCVoiceServiceImpl implements WxCVoiceService { voice.put("voiceid", wxCVoiceTable.getVoiceId()); - voice.put("expire_time", wxCVoiceTable.getExpireTime()); + voice.put("expire_time", wxCVoiceTable.getExpireTime().getTime()/1000); voice.put("voicename", wxCVoiceTable.getVoiceName()); voice.put("voicetype", EnumClassType.SHARE.getCode()); voice.put("displayname", wxCVoiceTable.getVoiceDisplayName()); diff --git a/suimangService/src/main/resources/mapper/WxCVideoMapper.xml b/suimangService/src/main/resources/mapper/WxCVideoMapper.xml index dd0e225..0dc0e45 100644 --- a/suimangService/src/main/resources/mapper/WxCVideoMapper.xml +++ b/suimangService/src/main/resources/mapper/WxCVideoMapper.xml @@ -9,9 +9,11 @@ + + @@ -25,7 +27,7 @@ -->