-- 新版提交
This commit is contained in:
@@ -317,6 +317,7 @@ public class KdApiEOrder {
|
||||
params.put("RequestData", KdUtils.urlEncoder(RequestData, "UTF-8"));
|
||||
params.put("EBusinessID", EBusinessID);
|
||||
params.put("RequestType", "8008");//在途监控订阅接口指令8008/地图版订阅接口指令8005
|
||||
// params.put("RequestType", "8005");//在途监控订阅接口指令8008/地图版订阅接口指令8005
|
||||
String dataSign=KdUtils.encrypt(RequestData, ApiKey, "UTF-8");
|
||||
params.put("DataSign", KdUtils.urlEncoder(dataSign, "UTF-8"));
|
||||
params.put("DataType", "2");
|
||||
|
||||
@@ -10,17 +10,23 @@ import java.util.UUID;
|
||||
public class BaiduVoicesUtils {
|
||||
|
||||
// 填写申请百度语音申请的appkey 申请地址:百度AI开放平台
|
||||
private final static String appKey = "aKDun6vXyqPLhWMdoIsv87Ez";
|
||||
//todo private final static String appKey = "aKDun6vXyqPLhWMdoIsv87Ez";
|
||||
|
||||
// private final static String appKey = "eaPPX40oIazH8R4oWsD9U4IT";
|
||||
private final static String appKey = "xkyZMti9hu6KSQ8PdRDsadqI";
|
||||
|
||||
// 填写申请百度语音申请的APP SECRET
|
||||
private final static String secretKey = "ew9dMb4yGmwF1g4qutxNvogzjd9eP5tb";
|
||||
// todo private final static String secretKey = "ew9dMb4yGmwF1g4qutxNvogzjd9eP5tb";
|
||||
|
||||
// private final static String secretKey = "DTN0ioQywwM23IoT2ZzEBmvfBe63ATEY";
|
||||
private final static String secretKey = "KQvdrrADpV7hBzptqvakwG56dYuGljeg";
|
||||
|
||||
// text 的内容为"欢迎使用百度语音合成"的urlencode,utf-8 编码
|
||||
private final String text = "百度百科是百度公司推出的一部内容开放、自由的网络百科全书。";
|
||||
// 发音人选择, 0为普通女声,1为普通男生,3为情感合成-度逍遥,4为情感合成-度丫丫,默认为普通女声
|
||||
private final static int per = 3;
|
||||
// 基础 发音人选择, 0为普通女声,1为普通男生,3为情感合成-度逍遥,4为情感合成-度丫丫,默认为普通女声
|
||||
//度逍遥(精品)=5003,度小鹿=5118,度博文=106,度小童=110,度小萌=111,度米朵=103,度小娇=5
|
||||
// private final static int per = 3;
|
||||
private final static int per =3;
|
||||
// 语速,取值0-9,默认为5中语速
|
||||
private final static int spd = 5;
|
||||
// 音调,取值0-9,默认为5中语调
|
||||
@@ -36,7 +42,13 @@ public class BaiduVoicesUtils {
|
||||
TokenHolder holder = new TokenHolder(appKey, secretKey, TokenHolder.ASR_SCOPE);
|
||||
holder.resfresh();
|
||||
String token = holder.getToken();
|
||||
|
||||
String token1 = holder.getToken();
|
||||
final String s = ConnUtil.urlEncode(content);
|
||||
String url21 = url +"?tex=" + s;
|
||||
url21 +="&per="+ per;
|
||||
url21 +=""+cuid;
|
||||
url21 +=""+vol;
|
||||
long expiresAt = holder.getExpiresAt();
|
||||
// for (String a:list) {
|
||||
String url2 = url + "?tex=" + ConnUtil.urlEncode(content);
|
||||
url2 += "&per=" + per;
|
||||
|
||||
@@ -220,7 +220,7 @@ public class MD5Utils {
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
MD5Utils md = new MD5Utils();
|
||||
String strMD5 = new String("12345");
|
||||
String strMD5 = new String("696c23c1e04f330c55a635f571ee949f");
|
||||
|
||||
System.out.println("原始:" + strMD5);
|
||||
System.out.println("东东的:" + md.getStrrMD5(strMD5));
|
||||
|
||||
@@ -27,6 +27,10 @@ public class Query<T> {
|
||||
return this.getPage(params, null, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public IPage<T> getPage(Map<String, Object> params, String defaultOrderField, boolean isAsc) {
|
||||
//分页参数
|
||||
long curPage = 1;
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
package com.peanut.common.utils;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.apache.http.HttpStatus;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -18,6 +20,8 @@ import java.util.Map;
|
||||
*
|
||||
* @author Mark sunlightcs@gmail.com
|
||||
*/
|
||||
@Data
|
||||
//@Accessors(chain = true)
|
||||
public class R extends HashMap<String, Object> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@@ -25,14 +29,44 @@ public class R extends HashMap<String, Object> {
|
||||
put("code", 0);
|
||||
put("msg", "success");
|
||||
}
|
||||
|
||||
|
||||
public static R error() {
|
||||
return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员");
|
||||
// return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "未知异常,请联系管理员");
|
||||
return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, "");
|
||||
|
||||
}
|
||||
|
||||
public static R error(String msg) {
|
||||
return error(HttpStatus.SC_INTERNAL_SERVER_ERROR, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* int SC_NOT_IMPLEMENTED = 501;
|
||||
* int SC_BAD_GATEWAY = 502;
|
||||
* int SC_SERVICE_UNAVAILABLE = 503;
|
||||
* int SC_GATEWAY_TIMEOUT = 504;
|
||||
* @param
|
||||
* @param msg
|
||||
* @return
|
||||
*/
|
||||
public static R error1(String msg) {
|
||||
return error(HttpStatus.SC_NOT_IMPLEMENTED, msg);
|
||||
}
|
||||
|
||||
public static R error2() {
|
||||
return error(HttpStatus.SC_BAD_GATEWAY,"");
|
||||
}
|
||||
|
||||
public static R error3(String msg) {
|
||||
return error(HttpStatus.SC_SERVICE_UNAVAILABLE, msg);
|
||||
}
|
||||
public static R error4(String msg) {
|
||||
return error(HttpStatus.SC_GATEWAY_TIMEOUT, msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static R error(int code, String msg) {
|
||||
R r = new R();
|
||||
|
||||
Reference in New Issue
Block a user