| @@ -160,12 +160,7 @@ public class UserLiveController extends BaseController { | |||||
| //wxCLiveLoginVo.setStatus(0); | //wxCLiveLoginVo.setStatus(0); | ||||
| //wxCLiveLoginVo.setCurrent_time(new Date(System.currentTimeMillis() / 1000)); | //wxCLiveLoginVo.setCurrent_time(new Date(System.currentTimeMillis() / 1000)); | ||||
| // wxCLiveLoginVo.setExpire_time(basicLiveInfo.getExpireTime().getTime() / 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<String, Object> info = new HashMap(); | Map<String, Object> info = new HashMap(); | ||||
| Map<String, Object> data = new HashMap(); | Map<String, Object> data = new HashMap(); | ||||
| Map<Object, Object> status = new HashMap<>(); | Map<Object, Object> status = new HashMap<>(); | ||||
| @@ -186,7 +181,7 @@ public class UserLiveController extends BaseController { | |||||
| wxCLiveLoginVo.setData(data); | wxCLiveLoginVo.setData(data); | ||||
| wxCLiveLoginVo.setInfo(info); | wxCLiveLoginVo.setInfo(info); | ||||
| wxCLiveLoginVos.put("status",status); | wxCLiveLoginVos.put("status",status); | ||||
| wxCLiveLoginVos.put("token",token); | |||||
| wxCLiveLoginVos.put("token",basicInfo.getToken()); | |||||
| System.out.println("wxCLiveLoginVo.getToken() = " + wxCLiveLoginVo.getToken()); | System.out.println("wxCLiveLoginVo.getToken() = " + wxCLiveLoginVo.getToken()); | ||||
| @@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.ToString; | import lombok.ToString; | ||||
| import java.util.Date; | |||||
| @TableName(value = "wx_c_voice") | @TableName(value = "wx_c_voice") | ||||
| @Data | @Data | ||||
| @ToString(callSuper = true) | @ToString(callSuper = true) | ||||
| @@ -22,7 +24,7 @@ public class WxCUserAuthority { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String currentTime; | private String currentTime; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String expireTime; | |||||
| private Date expireTime; | |||||
| } | } | ||||
| @@ -23,7 +23,7 @@ public class WxCVideoTable extends TenantEntityWithoutFinalTenantId { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String currentTime; | private String currentTime; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String expireTime; | |||||
| private Date expireTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value="数字人id",name="id") | @io.swagger.annotations.ApiModelProperty(value="数字人id",name="id") | ||||
| @@ -37,14 +37,18 @@ public class WxCVideoTable extends TenantEntityWithoutFinalTenantId { | |||||
| private String image; | private String image; | ||||
| @io.swagger.annotations.ApiModelProperty(value="数字人样例视频链接",name="demo") | @io.swagger.annotations.ApiModelProperty(value="数字人样例视频链接",name="demo") | ||||
| private String demo; | private String demo; | ||||
| @io.swagger.annotations.ApiModelProperty(value="数字人样例视频链接",name="model") | |||||
| @io.swagger.annotations.ApiModelProperty(value="数字人模板视频链接",name="model") | |||||
| private String model; | private String model; | ||||
| @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息文件链接",name="preinfo") | @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息文件链接",name="preinfo") | ||||
| private String preInfo; | private String preInfo; | ||||
| @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息文件链接",name="model_path") | |||||
| @io.swagger.annotations.ApiModelProperty(value="数字人模板文件链接",name="model_path") | |||||
| private String modelPath; | private String modelPath; | ||||
| @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息文件链接",name="preInfo_path") | @io.swagger.annotations.ApiModelProperty(value="数字人模板预处理信息文件链接",name="preInfo_path") | ||||
| private String preInfoPath; | 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; | |||||
| @@ -6,6 +6,7 @@ import lombok.Data; | |||||
| import lombok.ToString; | import lombok.ToString; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Date; | |||||
| import java.util.List; | import java.util.List; | ||||
| @TableName(value = "voice_info") | @TableName(value = "voice_info") | ||||
| @@ -19,7 +20,7 @@ public class WxCVoiceTable { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String currentTime; | private String currentTime; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private String expireTime; | |||||
| private Date expireTime; | |||||
| @io.swagger.annotations.ApiModelProperty(value = "地区名称", name = "local_name") | @io.swagger.annotations.ApiModelProperty(value = "地区名称", name = "local_name") | ||||
| private String localelName; | private String localelName; | ||||
| @@ -44,8 +44,8 @@ public class WxCUserAuthorityServiceImpl implements WxCUserAuthorityService { | |||||
| data.put("type",wxCUserAuthority.getType()); | data.put("type",wxCUserAuthority.getType()); | ||||
| data.put("resource_id",wxCUserAuthority.getResourceId()); | data.put("resource_id",wxCUserAuthority.getResourceId()); | ||||
| data.put("class",wxCUserAuthority.getClassType()); | 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); | authorList.add(data); | ||||
| } | } | ||||
| authorVos.put("authorList",authorList); | authorVos.put("authorList",authorList); | ||||
| @@ -68,8 +68,8 @@ public class WxCUserAuthorityServiceImpl implements WxCUserAuthorityService { | |||||
| data.put("class",wxCUserAuthority.getClassType()); | data.put("class",wxCUserAuthority.getClassType()); | ||||
| } | } | ||||
| data.put("class", EnumClassType.SHARE.getCode()); | 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); | authorVos.put("data",data); | ||||
| @@ -51,7 +51,7 @@ public class WxCVideoServiceImpl implements WxCVideoService,IExcelExportServer { | |||||
| List authorlist = new ArrayList(); | List authorlist = new ArrayList(); | ||||
| for (WxCVideoTable wxCVideoTable : TemplateVideo) { | for (WxCVideoTable wxCVideoTable : TemplateVideo) { | ||||
| data.put("username",wxCVideoTable.getUserName()); | data.put("username",wxCVideoTable.getUserName()); | ||||
| data.put("current_time",new Date(System.currentTimeMillis())); | |||||
| data.put("current_time",new Date(System.currentTimeMillis()/1000)); | |||||
| Map<String,Object> avatar = new HashMap(); | Map<String,Object> avatar = new HashMap(); | ||||
| avatar.put("avatar_id",wxCVideoTable.getId()); | 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_image",wxCVideoTable.getImage()); | ||||
| avatar.put("avatar_demo",wxCVideoTable.getDemo()); | avatar.put("avatar_demo",wxCVideoTable.getDemo()); | ||||
| avatar.put("avatar_model",wxCVideoTable.getModel()); | 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()); | avatar.put("class", wxCVideoTable.getClassType()); | ||||
| authorlist.add(avatar); | authorlist.add(avatar); | ||||
| data.put("authorlist",authorlist); | data.put("authorlist",authorlist); | ||||
| @@ -51,7 +51,7 @@ public class WxCVoiceServiceImpl implements WxCVoiceService { | |||||
| HashMap<String, Object> voice = new HashMap<>(); | HashMap<String, Object> voice = new HashMap<>(); | ||||
| data.put("username", wxCVoiceTable.getUserName()); | 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); | audioList.add(audio); | ||||
| audio.put("LocaleName", wxCVoiceTable.getLocalelName()); | audio.put("LocaleName", wxCVoiceTable.getLocalelName()); | ||||
| @@ -62,7 +62,7 @@ public class WxCVoiceServiceImpl implements WxCVoiceService { | |||||
| voice.put("voiceid", wxCVoiceTable.getVoiceId()); | 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("voicename", wxCVoiceTable.getVoiceName()); | ||||
| voice.put("voicetype", EnumClassType.SHARE.getCode()); | voice.put("voicetype", EnumClassType.SHARE.getCode()); | ||||
| voice.put("displayname", wxCVoiceTable.getVoiceDisplayName()); | voice.put("displayname", wxCVoiceTable.getVoiceDisplayName()); | ||||
| @@ -9,9 +9,11 @@ | |||||
| <result column="image" jdbcType="VARCHAR" property="image"/> | <result column="image" jdbcType="VARCHAR" property="image"/> | ||||
| <result column="demo" jdbcType="VARCHAR" property="demo"/> | <result column="demo" jdbcType="VARCHAR" property="demo"/> | ||||
| <result column="model" jdbcType="VARCHAR" property="model"/> | <result column="model" jdbcType="VARCHAR" property="model"/> | ||||
| <result column="model_md5" jdbcType="VARCHAR" property="modelMd5"/> | |||||
| <result column="model_path" jdbcType="VARCHAR" property="modelPath"/> | <result column="model_path" jdbcType="VARCHAR" property="modelPath"/> | ||||
| <result column="class" jdbcType="VARCHAR" property="classType"/> | <result column="class" jdbcType="VARCHAR" property="classType"/> | ||||
| <result column="preinfo" jdbcType="VARCHAR" property="preInfo"/> | <result column="preinfo" jdbcType="VARCHAR" property="preInfo"/> | ||||
| <result column="preinfo_md5" jdbcType="VARCHAR" property="preInfoMd5"/> | |||||
| <result column="preinfo_path" jdbcType="VARCHAR" property="preInfoPath"/> | <result column="preinfo_path" jdbcType="VARCHAR" property="preInfoPath"/> | ||||
| <result column="expire_time" jdbcType="VARCHAR" property="expireTime"/> | <result column="expire_time" jdbcType="VARCHAR" property="expireTime"/> | ||||
| @@ -25,7 +27,7 @@ | |||||
| </resultMap>--> | </resultMap>--> | ||||
| <select id="getById" resultMap="BaseResultMap"> | <select id="getById" resultMap="BaseResultMap"> | ||||
| SELECT wca.user_name,expire_time,wcav.id,wcav.name,wcav.image,wcav.model,wcav.preinfo,wcav.demo | SELECT wca.user_name,expire_time,wcav.id,wcav.name,wcav.image,wcav.model,wcav.preinfo,wcav.demo | ||||
| ,wcav.class,wcav.model_path,wcav.preinfo_path | |||||
| ,wcav.class,wcav.model_path,wcav.preinfo_path,wcav.model_md5,wcav.preinfo_md5 | |||||
| from wx_c_author wca | from wx_c_author wca | ||||
| left join wx_c_avatar wcav on wcav.id =wca.resource_id | left join wx_c_avatar wcav on wcav.id =wca.resource_id | ||||
| where wca.resource_id | where wca.resource_id | ||||