Commit 75113f94 authored by zhouqian's avatar zhouqian

abc

parent c661881b
...@@ -46,18 +46,6 @@ ...@@ -46,18 +46,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId> <artifactId>spring-boot-starter-integration</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jta-atomikos</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mobile</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.session</groupId> <groupId>org.springframework.session</groupId>
<artifactId>spring-session</artifactId> <artifactId>spring-session</artifactId>
...@@ -75,12 +63,6 @@ ...@@ -75,12 +63,6 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-web</artifactId>
</dependency> </dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
...@@ -227,22 +209,6 @@ ...@@ -227,22 +209,6 @@
<artifactId>quantgroup-config-sdk</artifactId> <artifactId>quantgroup-config-sdk</artifactId>
<version>1.0.3-SNAPSHOT</version> <version>1.0.3-SNAPSHOT</version>
</dependency> </dependency>
<!--<dependency>-->
<!--<groupId>cn.quantgroup</groupId>-->
<!--<artifactId>quantgroup-user-sdk</artifactId>-->
<!--<version>1.0.0-SNAPSHOT</version>-->
<!--<scope>system</scope>-->
<!--<systemPath>/Users/Miraculous/xyqb-git/xyqb-user-sdk/target/quantgroup-user-sdk-1.0.0-SNAPSHOT.jar</systemPath>-->
<!--</dependency>-->
<dependency>
<groupId>cn.quantgroup</groupId>
<artifactId>quantgroup-user-sdk</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
...@@ -261,7 +227,6 @@ ...@@ -261,7 +227,6 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<profiles> <profiles>
<profile> <profile>
<id>product</id> <id>product</id>
...@@ -307,72 +272,6 @@ ...@@ -307,72 +272,6 @@
</resources> </resources>
</build> </build>
</profile> </profile>
<profile>
<id>test</id>
<properties>
<profiles.activation>test</profiles.activation>
</properties>
<dependencies>
<dependency>
<groupId>cn.quantgroup</groupId>
<artifactId>quantgroup-sms-sdk</artifactId>
<version>1.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>
${project.basedir}/src/main/resources/config/test
</directory>
</resource>
</resources>
</build>
</profile>
<profile>
<id>beta</id>
<properties>
<profiles.activation>beta</profiles.activation>
</properties>
<dependencies>
<dependency>
<groupId>cn.quantgroup</groupId>
<artifactId>quantgroup-sms-sdk</artifactId>
<version>1.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>
${project.basedir}/src/main/resources/config/beta
</directory>
</resource>
</resources>
</build>
</profile>
<profile>
<id>beta2</id>
<properties>
<profiles.activation>beta2</profiles.activation>
</properties>
<dependencies>
<dependency>
<groupId>cn.quantgroup</groupId>
<artifactId>quantgroup-sms-sdk</artifactId>
<version>1.0.5-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>
${project.basedir}/src/main/resources/config/beta2
</directory>
</resource>
</resources>
</build>
</profile>
</profiles> </profiles>
</project> </project>
...@@ -33,12 +33,6 @@ public interface Constants { ...@@ -33,12 +33,6 @@ public interface Constants {
*/ */
String SESSION_PREFIX = "spring:session:sessions:"; String SESSION_PREFIX = "spring:session:sessions:";
interface Sms {
String VERIFICATION_CODE = "尊敬的用户,您本次的验证码为:%s,有效期10分钟。"; // 随机验证码
String BINDCARD_SMS = "用户您好,您已绑卡成功,将会在1-5个工作日内收到借款,请耐心等待。如有疑问,请致电400-002-0061,感谢您对我们的支持";//绑卡成功后的短信文案
String REPAY_SMS = "用户您好,您在信用钱包的本期账单已还款成功,保持良好的信用可升级为VIP用户,享更多特权,感谢您对信用钱包的支持";
}
interface Jr58 { interface Jr58 {
int ERROR_PHONE_NUMBER = 20007; // 手机号码格式不正确 int ERROR_PHONE_NUMBER = 20007; // 手机号码格式不正确
int ERROR_ID_CARD = 20009; // 身份证格式不正确 int ERROR_ID_CARD = 20009; // 身份证格式不正确
......
package cn.quantgroup.xyqb.aspect.captcha;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 类名称:CaptchaRestriction
* 类描述:
*
* @author 李宁
* @version 1.0.0
* 创建时间:15/12/23 12:15
* 修改人:
* 修改时间:15/12/23 12:15
* 修改备注:
*/
@Documented
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface CaptchaRestriction {
}
...@@ -3,11 +3,9 @@ package cn.quantgroup.xyqb.aspect.captcha; ...@@ -3,11 +3,9 @@ package cn.quantgroup.xyqb.aspect.captcha;
import cn.quantgroup.xyqb.Constants; import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.model.JsonResult; import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.config.IConfigurationService;
import cn.quantgroup.xyqb.thirdparty.jcaptcha.AbstractManageableImageCaptchaService; import cn.quantgroup.xyqb.thirdparty.jcaptcha.AbstractManageableImageCaptchaService;
import com.octo.captcha.service.CaptchaServiceException; import com.octo.captcha.service.CaptchaServiceException;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Aspect;
...@@ -24,10 +22,8 @@ import org.springframework.web.context.request.ServletRequestAttributes; ...@@ -24,10 +22,8 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.Date;
import java.util.Optional; import java.util.Optional;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.TimeUnit;
/** /**
* 类名称:CaptchaValidateAdvisor * 类名称:CaptchaValidateAdvisor
...@@ -56,9 +52,6 @@ public class CaptchaValidateAdvisor { ...@@ -56,9 +52,6 @@ public class CaptchaValidateAdvisor {
@Qualifier("customCaptchaService") @Qualifier("customCaptchaService")
private AbstractManageableImageCaptchaService imageCaptchaService; private AbstractManageableImageCaptchaService imageCaptchaService;
@Autowired
private IConfigurationService configurationService;
/** /**
* 自动化测试忽略验证码 * 自动化测试忽略验证码
*/ */
...@@ -72,73 +65,6 @@ public class CaptchaValidateAdvisor { ...@@ -72,73 +65,6 @@ public class CaptchaValidateAdvisor {
private void needCaptchaValidate() { private void needCaptchaValidate() {
} }
/**
* 客户端 Ip限制切面
*/
@Pointcut("@annotation(cn.quantgroup.xyqb.aspect.captcha.CaptchaRestriction)")
private void checkCaptchaRestriction() {
}
/**
* 根据 Ip 限制客户端 每分钟获取的图形二维码数量
*
* @param proceedingJoinPoint
* @return
* @throws Throwable
*/
@Around("checkCaptchaRestriction()")
private Object preventCaptchaRequest(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
Object[] args = proceedingJoinPoint.getArgs();
String remoteIp = getClientIp(args);
if (remoteIp == null || clientIpInSafeList(remoteIp)) {
return proceedingJoinPoint.proceed();
}
String limitKey = "ipcaptcha:" + DateFormatUtils.format(new Date(), "yyyyMMddHHmm") + StringUtils.remove(StringUtils.remove(remoteIp, '.'), ':');
Long count = redisTemplate.opsForValue().increment(limitKey, 1);
// 1, 2, 3... <= 50
if (count == 1) {
redisTemplate.expire(limitKey, 1, TimeUnit.MINUTES);
}
Long captchaPerIpPerMin = getCaptchaPerIpPerMin();
if (count <= captchaPerIpPerMin) {
try {
Object proceed = proceedingJoinPoint.proceed();
if (proceed != null && proceed.getClass() == JsonResult.class) {
JsonResult jsonResult = (JsonResult) proceed;
String code = jsonResult.getCode();
// 如果生成验证码失败, 不计数
if (!"0000".equals(code)) {
redisTemplate.opsForValue().increment(limitKey, -1L);
}
}
return proceed;
} catch (Exception e) {
// 发生异常, 不计数
redisTemplate.opsForValue().increment(limitKey, -1L);
throw e;
}
}
LOGGER.error("获取验证码失败, 客户端[{}] 每分钟请求验证码超限制 : [{}]", remoteIp, captchaPerIpPerMin);
return JsonResult.buildErrorStateResult("您获取验证码较频繁,请稍候再试!", null);
}
private boolean clientIpInSafeList(String remoteIp) {
String value = configurationService.getValue(Constants.CONFIG_CAPTCHA_WHITEIP_LIST);
return !StringUtils.isBlank(value) && value.contains(remoteIp);
}
private String getClientIp(Object[] args) {
if (args.length < 2) {
return null;
}
String ip = String.valueOf(args[1]);
return StringUtils.isNotBlank(ip) ? ip : null;
}
/** /**
* 在受图形验证码保护的接口方法执行前, 执行图形验证码校验 * 在受图形验证码保护的接口方法执行前, 执行图形验证码校验
...@@ -182,20 +108,14 @@ public class CaptchaValidateAdvisor { ...@@ -182,20 +108,14 @@ public class CaptchaValidateAdvisor {
} }
private boolean shouldSkipCaptchaValidate(String registerFrom, String captchaId, Object captchaValue) { private boolean shouldSkipCaptchaValidate(String registerFrom, String captchaId, Object captchaValue) {
boolean superCaptchaEnabled = Boolean.valueOf(configurationService.getValue(Constants.CONFIG_CAPTCHA_MAGIC_CODE_ENABLED));
// 如果启用了超级验证码功能, 检查超级验证码, 超级验证码区分大小写 // 如果启用了超级验证码功能, 检查超级验证码, 超级验证码区分大小写
if (superCaptchaEnabled && autoTestCaptchaEnabled) { if (autoTestCaptchaEnabled) {
return true; return true;
} }
return superCaptchaEnabled return StringUtils.equals(SUPER_CAPTCHA_ID, String.valueOf(captchaId)) && StringUtils.equals(SUPER_CAPTCHA, String.valueOf(captchaValue));
&& StringUtils.equals(SUPER_CAPTCHA_ID, String.valueOf(captchaId))
&& StringUtils.equals(SUPER_CAPTCHA, String.valueOf(captchaValue));
} }
private Long getCaptchaPerIpPerMin() {
return Long.valueOf(configurationService.getValue(Constants.CONFIG_CAPTCHA_PERIP_PERMIN));
}
} }
...@@ -2,8 +2,8 @@ package cn.quantgroup.xyqb.controller.external.user; ...@@ -2,8 +2,8 @@ package cn.quantgroup.xyqb.controller.external.user;
import cn.quantgroup.xyqb.entity.User; import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail; import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.entity.UserDetailRet; import cn.quantgroup.xyqb.model.UserDetailRet;
import cn.quantgroup.xyqb.entity.UserRet; import cn.quantgroup.xyqb.model.UserRet;
import cn.quantgroup.xyqb.model.IdType; import cn.quantgroup.xyqb.model.IdType;
import cn.quantgroup.xyqb.model.JsonResult; import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.repository.IUserDetailRepository; import cn.quantgroup.xyqb.repository.IUserDetailRepository;
......
package cn.quantgroup.xyqb.controller.external.user; package cn.quantgroup.xyqb.controller.external.user;
import cn.quantgroup.user.IUserSdkService;
import cn.quantgroup.user.UserSdkServiceFactory;
import cn.quantgroup.user.UserSysResult;
import cn.quantgroup.user.bean.UserDetailSaveBean;
import cn.quantgroup.user.retbean.XUserDetail;
import cn.quantgroup.xyqb.entity.User; import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail; import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.model.JsonResult; import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.UserModel; import cn.quantgroup.xyqb.model.UserModel;
import cn.quantgroup.xyqb.repository.IUserDetailRepository;
import cn.quantgroup.xyqb.service.user.IUserService; import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.Utils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.http.impl.client.CloseableHttpClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PostConstruct;
/** /**
* 同步用户数据,第三方模块访问时 * 同步用户数据,第三方模块访问时
* Created by Miraculous on 15/12/29. * Created by Miraculous on 15/12/29.
...@@ -32,19 +23,9 @@ public class SyncUserController { ...@@ -32,19 +23,9 @@ public class SyncUserController {
@Autowired @Autowired
private IUserService userService; private IUserService userService;
/*@Autowired
private IUserDetailRepository userDetailRepository;*/
@Autowired @Autowired
@Qualifier("httpClient") private IUserDetailRepository userDetailRepository;
private CloseableHttpClient httpClient;
@Value("${usersys.url}")
private String userSysUrl;
private IUserSdkService userSdkService;
@PostConstruct
private void init() {
userSdkService = UserSdkServiceFactory.generateSDKService(userSysUrl, httpClient);
}
@Autowired @Autowired
@Qualifier("stringRedisTemplate") @Qualifier("stringRedisTemplate")
...@@ -62,21 +43,13 @@ public class SyncUserController { ...@@ -62,21 +43,13 @@ public class SyncUserController {
if (null == user) { if (null == user) {
return JsonResult.buildErrorStateResult(null, null); return JsonResult.buildErrorStateResult(null, null);
} }
UserSysResult<XUserDetail> userSysResult = userSdkService.findUserDetailByUserId(user.getId()); UserDetail detail = userDetailRepository.findByUserId(user.getId());
// if(!userSysResult.isSuccess() || userSysResult.getData() == null){
// return JsonResult.buildErrorStateResult(null, null);
// }
UserModel userModel = new UserModel(user, Utils.xuserDetail2UserDetail(userSysResult.getData()));
return JsonResult.buildSuccessResult(null, userModel);
/*UserDetail detail = userDetailRepository.findByUserId(user.getId());
if (null == detail) { if (null == detail) {
// FIXME: 16/4/15 前期不对身份证强制要求.后期对修改 // FIXME: 16/4/15 前期不对身份证强制要求.后期对修改
// return JsonResult.buildErrorStateResult(null, null); // return JsonResult.buildErrorStateResult(null, null);
} }
UserModel userModel = new UserModel(user, detail); UserModel userModel = new UserModel(user, detail);
return JsonResult.buildSuccessResult(null, userModel);*/ return JsonResult.buildSuccessResult(null, userModel);
} }
@RequestMapping("/save_detail") @RequestMapping("/save_detail")
...@@ -91,20 +64,8 @@ public class SyncUserController { ...@@ -91,20 +64,8 @@ public class SyncUserController {
} }
userDetail.setId(null); userDetail.setId(null);
userDetail.setUserId(user.getId()); userDetail.setUserId(user.getId());
userDetailRepository.saveAndFlush(userDetail);
//修改代码
UserDetailSaveBean saveBean = new UserDetailSaveBean();
saveBean.setName(userDetail.getName());
saveBean.setEmail(userDetail.getEmail());
saveBean.setUserId(user.getId());
saveBean.setPhoneNo(userDetail.getPhoneNo());
saveBean.setIdNo(userDetail.getIdNo());
userSdkService.saveUserDetail(saveBean);
return JsonResult.buildSuccessResult(null, null); return JsonResult.buildSuccessResult(null, null);
/*userDetailRepository.saveAndFlush(userDetail);
return JsonResult.buildSuccessResult(null, null);*/
} }
@RequestMapping("/user_uuid") @RequestMapping("/user_uuid")
...@@ -119,22 +80,12 @@ public class SyncUserController { ...@@ -119,22 +80,12 @@ public class SyncUserController {
if (null == user) { if (null == user) {
return JsonResult.buildErrorStateResult(null, null); return JsonResult.buildErrorStateResult(null, null);
} }
UserDetail detail = userDetailRepository.findByUserId(user.getId());
UserSysResult<XUserDetail> userSysResult = userSdkService.findUserDetailByUserId(user.getId());
if(!userSysResult.isSuccess() || userSysResult.getData() == null){
}
UserModel userModel = new UserModel(user, Utils.xuserDetail2UserDetail(userSysResult.getData()));
return JsonResult.buildSuccessResult(null, userModel);
/*UserDetail detail = userDetailRepository.findByUserId(user.getId());
if (null == detail) { if (null == detail) {
// FIXME: 16/4/15 前期不对身份证强制要求.后期对修改 // FIXME: 16/4/15 前期不对身份证强制要求.后期对修改
// return JsonResult.buildErrorStateResult(null, null); // return JsonResult.buildErrorStateResult(null, null);
} }
UserModel userModel = new UserModel(user, detail); UserModel userModel = new UserModel(user, detail);
return JsonResult.buildSuccessResult(null, userModel);*/ return JsonResult.buildSuccessResult(null, userModel);
} }
} }
package cn.quantgroup.xyqb.controller.internal.sms; package cn.quantgroup.xyqb.controller.internal.sms;
import cn.quantgroup.sms.ConfirmableMsg; import cn.quantgroup.sms.ConfirmableMsg;
import cn.quantgroup.sms.SendAndForgetMsg;
import cn.quantgroup.sms.SmsSender;
import cn.quantgroup.xyqb.Constants; import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.aspect.captcha.CaptchaValidator; import cn.quantgroup.xyqb.aspect.captcha.CaptchaValidator;
import cn.quantgroup.xyqb.model.JsonResult; import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.sms.SmsResult;
import cn.quantgroup.xyqb.service.sms.ISmsService; import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.util.ValidationUtil; import cn.quantgroup.xyqb.util.ValidationUtil;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.ListUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -23,7 +16,10 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -23,7 +16,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.*; import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
...@@ -94,62 +90,6 @@ public class SmsController { ...@@ -94,62 +90,6 @@ public class SmsController {
return sendVerificationCode2(phoneNo); return sendVerificationCode2(phoneNo);
} }
/**
* 绑卡成功发送短信
*
* @param phoneNo
* @return
*/
@RequestMapping("/send_bind_card_code")
public JsonResult sendBindCardCode(@RequestParam String phoneNo) {
LOGGER.info("绑卡成功-发送短信, phoneNo:{}", phoneNo);
String content = Constants.Sms.BINDCARD_SMS;
// return sendBindCardSms(phoneNo);
return sendBindCardSms(phoneNo, content);
}
/**
* 还款成功发送短信
*
* @param phoneNo
* @return
*/
@RequestMapping("/send_repay_code")
public JsonResult sendRepayCode(@RequestParam String phoneNo) {
LOGGER.info("还款成功-发送短信, phoneNo:{}", phoneNo);
String content = Constants.Sms.REPAY_SMS;
// return sendRepaySms(phoneNo);
return sendBindCardSms(phoneNo, content);
}
/**
* 发送验证码
*
* @param phoneNo
* @return
*/
private JsonResult sendVerificationCode(String phoneNo) {
if (!ValidationUtil.validatePhoneNo(phoneNo)) {
return JsonResult.buildErrorStateResult("手机号必须为11位数字", null);
}
String key = Constants.REDIS_PREFIX_VERIFICATION_CODE + phoneNo;
long expire = redisTemplate.getExpire(key, TimeUnit.MINUTES);
if (expire >= EXPIRE_MINUTES - 1) {
return JsonResult.buildSuccessResult("发送成功", null);
}
String randomCode = smsIsDebug ? "000000" : String.valueOf(random.nextInt(899999) + 100000);
String content = String.format(Constants.Sms.VERIFICATION_CODE, randomCode);
SmsResult smsResult = smsService.send(phoneNo, content);
if (smsResult.isRet()) {
redisTemplate.opsForValue().set(key, randomCode, EXPIRE_MINUTES, TimeUnit.MINUTES);
return JsonResult.buildSuccessResult("发送成功", null);
}
return JsonResult.buildErrorStateResult("发送失败", null);
}
private JsonResult sendVerificationCode2(String phoneNo) { private JsonResult sendVerificationCode2(String phoneNo) {
if (!ValidationUtil.validatePhoneNo(phoneNo)) { if (!ValidationUtil.validatePhoneNo(phoneNo)) {
...@@ -178,45 +118,4 @@ public class SmsController { ...@@ -178,45 +118,4 @@ public class SmsController {
} }
} }
private JsonResult sendBindCardSms(String phoneNo, String content) {
if (!ValidationUtil.validatePhoneNo(phoneNo)) {
return JsonResult.buildErrorStateResult("手机号必须为11位数字", null);
}
SmsResult smsResult = smsService.send(phoneNo, content);
if (smsResult != null && smsResult.isRet()) {
return JsonResult.buildSuccessResult("发送成功", null);
}
return JsonResult.buildErrorStateResult("发送失败", null);
}
/**
* 发送固定短信文案
*
* @param phoneNo
* @return
*/
private JsonResult sendBindCardSms(String phoneNo) {
if (!ValidationUtil.validatePhoneNo(phoneNo)) {
return JsonResult.buildErrorStateResult("手机号必须为11位数字", null);
}
try {
smsService.getSmsSender().sendAndForget(new SendAndForgetMsg(Collections.EMPTY_LIST, "2", "1", phoneNo));
} catch (Exception e) {
LOGGER.error("发送绑卡短信失败");
}
return JsonResult.buildSuccessResult(null, null);
}
private JsonResult sendRepaySms(String phoneNo) {
if (!ValidationUtil.validatePhoneNo(phoneNo)) {
return JsonResult.buildErrorStateResult("手机号必须为11位数字", null);
}
try {
smsService.getSmsSender().sendAndForget(new SendAndForgetMsg(Collections.EMPTY_LIST, "3", "1", phoneNo));
} catch (Exception e) {
LOGGER.error("发送还款短信失败");
}
return JsonResult.buildSuccessResult(null, null);
}
} }
package cn.quantgroup.xyqb.controller.internal.user; package cn.quantgroup.xyqb.controller.internal.user;
import cn.quantgroup.user.IUserSdkService;
import cn.quantgroup.user.UserSdkServiceFactory;
import cn.quantgroup.user.UserSysResult;
import cn.quantgroup.user.retbean.XUserDetail;
import cn.quantgroup.xyqb.Constants; import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.controller.IBaseController; import cn.quantgroup.xyqb.controller.IBaseController;
import cn.quantgroup.xyqb.entity.User; import cn.quantgroup.xyqb.entity.User;
...@@ -13,17 +9,15 @@ import cn.quantgroup.xyqb.exception.UserNotExistException; ...@@ -13,17 +9,15 @@ import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.model.AuthBean; import cn.quantgroup.xyqb.model.AuthBean;
import cn.quantgroup.xyqb.model.JsonResult; import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.UserModel; import cn.quantgroup.xyqb.model.UserModel;
import cn.quantgroup.xyqb.repository.IUserDetailRepository;
import cn.quantgroup.xyqb.service.sms.ISmsService; import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.service.user.IUserService; import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.Utils;
import cn.quantgroup.xyqb.util.ValidationUtil; import cn.quantgroup.xyqb.util.ValidationUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.http.impl.client.CloseableHttpClient;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.connection.RedisConnectionFactory; import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.web.WebAttributes; import org.springframework.security.web.WebAttributes;
...@@ -31,7 +25,6 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -31,7 +25,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PostConstruct;
import java.security.Principal; import java.security.Principal;
import java.util.Random; import java.util.Random;
...@@ -66,15 +59,7 @@ public class UserController implements IBaseController { ...@@ -66,15 +59,7 @@ public class UserController implements IBaseController {
private ISmsService smsService; private ISmsService smsService;
@Autowired @Autowired
@Qualifier("httpClient") private IUserDetailRepository userDetailRepository;
private CloseableHttpClient httpClient;
@Value("${usersys.url}")
private String userSysUrl;
private IUserSdkService userSdkService;
@PostConstruct
private void init() {
userSdkService = UserSdkServiceFactory.generateSDKService(userSysUrl, httpClient);
}
private static final char[] PWD_BASE = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', private static final char[] PWD_BASE = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',
...@@ -339,14 +324,13 @@ public class UserController implements IBaseController { ...@@ -339,14 +324,13 @@ public class UserController implements IBaseController {
@RequestMapping("/syncUserInfo") @RequestMapping("/syncUserInfo")
public JsonResult syncUserInfo() { public JsonResult syncUserInfo() {
User user = getCurrentUser(); User user = getCurrentUser();
if (null == user) { if (null == user) {
return JsonResult.buildErrorStateResult(null, null); return JsonResult.buildErrorStateResult(null, null);
} }
UserSysResult<XUserDetail> userDetailUserSysResult = userSdkService.findUserDetailByUserId(user.getId()); UserDetail detail = userDetailRepository.findByUserId(user.getId());
UserDetail detail = userDetailUserSysResult.isSuccess() ? Utils.xuserDetail2UserDetail(userDetailUserSysResult.getData()) : null; UserModel userModel = new UserModel(user, detail);
UserModel userModel = new UserModel(user, detail); return JsonResult.buildSuccessResult("token校验成功", userModel);
return JsonResult.buildSuccessResult("token校验成功", userModel);
} }
} }
package cn.quantgroup.xyqb.entity;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* Created by Miraculous on 15/7/21.
*/
@Entity
@Table(name = "bank_card", uniqueConstraints = @UniqueConstraint(columnNames = "card_no"))
public class BankCard implements Serializable {
private static final long serialVersionUID = -1L;
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "user_id")
private Long userId;
@NotNull
@Column(name = "card_no")
private String cardNo;
// 持卡人
@Column(name = "card_holder_name")
private String cardHolderName;
@Column(name = "phone_no")
private String phoneNo;
@Column(name = "bank_name")
private String bankName;
// 支行行号
@Column(name = "branch_no")
private String branchNo;
@Column(name = "branch_name")
private String branchName;
@Column(name = "has_already_binded")
private Boolean hasAlreadyBinded;
@Column(name = "city")
private String city;
@Column(name = "province")
private String province;
@Column(name = "created_at")
private Timestamp createdAt;
@Column(name = "updated_at")
private Timestamp updatedAt;
public BankCard() {
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getBranchName() {
return branchName;
}
public void setBranchName(String branchName) {
this.branchName = branchName;
}
public String getBranchNo() {
return branchNo;
}
public void setBranchNo(String branchNo) {
this.branchNo = branchNo;
}
public String getCardHolderName() {
return cardHolderName;
}
public void setCardHolderName(String cardHolderName) {
this.cardHolderName = cardHolderName;
}
public String getCardNo() {
return cardNo;
}
public void setCardNo(String cardNo) {
this.cardNo = cardNo;
}
public Timestamp getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Timestamp createdAt) {
this.createdAt = createdAt;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getPhoneNo() {
return phoneNo;
}
public void setPhoneNo(String phoneNo) {
this.phoneNo = phoneNo;
}
public Timestamp getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Timestamp updatedAt) {
this.updatedAt = updatedAt;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Boolean getHasAlreadyBinded() {
return hasAlreadyBinded;
}
public void setHasAlreadyBinded(Boolean hasAlreadyBinded) {
this.hasAlreadyBinded = hasAlreadyBinded;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
@Override
public String toString() {
return "BankCard{" +
"bankName='" + bankName + '\'' +
", id=" + id +
", userId=" + userId +
", cardNo='" + cardNo + '\'' +
", cardHolderName='" + cardHolderName + '\'' +
", phoneNo='" + phoneNo + '\'' +
", branchNo='" + branchNo + '\'' +
", branchName='" + branchName + '\'' +
", hasAlreadyBinded=" + hasAlreadyBinded +
", city='" + city + '\'' +
", province='" + province + '\'' +
", createdAt=" + createdAt +
", updatedAt=" + updatedAt +
'}';
}
}
package cn.quantgroup.xyqb.entity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* @author mengfan.feng
* @time 2015-10-27 15:13
*/
@Entity
@Table(name = "configuration")
@Getter
@Setter
@ToString
public class Configuration implements Serializable {
private static final long serialVersionUID = -1L;
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "k")
private String key;
@Column(name = "v")
private String value;
}
package cn.quantgroup.xyqb.entity;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* Created by FrankChow on 15/11/4.
*/
@Entity
@Table(name = "ip_addr", uniqueConstraints = @UniqueConstraint(columnNames = "phone_no"))
public class IpAddr {
private static final long serialVersionUID = -1L;
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(name = "user_id")
private Long userId;
@Column(name = "phone_no")
private String phoneNo;
//第一次用户来源 channel_id
@Column(name = "registered_from")
private Long registeredFrom;
@Column(name = "ip_addr")
private String ipAddr;
@Column(name = "location")
private String location;
@Column(name = "location_id")
private int locationId;
@Column(name = "is_processed")
private Boolean isProcessed = false;
//创建时间
@Column(name = "created_at")
private Timestamp createdAt;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getPhoneNo() {
return phoneNo;
}
public void setPhoneNo(String phoneNo) {
this.phoneNo = phoneNo;
}
public String getIpAddr() {
return ipAddr;
}
public void setIpAddr(String ipAddr) {
this.ipAddr = ipAddr;
}
public String getLocation() {
return location;
}
public void setLocation(String location) {
this.location = location;
}
public int getLocationId() {
return locationId;
}
public void setLocationId(int locationId) {
this.locationId = locationId;
}
public Boolean getIsProcessed() {
return isProcessed;
}
public void setIsProcessed(Boolean isProcessed) {
this.isProcessed = isProcessed;
}
public Timestamp getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Timestamp createdAt) {
this.createdAt = createdAt;
}
public Long getRegisteredFrom() {
return registeredFrom;
}
public void setRegisteredFrom(Long registeredFrom) {
this.registeredFrom = registeredFrom;
}
}
package cn.quantgroup.xyqb.entity; package cn.quantgroup.xyqb.entity;
import lombok.*;
import javax.jws.soap.SOAPBinding;
import javax.persistence.*; import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
import java.sql.Timestamp; import java.sql.Timestamp;
...@@ -7,6 +10,9 @@ import java.sql.Timestamp; ...@@ -7,6 +10,9 @@ import java.sql.Timestamp;
/** /**
* Created by Miraculous on 15/7/4. * Created by Miraculous on 15/7/4.
*/ */
@Getter
@Setter
@ToString
@Entity @Entity
@Table(name = "user", uniqueConstraints = @UniqueConstraint(columnNames = "phone_no")) @Table(name = "user", uniqueConstraints = @UniqueConstraint(columnNames = "phone_no"))
public class User implements Serializable { public class User implements Serializable {
...@@ -46,68 +52,5 @@ public class User implements Serializable { ...@@ -46,68 +52,5 @@ public class User implements Serializable {
@Column(name = "updated_at") @Column(name = "updated_at")
private Timestamp updatedAt; private Timestamp updatedAt;
public Boolean isEnable() {
return enable;
}
public void setEnable(Boolean enable) {
this.enable = enable;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getPhoneNo() {
return phoneNo;
}
public void setPhoneNo(String phoneNo) {
this.phoneNo = phoneNo;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Long getRegisteredFrom() {
return registeredFrom;
}
public void setRegisteredFrom(Long registeredFrom) {
this.registeredFrom = registeredFrom;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public Timestamp getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Timestamp createdAt) {
this.createdAt = createdAt;
}
public Timestamp getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Timestamp updatedAt) {
this.updatedAt = updatedAt;
}
} }
...@@ -2,6 +2,7 @@ package cn.quantgroup.xyqb.entity; ...@@ -2,6 +2,7 @@ package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.model.Gender; import cn.quantgroup.xyqb.model.Gender;
import cn.quantgroup.xyqb.model.IdType; import cn.quantgroup.xyqb.model.IdType;
import lombok.*;
import javax.persistence.*; import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
...@@ -10,6 +11,9 @@ import java.sql.Timestamp; ...@@ -10,6 +11,9 @@ import java.sql.Timestamp;
/** /**
* Created by FrankChow on 15/7/8. * Created by FrankChow on 15/7/8.
*/ */
@Getter
@Setter
@ToString
@Entity @Entity
@Table(name = "user_detail", uniqueConstraints = @UniqueConstraint(columnNames = "user_id")) @Table(name = "user_detail", uniqueConstraints = @UniqueConstraint(columnNames = "user_id"))
public class UserDetail implements Serializable { public class UserDetail implements Serializable {
...@@ -60,117 +64,5 @@ public class UserDetail implements Serializable { ...@@ -60,117 +64,5 @@ public class UserDetail implements Serializable {
@Column(name = "updated_at") @Column(name = "updated_at")
private Timestamp updatedAt; private Timestamp updatedAt;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getPhoneNo() {
return phoneNo;
}
public void setPhoneNo(String phoneNo) {
this.phoneNo = phoneNo;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getIdNo() {
return idNo;
}
public void setIdNo(String idNo) {
this.idNo = idNo;
}
public IdType getIdType() {
return idType;
}
public void setIdType(IdType idType) {
this.idType = idType;
}
public Boolean getIsAuthenticated() {
return isAuthenticated;
}
public void setIsAuthenticated(Boolean isAuthenticated) {
this.isAuthenticated = isAuthenticated;
}
public Gender getGender() {
return gender;
}
public void setGender(Gender gender) {
this.gender = gender;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getQq() {
return qq;
}
public void setQq(String qq) {
this.qq = qq;
}
public Timestamp getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Timestamp createdAt) {
this.createdAt = createdAt;
}
public Timestamp getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Timestamp updatedAt) {
this.updatedAt = updatedAt;
}
@Override
public String toString() {
return "UserDetail{" +
"createdAt=" + createdAt +
", id=" + id +
", userId=" + userId +
", phoneNo='" + phoneNo + '\'' +
", name='" + name + '\'' +
", idNo='" + idNo + '\'' +
", idType=" + idType +
", isAuthenticated=" + isAuthenticated +
", gender=" + gender +
", email='" + email + '\'' +
", qq='" + qq + '\'' +
", updatedAt=" + updatedAt +
'}';
}
} }
...@@ -5,6 +5,8 @@ package cn.quantgroup.xyqb.exception; ...@@ -5,6 +5,8 @@ package cn.quantgroup.xyqb.exception;
*/ */
public class IdCardException extends RuntimeException { public class IdCardException extends RuntimeException {
private static final long serialVersionUID = -1L;
public IdCardException() { public IdCardException() {
super("非法的身份证号码"); super("非法的身份证号码");
} }
......
...@@ -5,6 +5,8 @@ package cn.quantgroup.xyqb.exception; ...@@ -5,6 +5,8 @@ package cn.quantgroup.xyqb.exception;
*/ */
public class NullUserException extends RuntimeException { public class NullUserException extends RuntimeException {
private static final long serialVersionUID = -1L;
public NullUserException() { public NullUserException() {
super("未找到用户"); super("未找到用户");
} }
......
...@@ -7,7 +7,9 @@ import org.springframework.security.core.AuthenticationException; ...@@ -7,7 +7,9 @@ import org.springframework.security.core.AuthenticationException;
* @time 2015-09-08 17:49 * @time 2015-09-08 17:49
*/ */
public class PasswordErrorException extends AuthenticationException { public class PasswordErrorException extends AuthenticationException {
private static final long serialVersionUID = -1L;
public PasswordErrorException(String msg, Throwable t) { public PasswordErrorException(String msg, Throwable t) {
super(msg, t); super(msg, t);
} }
......
...@@ -7,6 +7,8 @@ package cn.quantgroup.xyqb.exception; ...@@ -7,6 +7,8 @@ package cn.quantgroup.xyqb.exception;
*/ */
public class ResponseException extends RuntimeException { public class ResponseException extends RuntimeException {
private static final long serialVersionUID = -1L;
public ResponseException(String message) { public ResponseException(String message) {
super(message); super(message);
} }
......
...@@ -4,6 +4,8 @@ package cn.quantgroup.xyqb.exception; ...@@ -4,6 +4,8 @@ package cn.quantgroup.xyqb.exception;
* Created by Miraculous on 15/7/29. * Created by Miraculous on 15/7/29.
*/ */
public class ResubmissionException extends RuntimeException { public class ResubmissionException extends RuntimeException {
private static final long serialVersionUID = -1L;
public ResubmissionException() { public ResubmissionException() {
super("不能重复提交表单"); super("不能重复提交表单");
} }
......
...@@ -8,6 +8,8 @@ import org.springframework.security.core.AuthenticationException; ...@@ -8,6 +8,8 @@ import org.springframework.security.core.AuthenticationException;
*/ */
public class UserNotExistException extends AuthenticationException { public class UserNotExistException extends AuthenticationException {
private static final long serialVersionUID = -1L;
public UserNotExistException(String msg, Throwable t) { public UserNotExistException(String msg, Throwable t) {
super(msg, t); super(msg, t);
} }
......
...@@ -7,6 +7,8 @@ import org.springframework.security.core.AuthenticationException; ...@@ -7,6 +7,8 @@ import org.springframework.security.core.AuthenticationException;
*/ */
public class VerificationCodeErrorException extends AuthenticationException { public class VerificationCodeErrorException extends AuthenticationException {
private static final long serialVersionUID = -1L;
public VerificationCodeErrorException() { public VerificationCodeErrorException() {
super("验证码错误"); super("验证码错误");
} }
......
package cn.quantgroup.xyqb.filter; package cn.quantgroup.xyqb.filter;
import cn.quantgroup.xyqb.model.AppUserParam; import cn.quantgroup.xyqb.model.AppUserParam;
import cn.quantgroup.xyqb.service.config.IConfigurationService;
import cn.quantgroup.xyqb.service.security.impl.UserDetailsByPhoneService; import cn.quantgroup.xyqb.service.security.impl.UserDetailsByPhoneService;
import cn.quantgroup.xyqb.util.IPUtil; import cn.quantgroup.xyqb.util.IPUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -23,8 +22,6 @@ public class AppAuthenticatedFilter extends AbstractPreAuthenticatedProcessingFi ...@@ -23,8 +22,6 @@ public class AppAuthenticatedFilter extends AbstractPreAuthenticatedProcessingFi
private static final Logger LOGGER = LoggerFactory.getLogger(AppAuthenticatedFilter.class); private static final Logger LOGGER = LoggerFactory.getLogger(AppAuthenticatedFilter.class);
@Autowired
private IConfigurationService configurationService;
@Autowired @Autowired
public AppAuthenticatedFilter(UserDetailsByPhoneService userDetailsService) { public AppAuthenticatedFilter(UserDetailsByPhoneService userDetailsService) {
......
...@@ -21,7 +21,7 @@ public class AuthenticationUserDetail extends User implements UserDetails { ...@@ -21,7 +21,7 @@ public class AuthenticationUserDetail extends User implements UserDetails {
this.setRegisteredFrom(user.getRegisteredFrom()); this.setRegisteredFrom(user.getRegisteredFrom());
this.setPassword(user.getPassword()); this.setPassword(user.getPassword());
this.setUuid(user.getUuid()); this.setUuid(user.getUuid());
this.setEnable(user.isEnable()); this.setEnable(user.getEnable());
} }
@Override @Override
...@@ -58,6 +58,6 @@ public class AuthenticationUserDetail extends User implements UserDetails { ...@@ -58,6 +58,6 @@ public class AuthenticationUserDetail extends User implements UserDetails {
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
return super.isEnable(); return super.getEnable();
} }
} }
package cn.quantgroup.xyqb.entity; package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.model.Gender; import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.model.IdType;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
......
package cn.quantgroup.xyqb.entity; package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.entity.User;
import lombok.Data; import lombok.Data;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable; import java.io.Serializable;
import java.sql.Timestamp;
/** /**
* Created by 11 on 2016/12/20. * Created by 11 on 2016/12/20.
......
package cn.quantgroup.xyqb.model.sms;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;
/**
* <?xml version="1.0" encoding="gbk"?>
* <response>
* <code>00</code>
* <message>
* <desmobile>13900000000</desmobile>
* <msgid>200811041234253654785</msgid>
* </message>
* <message>
* <desmobile>13400000000</desmobile>
* <msgid>200811041234253654786</msgid>
* </message>>
* </response>
*
* @author mengfan.feng
* @time 2015-09-14 15:02
*/
@Getter
@Setter
@ToString
@XmlRootElement(name = "response")
@XmlAccessorType(XmlAccessType.FIELD)
public class GuoDuResult {
private String code;
@XmlElement(name = "message")
private List<Message> messages;
@Getter
@Setter
@ToString
@XmlAccessorType(XmlAccessType.FIELD)
public static class Message {
private String desmobile;
private String msgid;
}
}
package cn.quantgroup.xyqb.model.sms;
import lombok.Getter;
/**
* @author mengfan.feng
* @time 2015-10-23 13:52
*/
public class SmsConfig {
/**
* <pre>
* 短信平台
* 0 国都短信平台
* 1 创蓝短信平台
* 2 掌中无限短信平台
* 3 梦网短信平台
* 4 漫道短信平台
* </pre>
*/
@Getter
public enum SMS {
// 221.179.180.158/218.241.67.213/211.100.62.140
GUO_DU("http://123.126.133.188:9007/QxtSms/QxtFirewall", "zxlm", "zxlm001", true),
CHUANG_LAN("http://222.73.117.158/msg/HttpBatchSendSM", "Zxlm888", "Zxlm888888", true),
ZHANG_ZHONG_WU_XIAN("http://211.99.191.148/mms/services/info?wsdl", "YCWL-CRM-0100-JOCLMC", "38571163", false),
MENG_WANG("http://61.130.7.220:8023/MWGate/wmgw.asmx?wsdl", "J50656", "856210", true),
MAN_DAO("http://sdk.entinfo.cn:8060/webservice.asmx?wsdl", "SDK-BBX-010-23013", "a@2bb0@4", true),;
/**
* 请求链接
*/
private String url;
/**
* 平台帐号
*/
private String account;
/**
* 平台密码
*/
private String password;
/**
* 是否激活
*/
private boolean enabled;
SMS(String url, String account, String password, boolean enabled) {
this.url = url;
this.account = account;
this.password = password;
this.enabled = enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
}
/**
* 短信签名
*/
public static final String SMS_SIGN = "【信用钱包】";
/**
* 短信发送下标
*/
public static final String SMS_INDEX_KEY = "sms.send-index";
}
package cn.quantgroup.xyqb.model.sms;
/**
* @author mengfan.feng
* @time 2015-07-25 19:08
*/
public class SmsResult {
private boolean ret;
private String msg;
private SmsResult(boolean ret, String msg) {
this.ret = ret;
this.msg = msg;
}
public static SmsResult success() {
return new SmsResult(true, null);
}
public static SmsResult success(String msg) {
return new SmsResult(true, msg);
}
public static SmsResult error(String msg) {
return new SmsResult(false, msg);
}
public boolean isRet() {
return ret;
}
public void setRet(boolean ret) {
this.ret = ret;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
@Override
public String toString() {
return "SmsResult{" +
"ret=" + ret +
", msg='" + msg + '\'' +
'}';
}
}
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.Configuration;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
* @author mengfan.feng
* @time 2015-10-27 15:18
*/
public interface IConfigurationRepository extends JpaRepository<Configuration, Long> {
@Query("from Configuration where enable = true and k like 'safe\\_ip\\_login\\_from\\_%'")
List<Configuration> findSafeIp();
List<Configuration> findByKeyLike(String catePrefix);
}
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.IpAddr;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* Created by FrankChow on 15/11/4.
*/
public interface IIpAddrRepository extends JpaRepository<IpAddr, Long> {
IpAddr findByPhoneNo(String phoneNo);
IpAddr findByUserId(Long userId);
}
package cn.quantgroup.xyqb.service.config;
/**
* @author mengfan.feng
* @time 2015-10-27 15:20
*/
public interface IConfigurationService {
String getValue(String key);
/**
* 重置 Configuration
*/
void resetConfiguration();
/**
* 校验IP
*
* @param loginFrom 渠道来源
* @param ip 请求IP
* @return
*/
boolean validateIp(String loginFrom, String ip);
}
package cn.quantgroup.xyqb.service.config.impl;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.entity.Configuration;
import cn.quantgroup.xyqb.repository.IConfigurationRepository;
import cn.quantgroup.xyqb.service.config.IConfigurationService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
/**
* @author mengfan.feng
* @time 2015-10-27 15:22
*/
@Service
public class ConfigurationServiceImpl implements IConfigurationService {
@Autowired
private IConfigurationRepository configurationRepository;
private static final Map<String, String> CONFIGURATION_MAP = new HashMap<>();
private static final Map<String, Pattern> IP_PATTERN_MAP = new HashMap<>();
private static final Pattern INNER_IP_PATTERN = Pattern.compile("^172\\.16\\..*$");
@PostConstruct
private void init() {
List<Configuration> configurations = configurationRepository.findSafeIp();
List<Configuration> captchaConfig = configurationRepository.findByKeyLike(Constants.CONFIG_CAPTCHA);
configurations.addAll(captchaConfig);
if (CollectionUtils.isEmpty(configurations)) {
return;
}
configurations.forEach(e -> CONFIGURATION_MAP.put(e.getKey(), e.getValue()));
}
@Override
public String getValue(String key) {
return CONFIGURATION_MAP.get(key);
}
@Override
public void resetConfiguration() {
CONFIGURATION_MAP.clear();
IP_PATTERN_MAP.clear();
this.init();
}
@Override
public boolean validateIp(String loginFrom, String ip) {
if (StringUtils.isEmpty(loginFrom) || StringUtils.isEmpty(ip)) {
return false;
}
String key = "safe_ip_login_from_" + loginFrom;
String value = this.getValue(key);
if (StringUtils.isEmpty(value)) {
return false;
}
if (StringUtils.contains(value, ip)) {
return true;
}
Pattern pattern = IP_PATTERN_MAP.get(key);
if (pattern == null) {
pattern = Pattern.compile(value);
IP_PATTERN_MAP.put(key, pattern);
}
return pattern.matcher(ip).matches() || INNER_IP_PATTERN.matcher(ip).matches();
}
}
package cn.quantgroup.xyqb.service.jr58.impl; package cn.quantgroup.xyqb.service.jr58.impl;
import cn.quantgroup.user.IUserSdkService;
import cn.quantgroup.user.UserSdkServiceFactory;
import cn.quantgroup.user.UserSysResult;
import cn.quantgroup.user.bean.UserBean;
import cn.quantgroup.user.bean.UserDetailSaveBean;
import cn.quantgroup.user.retbean.XUser;
import cn.quantgroup.xyqb.Constants; import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.entity.User; import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.entity.UserJr58; import cn.quantgroup.xyqb.entity.UserJr58;
import cn.quantgroup.xyqb.model.IdCardInfo; import cn.quantgroup.xyqb.model.IdCardInfo;
import cn.quantgroup.xyqb.model.IdType;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.jr58.Jr58Authorization; import cn.quantgroup.xyqb.model.jr58.Jr58Authorization;
import cn.quantgroup.xyqb.model.jr58.Jr58RegisterParam; import cn.quantgroup.xyqb.model.jr58.Jr58RegisterParam;
import cn.quantgroup.xyqb.model.jr58.Jr58RegisterResult; import cn.quantgroup.xyqb.model.jr58.Jr58RegisterResult;
import cn.quantgroup.xyqb.repository.IUserDetailRepository;
import cn.quantgroup.xyqb.repository.IUserJr58Repository; import cn.quantgroup.xyqb.repository.IUserJr58Repository;
import cn.quantgroup.xyqb.repository.IUserRepository;
import cn.quantgroup.xyqb.service.auth.IIdCardService;
import cn.quantgroup.xyqb.service.http.IHttpService; import cn.quantgroup.xyqb.service.http.IHttpService;
import cn.quantgroup.xyqb.service.jr58.Jr58Service; import cn.quantgroup.xyqb.service.jr58.Jr58Service;
import cn.quantgroup.xyqb.service.user.ILkbUserService; import cn.quantgroup.xyqb.service.user.ILkbUserService;
import cn.quantgroup.xyqb.util.GZipUtil; import cn.quantgroup.xyqb.util.GZipUtil;
import cn.quantgroup.xyqb.util.Utils; import cn.quantgroup.xyqb.util.PasswordUtil;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
...@@ -30,10 +30,10 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -30,10 +30,10 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.ParseException;
import java.util.Base64; import java.util.Base64;
import java.util.Map; import java.util.Map;
...@@ -55,43 +55,33 @@ public class Jr58ServiceImpl implements Jr58Service { ...@@ -55,43 +55,33 @@ public class Jr58ServiceImpl implements Jr58Service {
@Autowired @Autowired
private IHttpService httpService; private IHttpService httpService;
@Autowired
@Qualifier("httpClient")
private CloseableHttpClient httpClient;
@Value("${xyqb.api.url}") @Value("${xyqb.api.url}")
private String apiUrl; private String apiUrl;
@Value("${lkb.import.url}") @Value("${lkb.import.url}")
private String pushImportForJr58Url; private String pushImportForJr58Url;
@Value("${usersys.url}") @Autowired
private String userSysUrl; private IUserRepository userRepository;
private IUserSdkService userSdkService;
@PostConstruct @Autowired
private void init() { private IUserDetailRepository userDetailRepository;
userSdkService = UserSdkServiceFactory.generateSDKService(userSysUrl, httpClient);
} @Autowired
private IIdCardService idCardService;
@Override @Override
@Transactional(value = Transactional.TxType.REQUIRED) @Transactional(value = Transactional.TxType.REQUIRED)
public String register(Jr58RegisterParam param) { public String register(Jr58RegisterParam param) {
String uuid; String uuid;
User user = userRepository.findByPhoneNo(param.getPhone());
/***************** 用户是否在新系统存在 ********************/ /***************** 用户是否在新系统存在 ********************/
UserSysResult<XUser> userResult = userSdkService.findUserByPhoneNo(param.getPhone()); if (user != null) {
if ("0000".equals(userResult.getCode()) && userResult.getData() != null) { uuid = user.getUuid();
uuid = userResult.getData().getUuid();
LOGGER.info("该用户已经在新系统中存在, uuid:{}", uuid);
return uuid; return uuid;
} }
// User user = userRepository.findByPhoneNo(param.getPhone());
// if (user != null) {
// uuid = user.getUuid();
// LOGGER.info("该用户已经在新系统中存在, uuid:{}", uuid);
// return uuid;
// }
/***************** 向老系统注册用户 ********************/ /***************** 向老系统注册用户 ********************/
Jr58RegisterResult result = lkbUserService.registerJr58(param); Jr58RegisterResult result = lkbUserService.registerJr58(param);
...@@ -110,7 +100,7 @@ public class Jr58ServiceImpl implements Jr58Service { ...@@ -110,7 +100,7 @@ public class Jr58ServiceImpl implements Jr58Service {
/***************** 新用户 ********************/ /***************** 新用户 ********************/
LOGGER.info("Save User:{}", uuid); LOGGER.info("Save User:{}", uuid);
User user = this.saveUser(param, uuid); user = this.saveUser(param, uuid);
if (user == null) { if (user == null) {
throw new RuntimeException("保存用户信息出错"); throw new RuntimeException("保存用户信息出错");
} }
...@@ -181,26 +171,22 @@ public class Jr58ServiceImpl implements Jr58Service { ...@@ -181,26 +171,22 @@ public class Jr58ServiceImpl implements Jr58Service {
private void saveUserDetail(Jr58RegisterParam param, Long userId) { private void saveUserDetail(Jr58RegisterParam param, Long userId) {
Timestamp currentTime = new Timestamp(System.currentTimeMillis()); Timestamp currentTime = new Timestamp(System.currentTimeMillis());
IdCardInfo idCardInfo = param.getIdCardInfo(); IdCardInfo idCardInfo = param.getIdCardInfo();
UserDetail userDetail = new UserDetail();
UserDetailSaveBean bean = new UserDetailSaveBean(); userDetail.setUserId(userId);
bean.setUserId(userId); userDetail.setName(param.getName());
bean.setPhoneNo(param.getPhone()); userDetail.setPhoneNo(param.getPhone());
bean.setIdNo(param.getIdcard()); userDetail.setIdNo(param.getIdcard());
bean.setName(param.getName()); Timestamp time = new Timestamp(System.currentTimeMillis());
bean.setEmail(param.getEmail()); userDetail.setCreatedAt(time);
userSdkService.saveUserDetail(bean); userDetail.setUpdatedAt(time);
// userDetail.setIdType(IdType.ID_CARD);
// UserDetail userDetail = new UserDetail(); try {
// userDetail.setUserId(userId); userDetail.setGender(idCardService.getIdCardInfo(param.getIdcard()).getGender());
// userDetail.setPhoneNo(param.getPhone()); } catch (ParseException e) {
// userDetail.setIdNo(param.getIdcard()); LOGGER.error("根据身份证获取性别出错,错误信息:" + e);
// userDetail.setName(param.getName()); }
// userDetail.setIdType(IdType.ID_CARD); userDetail.setEmail(StringUtils.substring(param.getEmail(), 0, 30));
// userDetail.setGender(idCardInfo.getGender()); userDetailRepository.saveAndFlush(userDetail);
// userDetail.setEmail(StringUtils.substring(param.getEmail(), 0, 30));
// userDetail.setCreatedAt(currentTime);
// userDetail.setUpdatedAt(currentTime);
// userDetailRepository.saveAndFlush(userDetail);
} }
/** /**
...@@ -211,19 +197,16 @@ public class Jr58ServiceImpl implements Jr58Service { ...@@ -211,19 +197,16 @@ public class Jr58ServiceImpl implements Jr58Service {
*/ */
private User saveUser(Jr58RegisterParam param, String uuid) { private User saveUser(Jr58RegisterParam param, String uuid) {
Timestamp currentTime = new Timestamp(System.currentTimeMillis()); Timestamp currentTime = new Timestamp(System.currentTimeMillis());
User user = new User();
UserBean userBean = new UserBean(); user.setPhoneNo(param.getPhone());
userBean.setPhoneNo(param.getPhone()); user.setCreatedAt(currentTime);
userBean.setRegisteredFrom(Constants.Channel.JR58); user.setUpdatedAt(currentTime);
userBean.setUuid(uuid); user.setEnable(true);
userBean.setPassword(""); user.setRegisteredFrom(Constants.Channel.JR58);
userBean.setCreatedAt(currentTime); user.setUuid(uuid);
userBean.setUpdatedAt(currentTime); user.setPassword("");
UserSysResult<XUser> result = userSdkService.saveUser(userBean); user = userRepository.save(user);
if (result.isSuccess()) { return userRepository.saveAndFlush(user);
return Utils.xuser2User(result.getData());
}
return null;
} }
......
package cn.quantgroup.xyqb.service.security.impl; package cn.quantgroup.xyqb.service.security.impl;
import cn.quantgroup.user.IUserSdkService;
import cn.quantgroup.user.UserSdkServiceFactory;
import cn.quantgroup.user.UserSysResult;
import cn.quantgroup.user.bean.UserBean;
import cn.quantgroup.user.bean.UserDetailSaveBean;
import cn.quantgroup.user.retbean.XUser;
import cn.quantgroup.user.retbean.XUserDetail;
import cn.quantgroup.xyqb.Constants; import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.entity.User; import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail; import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.exception.UserNotExistException; import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.model.AppUserParam; import cn.quantgroup.xyqb.model.AppUserParam;
import cn.quantgroup.xyqb.model.AuthenticationUserDetail; import cn.quantgroup.xyqb.model.AuthenticationUserDetail;
import cn.quantgroup.xyqb.model.IdCardInfo;
import cn.quantgroup.xyqb.model.IdType;
import cn.quantgroup.xyqb.repository.IUserDetailRepository;
import cn.quantgroup.xyqb.repository.IUserRepository;
import cn.quantgroup.xyqb.service.auth.IIdCardService;
import cn.quantgroup.xyqb.service.sms.ISmsService; import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.service.user.ILkbUserService; import cn.quantgroup.xyqb.service.user.ILkbUserService;
import cn.quantgroup.xyqb.service.user.IUserService; import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.PasswordUtil; import cn.quantgroup.xyqb.util.PasswordUtil;
import cn.quantgroup.xyqb.util.Utils;
import cn.quantgroup.xyqb.util.ValidationUtil; import cn.quantgroup.xyqb.util.ValidationUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.impl.client.CloseableHttpClient;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.core.userdetails.AuthenticationUserDetailsService; import org.springframework.security.core.userdetails.AuthenticationUserDetailsService;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException; import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken; import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Random; import java.util.Random;
...@@ -54,21 +47,16 @@ public class UserDetailsByPhoneService implements AuthenticationUserDetailsServi ...@@ -54,21 +47,16 @@ public class UserDetailsByPhoneService implements AuthenticationUserDetailsServi
@Autowired @Autowired
private ISmsService smsService; private ISmsService smsService;
@Autowired @Autowired
@Qualifier("httpClient") private IUserRepository userRepository;
private CloseableHttpClient httpClient; @Autowired
private IIdCardService idCardService;
@Autowired
private IUserDetailRepository userDetailRepository;
private static final Random random = new Random(); private static final Random random = new Random();
@Value("${usersys.url}")
private String userSysUrl;
private IUserSdkService userSdkService;
@PostConstruct
private void init() {
userSdkService = UserSdkServiceFactory.generateSDKService(userSysUrl, httpClient);
}
@Override @Override
public UserDetails loadUserDetails(PreAuthenticatedAuthenticationToken token) throws UsernameNotFoundException { public UserDetails loadUserDetails(PreAuthenticatedAuthenticationToken token) throws UsernameNotFoundException {
AppUserParam param = (AppUserParam) token.getPrincipal(); AppUserParam param = (AppUserParam) token.getPrincipal();
...@@ -103,22 +91,19 @@ public class UserDetailsByPhoneService implements AuthenticationUserDetailsServi ...@@ -103,22 +91,19 @@ public class UserDetailsByPhoneService implements AuthenticationUserDetailsServi
Timestamp currentTime = new Timestamp(System.currentTimeMillis()); Timestamp currentTime = new Timestamp(System.currentTimeMillis());
LOGGER.info("第三方登录用户,保存 User"); LOGGER.info("第三方登录用户,保存 User");
User user = new User();
UserBean userBean = new UserBean(); user.setEnable(true);
userBean.setRegisteredFrom(param.getRegisterFrom()); user.setPhoneNo(param.getPhoneNo());
userBean.setUpdatedAt(currentTime); user.setUpdatedAt(currentTime);
userBean.setCreatedAt(currentTime); user.setCreatedAt(currentTime);
userBean.setPhoneNo(param.getPhoneNo()); user.setUuid(uuid);
userBean.setPassword(PasswordUtil.MD5(randomCode + Constants.PASSWORD_SALT)); user.setPassword(PasswordUtil.MD5(randomCode + Constants.PASSWORD_SALT));
userBean.setUuid(uuid); user.setRegisteredFrom(param.getRegisterFrom());
UserSysResult<XUser> result = userSdkService.saveUser(userBean);
if (!result.isSuccess()) { user = userRepository.save(user);
if (user == null) {
throw new RuntimeException("保存用户出错"); throw new RuntimeException("保存用户出错");
} }
User user = Utils.xuser2User(result.getData());
// user = userRepository.saveAndFlush(user);
smsService.sendAfterRegister(param.getPhoneNo()); smsService.sendAfterRegister(param.getPhoneNo());
LOGGER.info("第三方登录用户注册成功, registerFrom:{}, phoneNo:{}, 并且已发送短信通知", param.getRegisterFrom(), param.getPhoneNo()); LOGGER.info("第三方登录用户注册成功, registerFrom:{}, phoneNo:{}, 并且已发送短信通知", param.getRegisterFrom(), param.getPhoneNo());
...@@ -126,19 +111,27 @@ public class UserDetailsByPhoneService implements AuthenticationUserDetailsServi ...@@ -126,19 +111,27 @@ public class UserDetailsByPhoneService implements AuthenticationUserDetailsServi
if (StringUtils.isNotEmpty(param.getIdNo())) { if (StringUtils.isNotEmpty(param.getIdNo())) {
LOGGER.info("第三方登录用户,保存 UserDetail"); LOGGER.info("第三方登录用户,保存 UserDetail");
UserDetailSaveBean saveBean = new UserDetailSaveBean(); IdCardInfo cardInfo;
saveBean.setIdNo(param.getIdNo()); try {
saveBean.setPhoneNo(user.getPhoneNo()); cardInfo = idCardService.getIdCardInfoWithExceptions(param.getIdNo());
saveBean.setUserId(user.getId()); UserDetail userDetail = new UserDetail();
saveBean.setEmail(""); userDetail.setIdNo(cardInfo.getIdNo());
saveBean.setName(param.getName()); userDetail.setPhoneNo(param.getPhoneNo());
UserSysResult<XUserDetail> userDetailUserSysResult = userSdkService.saveUserDetail(saveBean); userDetail.setName(param.getName());
if (userDetailUserSysResult.isSuccess()) { userDetail.setIdType(IdType.ID_CARD);
return user; userDetail.setUpdatedAt(currentTime);
userDetail.setCreatedAt(currentTime);
userDetail.setUserId(user.getId());
userDetail.setGender(cardInfo.getGender());
userDetailRepository.saveAndFlush(userDetail);
lkbUserService.userUpdate(user.getUuid(), param.getName(), cardInfo.getIdNo());
} catch (Exception e) {
LOGGER.error("保存 UserDetail 出现异常", e);
} }
lkbUserService.userUpdate(user.getUuid(), param.getName(), param.getIdNo());
} }
return user; return user;
} }
......
...@@ -24,7 +24,7 @@ public class UserDetailsServiceImpl implements UserDetailsService { ...@@ -24,7 +24,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
User user = userService.findByPhone(phoneNo); User user = userService.findByPhone(phoneNo);
if (user == null) { if (user == null) {
throw new UserNotExistException("未找到用户:" + phoneNo); throw new UserNotExistException("未找到用户:" + phoneNo);
}else if(! user.isEnable()){ }else if(! user.getEnable()){
throw new UserNotExistException("用户已禁用:" + phoneNo); throw new UserNotExistException("用户已禁用:" + phoneNo);
} }
return new AuthenticationUserDetail(user); return new AuthenticationUserDetail(user);
......
package cn.quantgroup.xyqb.service.sms;
import cn.quantgroup.xyqb.model.sms.SmsResult;
import java.net.URLEncoder;
/**
* 短信发送接口
*
* @author mengfan.feng
* @time 2015-07-25 18:47
*/
public interface ISmsSender {
/**
* 发送消息<br/>
*
* @param phone 手机号
* @param content 要发送的内容
* @return ret=true,发送成功<br/>
* ret=false,msg=错误信息
*/
SmsResult send(String phone, String content);
/**
* URL encode
*
* @param content
* @return
*/
default String encode(String content, String charset) {
try {
return URLEncoder.encode(content, charset);
} catch (Exception e) {
return content;
}
}
}
package cn.quantgroup.xyqb.service.sms; package cn.quantgroup.xyqb.service.sms;
import cn.quantgroup.sms.SmsSender; import cn.quantgroup.sms.SmsSender;
import cn.quantgroup.xyqb.model.sms.SmsResult;
/** /**
* 短信发送服务 * 短信发送服务
...@@ -13,15 +12,5 @@ public interface ISmsService { ...@@ -13,15 +12,5 @@ public interface ISmsService {
SmsSender getSmsSender(); SmsSender getSmsSender();
/**
* 发送消息<br/>
*
* @param phone 手机号
* @param content 要发送的内容
* @return ret=true,发送成功<br/>
* ret=false,msg=错误信息
*/
SmsResult send(String phone, String content);
void sendAfterRegister(String phoneNo); void sendAfterRegister(String phoneNo);
} }
package cn.quantgroup.xyqb.service.sms.impl;
import cn.quantgroup.xyqb.model.sms.SmsResult;
import cn.quantgroup.xyqb.service.http.IHttpService;
import cn.quantgroup.xyqb.service.sms.ISmsSender;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import static cn.quantgroup.xyqb.model.sms.SmsConfig.SMS.CHUANG_LAN;
/**
* <pre>
* 创蓝短信平台
* 短信提交响应分为两行,第一行为响应时间和状态,第二行为服务器给出提交msgid。
* 无论发送的号码是多少,一个发送请求只返回一个msgid,如果响应的状态不是“0”,则没有msgid即第二行数据。
* (每行以换行符(0x0a,即\n)分割)
* 0 提交成功
* 101 无此用户
* 102 密码错
* 103 提交过快(提交速度超过流速限制)
* 104 系统忙(因平台侧原因,暂时无法处理提交的短信)
* 105 敏感短信(短信内容包含敏感词)
* 106 消息长度错(>536或<=0)
* 107 包含错误的手机号码
* 108 手机号码个数错(群发>50000或<=0;单发>200或<=0)
* 109 无发送额度(该用户可用短信数已使用完)
* 110 不在发送时间内
* 111 超出该账户当月发送额度限制
* 112 无此产品,用户没有订购该产品
* 113 extno格式错(非数字或者长度不对)
* 115 自动审核驳回
* 116 签名不合法,未带签名(用户必须带签名的前提下)
* 117 IP地址认证错,请求调用的IP地址不是系统登记的IP地址
* 118 用户没有相应的发送权限
* 119 用户已过期
* </pre>
*
* @author mengfan.feng
* @time 2015-09-14 14:36
*/
@Service
public class ChuangLanSms implements ISmsSender {
private static final Map<String, String> ERRORS = ImmutableMap.<String, String>builder()
.put("0", "提交成功")
.put("101", "无此用户")
.put("102", "密码错")
.put("103", "提交过快(提交速度超过流速限制)")
.put("104", "系统忙(因平台侧原因,暂时无法处理提交的短信)")
.put("105", "敏感短信(短信内容包含敏感词)")
.put("106", "消息长度错(>536或<=0)")
.put("107", "包含错误的手机号码")
.put("108", "手机号码个数错(群发>50000或<=0;单发>200或<=0)")
.put("109", "无发送额度(该用户可用短信数已使用完)")
.put("110", "不在发送时间内")
.put("111", "超出该账户当月发送额度限制")
.put("112", "无此产品,用户没有订购该产品")
.put("113", "extno格式错(非数字或者长度不对)")
.put("115", "自动审核驳回")
.put("116", "签名不合法,未带签名(用户必须带签名的前提下)")
.put("117", "IP地址认证错,请求调用的IP地址不是系统登记的IP地址")
.put("118", "用户没有相应的发送权限")
.put("119", "用户已过期")
.build();
@Autowired
private IHttpService httpService;
@Override
public SmsResult send(String phone, String content) {
Map<String, String> parameters = ImmutableMap.<String, String>builder()
.put("account", CHUANG_LAN.getAccount())
.put("pswd", CHUANG_LAN.getPassword())
.put("needstatus", "true")
.put("mobile", phone)
.put("msg", content)
.build();
String response = httpService.get(CHUANG_LAN.getUrl(), parameters);
if (StringUtils.isBlank(response)) {
return SmsResult.error("创蓝短信平台,返回结果为空");
}
String line1[] = response.split("\n")[0].split(",");
String code = line1[1];
if ("0".equals(code)) {
return SmsResult.success();
}
return SmsResult.error(ERRORS.get(code));
}
}
package cn.quantgroup.xyqb.service.sms.impl;
import cn.quantgroup.xyqb.model.sms.GuoDuResult;
import cn.quantgroup.xyqb.model.sms.SmsConfig;
import cn.quantgroup.xyqb.model.sms.SmsResult;
import cn.quantgroup.xyqb.service.http.IHttpService;
import cn.quantgroup.xyqb.service.sms.ISmsSender;
import cn.quantgroup.xyqb.util.XmlUtil;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;
import static cn.quantgroup.xyqb.model.sms.SmsConfig.SMS.GUO_DU;
/**
* <pre>
* 国都短信平台
* 状态码 说明
* 01 批量短信提交成功
* 02 IP限制
* 03 单条短信提交成功
* 04 用户名错误
* 05 密码错误
* 07 发送时间错误
* 08 信息内容为黑内容
* 09 该用户的该内容 受同天内,内容不能重复发 限制
* 10 扩展号错误
* 97 短信参数有误
* 11 余额不足
* -1 程序异常
* </pre>
*
* @author mengfan.feng
* @time 2015-09-21 11:25
*/
@Service
public class GuoDuSms implements ISmsSender {
private static final Map<String, String> ERRORS = ImmutableMap.<String, String>builder()
.put("01", "批量短信提交成功")
.put("02", "IP限制")
.put("03", "单条短信提交成功")
.put("04", "用户名错误")
.put("05", "密码错误")
.put("07", "发送时间错误")
.put("08", "信息内容为黑内容")
.put("09", "该用户的该内容 受同天内,内容不能重复发 限制")
.put("10", "扩展号错误")
.put("97", "短信参数有误")
.put("11", "余额不足")
.put("-1", "程序异常")
.build();
@Autowired
private IHttpService httpService;
@Override
public SmsResult send(String phone, String content) {
Map<String, String> parameters = ImmutableMap.<String, String>builder()
.put("OperID", GUO_DU.getAccount())
.put("OperPass", GUO_DU.getPassword())
.put("SendTime", "")
.put("ValidTime", "")
.put("AppendID", "")
.put("DesMobile", phone)
.put("Content", encode(SmsConfig.SMS_SIGN + content, "GBK"))
.put("ContentType", "8")
.build();
String response = httpService.get(GUO_DU.getUrl() + "?" + Joiner.on("&").withKeyValueSeparator("=").join(parameters));
if (StringUtils.isBlank(response)) {
return SmsResult.error("国都短信平台,返回结果为空");
}
GuoDuResult result = XmlUtil.obj(response, GuoDuResult.class);
String code = result.getCode();
if ("03".equals(code) || "01".equals(code)) {
return SmsResult.success();
}
return SmsResult.error(ERRORS.get(code));
}
}
package cn.quantgroup.xyqb.service.sms.impl;
import cn.quantgroup.xyqb.model.sms.SmsConfig;
import cn.quantgroup.xyqb.model.sms.SmsResult;
import cn.quantgroup.xyqb.service.sms.ISmsSender;
import cn.quantgroup.xyqb.thirdparty.mandao.WebService;
import cn.quantgroup.xyqb.util.PasswordUtil;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import static cn.quantgroup.xyqb.model.sms.SmsConfig.SMS.MAN_DAO;
/**
* 漫道短信平台
*
* @author mengfan.feng
* @time 2015-11-02 14:28
*/
@Service
public class ManDaoSms implements ISmsSender {
private static final Map<String, String> ERRORS = ImmutableMap.<String, String>builder()
.put("-2", "帐号/密码不正确")
.put("-4", "余额不足支持本次发送")
.put("-5", "数据格式错误")
.put("-6", "参数有误")
.put("-7", "权限受限")
.put("-8", "流量控制错误")
.put("-9", "扩展码权限错误")
.put("-10", "内容长度长")
.put("-11", "内部数据库错误")
.put("-12", "序列号状态错误")
.put("-14", "服务器写文件失败")
.put("-17", "没有权限")
.put("-19", "禁止同时使用多个接口地址")
.put("-20", "相同手机号,相同内容重复提交")
.put("-22", "Ip鉴权失败")
.put("-23", "缓存无此序列号信息")
.put("-601", "序列号为空,参数错误")
.put("-602", "序列号格式错误,参数错误")
.put("-603", "密码为空,参数错误")
.put("-604", "手机号码为空,参数错误")
.put("-605", "内容为空,参数错误")
.put("-606", "ext长度大于9,参数错误")
.put("-607", "参数错误 扩展码非数字 ")
.put("-608", "参数错误 定时时间非日期格式")
.put("-609", "rrid长度大于18,参数错误 ")
.put("-610", "参数错误 rrid非数字")
.put("-611", "参数错误 内容编码不符合规范")
.put("-623", "手机个数与内容个数不匹配")
.put("-624", "扩展个数与手机个数数")
.put("-625", "定时时间个数与手机个数数不匹配")
.put("-626", "rrid个数与手机个数数不匹配")
.build();
private static final String PWD = PasswordUtil.MD5(MAN_DAO.getAccount() + MAN_DAO.getPassword()).toUpperCase();
@Override
public SmsResult send(String phone, String content) {
String response = new WebService().getWebServiceSoap().mt(MAN_DAO.getAccount(), PWD, phone, content + SmsConfig.SMS_SIGN, "", "", "");
if (StringUtils.isBlank(response)) {
return SmsResult.error("漫道短信平台,返回结果为空");
}
long rrid = Long.parseLong(response);
if (rrid > 0) {
return SmsResult.success();
}
return SmsResult.error(ERRORS.get(response));
}
}
package cn.quantgroup.xyqb.service.sms.impl;
import cn.quantgroup.xyqb.model.sms.SmsResult;
import cn.quantgroup.xyqb.service.sms.ISmsSender;
import cn.quantgroup.xyqb.thirdparty.mengwang.Wmgw;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import static cn.quantgroup.xyqb.model.sms.SmsConfig.SMS.MENG_WANG;
/**
* <pre>
* 梦网短信平台
* 错误返回:
* -1 参数为空。信息、电话号码等有空指针,登陆失败
* -12 有异常电话号码
* -13 电话号码个数与实际个数不相等
* -14 实际号码个数超过100
* -999 web服务器内部错误
* -10001 用户登陆不成功(帐号不存在/停用/密码错误)
* -10003 用户余额不足
* -10011 信息内容超长
* -10029 此用户没有权限从此通道发送信息(用户没有绑定该性质的通道,比如:用户发了小灵通的号码)
* -10030 不能发送移动号码
* -10031 手机号码(段)非法
* -10057 IP受限
* -10056 连接数超限
* </pre>
*
* @author mengfan.feng
* @time 2015-10-22 16:25
*/
@Service
public class MengWangSms implements ISmsSender {
private static final Map<String, String> ERRORS = ImmutableMap.<String, String>builder()
.put("-1", "参数为空")
.put("-12", "有异常电话号码")
.put("-13", "电话号码个数与实际个数不相等")
.put("-14", "实际号码个数超过100")
.put("-999", "web服务器内部错误")
.put("-10001", "用户登陆不成功(帐号不存在/停用/密码错误)")
.put("-10003", "用户余额不足")
.put("-10011", "信息内容超长")
.put("-10029", "此用户没有权限从此通道发送信息")
.put("-10030", "不能发送移动号码")
.put("-10031", "手机号码(段)非法")
.put("-10057", "IP受限")
.put("-10056", "连接数超限")
.build();
@Override
public SmsResult send(String phone, String content) {
String response = new Wmgw().getWmgwSoap().mongateSendSubmit(MENG_WANG.getAccount(), MENG_WANG.getPassword(), phone, content, 1, "*", "0");
if (StringUtils.isBlank(response)) {
return SmsResult.error("梦网短信平台,返回结果为空");
}
if (response.replaceFirst("-", "").length() > 10) {
return SmsResult.success();
}
return SmsResult.error(ERRORS.get(response));
}
}
...@@ -2,11 +2,7 @@ package cn.quantgroup.xyqb.service.sms.impl; ...@@ -2,11 +2,7 @@ package cn.quantgroup.xyqb.service.sms.impl;
import cn.quantgroup.sms.SendAndForgetMsg; import cn.quantgroup.sms.SendAndForgetMsg;
import cn.quantgroup.sms.SmsSender; import cn.quantgroup.sms.SmsSender;
import cn.quantgroup.xyqb.model.sms.SmsConfig;
import cn.quantgroup.xyqb.model.sms.SmsResult;
import cn.quantgroup.xyqb.service.sms.ISmsSender;
import cn.quantgroup.xyqb.service.sms.ISmsService; import cn.quantgroup.xyqb.service.sms.ISmsService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -15,13 +11,8 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -15,13 +11,8 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.Collections; import java.util.Collections;
import static cn.quantgroup.xyqb.model.sms.SmsConfig.SMS_INDEX_KEY;
/** /**
* @author mengfan.feng * @author mengfan.feng
* @time 2015-07-25 18:47 * @time 2015-07-25 18:47
...@@ -38,96 +29,14 @@ public class SmsServiceImpl implements ISmsService { ...@@ -38,96 +29,14 @@ public class SmsServiceImpl implements ISmsService {
@Qualifier("stringRedisTemplate") @Qualifier("stringRedisTemplate")
private RedisTemplate<String, String> redisTemplate; private RedisTemplate<String, String> redisTemplate;
@Autowired private SmsSender smsSender = null;
private GuoDuSms guoDuSms;
@Autowired
private ChuangLanSms chuangLanSms;
@Autowired
private ZhangZhongSms zhangZhongSms;
@Autowired
private MengWangSms mengWangSms;
@Autowired
private ManDaoSms manDaoSms;
private SmsSender smsSender;
private static final ISmsSender[] SMS_SENDERS = new ISmsSender[5];
@PostConstruct
private void init() {
smsSender = new SmsSender();
SMS_SENDERS[0] = guoDuSms;
SMS_SENDERS[1] = chuangLanSms;
SMS_SENDERS[2] = zhangZhongSms;
SMS_SENDERS[3] = mengWangSms;
SMS_SENDERS[4] = manDaoSms;
if (isDebug) {
for (SmsConfig.SMS sms : SmsConfig.SMS.values()) {
sms.setEnabled(false);
}
redisTemplate.opsForValue().set(SMS_INDEX_KEY, "-1");
return;
}
if (StringUtils.isEmpty(redisTemplate.opsForValue().get(SMS_INDEX_KEY))) {
redisTemplate.opsForValue().set(SMS_INDEX_KEY, "0");
}
}
@Override @Override
public SmsSender getSmsSender() { public SmsSender getSmsSender() {
return this.smsSender; if (null == smsSender) {
} smsSender = new SmsSender();
@Override
public SmsResult send(String phone, String content) {
if (StringUtils.isBlank(phone) || StringUtils.isBlank(content)) {
return SmsResult.error("参数错误");
}
/********** Debug模式 ***********/
int smsIndex = Integer.parseInt(redisTemplate.opsForValue().get(SMS_INDEX_KEY));
if (isDebug && smsIndex < 0) {
return SmsResult.success();
} }
return this.smsSender;
SmsResult result = SmsResult.error("发送失败");
/********** 如果发送失败,选择其他短信平台重新发送 ***********/
for (int i = 0; i < SMS_SENDERS.length; i++) {
if (smsIndex >= SMS_SENDERS.length) {
smsIndex = 0;
}
try {
if (!SmsConfig.SMS.values()[smsIndex].isEnabled()) {
LOGGER.info("短信平台已关闭, smsIndex:{}", smsIndex);
smsIndex++;
continue;
}
result = SMS_SENDERS[smsIndex].send(phone, content);
} catch (Exception e) {
LOGGER.error("短信发送出现异常", e);
result.setMsg("系统异常");
}
if (result.isRet()) {
LOGGER.info("短信发送成功, smsIndex:{}, phone:{}, content:{}", smsIndex, phone, content);
break;
} else {
LOGGER.warn("短信发送失败, smsIndex:{}, phone:{}, content:{}, reason:{}", smsIndex, phone, content, result.getMsg());
smsIndex++;
}
}
redisTemplate.opsForValue().set(SMS_INDEX_KEY, smsIndex + "");
return result;
} }
@Override @Override
......
package cn.quantgroup.xyqb.service.sms.impl;
import cn.quantgroup.xyqb.model.sms.SmsResult;
import cn.quantgroup.xyqb.service.sms.ISmsSender;
import cn.quantgroup.xyqb.thirdparty.zhangzhongwuxian.Info;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import static cn.quantgroup.xyqb.model.sms.SmsConfig.SMS.ZHANG_ZHONG_WU_XIAN;
/**
* <pre>
* 掌中无限短信平台
* 返回值 说明
* 0 成功
* -1 用户名或密码不正确
* -2 余额不够
* -3 帐号没有注册
* -4 内容超长
* -5 账号路由为空
* -6 手机号码多余1000个(或手机号码非法或错误)
* -8 扩展号超长
* -13 定时时间错误或者小于当前系统时间
* -17 手机号码为空
* -18 号码不是数字或者逗号不是英文逗号
* -19 短信内容为空
* 5 具体的禁发词 关键词的原因失败返回的值,逗号后面的中文实际返回时做了urlencode的编码转换(GBK字符集)。
* -32 (包体异常)或网络故障
* </pre>
*
* @author mengfan.feng
* @time 2015-09-14 14:36
*/
@Service
public class ZhangZhongSms implements ISmsSender {
private static final Map<String, String> ERRORS = ImmutableMap.<String, String>builder()
.put("0", "成功")
.put("-1", "用户名或密码不正确")
.put("-2", "余额不够")
.put("-3", "帐号没有注册")
.put("-4", "内容超长")
.put("-5", "账号路由为空")
.put("-6", "手机号码多余1000个(或手机号码非法或错误)")
.put("-8", "扩展号超长")
.put("-13", "定时时间错误或者小于当前系统时间")
.put("-17", "手机号码为空")
.put("-18", "号码不是数字或者逗号不是英文逗号")
.put("-19", "短信内容为空")
.put("5", "具体的禁发词,关键词的原因失败")
.put("-32", "(包体异常)或网络故障")
.build();
@Override
public SmsResult send(String phone, String content) {
String response = new Info().getInfoHttpPort().sendSMS(ZHANG_ZHONG_WU_XIAN.getAccount(), ZHANG_ZHONG_WU_XIAN.getPassword(), phone, content, "", "1", "", "1", "", "4");
if (StringUtils.isBlank(response)) {
return SmsResult.error("掌中无限短信平台,返回结果为空");
}
if ("0".equals(response)) {
return SmsResult.success();
}
return SmsResult.error(ERRORS.get(response));
}
}
package cn.quantgroup.xyqb.service.user.impl; package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.user.IUserSdkService;
import cn.quantgroup.user.UserSdkServiceFactory;
import cn.quantgroup.user.UserSysResult;
import cn.quantgroup.user.bean.UserBean;
import cn.quantgroup.user.retbean.XUser;
import cn.quantgroup.xyqb.Constants; import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.entity.IpAddr;
import cn.quantgroup.xyqb.entity.User; import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.repository.IIpAddrRepository;
import cn.quantgroup.xyqb.repository.IUserRepository; import cn.quantgroup.xyqb.repository.IUserRepository;
import cn.quantgroup.xyqb.service.sms.ISmsService; import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.service.user.ILkbUserService; import cn.quantgroup.xyqb.service.user.ILkbUserService;
import cn.quantgroup.xyqb.service.user.IUserService; import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.PasswordUtil; import cn.quantgroup.xyqb.util.PasswordUtil;
import cn.quantgroup.xyqb.util.Utils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.http.impl.client.CloseableHttpClient;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
...@@ -42,24 +30,11 @@ public class UserServiceImpl implements IUserService { ...@@ -42,24 +30,11 @@ public class UserServiceImpl implements IUserService {
@Autowired @Autowired
private ILkbUserService lkbUserService; private ILkbUserService lkbUserService;
@Autowired
private IIpAddrRepository ipAddrRepository;
@Autowired @Autowired
private IUserRepository userRepository; private IUserRepository userRepository;
@Autowired @Autowired
private ISmsService smsService; private ISmsService smsService;
@Autowired
@Qualifier("httpClient")
private CloseableHttpClient httpClient;
@Value("${usersys.url}")
private String userSysUrl;
private IUserSdkService userSdkService;
@PostConstruct
private void init() {
userSdkService = UserSdkServiceFactory.generateSDKService(userSysUrl, httpClient);
}
@Override @Override
@Cacheable(value = "usercache", key = "'xyqbuser' + #phone", unless = "#result == null", cacheManager = "cacheManager") @Cacheable(value = "usercache", key = "'xyqbuser' + #phone", unless = "#result == null", cacheManager = "cacheManager")
...@@ -77,39 +52,28 @@ public class UserServiceImpl implements IUserService { ...@@ -77,39 +52,28 @@ public class UserServiceImpl implements IUserService {
String uuid = lkbUserService.registerApp(phoneNo, password); String uuid = lkbUserService.registerApp(phoneNo, password);
Timestamp currentTime = new Timestamp(System.currentTimeMillis()); Timestamp currentTime = new Timestamp(System.currentTimeMillis());
UserBean userBean = new UserBean(); User user = new User();
userBean.setUuid(uuid); user.setEnable(true);
userBean.setPassword(PasswordUtil.MD5(password.toLowerCase() + Constants.PASSWORD_SALT)); user.setPhoneNo(phoneNo);
userBean.setPhoneNo(phoneNo); user.setUpdatedAt(currentTime);
userBean.setCreatedAt(currentTime); user.setCreatedAt(currentTime);
userBean.setUpdatedAt(currentTime); user.setUuid(uuid);
userBean.setRegisteredFrom(registerFrom); user.setPassword(PasswordUtil.MD5(password.toLowerCase() + Constants.PASSWORD_SALT));
user.setRegisteredFrom(registerFrom);
UserSysResult<XUser> userUserSysResult = userSdkService.saveUser(userBean);
if (!userUserSysResult.isSuccess()) { return userRepository.save(user);
throw new RuntimeException("保存用户信息出错");
}
return Utils.xuser2User(userUserSysResult.getData());
} }
@Override @Override
@Cacheable(value = "usercache", key = "'xyqbuser' + #phone", unless = "#result == null", cacheManager = "cacheManager") @Cacheable(value = "usercache", key = "'xyqbuser' + #phone", unless = "#result == null", cacheManager = "cacheManager")
public User findByPhone(String phone) { public User findByPhone(String phone) {
UserSysResult<XUser> user = userSdkService.findUserByPhoneNo(phone); return userRepository.findByPhoneNo(phone);
if (user.isSuccess()) {
return Utils.xuser2User(user.getData());
}
return null;
} }
@Override @Override
public User findByUuid(String uuid) { public User findByUuid(String uuid) {
UserSysResult<XUser> user = userSdkService.findUserByUuid(uuid); return userRepository.findByUuid(uuid);
if (user.isSuccess()) {
return Utils.xuser2User(user.getData());
}
return null;
} }
@Override @Override
...@@ -119,75 +83,38 @@ public class UserServiceImpl implements IUserService { ...@@ -119,75 +83,38 @@ public class UserServiceImpl implements IUserService {
String uuid = lkbUserService.registerApp(phoneNo, password); String uuid = lkbUserService.registerApp(phoneNo, password);
Timestamp currentTime = new Timestamp(System.currentTimeMillis()); Timestamp currentTime = new Timestamp(System.currentTimeMillis());
UserBean userBean = new UserBean(); User user = new User();
userBean.setPhoneNo(phoneNo); user.setEnable(true);
userBean.setRegisteredFrom(registerFrom); user.setPhoneNo(phoneNo);
userBean.setPassword(PasswordUtil.MD5(password.toLowerCase() + Constants.PASSWORD_SALT)); user.setUpdatedAt(currentTime);
userBean.setUuid(uuid); user.setCreatedAt(currentTime);
userBean.setCreatedAt(currentTime); user.setUuid(uuid);
userBean.setUpdatedAt(currentTime); user.setPassword(PasswordUtil.MD5(password.toLowerCase() + Constants.PASSWORD_SALT));
user.setRegisteredFrom(registerFrom);
UserSysResult<XUser> userSysResult = userSdkService.saveUser(userBean);
/** user = userRepository.save(user);
* 保存失败,直接返回false
*/
if(!userSysResult.isSuccess()){
return false;
}
User user =Utils.xuser2User(userSysResult.getData());
smsService.sendAfterRegister(phoneNo); smsService.sendAfterRegister(phoneNo);
IpAddr ipAddr = new IpAddr(); return user != null;
ipAddr.setIpAddr(userIp);
ipAddr.setUserId(user.getId());
ipAddr.setPhoneNo(phoneNo);
ipAddr.setLocation("");
ipAddr.setRegisteredFrom(registerFrom);
ipAddr.setCreatedAt(currentTime);
ipAddrRepository.saveAndFlush(ipAddr);
return exist(phoneNo);
} }
@Override @Override
public boolean exist(String phoneNo) { public boolean exist(String phoneNo) {
UserSysResult<XUser> userUserSysResult = userSdkService.findUserByPhoneNo(phoneNo); return userRepository.findByPhoneNo(phoneNo) != null;
if (userUserSysResult.isSuccess() && userUserSysResult.getData() != null) {
return true;
}
return false;
} }
@Override @Override
@CacheEvict(value = "usercache", key = "'xyqbuser' + #phone", cacheManager = "cacheManager") @CacheEvict(value = "usercache", key = "'xyqbuser' + #phone", cacheManager = "cacheManager")
public boolean resetPassword(String phoneNo, String password) { public boolean resetPassword(String phoneNo, String password) {
UserSysResult<XUser> userSysResult = userSdkService.findUserByPhoneNo(phoneNo); User user = userRepository.findByPhoneNo(phoneNo);
if(!userSysResult.isSuccess() || userSysResult.getData() == null){
throw new RuntimeException("用户[" + phoneNo + "]不存在");
}
XUser user = userSysResult.getData();
user.setPassword(PasswordUtil.MD5(password.toLowerCase() + Constants.PASSWORD_SALT));
UserBean userBean = new UserBean();
userBean.setUuid(user.getUuid());
userBean.setPassword(user.getPassword());
userBean.setUpdatedAt(new Timestamp(System.currentTimeMillis()));
userBean.setCreatedAt(user.getCreatedAt());
userBean.setRegisteredFrom(user.getRegisteredFrom());
userBean.setPhoneNo(user.getPhoneNo());
userSysResult = userSdkService.saveUser(userBean);
if(userSysResult.isSuccess() && userSysResult.getData() != null){
stringRedisTemplate.expire("usercache:xyqbuser" + phoneNo, 1L, TimeUnit.MILLISECONDS);
}
return StringUtils.equals(PasswordUtil.MD5(password.toLowerCase() + Constants.PASSWORD_SALT), user.getPassword());
/*User user = userRepository.findByPhoneNo(phoneNo);
if (user == null) { if (user == null) {
throw new RuntimeException("用户[" + phoneNo + "]不存在"); throw new RuntimeException("用户[" + phoneNo + "]不存在");
} }
user.setPassword(PasswordUtil.MD5(password.toLowerCase() + Constants.PASSWORD_SALT)); user.setPassword(PasswordUtil.MD5(password.toLowerCase() + Constants.PASSWORD_SALT));
user = userRepository.saveAndFlush(user); user = userRepository.save(user);
//usercache:xyqbuser18888888888 手动清除 stringRedisTemplate.expire("usercache:xyqbuser" + phoneNo, 1L, TimeUnit.MILLISECONDS);
stringRedisTemplate.expire("usercache:xyqbuser" + phoneNo, 1L, TimeUnit.MILLISECONDS);*/ return StringUtils.equals(PasswordUtil.MD5(password.toLowerCase() + Constants.PASSWORD_SALT), user.getPassword());
} }
} }
...@@ -31,7 +31,7 @@ public class CustomGimpyFactory extends GimpyFactory { ...@@ -31,7 +31,7 @@ public class CustomGimpyFactory extends GimpyFactory {
public ImageCaptcha getImageCaptcha(Locale locale) { public ImageCaptcha getImageCaptcha(Locale locale) {
Integer wordLength = this.getRandomLength(); Integer wordLength = this.getRandomLength();
String word = this.getWordGenerator().getWord(wordLength, locale); String word = this.getWordGenerator().getWord(wordLength, locale);
BufferedImage image = null; BufferedImage image;
try { try {
image = this.getWordToImage().getImage(word); image = this.getWordToImage().getImage(word);
......
package cn.quantgroup.xyqb.thirdparty.mandao;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ArrayOfMOBody complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ArrayOfMOBody"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="MOBody" type="{http://tempuri.org/}MOBody" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfMOBody", propOrder = {
"moBody"
})
public class ArrayOfMOBody {
@XmlElement(name = "MOBody", nillable = true)
protected List<MOBody> moBody;
/**
* Gets the value of the moBody property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the moBody property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getMOBody().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link MOBody }
*
*
*/
public List<MOBody> getMOBody() {
if (moBody == null) {
moBody = new ArrayList<MOBody>();
}
return this.moBody;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ArrayOfString complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ArrayOfString"&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="string" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfString", propOrder = {
"string"
})
public class ArrayOfString {
@XmlElement(nillable = true)
protected List<String> string;
/**
* Gets the value of the string property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the string property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getString().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getString() {
if (string == null) {
string = new ArrayList<String>();
}
return this.string;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="sn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="pwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sn",
"pwd"
})
@XmlRootElement(name = "balance")
public class Balance {
protected String sn;
protected String pwd;
/**
* Gets the value of the sn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSn() {
return sn;
}
/**
* Sets the value of the sn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSn(String value) {
this.sn = value;
}
/**
* Gets the value of the pwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPwd() {
return pwd;
}
/**
* Sets the value of the pwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPwd(String value) {
this.pwd = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="balanceResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"balanceResult"
})
@XmlRootElement(name = "balanceResponse")
public class BalanceResponse {
protected String balanceResult;
/**
* Gets the value of the balanceResult property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBalanceResult() {
return balanceResult;
}
/**
* Sets the value of the balanceResult property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBalanceResult(String value) {
this.balanceResult = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="sn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="pwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="mobile" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="content" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="ext" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="stime" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="rrid" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="bcode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sn",
"pwd",
"mobile",
"content",
"ext",
"stime",
"rrid",
"bcode"
})
@XmlRootElement(name = "bianliang")
public class Bianliang {
protected String sn;
protected String pwd;
protected String mobile;
protected String content;
protected String ext;
protected String stime;
protected String rrid;
protected String bcode;
/**
* Gets the value of the sn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSn() {
return sn;
}
/**
* Sets the value of the sn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSn(String value) {
this.sn = value;
}
/**
* Gets the value of the pwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPwd() {
return pwd;
}
/**
* Sets the value of the pwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPwd(String value) {
this.pwd = value;
}
/**
* Gets the value of the mobile property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMobile() {
return mobile;
}
/**
* Sets the value of the mobile property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMobile(String value) {
this.mobile = value;
}
/**
* Gets the value of the content property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getContent() {
return content;
}
/**
* Sets the value of the content property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setContent(String value) {
this.content = value;
}
/**
* Gets the value of the ext property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getExt() {
return ext;
}
/**
* Sets the value of the ext property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setExt(String value) {
this.ext = value;
}
/**
* Gets the value of the stime property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getStime() {
return stime;
}
/**
* Sets the value of the stime property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setStime(String value) {
this.stime = value;
}
/**
* Gets the value of the rrid property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRrid() {
return rrid;
}
/**
* Sets the value of the rrid property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRrid(String value) {
this.rrid = value;
}
/**
* Gets the value of the bcode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBcode() {
return bcode;
}
/**
* Sets the value of the bcode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBcode(String value) {
this.bcode = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="bianliangResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"bianliangResult"
})
@XmlRootElement(name = "bianliangResponse")
public class BianliangResponse {
protected String bianliangResult;
/**
* Gets the value of the bianliangResult property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getBianliangResult() {
return bianliangResult;
}
/**
* Sets the value of the bianliangResult property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setBianliangResult(String value) {
this.bianliangResult = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="sn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="pwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="cardno" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="cardpwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sn",
"pwd",
"cardno",
"cardpwd"
})
@XmlRootElement(name = "ChargUp")
public class ChargUp {
protected String sn;
protected String pwd;
protected String cardno;
protected String cardpwd;
/**
* Gets the value of the sn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSn() {
return sn;
}
/**
* Sets the value of the sn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSn(String value) {
this.sn = value;
}
/**
* Gets the value of the pwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPwd() {
return pwd;
}
/**
* Sets the value of the pwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPwd(String value) {
this.pwd = value;
}
/**
* Gets the value of the cardno property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCardno() {
return cardno;
}
/**
* Sets the value of the cardno property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCardno(String value) {
this.cardno = value;
}
/**
* Gets the value of the cardpwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCardpwd() {
return cardpwd;
}
/**
* Sets the value of the cardpwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCardpwd(String value) {
this.cardpwd = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="ChargUpResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"chargUpResult"
})
@XmlRootElement(name = "ChargUpResponse")
public class ChargUpResponse {
@XmlElement(name = "ChargUpResult")
protected String chargUpResult;
/**
* Gets the value of the chargUpResult property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getChargUpResult() {
return chargUpResult;
}
/**
* Sets the value of the chargUpResult property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setChargUpResult(String value) {
this.chargUpResult = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="sn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="pwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="fname" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="rrid" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="sort" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
* &lt;element name="total" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
* &lt;element name="ftype" type="{http://www.w3.org/2001/XMLSchema}int"/&gt;
* &lt;element name="content" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sn",
"pwd",
"fname",
"rrid",
"sort",
"total",
"ftype",
"content"
})
@XmlRootElement(name = "fileMT")
public class FileMT {
protected String sn;
protected String pwd;
protected String fname;
protected String rrid;
protected int sort;
protected int total;
protected int ftype;
protected String content;
/**
* Gets the value of the sn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSn() {
return sn;
}
/**
* Sets the value of the sn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSn(String value) {
this.sn = value;
}
/**
* Gets the value of the pwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPwd() {
return pwd;
}
/**
* Sets the value of the pwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPwd(String value) {
this.pwd = value;
}
/**
* Gets the value of the fname property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getFname() {
return fname;
}
/**
* Sets the value of the fname property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setFname(String value) {
this.fname = value;
}
/**
* Gets the value of the rrid property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getRrid() {
return rrid;
}
/**
* Sets the value of the rrid property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setRrid(String value) {
this.rrid = value;
}
/**
* Gets the value of the sort property.
*
*/
public int getSort() {
return sort;
}
/**
* Sets the value of the sort property.
*
*/
public void setSort(int value) {
this.sort = value;
}
/**
* Gets the value of the total property.
*
*/
public int getTotal() {
return total;
}
/**
* Sets the value of the total property.
*
*/
public void setTotal(int value) {
this.total = value;
}
/**
* Gets the value of the ftype property.
*
*/
public int getFtype() {
return ftype;
}
/**
* Sets the value of the ftype property.
*
*/
public void setFtype(int value) {
this.ftype = value;
}
/**
* Gets the value of the content property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getContent() {
return content;
}
/**
* Sets the value of the content property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setContent(String value) {
this.content = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="fileMTResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"fileMTResult"
})
@XmlRootElement(name = "fileMTResponse")
public class FileMTResponse {
protected String fileMTResult;
/**
* Gets the value of the fileMTResult property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getFileMTResult() {
return fileMTResult;
}
/**
* Sets the value of the fileMTResult property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setFileMTResult(String value) {
this.fileMTResult = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="sn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="pwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sn",
"pwd"
})
@XmlRootElement(name = "GetAllInfo")
public class GetAllInfo {
protected String sn;
protected String pwd;
/**
* Gets the value of the sn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSn() {
return sn;
}
/**
* Sets the value of the sn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSn(String value) {
this.sn = value;
}
/**
* Gets the value of the pwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPwd() {
return pwd;
}
/**
* Sets the value of the pwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPwd(String value) {
this.pwd = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="sn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="pwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="ver" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="oem" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sn",
"pwd",
"ver",
"oem"
})
@XmlRootElement(name = "GetAllInfo2")
public class GetAllInfo2 {
protected String sn;
protected String pwd;
protected String ver;
protected String oem;
/**
* Gets the value of the sn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSn() {
return sn;
}
/**
* Sets the value of the sn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSn(String value) {
this.sn = value;
}
/**
* Gets the value of the pwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPwd() {
return pwd;
}
/**
* Sets the value of the pwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPwd(String value) {
this.pwd = value;
}
/**
* Gets the value of the ver property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVer() {
return ver;
}
/**
* Sets the value of the ver property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVer(String value) {
this.ver = value;
}
/**
* Gets the value of the oem property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getOem() {
return oem;
}
/**
* Sets the value of the oem property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setOem(String value) {
this.oem = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="GetAllInfo2Result" type="{http://tempuri.org/}RegistryInfo2" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"getAllInfo2Result"
})
@XmlRootElement(name = "GetAllInfo2Response")
public class GetAllInfo2Response {
@XmlElement(name = "GetAllInfo2Result")
protected RegistryInfo2 getAllInfo2Result;
/**
* Gets the value of the getAllInfo2Result property.
*
* @return
* possible object is
* {@link RegistryInfo2 }
*
*/
public RegistryInfo2 getGetAllInfo2Result() {
return getAllInfo2Result;
}
/**
* Sets the value of the getAllInfo2Result property.
*
* @param value
* allowed object is
* {@link RegistryInfo2 }
*
*/
public void setGetAllInfo2Result(RegistryInfo2 value) {
this.getAllInfo2Result = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="GetAllInfoResult" type="{http://tempuri.org/}RegistryInfo" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"getAllInfoResult"
})
@XmlRootElement(name = "GetAllInfoResponse")
public class GetAllInfoResponse {
@XmlElement(name = "GetAllInfoResult")
protected RegistryInfo getAllInfoResult;
/**
* Gets the value of the getAllInfoResult property.
*
* @return
* possible object is
* {@link RegistryInfo }
*
*/
public RegistryInfo getGetAllInfoResult() {
return getAllInfoResult;
}
/**
* Sets the value of the getAllInfoResult property.
*
* @param value
* allowed object is
* {@link RegistryInfo }
*
*/
public void setGetAllInfoResult(RegistryInfo value) {
this.getAllInfoResult = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="sn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="pwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sn",
"pwd"
})
@XmlRootElement(name = "GetBalance")
public class GetBalance {
protected String sn;
protected String pwd;
/**
* Gets the value of the sn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSn() {
return sn;
}
/**
* Sets the value of the sn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSn(String value) {
this.sn = value;
}
/**
* Gets the value of the pwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPwd() {
return pwd;
}
/**
* Sets the value of the pwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPwd(String value) {
this.pwd = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="GetBalanceResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"getBalanceResult"
})
@XmlRootElement(name = "GetBalanceResponse")
public class GetBalanceResponse {
@XmlElement(name = "GetBalanceResult")
protected String getBalanceResult;
/**
* Gets the value of the getBalanceResult property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getGetBalanceResult() {
return getBalanceResult;
}
/**
* Sets the value of the getBalanceResult property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setGetBalanceResult(String value) {
this.getBalanceResult = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="sn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="pwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sn",
"pwd"
})
@XmlRootElement(name = "GetCode")
public class GetCode {
protected String sn;
protected String pwd;
/**
* Gets the value of the sn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSn() {
return sn;
}
/**
* Sets the value of the sn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSn(String value) {
this.sn = value;
}
/**
* Gets the value of the pwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPwd() {
return pwd;
}
/**
* Sets the value of the pwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPwd(String value) {
this.pwd = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="GetCodeResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"getCodeResult"
})
@XmlRootElement(name = "GetCodeResponse")
public class GetCodeResponse {
@XmlElement(name = "GetCodeResult")
protected String getCodeResult;
/**
* Gets the value of the getCodeResult property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getGetCodeResult() {
return getCodeResult;
}
/**
* Sets the value of the getCodeResult property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setGetCodeResult(String value) {
this.getCodeResult = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="sn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="pwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sn",
"pwd"
})
@XmlRootElement(name = "GetFlag")
public class GetFlag {
protected String sn;
protected String pwd;
/**
* Gets the value of the sn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSn() {
return sn;
}
/**
* Sets the value of the sn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSn(String value) {
this.sn = value;
}
/**
* Gets the value of the pwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPwd() {
return pwd;
}
/**
* Sets the value of the pwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPwd(String value) {
this.pwd = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="GetFlagResult" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"getFlagResult"
})
@XmlRootElement(name = "GetFlagResponse")
public class GetFlagResponse {
@XmlElement(name = "GetFlagResult")
protected String getFlagResult;
/**
* Gets the value of the getFlagResult property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getGetFlagResult() {
return getFlagResult;
}
/**
* Sets the value of the getFlagResult property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setGetFlagResult(String value) {
this.getFlagResult = value;
}
}
package cn.quantgroup.xyqb.thirdparty.mandao;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence&gt;
* &lt;element name="sn" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;element name="pwd" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
* &lt;/sequence&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"sn",
"pwd"
})
@XmlRootElement(name = "GetGaoDuan")
public class GetGaoDuan {
protected String sn;
protected String pwd;
/**
* Gets the value of the sn property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSn() {
return sn;
}
/**
* Sets the value of the sn property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSn(String value) {
this.sn = value;
}
/**
* Gets the value of the pwd property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPwd() {
return pwd;
}
/**
* Sets the value of the pwd property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPwd(String value) {
this.pwd = value;
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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