| @@ -245,42 +245,8 @@ public class PhotoSpeakVideoController extends BaseController { | |||
| mouldVideoUpd.setVideoStatus(EnumVideoStatus.ing.getCode()); | |||
| mouldVideoUpd.setVideoMsg(""); | |||
| mouldVideoUpd.setCreateVideoDate(new Date()); | |||
| // | |||
| if (mouldVideo.getSubtitleEnabled()==1){ | |||
| // 开启字幕 | |||
| mouldVideoUpd.setSubtitleEnabled(1); | |||
| Map params = new HashMap(); | |||
| JSONObject subtitle = JSON.parseObject(mouldVideo.getSubtitleParams()); | |||
| subtitle.put("Fontname",(subtitle.get("Fontname")==null?"宋体":subtitle.get("Fontname"))); | |||
| subtitle.put("Fontsize",(subtitle.get("Fontsize")==null? 25:subtitle.get("Fontsize"))); | |||
| subtitle.put("PrimaryColour",(subtitle.get("PrimaryColour")==null?"&Hffffff":subtitle.get("PrimaryColour"))); | |||
| subtitle.put("SecondaryColour",(subtitle.get("SecondaryColour")==null?"BBGGRR":subtitle.get("SecondaryColour"))); | |||
| subtitle.put("OutlineColour",(subtitle.get("OutlineColour")==null?"BBGGRR":subtitle.get("OutlineColour"))); | |||
| subtitle.put("BackColour",(subtitle.get("BackColour")==null?"&H0000ff":subtitle.get("BackColour"))); | |||
| subtitle.put("Bold",(subtitle.get("Bold")==null? -1:subtitle.get("Bold"))); | |||
| subtitle.put("Italic",(subtitle.get("Italic")==null? 0:subtitle.get("Italic"))); | |||
| subtitle.put("Underline",(subtitle.get("Underline")==null? 0:subtitle.get("Underline"))); | |||
| subtitle.put("Strikeout",(subtitle.get("Strikeout")==null? 0:subtitle.get("Strikeout"))); | |||
| subtitle.put("ScaleX",(subtitle.get("ScaleX")==null? 100:subtitle.get("ScaleX"))); | |||
| subtitle.put("ScaleY",(subtitle.get("ScaleY")==null? 100:subtitle.get("ScaleY"))); | |||
| subtitle.put("Spacing",(subtitle.get("Spacing")==null? 0:subtitle.get("Spacing"))); | |||
| subtitle.put("Angle",(subtitle.get("Angle")==null? 15:subtitle.get("Angle"))); | |||
| subtitle.put("BorderStyle",(subtitle.get("BorderStyle")==null?"1":subtitle.get("BorderStyle"))); | |||
| subtitle.put("Outline",(subtitle.get("Outline")==null? 20:subtitle.get("Outline"))); | |||
| subtitle.put("Shadow",(subtitle.get("Shadow")==null? 12:subtitle.get("Shadow"))); | |||
| subtitle.put("Alignment",(subtitle.get("Alignment")==null? 1:subtitle.get("Alignment"))); | |||
| subtitle.put("MarginL",(subtitle.get("MarginL")==null? 100:subtitle.get("MarginL"))); | |||
| subtitle.put("MarginR",(subtitle.get("MarginR")==null? 100:subtitle.get("MarginR"))); | |||
| subtitle.put("MarginV",(subtitle.get("MarginV")==null? 100:subtitle.get("MarginV"))); | |||
| // subtitle.put("enabled",1); | |||
| //subtitle.put("text",mouldVideo.getPaperwork()); | |||
| // subtitle.put("params",params); | |||
| mouldVideoUpd.setSubtitleParams(String.valueOf(subtitle)); | |||
| videoUpd.setSubtitleParams(String.valueOf(subtitle)); | |||
| videoUpd.setSubtitleEnabled(1); | |||
| }// | |||
| photoSpeakVideoService.saveOrUpdate(mouldVideoUpd); | |||
| photoSpeakVideoService.saveOrUpdate(mouldVideoUpd); | |||
| photoSpeakVideoService.createVideo(videoUpd); | |||
| return new ResultData(); | |||
| @@ -29,10 +29,7 @@ import javax.servlet.ServletOutputStream; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.awt.image.BufferedImage; | |||
| import java.io.IOException; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| import java.util.UUID; | |||
| import java.util.*; | |||
| @RestController | |||
| @RequestMapping("/api/live") | |||
| @@ -95,67 +92,98 @@ public class UserLiveController extends BaseController { | |||
| @AuthIgnore | |||
| @PostMapping("/login") | |||
| @ApiOperation(value = "用户登录", notes = "{\"username\":\"string\",\"password\":\"string\",\"code\":\"string\",\"Mcode\":\"string\",\"status\":\"int\"}") | |||
| public ResultData login(@RequestBody Map<String, String> map, HttpServletResponse response) { | |||
| public Map<String,Object> login(@RequestBody Map<String, String> map, HttpServletResponse response) { | |||
| Map<String,Object> wxCLiveLoginVos = new HashMap<>(); | |||
| String ipAddr = getIpAddr(); | |||
| logger.debug("[" + ipAddr + "] WxUserGrantController::login"); | |||
| String code = map.get("code"); | |||
| if (StringUtils.isBlank(code)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "请输入验证码"); | |||
| HashMap<Object, Object> status = new HashMap<>(); | |||
| status.put("code",ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); | |||
| status.put("message","请输入验证码"); | |||
| wxCLiveLoginVos.put("status",status); | |||
| return wxCLiveLoginVos; | |||
| // new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "请输入验证码"); | |||
| } | |||
| String key = Constant.captchaPrev + ":" + ipAddr; | |||
| String code1 = RedisCacheUtils.getCacheString(redisTemplate, key); | |||
| if (StringUtils.isBlank(code1)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "验证码已过期"); | |||
| } | |||
| if (!code1.equals(code)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "验证码不正确"); | |||
| } | |||
| // if (StringUtils.isBlank(code1)) { | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "验证码已过期"); | |||
| // } | |||
| // if (!code1.equals(code)) { | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "验证码不正确"); | |||
| // } | |||
| String phone = map.get("username"); | |||
| String password = map.get("password"); | |||
| if (StringUtils.isBlank(phone) || StringUtils.isBlank(password)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "手机号或密码为空"); | |||
| HashMap<Object, Object> status = new HashMap<>(); | |||
| status.put("code",ErrorCode.SYS_PARAMETER_ERROR.getCode()); | |||
| status.put("message","手机号或密码为空"); | |||
| wxCLiveLoginVos.put("status",status); | |||
| return wxCLiveLoginVos; | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "手机号或密码为空"); | |||
| } | |||
| WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.findInfoByPhone(getTenantInfo(), phone); | |||
| if (basicInfo == null) { | |||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | |||
| HashMap<Object, Object> status = new HashMap<>(); | |||
| status.put("code",ErrorCode.USER_IS_EMPTY); | |||
| status.put("message","用户不存在"); | |||
| wxCLiveLoginVos.put("status",status); | |||
| return wxCLiveLoginVos; | |||
| // return new ResultData(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| String encryptPassword = new PasswordHelper().encryptPassword(password); | |||
| if (!encryptPassword.equals(basicInfo.getPassword())) { | |||
| return new ResultData(ErrorCode.USER_PASSWD_ERR.getCode(), "手机号或密码错误"); | |||
| HashMap<Object, Object> status = new HashMap<>(); | |||
| status.put("code",ErrorCode.USER_PASSWD_ERR.getCode()); | |||
| status.put("message","手机号或密码错误"); | |||
| wxCLiveLoginVos.put("status",status); | |||
| return wxCLiveLoginVos; | |||
| // return new ResultData(ErrorCode.USER_PASSWD_ERR.getCode(), "手机号或密码错误"); | |||
| } | |||
| int status = Integer.parseInt(map.get("status")); | |||
| int statu = Integer.parseInt(map.get("status")); | |||
| if (status == 0) { | |||
| if (statu == 0) { | |||
| WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(basicInfo.getId()); | |||
| if (basicLiveInfo.getCode() != null && !map.get("Mcode").equals(basicLiveInfo.getCode())) { | |||
| return new ResultData(ErrorCode.USER_ALREADY_LOGIN.getCode(), "用户已在其他设备登录"); | |||
| HashMap<Object, Object> status = new HashMap<>(); | |||
| status.put("code",ErrorCode.USER_ALREADY_LOGIN.getCode()); | |||
| status.put("message","用户已在其他设备登录"); | |||
| wxCLiveLoginVos.put("status",status); | |||
| return wxCLiveLoginVos; | |||
| // return new ResultData(ErrorCode.USER_ALREADY_LOGIN.getCode(), "用户已在其他设备登录"); | |||
| } | |||
| if (basicLiveInfo.getCode() == null) { | |||
| wxCLiveUserBasicInfoService.updateCode(basicInfo.getId(), map.get("Mcode")); | |||
| } | |||
| } | |||
| if (status == -1) { | |||
| if (statu == -1) { | |||
| wxCLiveUserBasicInfoService.updateCode(basicInfo.getId(), null); | |||
| basicInfo.setStatus(-2); | |||
| return new ResultData(ErrorCode.USER_CANCEL_MCODE.getCode(), "设备已注销"); | |||
| HashMap<Object, Object> status = new HashMap<>(); | |||
| status.put("code",ErrorCode.USER_CANCEL_MCODE.getCode()); | |||
| status.put("message","设备已注销"); | |||
| wxCLiveLoginVos.put("status",status); | |||
| return wxCLiveLoginVos; | |||
| // return new ResultData(ErrorCode.USER_CANCEL_MCODE.getCode(), "设备已注销"); | |||
| } | |||
| wxCUserBasicInfoService.handleLoginUser(basicInfo); | |||
| WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(basicInfo.getId()); | |||
| Map<String, Object> resultMap = new HashMap(); | |||
| WxCLiveLoginVo wxCLiveLoginVo = new WxCLiveLoginVo(); | |||
| wxCLiveLoginVo.setCode(Integer.parseInt(map.get("Mcode"))); | |||
| wxCLiveLoginVo.setVersion(basicLiveInfo.getVersion()); | |||
| //wxCLiveLoginVo.setVersion(basicLiveInfo.getVersion()); | |||
| wxCLiveLoginVo.setUsername(map.get("username")); | |||
| wxCLiveLoginVo.setStatus(0); | |||
| wxCLiveLoginVo.setCurrent_time(new Date(System.currentTimeMillis() / 1000)); | |||
| wxCLiveLoginVo.setExpire_time(basicLiveInfo.getExpireTime().getTime() / 1000); | |||
| //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:用户信息 | |||
| @@ -163,48 +191,77 @@ public class UserLiveController extends BaseController { | |||
| //返回给前端 | |||
| wxCLiveLoginVo.setToken(token); | |||
| Map<String, Object> info = new HashMap(); | |||
| Map<String, Object> Status = new HashMap(); | |||
| Map<String, Object> data = new HashMap(); | |||
| Map<Object, Object> status = new HashMap<>(); | |||
| status.put("code",1000); | |||
| status.put("message","success"); | |||
| data.put("status",0); | |||
| data.put("version",basicLiveInfo.getVersion()); | |||
| data.put("current_time",new Date(System.currentTimeMillis() / 1000)); | |||
| data.put("expire_time",basicLiveInfo.getExpireTime().getTime() / 1000); | |||
| info.put("log_id", basicInfo.getId()); | |||
| info.put("server_type","user login"); | |||
| info.put("username", basicInfo.getPhone()); | |||
| wxCLiveLoginVo.setParam(info); | |||
| Status.put("code",1000); | |||
| Status.put("msg","success"); | |||
| wxCLiveLoginVo.setParam(Status); | |||
| wxCLiveLoginVos.put("data",data); | |||
| wxCLiveLoginVos.put("info",info); | |||
| wxCLiveLoginVo.setData(data); | |||
| wxCLiveLoginVo.setInfo(info); | |||
| wxCLiveLoginVos.put("status",status); | |||
| wxCLiveLoginVos.put("token",token); | |||
| System.out.println("wxCLiveLoginVo.getToken() = " + wxCLiveLoginVo.getToken()); | |||
| return new ResultData(wxCLiveLoginVo); | |||
| return wxCLiveLoginVos; | |||
| // return new ResultData(1000,"success",wxCLiveLoginVo); | |||
| } | |||
| /** | |||
| * 视频模板列表 | |||
| */ | |||
| @AuthIgnore | |||
| @PostMapping("/avatarList") | |||
| @ApiOperation(value = "视频模板列表", notes = "{\"username\",\"string\",\"code\",\"string\"}") | |||
| public ResultData avatarList(@RequestBody Map<String, String> params) { | |||
| public Map<String,Object> avatarList(@RequestBody Map<String, String> params) { | |||
| Map<String,Object> avatarVos = new HashMap<>(); | |||
| String ipaddress = getIpAddr(); | |||
| logger.debug("[" + ipaddress + "] WxUserGrantController::getAvatarList"); | |||
| long id = getMemberId(); | |||
| WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.getById(id); | |||
| return wxCVideoService.getById(id); | |||
| String phone = params.get("username"); | |||
| WxCUserBasicInfo infoByPhone = wxCUserBasicInfoService.findInfoByPhone(getTenantInfo(), phone); | |||
| Long id = infoByPhone.getId(); | |||
| System.out.println("id = " + id); | |||
| Map<Object, Object> status = new HashMap<>(); | |||
| status.put("code",1000); | |||
| status.put("msg","success"); | |||
| // long id = getMemberId(); | |||
| // System.out.println("id = " + id); | |||
| // WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.getById(infoByPhone.getId()); | |||
| avatarVos.put("status",status); | |||
| return wxCVideoService.getById(infoByPhone.getId()); | |||
| // return new ResultData(1000,"success",wxCVideoService.getById(infoByPhone.getId())); | |||
| } | |||
| /** | |||
| * 音频模板列表 | |||
| */ | |||
| @AuthIgnore | |||
| @PostMapping("/audioList") | |||
| @ApiOperation(value = "音频模板列表", notes = "{\"username\",\"string\",\"code\",\"string\"}") | |||
| public ResultData audioList(@RequestBody Map<String, String> params) { | |||
| public Map<String,Object> audioList(@RequestBody Map<String, String> params) { | |||
| String ipaddress = getIpAddr(); | |||
| logger.debug("[" + ipaddress + "] WxUserGrantController::getAudioList"); | |||
| String phone = params.get("username"); | |||
| WxCUserBasicInfo infoByPhone = wxCUserBasicInfoService.findInfoByPhone(getTenantInfo(), phone); | |||
| Long id = infoByPhone.getId(); | |||
| System.out.println("id = " + id); | |||
| long id = getMemberId(); | |||
| // long id = getMemberId(); | |||
| return wxCVoiceService.getById(id); | |||
| @@ -214,15 +271,21 @@ public class UserLiveController extends BaseController { | |||
| * 资源权限查询 | |||
| */ | |||
| @AuthIgnore | |||
| @ApiOperation(value = "资源权限查询", notes = "{\"username\",\"string\",\"code\",\"string\",\"type\",\"int\",\"resource_id\",\"long\"}") | |||
| @PostMapping("/author") | |||
| public ResultData getAuthor(@RequestBody Map<String, String> params) { | |||
| public Map<String,Object> getAuthor(@RequestBody Map<String, String> params) { | |||
| String ipaddress = getIpAddr(); | |||
| logger.debug("[" + ipaddress + "] WxUserGrantController::getAuthor"); | |||
| long id = getMemberId(); | |||
| String phone = params.get("username"); | |||
| WxCUserBasicInfo infoByPhone = wxCUserBasicInfoService.findInfoByPhone(getTenantInfo(), phone); | |||
| Long id = infoByPhone.getId(); | |||
| System.out.println("id = " + id); | |||
| //long id = getMemberId(); | |||
| String username = params.get("username"); | |||
| String code = params.get("code"); | |||
| @@ -12,10 +12,10 @@ public class WxCLiveLoginVo { | |||
| private String token; //令牌 | |||
| private String username; //令牌 | |||
| private int status; //用户登录状态 2设备注销,1登陆失败,0登陆成功 | |||
| private int version; //用户购买的软件套餐 | |||
| private Date current_time;//服务器当前时间 | |||
| private long expire_time;//套餐过期时间 | |||
| // private int status; //用户登录状态 2设备注销,1登陆失败,0登陆成功 | |||
| // private int version; //用户购买的软件套餐 | |||
| // private Date current_time;//服务器当前时间 | |||
| // private long expire_time;//套餐过期时间 | |||
| private int code; //机器码 | |||
| @ApiModelProperty(value = "响应") | |||
| private Map<String,Object> data = new HashMap<>(); | |||
| @@ -23,7 +23,7 @@ public class WxCLiveLoginVo { | |||
| // @ApiModelProperty(value = "响应") | |||
| //private Map<String,Object> Status = new HashMap<>(); | |||
| @ApiModelProperty(value = "其它参数") | |||
| private Map<String,Object> param = new HashMap<>(); | |||
| @ApiModelProperty(value = "信息") | |||
| private Map<String,Object> info = new HashMap<>(); | |||
| } | |||
| @@ -9,7 +9,7 @@ import java.util.List; | |||
| public interface WxCVideoMapper extends CommonMapper<WxCVideoTable, String> { | |||
| List<WxCVideoTable> getById(@Param("user_id") Long id); | |||
| List<WxCVideoTable> getById(Long id); | |||
| @@ -2,6 +2,8 @@ package com.iformall.service; | |||
| import com.iformall.common.ResultData; | |||
| import java.util.Map; | |||
| public interface WxCUserAuthorityService { | |||
| ResultData getAuthor(Long id, String code, Integer type, Long resourceId); | |||
| Map<String,Object> getAuthor(Long id, String code, Integer type, Long resourceId); | |||
| } | |||
| @@ -3,8 +3,10 @@ package com.iformall.service; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCVideoTable; | |||
| import java.util.Map; | |||
| public interface WxCVideoService { | |||
| ResultData getById(Long id); | |||
| Map<String,Object> getById(Long id); | |||
| } | |||
| @@ -2,6 +2,8 @@ package com.iformall.service; | |||
| import com.iformall.common.ResultData; | |||
| import java.util.Map; | |||
| public interface WxCVoiceService { | |||
| ResultData getById(Long id); | |||
| Map<String,Object> getById(Long id); | |||
| } | |||
| @@ -7,10 +7,7 @@ import com.iformall.service.WxCUserAuthorityService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.*; | |||
| @Service | |||
| public class WxCUserAuthorityServiceImpl implements WxCUserAuthorityService { | |||
| @@ -20,8 +17,9 @@ public class WxCUserAuthorityServiceImpl implements WxCUserAuthorityService { | |||
| @Override | |||
| public ResultData getAuthor(Long id, String code, Integer type, Long resourceId) { | |||
| public Map<String,Object> getAuthor(Long id, String code, Integer type, Long resourceId) { | |||
| List<WxCUserAuthority> resultList = new ArrayList<WxCUserAuthority>(); | |||
| HashMap<String, Object> authorVos = new HashMap<>(); | |||
| if (type==0){ | |||
| //查询数字人相关权限 | |||
| @@ -32,34 +30,51 @@ public class WxCUserAuthorityServiceImpl implements WxCUserAuthorityService { | |||
| resultList = wxCUserAuthorityMapper.getAuthorVoice(id,1,resourceId); | |||
| } | |||
| if (resourceId==null){ | |||
| if (resourceId==null||resourceId==-1){ | |||
| //若资源id没有传入那就展示所有当前类型资源权限 | |||
| HashMap<String, Object> resultMap = new HashMap<>(); | |||
| HashMap<String, Object> info = new HashMap<>(); | |||
| HashMap<String, Object> status = new HashMap<>(); | |||
| List authorList = new ArrayList(); | |||
| for (WxCUserAuthority wxCUserAuthority : resultList) { | |||
| HashMap<String, Object> author = new HashMap<>(); | |||
| author.put("username",wxCUserAuthority.getUserName()); | |||
| author.put("type",wxCUserAuthority.getType()); | |||
| author.put("resource_id",wxCUserAuthority.getResourceId()); | |||
| author.put("class",wxCUserAuthority.getClassType()); | |||
| author.put("current_time",new Date(System.currentTimeMillis())); | |||
| author.put("expire_time",wxCUserAuthority.getExpireTime()); | |||
| authorList.add(author); | |||
| HashMap<String, Object> data = new HashMap<>(); | |||
| data.put("username",wxCUserAuthority.getUserName()); | |||
| 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()); | |||
| authorList.add(data); | |||
| } | |||
| resultMap.put("authorList",authorList); | |||
| authorVos.put("authorList",authorList); | |||
| info.put("log_id",id); | |||
| info.put("server_type","author"); | |||
| authorVos.put("info",info); | |||
| status.put("code",1000); | |||
| status.put("msg","success"); | |||
| authorVos.put("status",status); | |||
| return authorVos; | |||
| } | |||
| HashMap<String, Object> resultMap = new HashMap<>(); | |||
| HashMap<String, Object> data = new HashMap<>(); | |||
| HashMap<String, Object> info = new HashMap<>(); | |||
| HashMap<String, Object> status = new HashMap<>(); | |||
| for (WxCUserAuthority wxCUserAuthority : resultList) { | |||
| resultMap.put("username",wxCUserAuthority.getUserName()); | |||
| resultMap.put("type",wxCUserAuthority.getType()); | |||
| resultMap.put("resource_id",wxCUserAuthority.getResourceId()); | |||
| resultMap.put("class",wxCUserAuthority.getClassType()); | |||
| resultMap.put("current_time",new Date(System.currentTimeMillis())); | |||
| resultMap.put("expire_time",wxCUserAuthority.getExpireTime()); | |||
| data.put("username",wxCUserAuthority.getUserName()); | |||
| 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()); | |||
| } | |||
| authorVos.put("data",data); | |||
| info.put("log_id",id); | |||
| info.put("server_type","author"); | |||
| authorVos.put("info",info); | |||
| status.put("code",1000); | |||
| status.put("msg","success"); | |||
| authorVos.put("status",status); | |||
| return new ResultData(resultMap); | |||
| return authorVos; | |||
| } | |||
| } | |||
| @@ -32,11 +32,12 @@ public class WxCVideoServiceImpl implements WxCVideoService,IExcelExportServer { | |||
| @Autowired | |||
| WxCVideoMapper wxCVideoMapper; | |||
| @Override | |||
| public ResultData getById(Long id) { | |||
| public Map<String,Object> getById(Long id) { | |||
| System.out.println("id = " + id); | |||
| List<WxCVideoTable> TemplateVideo = wxCVideoMapper.getById(id); | |||
| System.out.println("TemplateVideo = " + TemplateVideo); | |||
| Map<String,Object> resultMap = new HashMap(); | |||
| Map<String,Object> avatarVos = new HashMap(); | |||
| Map<String,Object> data = new HashMap(); | |||
| @@ -54,12 +55,20 @@ public class WxCVideoServiceImpl implements WxCVideoService,IExcelExportServer { | |||
| avatar.put("avatar_preinfo",wxCVideoTable.getPreInfo()); | |||
| avatar.put("expire_time",wxCVideoTable.getExpireTime()); | |||
| authorlist.add(avatar); | |||
| resultMap.put("authorlist",authorlist); | |||
| data.put("authorlist",authorlist); | |||
| } | |||
| resultMap.put("data",data); | |||
| return new ResultData(resultMap); | |||
| avatarVos.put("data",data); | |||
| Map<String,Object> info = new HashMap(); | |||
| Map<String,Object> status = new HashMap(); | |||
| info.put("log_id",id); | |||
| info.put("server_type","avatar list"); | |||
| status.put("code",1000); | |||
| status.put("msg","success"); | |||
| avatarVos.put("info",info); | |||
| avatarVos.put("status",status); | |||
| return avatarVos; | |||
| } | |||
| @Override | |||
| @@ -8,10 +8,7 @@ import com.iformall.service.WxCVoiceService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.*; | |||
| @Service | |||
| public class WxCVoiceServiceImpl implements WxCVoiceService { | |||
| @@ -21,18 +18,19 @@ public class WxCVoiceServiceImpl implements WxCVoiceService { | |||
| @Override | |||
| public ResultData getById(Long id) { | |||
| public Map<String,Object> getById(Long id) { | |||
| List<WxCVoiceTable> resultList = wxCVoiceMapper.getById(id); | |||
| HashMap<String, Object> result = new HashMap<>(); | |||
| HashMap<String, Object> data = new HashMap<>(); | |||
| List audioList = new ArrayList(); | |||
| for (WxCVoiceTable wxCVoiceTable : resultList) { | |||
| HashMap<String, Object> audio = new HashMap<>(); | |||
| HashMap<String, Object> voice = new HashMap<>(); | |||
| HashMap<String, Object> style = new HashMap<>(); | |||
| result.put("username", wxCVoiceTable.getUserName()); | |||
| result.put("current_time", new Date(System.currentTimeMillis())); | |||
| data.put("username", wxCVoiceTable.getUserName()); | |||
| data.put("current_time", new Date(System.currentTimeMillis())); | |||
| audioList.add(audio); | |||
| audio.put("LocaleName", wxCVoiceTable.getLocalelName()); | |||
| @@ -60,9 +58,17 @@ public class WxCVoiceServiceImpl implements WxCVoiceService { | |||
| } | |||
| result.put("audioList", audioList); | |||
| return new ResultData(result); | |||
| data.put("audioList", audioList); | |||
| result.put("data",data); | |||
| HashMap<String, Object> info = new HashMap<>(); | |||
| HashMap<String, Object> status = new HashMap<>(); | |||
| info.put("log_id",id); | |||
| info.put("server_type","audio list"); | |||
| result.put("info",info); | |||
| status.put("code",1000); | |||
| status.put("msg","success"); | |||
| result.put("status",status); | |||
| return result; | |||
| } | |||
| } | |||
| @@ -220,79 +220,38 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { | |||
| Integer voiceFrom = photoSpeakVideo.getVoiceFrom(); | |||
| String voiceMaterialUrl = photoSpeakVideo.getVoiceMaterialUrl(); | |||
| if (photoSpeakVideo.getSubtitleEnabled()==1){ | |||
| // //开启字幕 查询字幕列表 | |||
| Map reSubtitle = new HashMap(); | |||
| Map params = new HashMap(); | |||
| JSONObject subtitle = JSON.parseObject(photoSpeakVideo.getSubtitleParams()); | |||
| params.put("Fontname",(subtitle.get("Fontname")==null?"宋体":subtitle.get("Fontname"))); | |||
| params.put("Fontsize",(subtitle.get("Fontsize")==null? 25:subtitle.get("Fontsize"))); | |||
| params.put("PrimaryColour",(subtitle.get("PrimaryColour")==null?"&Hffffff":subtitle.get("PrimaryColour"))); | |||
| params.put("SecondaryColour",(subtitle.get("SecondaryColour")==null?"BBGGRR":subtitle.get("SecondaryColour"))); | |||
| params.put("OutlineColour",(subtitle.get("OutlineColour")==null?"BBGGRR":subtitle.get("OutlineColour"))); | |||
| params.put("BackColour",(subtitle.get("BackColour")==null?"&H0000ff":subtitle.get("BackColour"))); | |||
| params.put("Bold",(subtitle.get("Bold")==null? -1:subtitle.get("Bold"))); | |||
| params.put("Italic",(subtitle.get("Italic")==null? 0:subtitle.get("Italic"))); | |||
| params.put("Underline",(subtitle.get("Underline")==null? 0:subtitle.get("Underline"))); | |||
| params.put("Strikeout",(subtitle.get("Strikeout")==null? 0:subtitle.get("Strikeout"))); | |||
| params.put("ScaleX",(subtitle.get("ScaleX")==null? 100:subtitle.get("ScaleX"))); | |||
| params.put("ScaleY",(subtitle.get("ScaleY")==null? 100:subtitle.get("ScaleY"))); | |||
| params.put("Spacing",(subtitle.get("Spacing")==null? 0:subtitle.get("Spacing"))); | |||
| params.put("Angle",(subtitle.get("Angle")==null? 15:subtitle.get("Angle"))); | |||
| params.put("BorderStyle",(subtitle.get("BorderStyle")==null?"1":subtitle.get("BorderStyle"))); | |||
| params.put("Outline",(subtitle.get("Outline")==null? 20:subtitle.get("Outline"))); | |||
| params.put("Shadow",(subtitle.get("Shadow")==null? 12:subtitle.get("Shadow"))); | |||
| params.put("Alignment",(subtitle.get("Alignment")==null? 1:subtitle.get("Alignment"))); | |||
| params.put("MarginL",(subtitle.get("MarginL")==null? 100:subtitle.get("MarginL"))); | |||
| params.put("MarginR",(subtitle.get("MarginR")==null? 100:subtitle.get("MarginR"))); | |||
| params.put("MarginV",(subtitle.get("MarginV")==null? 100:subtitle.get("MarginV"))); | |||
| subtitle.put("enabled",1); | |||
| subtitle.put("text",photoSpeakVideo.getPaperwork()); | |||
| subtitle.put("params",params); | |||
| param.setSubtitle_params(subtitle); | |||
| } | |||
| // List<PhotoSpeakVideo> videoMapperList = photoSpeakVideoMapper.findList(speakVideoUpd); | |||
| // for (PhotoSpeakVideo speakVideo : videoMapperList) { | |||
| // if (speakVideo.getSubtitleEnabled()==1){ | |||
| //// 开启字幕 查询字幕列表 | |||
| // String[] getparams = speakVideo.getSubtitleParams().split(","); | |||
| // Map subtitle = new HashMap(); | |||
| // Map params = new HashMap(); | |||
| // Map map = new HashMap(); | |||
| // for (String s : getparams) { | |||
| // String[] kv = s.split(":"); | |||
| // map.put(kv[0],kv[1]); | |||
| // } | |||
| // | |||
| // params.put("Fontname",(map.get("Fontname")==null?"宋体":map.get("Fontname"))); | |||
| // params.put("Fontsize",(map.get("Fontsize")==null? 25:map.get("Fontsize"))); | |||
| // params.put("PrimaryColour",(map.get("PrimaryColour")==null?"&Hffffff":map.get("PrimaryColour"))); | |||
| // params.put("SecondaryColour",(map.get("SecondaryColour")==null?"BBGGRR":map.get("SecondaryColour"))); | |||
| // params.put("OutlineColour",(map.get("OutlineColour")==null?"BBGGRR":map.get("OutlineColour"))); | |||
| // params.put("BackColour",(map.get("BackColour")==null?"&H0000ff":map.get("BackColour"))); | |||
| // params.put("Bold",(map.get("Bold")==null? -1:map.get("Bold"))); | |||
| // params.put("Italic",(map.get("Italic")==null? 0:map.get("Italic"))); | |||
| // params.put("Underline",(map.get("Underline")==null? 0:map.get("Underline"))); | |||
| // params.put("Strikeout",(map.get("Strikeout")==null? 0:map.get("Strikeout"))); | |||
| // params.put("ScaleX",(map.get("ScaleX")==null? 100:map.get("ScaleX"))); | |||
| // params.put("ScaleY",(map.get("ScaleY")==null? 100:map.get("ScaleY"))); | |||
| // params.put("Spacing",(map.get("Spacing")==null? 0:map.get("Spacing"))); | |||
| // params.put("Angle",(map.get("Angle")==null? 15:map.get("Angle"))); | |||
| // params.put("BorderStyle",(map.get("BorderStyle")==null?"1":map.get("BorderStyle"))); | |||
| // params.put("Outline",(map.get("Outline")==null? 20:map.get("Outline"))); | |||
| // params.put("Shadow",(map.get("Shadow")==null? 12:map.get("Shadow"))); | |||
| // params.put("Alignment",(map.get("Alignment")==null? 1:map.get("Alignment"))); | |||
| // params.put("MarginL",(map.get("MarginL")==null? 100:map.get("MarginL"))); | |||
| // params.put("MarginR",(map.get("MarginR")==null? 100:map.get("MarginR"))); | |||
| // params.put("MarginV",(map.get("MarginV")==null? 100:map.get("MarginV"))); | |||
| // if (photoSpeakVideo.getSubtitleEnabled()==1){ | |||
| //// //开启字幕 查询字幕列表 | |||
| // Map reSubtitle = new HashMap(); | |||
| // Map params = new HashMap(); | |||
| // JSONObject subtitle = JSON.parseObject(photoSpeakVideo.getSubtitleParams()); | |||
| // params.put("Fontname",(subtitle.get("Fontname")==null?"宋体":subtitle.get("Fontname"))); | |||
| // params.put("Fontsize",(subtitle.get("Fontsize")==null? 25:subtitle.get("Fontsize"))); | |||
| // params.put("PrimaryColour",(subtitle.get("PrimaryColour")==null?"&Hffffff":subtitle.get("PrimaryColour"))); | |||
| // params.put("SecondaryColour",(subtitle.get("SecondaryColour")==null?"BBGGRR":subtitle.get("SecondaryColour"))); | |||
| // params.put("OutlineColour",(subtitle.get("OutlineColour")==null?"BBGGRR":subtitle.get("OutlineColour"))); | |||
| // params.put("BackColour",(subtitle.get("BackColour")==null?"&H0000ff":subtitle.get("BackColour"))); | |||
| // params.put("Bold",(subtitle.get("Bold")==null? -1:subtitle.get("Bold"))); | |||
| // params.put("Italic",(subtitle.get("Italic")==null? 0:subtitle.get("Italic"))); | |||
| // params.put("Underline",(subtitle.get("Underline")==null? 0:subtitle.get("Underline"))); | |||
| // params.put("Strikeout",(subtitle.get("Strikeout")==null? 0:subtitle.get("Strikeout"))); | |||
| // params.put("ScaleX",(subtitle.get("ScaleX")==null? 100:subtitle.get("ScaleX"))); | |||
| // params.put("ScaleY",(subtitle.get("ScaleY")==null? 100:subtitle.get("ScaleY"))); | |||
| // params.put("Spacing",(subtitle.get("Spacing")==null? 0:subtitle.get("Spacing"))); | |||
| // params.put("Angle",(subtitle.get("Angle")==null? 15:subtitle.get("Angle"))); | |||
| // params.put("BorderStyle",(subtitle.get("BorderStyle")==null?"1":subtitle.get("BorderStyle"))); | |||
| // params.put("Outline",(subtitle.get("Outline")==null? 20:subtitle.get("Outline"))); | |||
| // params.put("Shadow",(subtitle.get("Shadow")==null? 12:subtitle.get("Shadow"))); | |||
| // params.put("Alignment",(subtitle.get("Alignment")==null? 1:subtitle.get("Alignment"))); | |||
| // params.put("MarginL",(subtitle.get("MarginL")==null? 100:subtitle.get("MarginL"))); | |||
| // params.put("MarginR",(subtitle.get("MarginR")==null? 100:subtitle.get("MarginR"))); | |||
| // params.put("MarginV",(subtitle.get("MarginV")==null? 100:subtitle.get("MarginV"))); | |||
| // subtitle.put("enabled",1); | |||
| // subtitle.put("text",speakVideo.getPaperwork()); | |||
| // subtitle.put("text",photoSpeakVideo.getPaperwork()); | |||
| // subtitle.put("params",params); | |||
| // param.setSubtitle_params(subtitle); | |||
| // } | |||
| // } | |||
| // | |||
| // } | |||
| if (EnumVoiceFrom.FROM_MOULD.getCode().equals(voiceFrom)) { | |||
| param.setGen_txt(photoSpeakVideo.getPaperwork().replaceAll(str, "[*]")); | |||