Commit aaa3d448 authored by zhengjian's avatar zhengjian

你我贷

parent 99598b8a
......@@ -324,11 +324,12 @@
<groupId>com.lkb.data</groupId>
<artifactId>lkb-data-service</artifactId>
<version>1.7.8.4-3c-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.lkb.data</groupId>
<artifactId>lkb-core</artifactId>
<version>1.0.21</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
......@@ -29,5 +29,5 @@ public class RedisKeyConstants {
/**
* 你我贷token
*/
public static final String NI_WO_DAI_TOKEN_KEY = "DATA_EXPORT_PLATFORM:NIWODAI:TOKEN:YHALEA";
public static final String NI_WO_DAI_TOKEN_KEY = "DATA_EXPORT_PLATFORM:NIWODAI:TOKEN:YHABEA";
}
package com.quantgroup.asset.distribution.service.niwodai;
import com.quantgroup.asset.distribution.service.niwodai.vo.NiwodaiCostant;
import com.quantgroup.asset.distribution.service.niwodai.vo.NiwodaiIncomingResponseVO;
import java.util.Map;
public interface INiwodaiAssetService {
NiwodaiIncomingResponseVO incoming(String uuid, String orderId, String amount, Integer term,
NiwodaiCostant.MnoData mnoData);
Map<String,Object> queryUserBasic2Info(String userId, String phoneNo, boolean isQuery);
}
......@@ -78,7 +78,7 @@ public class NiwodaiServiceImpl implements INiwodaiService {
NiwodaiAccessTokenResponseVO vo = acquireAccessToken();
if (vo != null){
token = vo.getAccessToken();
iRedisService.setStringEx(RedisKeyConstants.NI_WO_DAI_TOKEN_KEY,token,10, TimeUnit.MINUTES);
iRedisService.setStringEx(RedisKeyConstants.NI_WO_DAI_TOKEN_KEY,token,8, TimeUnit.MINUTES);
}else {
return null;
}
......
package com.quantgroup.asset.distribution.service.niwodai.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @author fengjunkai
* @create 2018-05-25 下午 3:27
**/
@Data
public class Address implements Serializable{
private static final long serialVersionUID = 665730924402064515L;
private Long provinceCode;
private String province;
private Long cityCode;
private String city;
private Long districtCode;
private String district;
private String address;
}
package com.quantgroup.asset.distribution.service.niwodai.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author fengjunkai
* @create 2018-05-25 下午 10:47
**/
@Data
public class BasicInfo2Detail implements Serializable {
private static final long serialVersionUID = 8649600289150722511L;
private String email;
private String educationEnum;
private String occupationEnum;
private String incomeRangeEnum;
private String name;
private String marryStatus;
private List<Address> addressList;
private List<Contacts> contactList;
}
package com.quantgroup.asset.distribution.service.niwodai.vo;
import lombok.Data;
import java.io.Serializable;
/**
* 原本有一个联系人,为了兼容全量用户信息需要重新创建一个
*
* @author fengjunkai
* @create 2018-05-25 下午 10:57
**/
@Data
public class Contacts implements Serializable {
private static final long serialVersionUID = 3119705836615833451L;
private String name;
private String phoneNo;
private String relationName;
}
package com.quantgroup.asset.distribution.util;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
public class GZIPUtils {
public static String compress(String primStr) {
if (primStr == null || primStr.length() == 0) {
return primStr;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
GZIPOutputStream gzip = null;
try {
gzip = new GZIPOutputStream(out);
gzip.write(primStr.getBytes());
} catch (IOException e) {
e.printStackTrace();
} finally {
if (gzip != null) {
try {
gzip.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return new sun.misc.BASE64Encoder().encode(out.toByteArray());
}
/**
* 使用gzip进行解压缩
*/
public static String uncompress(String compressedStr) {
if (compressedStr == null) {
return null;
}
ByteArrayOutputStream out = new ByteArrayOutputStream();
ByteArrayInputStream in = null;
GZIPInputStream ginzip = null;
byte[] compressed = null;
String decompressed = null;
try {
compressed = new sun.misc.BASE64Decoder().decodeBuffer(compressedStr);
in = new ByteArrayInputStream(compressed);
ginzip = new GZIPInputStream(in);
byte[] buffer = new byte[1024];
int offset = -1;
while ((offset = ginzip.read(buffer)) != -1) {
out.write(buffer, 0, offset);
}
decompressed = out.toString();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ginzip != null) {
try {
ginzip.close();
} catch (IOException e) {
}
}
if (in != null) {
try {
in.close();
} catch (IOException e) {
}
}
try {
out.close();
} catch (IOException e) {
}
}
return decompressed;
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment