Browse Source

//..

private_deployment
xhxu 1 year ago
parent
commit
66bce97865
5 changed files with 49 additions and 22 deletions
  1. +1
    -1
      suimangCApi/src/main/java/com/iformall/controller/UserLiveController.java
  2. +4
    -2
      suimangService/src/main/java/com/iformall/domain/po/WxCVoiceTable.java
  3. +1
    -1
      suimangService/src/main/java/com/iformall/service/WxCVoiceService.java
  4. +40
    -16
      suimangService/src/main/java/com/iformall/service/impl/WxCVoiceServiceImpl.java
  5. +3
    -2
      suimangService/src/main/resources/mapper/WxCVoiceMapper.xml

+ 1
- 1
suimangCApi/src/main/java/com/iformall/controller/UserLiveController.java View File

@@ -210,7 +210,7 @@ public class UserLiveController extends BaseController {
resultMap.put("status", status);
return resultMap;
}
return wxCVoiceService.getById(id);
return wxCVoiceService.getById(id,basicLiveInfo.getPhone());
}

/**


+ 4
- 2
suimangService/src/main/java/com/iformall/domain/po/WxCVoiceTable.java View File

@@ -28,7 +28,9 @@ public class WxCVoiceTable {
private String localDisPlayName;

@io.swagger.annotations.ApiModelProperty(value = "声纹ID", name = "id")
private int voiceId;
private Long voiceId;
@io.swagger.annotations.ApiModelProperty(value = "声纹ID", name = "languageId")
private Long languageId;
@io.swagger.annotations.ApiModelProperty(value = "声纹名称(用于调微软接口)", name = "local_name")
private String voiceName;
@io.swagger.annotations.ApiModelProperty(value = "声纹展示名称", name = "display_name")
@@ -39,7 +41,7 @@ public class WxCVoiceTable {
private int voiceType;

@io.swagger.annotations.ApiModelProperty(value = "声纹列表", name = "mould_sm_id")
private String MouldSmId;
private String mouldSmId;

@io.swagger.annotations.ApiModelProperty(value = "声纹列表", name = "style_list")
private String styleList ;


+ 1
- 1
suimangService/src/main/java/com/iformall/service/WxCVoiceService.java View File

@@ -8,7 +8,7 @@ import java.util.List;
import java.util.Map;

public interface WxCVoiceService {
Map<String,Object> getById(Long id);
Map<String,Object> getById(Long id,String phone);

List<VoiceInfo> chooseType(Long id);



+ 40
- 16
suimangService/src/main/java/com/iformall/service/impl/WxCVoiceServiceImpl.java View File

@@ -43,20 +43,27 @@ public class WxCVoiceServiceImpl implements WxCVoiceService {


@Override
public Map<String, Object> getById(Long id) {
public Map<String, Object> getById(Long id,String phone) {
List<WxCVoiceTable> resultList = wxCVoiceMapper.getById(id);
HashMap<String, Object> result = new HashMap<>();
HashMap<String, Object> data = new HashMap<>();
List audioList = new ArrayList();
data.put("username", phone);
data.put("current_time", new Date(System.currentTimeMillis() / 1000));
// List audioList = new ArrayList();
Map<Long,Map<String, Object>> audioList = new HashMap();
for (WxCVoiceTable wxCVoiceTable : resultList) {
HashMap<String, Object> audio = new HashMap<>();
Map<String, Object> audio = audioList.get(wxCVoiceTable.getLanguageId());
if(audio == null){
audio = new HashMap<>();
audio.put("LocaleName", wxCVoiceTable.getLocalelName());
audio.put("displayname", wxCVoiceTable.getLocalDisPlayName());
}
List<Map<String, Object>> voiceList = (List<Map<String, Object>>) audio.get("styleList");
if(voiceList == null){
voiceList = new ArrayList<>();
}

HashMap<String, Object> voice = new HashMap<>();
data.put("username", wxCVoiceTable.getUserName());
data.put("current_time", new Date(System.currentTimeMillis() / 1000));
audioList.add(audio);
audio.put("LocaleName", wxCVoiceTable.getLocalelName());
audio.put("displayname", wxCVoiceTable.getLocalDisPlayName());
List voiceList = new ArrayList();
voiceList.add(voice);
audio.put("voiceList", voiceList);
voice.put("voiceid", wxCVoiceTable.getVoiceId());
@@ -67,17 +74,34 @@ public class WxCVoiceServiceImpl implements WxCVoiceService {
voice.put("gender", wxCVoiceTable.getGender());
List styleList = new ArrayList();

List<String> strings = JSON.parseArray(wxCVoiceTable.getStyleList(), String.class);
for (String y : strings) {
if(StringUtils.isBlank(wxCVoiceTable.getStyleList())){
HashMap<String, Object> style = new HashMap<>();
style.put("stylename", "default");
style.put("displayname", EnumSpeakType.getEnum("default").getMessage());
style.put("styledemo", aliyunOSSConfig.getFiledomain() + demoDirectory + wxCVoiceTable.getMouldSmId() + "_" + "default" + demoSuffix);
styleList.add(style);
voice.put("styleList", styleList);
}else{
HashMap<String, Object> style = new HashMap<>();
style.put("stylename", y);
style.put("displayname", EnumSpeakType.getEnum(y).getMessage());
style.put("styledemo", aliyunOSSConfig.getFiledomain() + demoDirectory + wxCVoiceTable.getMouldSmId() + "_" + y + demoSuffix);
style.put("stylename", "default");
style.put("displayname", EnumSpeakType.getEnum("default").getMessage());
style.put("styledemo", aliyunOSSConfig.getFiledomain() + demoDirectory + wxCVoiceTable.getMouldSmId() + "_" + "default" + demoSuffix);
styleList.add(style);

List<String> strings = JSON.parseArray(wxCVoiceTable.getStyleList(), String.class);
for (String y : strings) {
style = new HashMap<>();
style.put("stylename", y);
style.put("displayname", EnumSpeakType.getEnum(y).getMessage());
style.put("styledemo", aliyunOSSConfig.getFiledomain() + demoDirectory + wxCVoiceTable.getMouldSmId() + "_" + y + demoSuffix);
styleList.add(style);
}
voice.put("styleList", styleList);
}
voice.put("styleList", styleList);
}
data.put("audioList", audioList);

data.put("audioList", new ArrayList<>(audioList.values()));

result.put("data", data);
HashMap<String, Object> info = new HashMap<>();
HashMap<String, Object> status = new HashMap<>();


+ 3
- 2
suimangService/src/main/resources/mapper/WxCVoiceMapper.xml View File

@@ -8,6 +8,7 @@
<result column="name" jdbcType="VARCHAR" property="localelName"/>
<result column="chinese_name" jdbcType="VARCHAR" property="localDisPlayName"/>
<result column="id" jdbcType="INTEGER" property="voiceId"/>
<result column="language_id" jdbcType="INTEGER" property="language_id"/>
<result column="class" jdbcType="INTEGER" property="voiceType"/>
<result column="local_name" jdbcType="VARCHAR" property="voiceName"/>
<result column="display_name" jdbcType="VARCHAR" property="voiceDisplayName"/>
@@ -15,7 +16,7 @@

<result column="style_list" jdbcType="VARCHAR" property="styleList"/>

<result column="mould_sm_id" jdbcType="VARCHAR" property="MouldSmId"/>
<result column="mould_sm_id" jdbcType="VARCHAR" property="mouldSmId"/>

<result column="style_name" jdbcType="VARCHAR" property="styleName"/>
<result column="style_display_name" jdbcType="VARCHAR" property="styleDisplayName"/>
@@ -33,7 +34,7 @@
<!--join wx_c_voice_style wcvs on wcv.id=wcvs.voice_id where wca.user_id = #{id}-->
<!-- </select> -->
<select id="getById" resultMap="BaseResultMap">
select wca.user_name,wca.resource_id,wca.expire_time,vi.id,vi.language_id,vi.sex,vi.display_name,vi.local_name,vi.style_list,
select wca.user_name,wca.resource_id,wca.expire_time,vi.id,vi.language_id,vi.sex,vi.display_name,vi.local_name,vi.mould_sm_id,vi.style_list,
vl.name,vl.chinese_name
FROM wx_c_author wca
join voice_info vi on wca.resource_id = vi.id


Loading…
Cancel
Save