|
|
@@ -85,43 +85,44 @@ public class UserLiveController extends BaseController { |
|
|
@PostMapping("/login") |
|
|
@PostMapping("/login") |
|
|
@ApiOperation(value = "用户登录", notes = "{\"username\":\"string\",\"password\":\"string\",\"code\":\"string\",\"status\":\"int\"}") |
|
|
@ApiOperation(value = "用户登录", notes = "{\"username\":\"string\",\"password\":\"string\",\"code\":\"string\",\"status\":\"int\"}") |
|
|
public Map<String, Object> 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(); |
|
|
String ipAddr = getIpAddr(); |
|
|
logger.debug("[" + ipAddr + "] WxUserGrantController::login"); |
|
|
logger.debug("[" + ipAddr + "] WxUserGrantController::login"); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
|
|
HashMap<String, Object> status = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
String code = map.get("code"); |
|
|
String phone = map.get("username"); |
|
|
String phone = map.get("username"); |
|
|
String password = map.get("password"); |
|
|
String password = map.get("password"); |
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(phone) || StringUtils.isBlank(password)) { |
|
|
if (StringUtils.isBlank(phone) || StringUtils.isBlank(password)) { |
|
|
HashMap<Object, Object> status = new HashMap<>(); |
|
|
|
|
|
status.put("code", ErrorCode.SYS_PARAMETER_ERROR.getCode()); |
|
|
status.put("code", ErrorCode.SYS_PARAMETER_ERROR.getCode()); |
|
|
status.put("message", "手机号或密码为空"); |
|
|
status.put("message", "手机号或密码为空"); |
|
|
wxCLiveLoginVos.put("status", status); |
|
|
|
|
|
return wxCLiveLoginVos; |
|
|
|
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.findInfoByPhone(getTenantInfo(), phone); |
|
|
WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.findInfoByPhone(getTenantInfo(), phone); |
|
|
if (basicInfo == null) { |
|
|
if (basicInfo == null) { |
|
|
HashMap<Object, Object> status = new HashMap<>(); |
|
|
|
|
|
status.put("code", ErrorCode.USER_IS_EMPTY); |
|
|
status.put("code", ErrorCode.USER_IS_EMPTY); |
|
|
status.put("message", "用户不存在"); |
|
|
status.put("message", "用户不存在"); |
|
|
wxCLiveLoginVos.put("status", status); |
|
|
|
|
|
return wxCLiveLoginVos; |
|
|
|
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
String encryptPassword = new PasswordHelper().encryptPassword(password); |
|
|
String encryptPassword = new PasswordHelper().encryptPassword(password); |
|
|
if (!encryptPassword.equals(basicInfo.getPassword())) { |
|
|
if (!encryptPassword.equals(basicInfo.getPassword())) { |
|
|
HashMap<Object, Object> status = new HashMap<>(); |
|
|
|
|
|
status.put("code", ErrorCode.USER_PASSWD_ERR.getCode()); |
|
|
status.put("code", ErrorCode.USER_PASSWD_ERR.getCode()); |
|
|
status.put("message", "手机号或密码错误"); |
|
|
status.put("message", "手机号或密码错误"); |
|
|
wxCLiveLoginVos.put("status", status); |
|
|
|
|
|
return wxCLiveLoginVos; |
|
|
|
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
int statu = Integer.parseInt(map.get("status")); |
|
|
int statu = Integer.parseInt(map.get("status")); |
|
|
if (statu == 0) { |
|
|
if (statu == 0) { |
|
|
WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(basicInfo.getId()); |
|
|
WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(basicInfo.getId()); |
|
|
if (basicLiveInfo.getCode() != null && !map.get("code").equals(basicLiveInfo.getCode())) { |
|
|
|
|
|
HashMap<Object, Object> status = new HashMap<>(); |
|
|
|
|
|
|
|
|
if (basicLiveInfo.getCode() != null && !basicLiveInfo.getCode().equals(code)) { |
|
|
status.put("code", ErrorCode.USER_ALREADY_LOGIN.getCode()); |
|
|
status.put("code", ErrorCode.USER_ALREADY_LOGIN.getCode()); |
|
|
status.put("message", "用户已在其他设备登录"); |
|
|
status.put("message", "用户已在其他设备登录"); |
|
|
wxCLiveLoginVos.put("status", status); |
|
|
|
|
|
return wxCLiveLoginVos; |
|
|
|
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
if (basicLiveInfo.getCode() == null) { |
|
|
if (basicLiveInfo.getCode() == null) { |
|
|
wxCLiveUserBasicInfoService.updateCode(basicInfo.getId(), map.get("code")); |
|
|
wxCLiveUserBasicInfoService.updateCode(basicInfo.getId(), map.get("code")); |
|
|
@@ -130,37 +131,28 @@ public class UserLiveController extends BaseController { |
|
|
if (statu == -1) { |
|
|
if (statu == -1) { |
|
|
wxCLiveUserBasicInfoService.updateCode(basicInfo.getId(), null); |
|
|
wxCLiveUserBasicInfoService.updateCode(basicInfo.getId(), null); |
|
|
basicInfo.setStatus(-2); |
|
|
basicInfo.setStatus(-2); |
|
|
HashMap<Object, Object> status = new HashMap<>(); |
|
|
|
|
|
status.put("code", ErrorCode.USER_CANCEL_MCODE.getCode()); |
|
|
status.put("code", ErrorCode.USER_CANCEL_MCODE.getCode()); |
|
|
status.put("message", "设备已注销"); |
|
|
status.put("message", "设备已注销"); |
|
|
wxCLiveLoginVos.put("status", status); |
|
|
|
|
|
return wxCLiveLoginVos; |
|
|
|
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
wxCUserBasicInfoService.handleLoginUser(basicInfo); |
|
|
wxCUserBasicInfoService.handleLoginUser(basicInfo); |
|
|
WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(basicInfo.getId()); |
|
|
WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(basicInfo.getId()); |
|
|
WxCLiveLoginVo wxCLiveLoginVo = new WxCLiveLoginVo(); |
|
|
|
|
|
wxCLiveLoginVo.setCode(map.get("code")); |
|
|
|
|
|
wxCLiveLoginVo.setUsername(map.get("username")); |
|
|
|
|
|
Map<String, Object> info = new HashMap(); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> data = new HashMap(); |
|
|
Map<String, Object> data = new HashMap(); |
|
|
Map<Object, Object> status = new HashMap<>(); |
|
|
|
|
|
status.put("code", 1000); |
|
|
|
|
|
status.put("message", "success"); |
|
|
|
|
|
data.put("token", basicInfo.getToken()); |
|
|
|
|
|
|
|
|
data.put("username",basicInfo.getPhone()); |
|
|
data.put("status", 0); |
|
|
data.put("status", 0); |
|
|
data.put("version", basicLiveInfo.getVersion()); |
|
|
data.put("version", basicLiveInfo.getVersion()); |
|
|
data.put("current_time", new Date(System.currentTimeMillis() / 1000)); |
|
|
data.put("current_time", new Date(System.currentTimeMillis() / 1000)); |
|
|
data.put("expire_time", basicLiveInfo.getExpireTime().getTime() / 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()); |
|
|
|
|
|
wxCLiveLoginVos.put("data", data); |
|
|
|
|
|
wxCLiveLoginVos.put("info", info); |
|
|
|
|
|
wxCLiveLoginVo.setData(data); |
|
|
|
|
|
wxCLiveLoginVo.setInfo(info); |
|
|
|
|
|
wxCLiveLoginVos.put("status", status); |
|
|
|
|
|
System.out.println("wxCLiveLoginVo.getToken() = " + wxCLiveLoginVo.getToken()); |
|
|
|
|
|
return wxCLiveLoginVos; |
|
|
|
|
|
|
|
|
data.put("token", basicInfo.getToken()); |
|
|
|
|
|
resultMap.put("data", data); |
|
|
|
|
|
|
|
|
|
|
|
status.put("code", 1000); |
|
|
|
|
|
status.put("message", "success"); |
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
|
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
@@ -170,24 +162,30 @@ public class UserLiveController extends BaseController { |
|
|
@PostMapping("/avatarList") |
|
|
@PostMapping("/avatarList") |
|
|
@ApiOperation(value = "视频模板列表", notes = "{\"username\",\"string\",\"code\",\"string\"}") |
|
|
@ApiOperation(value = "视频模板列表", notes = "{\"username\",\"string\",\"code\",\"string\"}") |
|
|
public Map<String, Object> avatarList(@RequestBody Map<String, String> params) throws Exception { |
|
|
public Map<String, Object> avatarList(@RequestBody Map<String, String> params) throws Exception { |
|
|
Map<String, Object> avatarVos = new HashMap<>(); |
|
|
|
|
|
String ipaddress = getIpAddr(); |
|
|
String ipaddress = getIpAddr(); |
|
|
logger.debug("[" + ipaddress + "] WxUserGrantController::getAvatarList"); |
|
|
logger.debug("[" + ipaddress + "] WxUserGrantController::getAvatarList"); |
|
|
Long id = getMemberId(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
|
|
HashMap<String, Object> status = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
String code = params.get("code"); |
|
|
|
|
|
Long userId = getMemberId(); |
|
|
//鉴权 |
|
|
//鉴权 |
|
|
WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(id); |
|
|
|
|
|
if (basicLiveInfo.getCode() != null && !params.get("code").equals(basicLiveInfo.getCode())) { |
|
|
|
|
|
HashMap<Object, Object> status = new HashMap<>(); |
|
|
|
|
|
|
|
|
WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(userId); |
|
|
|
|
|
if (basicLiveInfo.getCode() != null && !basicLiveInfo.getCode().equals(code)) { |
|
|
status.put("code", ErrorCode.USER_ALREADY_LOGIN.getCode()); |
|
|
status.put("code", ErrorCode.USER_ALREADY_LOGIN.getCode()); |
|
|
status.put("message", "用户已在其他设备登录"); |
|
|
status.put("message", "用户已在其他设备登录"); |
|
|
avatarVos.put("status", status); |
|
|
|
|
|
return avatarVos; |
|
|
|
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
Map<Object, Object> status = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> data = wxCVideoService.getById(userId); |
|
|
|
|
|
resultMap.put("data", data); |
|
|
|
|
|
|
|
|
status.put("code", 1000); |
|
|
status.put("code", 1000); |
|
|
status.put("msg", "success"); |
|
|
status.put("msg", "success"); |
|
|
avatarVos.put("status", status); |
|
|
|
|
|
return wxCVideoService.getById(id); |
|
|
|
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -198,77 +196,134 @@ public class UserLiveController extends BaseController { |
|
|
@PostMapping("/audioList") |
|
|
@PostMapping("/audioList") |
|
|
@ApiOperation(value = "音频模板列表", notes = "{\"username\",\"string\",\"code\",\"string\"}") |
|
|
@ApiOperation(value = "音频模板列表", notes = "{\"username\",\"string\",\"code\",\"string\"}") |
|
|
public Map<String, Object> audioList(@RequestBody Map<String, String> params) { |
|
|
public Map<String, Object> audioList(@RequestBody Map<String, String> params) { |
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
|
|
String ipaddress = getIpAddr(); |
|
|
String ipaddress = getIpAddr(); |
|
|
logger.debug("[" + ipaddress + "] WxUserGrantController::getAudioList"); |
|
|
logger.debug("[" + ipaddress + "] WxUserGrantController::getAudioList"); |
|
|
Long id = getMemberId(); |
|
|
|
|
|
WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(id); |
|
|
|
|
|
if (basicLiveInfo.getCode() != null && !params.get("code").equals(basicLiveInfo.getCode())) { |
|
|
|
|
|
HashMap<Object, Object> status = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
|
|
HashMap<String, Object> status = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
String code = params.get("code"); |
|
|
|
|
|
|
|
|
|
|
|
Long userId = getMemberId(); |
|
|
|
|
|
WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(userId); |
|
|
|
|
|
if (basicLiveInfo.getCode() != null && !basicLiveInfo.getCode().equals(code)) { |
|
|
status.put("code", ErrorCode.USER_ALREADY_LOGIN.getCode()); |
|
|
status.put("code", ErrorCode.USER_ALREADY_LOGIN.getCode()); |
|
|
status.put("message", "用户已在其他设备登录"); |
|
|
status.put("message", "用户已在其他设备登录"); |
|
|
resultMap.put("status", status); |
|
|
resultMap.put("status", status); |
|
|
return resultMap; |
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
return wxCVoiceService.getById(id,null); |
|
|
|
|
|
|
|
|
Map<String, Object> data = wxCVoiceService.getById(userId); |
|
|
|
|
|
resultMap.put("data", data); |
|
|
|
|
|
|
|
|
|
|
|
status.put("code", 1000); |
|
|
|
|
|
status.put("msg", "success"); |
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 资源权限查询 |
|
|
* 资源权限查询 |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "资源权限查询", notes = "{\"username\",\"string\",\"code\",\"string\",\"type\",\"int\",\"resource_id\",\"long\"}") |
|
|
@ApiOperation(value = "资源权限查询", notes = "{\"username\",\"string\",\"code\",\"string\",\"type\",\"int\",\"resource_id\",\"long\"}") |
|
|
@PostMapping("/author") |
|
|
@PostMapping("/author") |
|
|
public Map<String, Object> getAuthor(@RequestBody Map<String, String> params) { |
|
|
public Map<String, Object> getAuthor(@RequestBody Map<String, String> params) { |
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
|
|
String ipaddress = getIpAddr(); |
|
|
String ipaddress = getIpAddr(); |
|
|
logger.debug("[" + ipaddress + "] WxUserGrantController::getAuthor"); |
|
|
logger.debug("[" + ipaddress + "] WxUserGrantController::getAuthor"); |
|
|
Long id = getMemberId(); |
|
|
|
|
|
WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(id); |
|
|
|
|
|
if (basicLiveInfo.getCode() != null && !params.get("code").equals(basicLiveInfo.getCode())) { |
|
|
|
|
|
HashMap<Object, Object> status = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
|
|
HashMap<String, Object> status = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
String code = params.get("code"); |
|
|
|
|
|
Integer type = Integer.parseInt(params.get("type")); |
|
|
|
|
|
Long resourceId = Long.valueOf(params.get("resource_id")); |
|
|
|
|
|
|
|
|
|
|
|
if(type == null){ |
|
|
|
|
|
status.put("code", ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); |
|
|
|
|
|
status.put("message", "type 为空"); |
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
|
|
|
} |
|
|
|
|
|
if(resourceId == null){ |
|
|
|
|
|
status.put("code", ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); |
|
|
|
|
|
status.put("message", "资源ID 为空"); |
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Long userId = getMemberId(); |
|
|
|
|
|
WxCUserBasicInfo basicLiveInfo = wxCLiveUserBasicInfoService.getById(userId); |
|
|
|
|
|
if (basicLiveInfo.getCode() != null && !basicLiveInfo.getCode().equals(code)) { |
|
|
status.put("code", ErrorCode.USER_ALREADY_LOGIN.getCode()); |
|
|
status.put("code", ErrorCode.USER_ALREADY_LOGIN.getCode()); |
|
|
status.put("message", "用户已在其他设备登录"); |
|
|
status.put("message", "用户已在其他设备登录"); |
|
|
resultMap.put("status", status); |
|
|
resultMap.put("status", status); |
|
|
return resultMap; |
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
String code = params.get("code"); |
|
|
|
|
|
Integer type = Integer.parseInt(params.get("type")); |
|
|
|
|
|
Long resourceId = Long.valueOf(params.get("resource_id")); |
|
|
|
|
|
return wxCUserAuthorityService.getAuthor(id, code, type, resourceId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> data = wxCUserAuthorityService.getAuthor(userId, code, type, resourceId); |
|
|
|
|
|
if(data != null){ |
|
|
|
|
|
resultMap.put("data", data); |
|
|
|
|
|
|
|
|
|
|
|
status.put("code", 1000); |
|
|
|
|
|
status.put("msg", "success"); |
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
status.put("code", ErrorCode.SYS_NULLPOINTER_ERROR.getCode()); |
|
|
|
|
|
status.put("msg", "未查询到资源权限"); |
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ApiOperation(value = "tts", notes = "{\"username\",\"string\",\"gen_txt\",\"string\",\"voice_id\",\"string\",\"voice_style\",\"string\",\"speed\",\"int\"}") |
|
|
@ApiOperation(value = "tts", notes = "{\"username\",\"string\",\"gen_txt\",\"string\",\"voice_id\",\"string\",\"voice_style\",\"string\",\"speed\",\"int\"}") |
|
|
@PostMapping("/audiotts") |
|
|
@PostMapping("/audiotts") |
|
|
public Map<String, Object> voicePreview(@RequestBody Map<String, String> params) { |
|
|
public Map<String, Object> voicePreview(@RequestBody Map<String, String> params) { |
|
|
logger.debug("[" + getIpAddr() + "] UserLiveController::voicePreview"); |
|
|
logger.debug("[" + getIpAddr() + "] UserLiveController::voicePreview"); |
|
|
Long id = getMemberId(); |
|
|
|
|
|
AiPreviewParam param = new AiPreviewParam(); |
|
|
|
|
|
if (params.get("voice_id") == null) { |
|
|
|
|
|
Map<String, Object> status = new HashMap<>(); |
|
|
|
|
|
status.put("code", ErrorCode.SYS_SERVER_ERROR.getCode()); |
|
|
|
|
|
|
|
|
Map<String, Object> resultMap = new HashMap<>(); |
|
|
|
|
|
HashMap<String, Object> status = new HashMap<>(); |
|
|
|
|
|
|
|
|
|
|
|
String voice_id = params.get("voice_id"); |
|
|
|
|
|
String voiceStyle = params.get("voice_style"); |
|
|
|
|
|
if (StringUtils.isBlank(voice_id)) { |
|
|
|
|
|
status.put("code", ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); |
|
|
status.put("msg", "音色ID不能为空"); |
|
|
status.put("msg", "音色ID不能为空"); |
|
|
return status; |
|
|
|
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
if (StringUtils.isBlank(params.get("gen_txt"))) { |
|
|
|
|
|
Map<String, Object> status = new HashMap<>(); |
|
|
|
|
|
status.put("code", ErrorCode.SYS_SERVER_ERROR.getCode()); |
|
|
|
|
|
status.put("msg", "需要生成的文字不能为空"); |
|
|
|
|
|
return status; |
|
|
|
|
|
|
|
|
Long voiceId = null; |
|
|
|
|
|
try{ |
|
|
|
|
|
voiceId = Long.parseLong(voice_id); |
|
|
|
|
|
}catch(Exception e){ |
|
|
|
|
|
status.put("code", ErrorCode.SYS_PARAMETER_ERROR.getCode()); |
|
|
|
|
|
status.put("msg", "音色ID参数异常"); |
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String text = params.get("gen_txt"); |
|
|
|
|
|
if (StringUtils.isBlank(text)) { |
|
|
|
|
|
resultMap.put("code", ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); |
|
|
|
|
|
resultMap.put("msg", "需要生成的文字不能为空"); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
if (Integer.parseInt(params.get("speed")) == -1) { |
|
|
|
|
|
param.setSpeed(0); |
|
|
|
|
|
|
|
|
String speedStr = params.get("speed"); |
|
|
|
|
|
Integer speed = null; |
|
|
|
|
|
try{ |
|
|
|
|
|
speed = Integer.parseInt(speedStr); |
|
|
|
|
|
}catch(Exception e){} |
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> data = wxCVoiceService.voicePreview(voiceId,voiceStyle,text,speed); |
|
|
|
|
|
if(data != null){ |
|
|
|
|
|
resultMap.put("data", data); |
|
|
|
|
|
|
|
|
|
|
|
status.put("code", 1000); |
|
|
|
|
|
status.put("msg", "success"); |
|
|
|
|
|
resultMap.put("status", status); |
|
|
|
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
param.setSpeed(Integer.parseInt(params.get("speed"))); |
|
|
|
|
|
param.setVoice_id(params.get("voice_id")); |
|
|
|
|
|
param.setVoice_style(params.get("voice_style")); |
|
|
|
|
|
param.setGen_txt(params.get("gen_txt")); |
|
|
|
|
|
Map<String, Object> resultMap = wxCVoiceService.voicePreview(param); |
|
|
|
|
|
Map<String, Object> info = new HashMap<>(); |
|
|
|
|
|
info.put("log_id", id); |
|
|
|
|
|
info.put("server_type", "audio tts"); |
|
|
|
|
|
resultMap.put("info", info); |
|
|
|
|
|
|
|
|
status.put("code", ErrorCode.SYS_PARAMETER_NOT_NULL.getCode()); |
|
|
|
|
|
status.put("msg", "获取tts 异常"); |
|
|
|
|
|
resultMap.put("status", status); |
|
|
return resultMap; |
|
|
return resultMap; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@@ -330,7 +385,6 @@ public class UserLiveController extends BaseController { |
|
|
public ResultData chooseType(Long id) { |
|
|
public ResultData chooseType(Long id) { |
|
|
logger.debug("[" + getIpAddr() + "] MouldPatchController::chooseType"); |
|
|
logger.debug("[" + getIpAddr() + "] MouldPatchController::chooseType"); |
|
|
List<VoiceInfo> voiceInfos = wxCVoiceService.chooseType(id); |
|
|
List<VoiceInfo> voiceInfos = wxCVoiceService.chooseType(id); |
|
|
System.out.println("voiceInfos = " + voiceInfos); |
|
|
|
|
|
return new ResultData(wxCVoiceService.chooseType(id)); |
|
|
|
|
|
|
|
|
return new ResultData(voiceInfos); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |