|
@@ -1,9 +1,29 @@
|
|
|
package cn.efunbox.audio.utils;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.Date;
|
|
|
+
|
|
|
/**
|
|
|
* 常量类
|
|
|
*/
|
|
|
public class BaseConstant {
|
|
|
|
|
|
public static final String HAG_SYNC_ORDER_TYPE = "Charge.SyncOrderRightRequest";
|
|
|
+
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+
|
|
|
+ String md5PlayUrl = md5PlayUrl("efunbox1...", "/audio/022/02202002/02202002006.mp3");
|
|
|
+ System.out.println(md5PlayUrl);
|
|
|
+ }
|
|
|
+
|
|
|
+ private static String md5PlayUrl(String key, String url){
|
|
|
+// SimpleDateFormat sdf = new SimpleDateFormat("YYYYMMddHHmm");
|
|
|
+// long endTime = System.currentTimeMillis() + (3 * 60 * 1000L);
|
|
|
+// Date date = new Date(endTime);
|
|
|
+// String time = sdf.format(new Date());
|
|
|
+ long time = System.currentTimeMillis() / 1000;
|
|
|
+ String md5Url = MD5.MD5Encode(key + url + time);
|
|
|
+ return "/"+ md5Url + "/" + time + url;
|
|
|
+ }
|
|
|
}
|