Commit 3c8b53b3 authored by 王亮's avatar 王亮

remove unused dependency.

parent ae057614
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
......@@ -45,12 +46,7 @@
<artifactId>SensorsAnalyticsSDK</artifactId>
<version>3.2.0</version>
</dependency>
<!-- swagger2 start -->
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-core</artifactId>
......@@ -153,16 +149,6 @@
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.0.4.Final</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
<exclusion>
<artifactId>xml-apis</artifactId>
<groupId>xml-apis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
......@@ -253,7 +239,7 @@
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>2.5.1</version>
<version>2.7.9</version>
</dependency>
<dependency>
......@@ -289,28 +275,11 @@
<dependency>
<groupId>cn.quantgroup</groupId>
<artifactId>commons-spring</artifactId>
<version>0.2.6</version>
</dependency>
<dependency>
<groupId>cn.quantgroup</groupId>
<artifactId>commons-core</artifactId>
<version>0.2.6</version>
</dependency>
<dependency>
<groupId>cn.quantgroup</groupId>
<artifactId>shutdown-spring-boot-starter</artifactId>
<version>0.2.6</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>cn.quantgroup</groupId>-->
<!-- <artifactId>brave-spring-boot-starter</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>cn.quantgroup</groupId>-->
<!-- <artifactId>enoch-agent-spring-boot-starter</artifactId>-->
<!-- </dependency>-->
<!--logback使用1.1.4版本-->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
......@@ -327,6 +296,7 @@
<version>1.1.6-SNAPSHOT</version>
</dependency>
<!-- 兼容旧 Spring Session 配置-->
<dependency>
<groupId>org.springframework.security</groupId>
......
package cn.quantgroup.tech.db;
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyValues;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.GenericBeanDefinition;
import org.springframework.boot.bind.RelaxedDataBinder;
import org.springframework.boot.bind.RelaxedPropertyResolver;
import org.springframework.context.EnvironmentAware;
import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.core.convert.ConversionService;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.core.env.Environment;
import org.springframework.core.type.AnnotationMetadata;
import javax.sql.DataSource;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
public class DynamicDataSourceRegister implements ImportBeanDefinitionRegistrar, EnvironmentAware {
private static final Logger log = LoggerFactory.getLogger(cn.quantgroup.tech.db.DynamicDataSourceRegister.class);
private ConversionService conversionService = new DefaultConversionService();
private static final String DATASOURCE_TYPE_DEFAULT = "com.zaxxer.hikari.HikariDataSource";
private static final String DATABASE_TYPE_DEFAULT = "com.mysql.jdbc.Driver";
private static final String MASTER_PREFIX = "spring.datasource.";
private static final String SLAVE_PREFIX = "slave.datasource.";
private DataSource masterDataSource;
private DataSource slaveDataSource;
public DynamicDataSourceRegister() {
}
public void setEnvironment(Environment environment) {
this.masterDataSource = this.buildDataSource(this.initDataSource(environment, "spring.datasource."));
this.dataBinder(this.masterDataSource, environment, "spring.datasource.");
this.slaveDataSource = this.buildDataSource(this.initDataSource(environment, "slave.datasource."));
this.dataBinder(this.slaveDataSource, environment, "slave.datasource.");
}
public void registerBeanDefinitions(AnnotationMetadata annotationMetadata, BeanDefinitionRegistry beanDefinitionRegistry) {
Map<Object, Object> targetDataSources = new HashMap(1);
targetDataSources.put(DSType.MASTER, this.masterDataSource);
DynamicDataSourceContextHolder.dataSourceIds.add(DSType.MASTER);
targetDataSources.put(DSType.SLAVE, this.slaveDataSource);
DynamicDataSourceContextHolder.dataSourceIds.add(DSType.SLAVE);
GenericBeanDefinition beanDefinition = new GenericBeanDefinition();
beanDefinition.setBeanClass(DynamicDataSource.class);
beanDefinition.setSynthetic(true);
MutablePropertyValues mpv = beanDefinition.getPropertyValues();
mpv.addPropertyValue("defaultTargetDataSource", this.masterDataSource);
mpv.addPropertyValue("targetDataSources", targetDataSources);
beanDefinitionRegistry.registerBeanDefinition("dataSource", beanDefinition);
log.info("Dynamic DataSource Registry Success");
}
private Map<String, Object> initDataSource(Environment env, String prefix) {
RelaxedPropertyResolver propertyResolver = new RelaxedPropertyResolver(env, prefix);
Map<String, Object> dsMap = new HashMap(1);
dsMap.put("type", propertyResolver.getProperty("type", "com.zaxxer.hikari.HikariDataSource"));
dsMap.put("driver-class-name", propertyResolver.getProperty("driver-class-name", "com.mysql.jdbc.Driver"));
dsMap.put("url", propertyResolver.getProperty("url"));
dsMap.put("username", propertyResolver.getProperty("username"));
dsMap.put("password", propertyResolver.getProperty("password"));
dsMap.put("maxPoolSize", propertyResolver.getProperty("maxPoolSize"));
return dsMap;
}
private void dataBinder(DataSource dataSource, Environment env, String prefix) {
RelaxedDataBinder dataBinder = new RelaxedDataBinder(dataSource);
dataBinder.setConversionService(this.conversionService);
dataBinder.setIgnoreNestedProperties(false);
dataBinder.setIgnoreInvalidFields(false);
dataBinder.setIgnoreUnknownFields(true);
Map<String, Object> rpr = (new RelaxedPropertyResolver(env, prefix)).getSubProperties("");
Map<String, Object> values = new HashMap(rpr);
values.remove("type");
values.remove("driver-class-name");
values.remove("url");
values.remove("username");
values.remove("password");
PropertyValues dataSourcePropertyValues = new MutablePropertyValues(values);
dataBinder.bind(dataSourcePropertyValues);
}
private DataSource buildDataSource(Map<String, Object> dsMap) {
try {
String type = dsMap.get("type").toString();
Class<? extends DataSource> dataSourceType = (Class<? extends DataSource>)Class.forName(type);
String driverClassName = dsMap.get("driver-class-name").toString();
String url = dsMap.get("url").toString();
String username = dsMap.get("username").toString();
String password = dsMap.get("password").toString();
Integer maxPoolSize = Integer.parseInt(dsMap.get("maxPoolSize").toString());
HikariConfig config = new HikariConfig();
config.setJdbcUrl(url);
config.setPassword(password);
config.setUsername(username);
// 连接池中允许的最大连接数。缺省值:10;推荐的公式:((core_count * 2) + effective_spindle_count)
//线上是双核机器,100已经非常多。。。。
config.setMaximumPoolSize(maxPoolSize);
config.setMinimumIdle(20);
//个连接idle状态的最大时长(毫秒),超时则被释放(retired),缺省:10分钟
config.setIdleTimeout(60000);
//等待连接池分配连接的最大时长(毫秒),超过这个时长还没可用的连接则发生SQLException, 缺省:30秒
config.setConnectionTimeout(30000);
config.setValidationTimeout(3000);
//个连接的生命时长(毫秒),超时而且没被使用则被释放(retired),缺省:30分钟,建议设置比数据库超时时长少30秒,
// 参考MySQL wait_timeout参数(show variables like '%timeout%';)
config.setMaxLifetime(TimeUnit.HOURS.toMillis(7));
config.addDataSourceProperty("cachePrepStmts", "true");
config.addDataSourceProperty("prepStmtCacheSize", "250");
config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
HikariDataSource datasource = new HikariDataSource(config);
// DataSourceBuilder factory = DataSourceBuilder.create().driverClassName(driverClassName).url(url).username(username).password(password).type(dataSourceType);
return datasource;
} catch (ClassNotFoundException var9) {
log.error("找不到数据源..你没配置hikari的包么? :{}", var9.getMessage());
return null;
}
}
}
\ No newline at end of file
package cn.quantgroup.xyqb;
import cn.quantgroup.xyqb.config.SequencerProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
......@@ -10,10 +11,6 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import lombok.extern.slf4j.Slf4j;
import cn.quantgroup.tech.db.EnableDynamicDataSource;
/**
* @author Anonymous
* 本地启动 :
......@@ -26,7 +23,6 @@ import cn.quantgroup.tech.db.EnableDynamicDataSource;
@EnableAsync
@EnableAspectJAutoProxy
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@EnableDynamicDataSource
@EnableConfigurationProperties({SequencerProperties.class})
public class Bootstrap {
......
......@@ -2,6 +2,7 @@ package cn.quantgroup.xyqb.aspect.accessable;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.util.IpUtil;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
......@@ -11,8 +12,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* IP白名单检验
*
......
package cn.quantgroup.xyqb.aspect.accessable;
import java.lang.annotation.*;
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;
/**
* Ip白名单检验标记
......
......@@ -7,6 +7,12 @@ import cn.quantgroup.xyqb.thirdparty.jcaptcha.AbstractManageableImageCaptchaServ
import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import com.octo.captcha.service.CaptchaServiceException;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
......@@ -14,8 +20,6 @@ import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
......@@ -24,14 +28,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
/**
* 限次图形验证码校验标记
*
......
package cn.quantgroup.xyqb.aspect.captcha;
import java.lang.annotation.*;
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;
/**
* 限次的图形验证码校验标记
......
......@@ -8,6 +8,12 @@ import cn.quantgroup.xyqb.service.captcha.IGeetestCaptchaService;
import cn.quantgroup.xyqb.service.captcha.IGeetestLogService;
import cn.quantgroup.xyqb.service.captcha.IQuantgroupCaptchaService;
import cn.quantgroup.xyqb.util.IpUtil;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
......@@ -18,13 +24,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
/**
* @author xufei on 2018/1/30.
*/
......
package cn.quantgroup.xyqb.aspect.captcha;
import java.lang.annotation.*;
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;
/**
* @author xufei on 2018/1/30.
......
......@@ -5,14 +5,16 @@ import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.thirdparty.jcaptcha.AbstractManageableImageCaptchaService;
import cn.quantgroup.xyqb.util.IpUtil;
import com.octo.captcha.service.CaptchaServiceException;
import java.nio.charset.Charset;
import java.util.Optional;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
......@@ -21,11 +23,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.nio.charset.Charset;
import java.util.Optional;
import java.util.UUID;
/**
* 类名称:CaptchaValidateAdvisor
* 类描述:
......
package cn.quantgroup.xyqb.aspect.captcha;
import java.lang.annotation.*;
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;
/**
* 类名称:CaptchaValidate
......
......@@ -11,6 +11,9 @@ import cn.quantgroup.xyqb.risk.repository.WhiteListRepository;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.TenantUtil;
import com.google.common.collect.Maps;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
......@@ -21,10 +24,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
/**
* @author :dongjianhua
* @date :Created in 2020/11/20 14:55
......
......@@ -2,6 +2,7 @@ package cn.quantgroup.xyqb.aspect.forbidden;
import cn.quantgroup.xyqb.exception.AccessForbiddenException;
import cn.quantgroup.xyqb.util.IpUtil;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
......@@ -10,8 +11,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
@Aspect
@Component
@Slf4j
......
package cn.quantgroup.xyqb.aspect.limit;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
......@@ -7,9 +9,6 @@ import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;
@Aspect
@Component
public class AccessLimitAspect {
......
......@@ -8,6 +8,9 @@ import cn.quantgroup.xyqb.model.session.SessionStruct;
import cn.quantgroup.xyqb.session.XyqbSessionContextHolder;
import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.util.TenantUtil;
import java.util.Objects;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
......@@ -18,10 +21,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
import java.util.Set;
/**
* 免密访问校验切面
*
......
package cn.quantgroup.xyqb.aspect.limit;
import java.lang.annotation.*;
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;
/**
* 免密访问校验标记
......
......@@ -4,14 +4,14 @@ package cn.quantgroup.xyqb.aspect.lock;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.util.IpUtil;
import java.util.Objects;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
......@@ -19,9 +19,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
/**
* 密码错误限次的校验
*
......
package cn.quantgroup.xyqb.aspect.lock;
import java.lang.annotation.*;
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;
/**
* 密码错误限次的校验标记
......
package cn.quantgroup.xyqb.aspect.lock;
import java.lang.annotation.*;
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;
/**
* 用redis进行锁<br/>
......
......@@ -2,6 +2,7 @@ package cn.quantgroup.xyqb.aspect.lock;
import cn.quantgroup.xyqb.exception.ResubmissionException;
import com.alibaba.fastjson.JSONObject;
import java.lang.reflect.Method;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -18,8 +19,6 @@ import org.springframework.expression.ExpressionException;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.stereotype.Component;
import java.lang.reflect.Method;
/**
* Redis Lock Aspect
*/
......
package cn.quantgroup.xyqb.aspect.logcaller;
import cn.quantgroup.xyqb.util.IpUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Stopwatch;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
......@@ -15,12 +17,6 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Stopwatch;
import cn.quantgroup.xyqb.util.IpUtil;
import lombok.extern.slf4j.Slf4j;
/**
* 调用者记录
* Created by Administrator on 2017/5/15.
......
package cn.quantgroup.xyqb.config;
import static cn.quantgroup.xyqb.security.SecurityConstant.PROPERTY_PREFIX;
import cn.quantgroup.xyqb.security.AuthenticationAdapter;
import cn.quantgroup.xyqb.security.AuthenticationPrincipal;
import cn.quantgroup.xyqb.security.CustomerAuthenticationManager;
import cn.quantgroup.xyqb.urora.UroraAuthenticationManager;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
......@@ -12,12 +17,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import static cn.quantgroup.xyqb.security.SecurityConstant.PROPERTY_PREFIX;
/**
* Created by Administrator on 2021/7/1 0001.
*/
......
package cn.quantgroup.xyqb.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
import java.util.HashMap;
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* Created by Administrator on 2021/7/1 0001.
......
......@@ -18,8 +18,8 @@ import com.octo.captcha.component.image.wordtoimage.WordToImage;
import com.octo.captcha.component.word.wordgenerator.RandomWordGenerator;
import com.octo.captcha.component.word.wordgenerator.WordGenerator;
import com.octo.captcha.engine.image.ListImageCaptchaEngine;
import java.awt.*;
import java.awt.Color;
import java.awt.Font;
import java.awt.image.ImageFilter;
/**
......
......@@ -5,11 +5,10 @@ import com.octo.captcha.Captcha;
import com.octo.captcha.engine.CaptchaEngine;
import com.octo.captcha.service.CaptchaServiceException;
import com.octo.captcha.service.captchastore.CaptchaStore;
import java.util.Locale;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import java.util.Locale;
/**
* 类名称:CustomCaptchaService
* 类描述:自定义的验证马实现服务
......
......@@ -5,15 +5,12 @@ import cn.quantgroup.xyqb.thirdparty.jcaptcha.SimpleCaptcha;
import com.octo.captcha.Captcha;
import com.octo.captcha.service.CaptchaServiceException;
import com.octo.captcha.service.captchastore.CaptchaStore;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.RedisTemplate;
import java.util.Collection;
import java.util.Collections;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
/**
* 类名称:RedisCaptchaStore
......
......@@ -4,7 +4,14 @@ package cn.quantgroup.xyqb.config.data;
* Created by Miraculous on 2016/11/16.
*/
import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
import java.util.Properties;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
......@@ -19,10 +26,6 @@ import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import java.util.Properties;
/**
* Created by Miraculous on 2016/11/14.
*/
......@@ -47,12 +50,12 @@ public class JpaConfig {
private Integer minPoolSize;
@Primary
@Bean
@DependsOn(value = "dataSource")
public EntityManagerFactory entityManagerFactory(DataSource dataSource) {
@DependsOn(value = "databaseSource")
public EntityManagerFactory entityManagerFactory(@Qualifier("databaseSource") DataSource dataSource) {
LocalContainerEntityManagerFactoryBean entityManager = new LocalContainerEntityManagerFactoryBean();
entityManager.setDataSource(dataSource);
entityManager.setPackagesToScan("cn.quantgroup.xyqb");
entityManager.setPersistenceUnitName("dataSource");
entityManager.setPersistenceUnitName("databaseSource");
Properties properties = new Properties();
properties.put("hibernate.jdbc.batch_size", 30);
properties.put("hibernate.order_inserts", true);
......@@ -74,6 +77,7 @@ public class JpaConfig {
return hibernateJpaVendorAdapter;
}
@Primary
@Bean
public PlatformTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) {
......@@ -84,11 +88,29 @@ public class JpaConfig {
@Primary
@Bean
@DependsOn(value = "dataSource")
public JdbcTemplate jdbcTemplate(DataSource dataSource){
@DependsOn(value = "databaseSource")
public JdbcTemplate jdbcTemplate(@Qualifier("databaseSource") DataSource dataSource){
JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource);
return jdbcTemplate;
}
@Bean(name = "databaseSource")
@Primary
public DataSource databaseSource() {
Properties properties = new Properties();
properties.setProperty("cachePrepStmts", "true");
properties.setProperty("prepStmtCacheSize", "250");
properties.setProperty("prepStmtCacheSqlLimit", "2048");
HikariConfig config = new HikariConfig();
config.setJdbcUrl(xyqbJdbcUrl);
config.setPassword(password);
config.setUsername(user);
config.setMaximumPoolSize(maxPoolSize);
config.setMinimumIdle(20);
config.setDataSourceProperties(properties);
return new HikariDataSource(config);
}
}
......@@ -2,6 +2,9 @@ package cn.quantgroup.xyqb.config.data;
import com.zaxxer.hikari.HikariDataSource;
import java.util.Properties;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.jdbc.DataSourceBuilder;
......@@ -18,10 +21,6 @@ import org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.persistence.EntityManagerFactory;
import javax.sql.DataSource;
import java.util.Properties;
/**
* 登录风控拦截数据库
*/
......
package cn.quantgroup.xyqb.config.data;
import cn.quantgroup.xyqb.session.XyqbSessionContextHolder;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.CacheManager;
......@@ -12,14 +14,10 @@ import org.springframework.data.redis.connection.RedisNode;
import org.springframework.data.redis.connection.RedisSentinelConfiguration;
import org.springframework.data.redis.connection.jedis.JedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import redis.clients.jedis.JedisPoolConfig;
import java.util.HashSet;
import java.util.Set;
/**
* Created by Miraculous on 15/7/4.
*/
......
package cn.quantgroup.xyqb.config.event;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
......@@ -8,10 +11,6 @@ import org.springframework.context.event.SimpleApplicationEventMulticaster;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.scheduling.support.TaskUtils;
import java.util.concurrent.Executor;
import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;
@Slf4j
@Configuration
public class EventConfig {
......
......@@ -4,6 +4,11 @@ import cn.quantgroup.tool.monitor.metric.api.TechHttpClient;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.SerializationFeature;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import javax.net.ssl.SSLContext;
import org.apache.http.client.HttpRequestRetryHandler;
import org.apache.http.client.config.CookieSpecs;
import org.apache.http.config.Registry;
......@@ -34,12 +39,6 @@ import org.springframework.format.support.FormattingConversionService;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.web.filter.CharacterEncodingFilter;
import javax.net.ssl.SSLContext;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
/**
* Created by Miraculous on 15/7/12.
......
package cn.quantgroup.xyqb.config.http;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import org.hibernate.validator.HibernateValidator;
import org.springframework.context.annotation.Bean;
import org.springframework.format.FormatterRegistry;
......@@ -7,10 +10,6 @@ import org.springframework.stereotype.Component;
import org.springframework.validation.beanvalidation.MethodValidationPostProcessor;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
@Component
public class MyWebMvcConfigurer extends WebMvcConfigurerAdapter {
......
......@@ -2,7 +2,6 @@ package cn.quantgroup.xyqb.config.http;
import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.ObjectSerializer;
import java.lang.reflect.Type;
import java.sql.Timestamp;
......
package cn.quantgroup.xyqb.config.mq;
import org.springframework.amqp.core.*;
import org.springframework.amqp.core.AmqpAdmin;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitAdmin;
......
package cn.quantgroup.xyqb.config.mq;
import org.springframework.amqp.core.*;
import java.util.HashMap;
import java.util.Map;
import org.springframework.amqp.core.AmqpAdmin;
import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory.CacheMode;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
......@@ -12,9 +18,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.HashMap;
import java.util.Map;
/**
* Created by xuran on 2017/9/7.
*/
......
package cn.quantgroup.xyqb.config.sentry;
import cn.quantgroup.xyqb.exception.*;
import cn.quantgroup.xyqb.exception.AccessForbiddenException;
import cn.quantgroup.xyqb.exception.AppletException;
import cn.quantgroup.xyqb.exception.DataException;
import cn.quantgroup.xyqb.exception.PasswordErrorLimitException;
import cn.quantgroup.xyqb.exception.UserRegisterLoginException;
import cn.quantgroup.xyqb.exception.VerificationCodeErrorException;
import io.sentry.Sentry;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.core.Ordered;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* {@link HandlerExceptionResolver} implementation that will record any exception that a
* Spring {@link org.springframework.web.servlet.mvc.Controller} throws to Sentry. It then
......
......@@ -2,14 +2,13 @@ package cn.quantgroup.xyqb.config.sentry;
import cn.quantgroup.tech.util.TechEnvironment;
import io.sentry.Sentry;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerExceptionResolver;
import javax.annotation.PostConstruct;
/**
* 初始化Sentry配置
* @author renwc
......
package cn.quantgroup.xyqb.controller;
import cn.quantgroup.xyqb.exception.*;
import cn.quantgroup.xyqb.exception.AccessForbiddenException;
import cn.quantgroup.xyqb.exception.AppletException;
import cn.quantgroup.xyqb.exception.DataException;
import cn.quantgroup.xyqb.exception.PasswordErrorLimitException;
import cn.quantgroup.xyqb.exception.ResubmissionException;
import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.exception.UserQueryLogException;
import cn.quantgroup.xyqb.exception.UserRegisterLoginException;
import cn.quantgroup.xyqb.exception.VerificationCodeErrorException;
import cn.quantgroup.xyqb.exception.WechatRelateUserException;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.exception.ResubmissionException;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.validation.ValidationException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.jdbc.BadSqlGrammarException;
......@@ -12,15 +27,11 @@ import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
import org.springframework.web.bind.MethodArgumentNotValidException;
import org.springframework.web.bind.MissingServletRequestParameterException;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import javax.validation.ValidationException;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by Miraculous on 15/7/6.
......
package cn.quantgroup.xyqb.controller;
import static cn.quantgroup.xyqb.session.XyqbSessionContextHolder.getXSession;
import static cn.quantgroup.xyqb.session.XyqbSessionContextHolder.getXSessionFromRedis;
import static cn.quantgroup.xyqb.session.XyqbSessionContextHolder.getXSessionFromTenantRedis;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.session.SessionStruct;
import cn.quantgroup.xyqb.util.IpUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import static cn.quantgroup.xyqb.session.XyqbSessionContextHolder.getXSession;
import static cn.quantgroup.xyqb.session.XyqbSessionContextHolder.getXSessionFromRedis;
import static cn.quantgroup.xyqb.session.XyqbSessionContextHolder.getXSessionFromTenantRedis;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
/**
* Created by Miraculous on 15/7/5.
......
......@@ -4,12 +4,11 @@ import cn.quantgroup.xyqb.entity.UserAuthorized;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.UserAuthorizedParam;
import cn.quantgroup.xyqb.service.auth.IUserAuthorizedService;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author xufei on 2018/1/5.
*/
......
package cn.quantgroup.xyqb.controller.dust.wechatverify;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
/**
* Created by 11 on 2017/2/8.
*/
......
package cn.quantgroup.xyqb.controller.external;
import static cn.quantgroup.xyqb.Constants.VERIFICATION_CODE_FINITE_COUNT_NEW;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR;
import cn.quantgroup.user.enums.LoginType;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.aspect.accessable.IpValidator;
......@@ -10,10 +13,19 @@ import cn.quantgroup.xyqb.aspect.forbidden.AccessForbiddenValidator;
import cn.quantgroup.xyqb.aspect.limit.PasswordFreeAccessValidator;
import cn.quantgroup.xyqb.aspect.lock.PasswordErrorFiniteValidator;
import cn.quantgroup.xyqb.controller.IBaseController;
import cn.quantgroup.xyqb.entity.*;
import cn.quantgroup.xyqb.entity.LoginRecord;
import cn.quantgroup.xyqb.entity.Merchant;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserAttached;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.exception.VerificationCodeErrorException;
import cn.quantgroup.xyqb.model.*;
import cn.quantgroup.xyqb.model.AuthBean;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.LoginProperties;
import cn.quantgroup.xyqb.model.TokenExchange;
import cn.quantgroup.xyqb.model.UserBrief;
import cn.quantgroup.xyqb.model.UserModel;
import cn.quantgroup.xyqb.model.session.SessionStruct;
import cn.quantgroup.xyqb.model.session.SessionValue;
import cn.quantgroup.xyqb.service.captcha.IGeetestLogService;
......@@ -22,14 +34,30 @@ import cn.quantgroup.xyqb.service.merchant.IMerchantService;
import cn.quantgroup.xyqb.service.register.IUserRegisterService;
import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.service.user.*;
import cn.quantgroup.xyqb.service.user.ILockIpv4Service;
import cn.quantgroup.xyqb.service.user.ILoginRecordService;
import cn.quantgroup.xyqb.service.user.ITenantService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.service.user.UserCenterService;
import cn.quantgroup.xyqb.service.wechat.IWechatService;
import cn.quantgroup.xyqb.session.XyqbSessionContextHolder;
import cn.quantgroup.xyqb.util.*;
import cn.quantgroup.xyqb.util.BctyptPasswordUtil;
import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.util.PasswordUtil;
import cn.quantgroup.xyqb.util.TenantUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import io.swagger.annotations.ApiOperation;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang.StringUtils;
......@@ -42,14 +70,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.*;
import static cn.quantgroup.xyqb.Constants.VERIFICATION_CODE_FINITE_COUNT_NEW;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR;
/**
* Http服务接口:用户注册、登录、重置密码
* Created by FrankChow on 15/7/5.
......@@ -633,7 +653,6 @@ public class UserController implements IBaseController {
@AccessForbiddenValidator
@PasswordFreeAccessValidator
@RequestMapping("/center/index")
@ApiOperation(value = "用户中心首页", notes = "用户中心首页显示头像, 昵称, 姓名", httpMethod = "POST")
public JsonResult userCenterIndex() {
UserBrief brief = new UserBrief();
......
package cn.quantgroup.xyqb.controller.external;
import cn.quantgroup.xyqb.controller.IBaseController;
import cn.quantgroup.xyqb.controller.internal.user.InnerController;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.model.IdCardInfo;
......@@ -11,7 +10,7 @@ import cn.quantgroup.xyqb.service.auth.IIdCardService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.util.ValidationUtil;
import cn.quantgroup.xyqb.validator.ChineseName;
import io.swagger.annotations.ApiOperation;
import java.util.Objects;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
......@@ -20,9 +19,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.sql.Timestamp;
import java.util.Objects;
/**
* Created by Miraculous on 2017/1/3.
*/
......@@ -53,7 +49,6 @@ public class UserDetailController implements IBaseController {
*/
@Deprecated
@RequestMapping("/save")
@ApiOperation(httpMethod = "POST", value = "保存/更新用户实名信息")
public JsonResult saveUserDetail(String idNo,
@ChineseName @RequestParam String name) {
if (!ValidationUtil.validateChinese(name)) {
......
......@@ -20,6 +20,23 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.collections.CollectionUtils;
......@@ -28,21 +45,15 @@ import org.apache.commons.lang.StringUtils;
import org.apache.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.*;
/**
* Created by 11 on 2017/1/17.
*/
......
package cn.quantgroup.xyqb.controller.external;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.aspect.accessable.IpValidator;
import cn.quantgroup.xyqb.aspect.captcha.CaptchaFiniteValidator;
import cn.quantgroup.xyqb.aspect.captcha.LoginInterceptor;
import cn.quantgroup.xyqb.aspect.limit.PasswordFreeAccessValidator;
import cn.quantgroup.xyqb.aspect.lock.PasswordErrorFiniteValidator;
import cn.quantgroup.xyqb.controller.IBaseController;
import cn.quantgroup.xyqb.entity.Merchant;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserAttached;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.exception.VerificationCodeErrorException;
import cn.quantgroup.xyqb.model.*;
import cn.quantgroup.xyqb.model.session.SessionStruct;
import cn.quantgroup.xyqb.model.session.SessionValue;
import cn.quantgroup.xyqb.model.webchat.AccessTokenResponse;
import cn.quantgroup.xyqb.service.http.IHttpService;
import cn.quantgroup.xyqb.service.merchant.IMerchantService;
import cn.quantgroup.xyqb.service.register.IUserRegisterService;
import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.service.user.*;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.wechat.IWechatFollowService;
import cn.quantgroup.xyqb.service.wechat.IWechatService;
import cn.quantgroup.xyqb.session.XyqbSessionContextHolder;
import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.util.PasswordUtil;
import cn.quantgroup.xyqb.util.TenantUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import io.swagger.annotations.ApiOperation;
import javax.sql.DataSource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.sql.DataSource;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.sql.Connection;
import java.util.*;
import static cn.quantgroup.xyqb.Constants.VERIFICATION_CODE_FINITE_COUNT_NEW;
/**
* 微信公众号与企业微信关注情况
*
......@@ -68,12 +22,6 @@ public class WechatFollowController implements IBaseController {
@Autowired
private IWechatFollowService wechatFollowService;
@Autowired
private DataSource dataSource;
@Autowired
private JdbcTemplate jdbcTemplate;
@RequestMapping("/wechatFollowTask")
public JsonResult wechatFollowTask() {
wechatFollowService.executeTask();
......
......@@ -4,18 +4,6 @@ import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.aspect.captcha.CaptchaValidator;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.thirdparty.jcaptcha.AbstractManageableImageCaptchaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
......@@ -23,6 +11,15 @@ import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 类名称:ImgCaptchaController
......@@ -31,7 +28,6 @@ import java.util.concurrent.TimeUnit;
* @author 李宁
* @version 1.0.0 创建时间:15/11/17 11:49 修改人: 修改时间:15/11/17 11:49 修改备注:
*/
@Api(value = "/api", description = "叫Api, 实际上是图形验证码. 你说神奇不神奇...")
@Slf4j
@RestController
@RequestMapping("/api")
......@@ -53,7 +49,6 @@ public class ImageCaptchaController {
* 默认匹配 GET /captcha, 提供4位数字和字母混合图片验证码
*/
@RequestMapping(value = "/captcha")
@ApiOperation(value = "获取验证码", notes = "获取图形验证码接口, 会返回一个base64的图形验证码", httpMethod = "GET")
public JsonResult fetchCaptcha(HttpServletRequest request) {
String imageId = UUID.randomUUID().toString();
BufferedImage challenge = imageCaptchaService.getImageChallengeForID(Constants.IMAGE_CAPTCHA_KEY + imageId, request.getLocale());
......@@ -78,7 +73,6 @@ public class ImageCaptchaController {
*/
@CaptchaValidator
@RequestMapping("/verification_image_code")
@ApiOperation(value = "验证图形验证码", notes = "验证图形验证码", httpMethod = "POST")
public JsonResult verificationImageCode() {
return JsonResult.buildSuccessResult("", null);
}
......
......@@ -9,20 +9,18 @@ import cn.quantgroup.xyqb.service.captcha.IQuantgroupCaptchaService;
import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.util.PasswordUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import io.swagger.annotations.ApiOperation;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
/**
* @author xufei on 2018/1/30.
*/
......@@ -44,7 +42,6 @@ public class NewCaptchaController {
@RequestMapping(value = "/captcha/new")
@ApiOperation(value = "获取新图形验证码", notes = "获取新图形验证码", httpMethod = "POST")
public JsonResult getCaptcha(String phoneNo, String clientType, String settingType, HttpServletRequest request) {
String remoteIp = IpUtil.getRemoteIP(request);
log.info("获取验证码, phoneNo:{}, clientType:{}, ip:{}, verifyType-qg:{}", phoneNo, clientType, remoteIp, geetestClose);
......@@ -89,7 +86,6 @@ public class NewCaptchaController {
}
@RequestMapping(value = "/captcha/new/passwd")
@ApiOperation(value = "获取新图形验证码(账密)", notes = "获取新图形验证码(账密)", httpMethod = "POST")
public JsonResult getCaptchaPasswd(String phoneNo, String clientType, String settingType, HttpServletRequest request) {
String remoteIp = IpUtil.getRemoteIP(request);
log.info("获取验证码, phoneNo:{}, clientType:{}, ip:{}, verifyType-qg:{}", phoneNo, clientType, remoteIp, geetestClose);
......
......@@ -5,10 +5,11 @@ import cn.quantgroup.xyqb.controller.IBaseController;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.util.ValidationUtil;
import com.alibaba.fastjson.JSONObject;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
......@@ -16,10 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* 锁控制器
*
......
......@@ -11,6 +11,12 @@ import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.util.DateUtils;
import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -22,9 +28,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* Created by FrankChow on 15/7/6.
*/
......
......@@ -7,12 +7,11 @@ import cn.quantgroup.xyqb.model.session.LoginInfo;
import cn.quantgroup.xyqb.model.session.SessionStruct;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* 查询已登录信息
* Created by Miraculous on 2016/12/30.
......
......@@ -17,10 +17,29 @@ import cn.quantgroup.xyqb.util.IdcardValidator;
import cn.quantgroup.xyqb.util.ValidationUtil;
import cn.quantgroup.xyqb.util.encrypt.Md5Util;
import cn.quantgroup.xyqb.util.encrypt.Rsa;
import com.google.gson.*;
import io.swagger.annotations.ApiOperation;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
......@@ -30,13 +49,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.util.*;
/**
* Created by zenglibin on 17/06/13.
*/
......@@ -71,7 +83,6 @@ public class UserQueryLogController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/259
*/
@RequestMapping("/queryLog")
@ApiOperation(value = "给运营系统提供的查询查询记录的", notes = "给运营系统提供的查询查询记录的", httpMethod = "POST")
public JsonResult queryLog(HttpServletRequest request, @RequestParam(required = false) String beginDate, @RequestParam(required = false) String endDate, Integer pageId, Integer pageSize) {
log.info("查询日期:beginDate{},endDate{}", beginDate, endDate);
String token = request.getHeader(Constants.X_AUTH_TOKEN);
......@@ -128,7 +139,6 @@ public class UserQueryLogController {
*/
@AccessForbiddenValidator
@RequestMapping("/queryUserInfo")
@ApiOperation(value = "给运营系统提供的查询用户信息的接口", notes = "给运营系统提供的查询用户信息的接口", httpMethod = "POST")
public JsonResult queryForResult(HttpServletRequest request, String key, String keyValues, String columns, Integer pageId, Integer pageSize) {
String token = request.getHeader(Constants.X_AUTH_TOKEN);
String userName = checkUserToken(token);
......@@ -269,7 +279,6 @@ public class UserQueryLogController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/257
*/
@RequestMapping("/exportUserInfo")
@ApiOperation(value = "给运营系统提供的导出用户信息的接口", notes = "给运营系统提供的导出用户信息的接口", httpMethod = "POST")
public JsonResult exportExcel(final HttpServletResponse response, HttpServletRequest request, String key, String keyValues, String columns) {
String token = request.getHeader(Constants.X_AUTH_TOKEN);
checkUserToken(token);
......
package cn.quantgroup.xyqb.controller.internal.user;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_PASSWORD_ERROR;
import cn.quantgroup.user.enums.LoginType;
import cn.quantgroup.xyqb.aspect.accessable.IpValidator;
import cn.quantgroup.xyqb.aspect.captcha.LoginInterceptor;
......@@ -23,7 +26,8 @@ import cn.quantgroup.xyqb.util.TenantUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import com.sensorsdata.analytics.javasdk.ISensorsAnalytics;
import com.sensorsdata.analytics.javasdk.bean.EventRecord;
import io.swagger.annotations.ApiOperation;
import javax.persistence.PersistenceException;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -34,12 +38,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.persistence.PersistenceException;
import javax.servlet.http.HttpServletRequest;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_PASSWORD_ERROR;
/**
* 第三方用户免密登录
*
......@@ -150,7 +148,6 @@ public class AppController implements IBaseController {
@Deprecated
@IpValidator
@RequestMapping("/login")
@ApiOperation(value = "App登陆", notes = "App登陆", httpMethod = "POST")
public JsonResult login(
String phoneNo,
String idNo, String name, String key,
......@@ -205,7 +202,6 @@ public class AppController implements IBaseController {
*/
@IpValidator
@RequestMapping("/login_super")
@ApiOperation(value = "免密登陆, 新手机号还自动注册", notes = "免密登陆, 新手机号还自动注册", httpMethod = "POST")
public JsonResult loginSuper(
String phoneNo,
String idNo, String name, String key,
......@@ -322,7 +318,6 @@ public class AppController implements IBaseController {
@LoginInterceptor
@IpValidator
@RequestMapping("/login2")
@ApiOperation(value = "免密登陆, 新手机号不自动注册", notes = "免密登陆, 新手机号不自动注册", httpMethod = "POST")
public JsonResult login2(
String phoneNo,
@RequestParam(required = false, defaultValue = "1") Long registerFrom,
......
package cn.quantgroup.xyqb.controller.internal.user;
import cn.quantgroup.tech.db.DSType;
import cn.quantgroup.tech.db.TargetDataSource;
import cn.quantgroup.user.enums.*;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR;
import cn.quantgroup.user.enums.BizType;
import cn.quantgroup.user.enums.EducationEnum;
import cn.quantgroup.user.enums.IncomeEnum;
import cn.quantgroup.user.enums.IncomeRangeEnum;
import cn.quantgroup.user.enums.MaritalStatus;
import cn.quantgroup.user.enums.OccupationEnum;
import cn.quantgroup.user.enums.Relation;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.aspect.accessable.IpValidator;
import cn.quantgroup.xyqb.aspect.forbidden.AccessForbiddenValidator;
import cn.quantgroup.xyqb.controller.IBaseController;
import cn.quantgroup.xyqb.controller.internal.user.resp.UserFullResp;
import cn.quantgroup.xyqb.entity.*;
import cn.quantgroup.xyqb.entity.Address;
import cn.quantgroup.xyqb.entity.Contact;
import cn.quantgroup.xyqb.entity.Merchant;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserBtRegister;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.entity.UserExtInfo;
import cn.quantgroup.xyqb.entity.UserSpouse;
import cn.quantgroup.xyqb.entity.WechatUserInfo;
import cn.quantgroup.xyqb.event.DisableActiveEvent;
import cn.quantgroup.xyqb.event.UserExtInfoSaveEvent;
import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.model.AddressRet;
import cn.quantgroup.xyqb.model.ContactInfo;
import cn.quantgroup.xyqb.model.ContactRet;
import cn.quantgroup.xyqb.model.Gender;
import cn.quantgroup.xyqb.model.IdCardInfo;
import cn.quantgroup.xyqb.model.IdType;
import cn.quantgroup.xyqb.model.*;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.Tuple;
import cn.quantgroup.xyqb.model.UserAssociation;
import cn.quantgroup.xyqb.model.UserAssociationModel;
import cn.quantgroup.xyqb.model.UserDetailRet;
import cn.quantgroup.xyqb.model.UserExtInfoRet;
import cn.quantgroup.xyqb.model.UserFullInfo;
import cn.quantgroup.xyqb.model.UserInfo;
import cn.quantgroup.xyqb.model.UserRet;
import cn.quantgroup.xyqb.model.UserSpouseRet;
import cn.quantgroup.xyqb.model.UserStatistics;
import cn.quantgroup.xyqb.service.api.IUserApiService;
import cn.quantgroup.xyqb.service.auth.IIdCardService;
import cn.quantgroup.xyqb.service.merchant.IMerchantService;
......@@ -22,10 +50,25 @@ import cn.quantgroup.xyqb.service.register.IUserDeregisterService;
import cn.quantgroup.xyqb.service.register.IUserRegisterService;
import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.service.user.*;
import cn.quantgroup.xyqb.service.user.CleanDataService;
import cn.quantgroup.xyqb.service.user.IAddressService;
import cn.quantgroup.xyqb.service.user.IContactService;
import cn.quantgroup.xyqb.service.user.IOauthLoginInfoService;
import cn.quantgroup.xyqb.service.user.ITenantService;
import cn.quantgroup.xyqb.service.user.IUserBtRegisterService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.IUserExtInfoService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.service.user.IUserSpouseService;
import cn.quantgroup.xyqb.service.user.vo.UserDetailVO;
import cn.quantgroup.xyqb.service.wechat.IWechatService;
import cn.quantgroup.xyqb.util.*;
import cn.quantgroup.xyqb.util.AesUtil;
import cn.quantgroup.xyqb.util.BctyptPasswordUtil;
import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.util.MqUtils;
import cn.quantgroup.xyqb.util.PasswordUtil;
import cn.quantgroup.xyqb.util.TenantUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import cn.quantgroup.xyqb.util.encrypt.Md5Util;
import cn.quantgroup.xyqb.validator.ChineseName;
import com.alibaba.fastjson.JSON;
......@@ -33,10 +76,19 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.google.common.base.MoreObjects;
import com.google.common.collect.Maps;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
......@@ -46,18 +98,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
......@@ -129,7 +176,6 @@ public class InnerController implements IBaseController {
@Deprecated
@IpValidator
@RequestMapping("/fetchUuid")
@ApiOperation(httpMethod = "POST", value = "根据手机号或身份证号查询用户UUID")
public JsonResult fetchUuid(String phoneNo, String idNo) {
String uuid = userService.findUuid(phoneNo, idNo);
log.info("根据手机号或身份证号查询用户UUID,phoneNo:{},idNo:{},uuid:{}", phoneNo, idNo, uuid);
......@@ -143,7 +189,6 @@ public class InnerController implements IBaseController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/215
*/
@RequestMapping("/user/search/phoneNo")
@ApiOperation(httpMethod = "GET", value = "根据手机号查询用户信息")
public JsonResult findByPhoneNo(String phoneNo, Integer tenantId) {
User user = userService.findByPhoneInDb(phoneNo);
if (user == null) {
......@@ -164,7 +209,6 @@ public class InnerController implements IBaseController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/219
*/
@RequestMapping("/user/search/uuid")
@ApiOperation(httpMethod = "POST", value = "根据UUID查询用户信息")
public JsonResult findByUuidInfo(String uuid, Integer tenantId) {
User user = userService.findByUuidWithCache(uuid);
if (user == null) {
......@@ -188,7 +232,6 @@ public class InnerController implements IBaseController {
*/
@Deprecated
@GetMapping("/user/search/hash")
@ApiOperation(httpMethod = "GET", value = "根据md5(手机号)或md5(身份证号)查询用户信息")
public JsonResult findByUuid(@RequestParam String md5Value,
@RequestParam(defaultValue = "1") Integer type) {
if (md5Value == null) {
......@@ -211,7 +254,6 @@ public class InnerController implements IBaseController {
*/
//与旧的区别就是新的如果返回多个的时候只取最新的
@GetMapping("/user/search/hash2")
@ApiOperation(httpMethod = "GET", value = "根据md5(手机号)或md5(身份证号)查询用户信息")
public JsonResult findByHash(@RequestParam String md5Value,
@RequestParam(defaultValue = "1") Integer type,
@RequestParam(required = false) Integer tenantId) {
......@@ -241,7 +283,6 @@ public class InnerController implements IBaseController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/229
*/
@RequestMapping("/userInfo/search/uuid")
@ApiOperation(httpMethod = "POST", value = "根据UUID查询用户详细信息")
public JsonResult findUserInfoByUuid(@RequestParam(value = "uuid") String uuid) {
log.info("需要查询的用户uuidid, uuid:" + uuid);
......@@ -265,7 +306,6 @@ public class InnerController implements IBaseController {
*/
@AccessForbiddenValidator
@RequestMapping("/userInfo/search/phone")
@ApiOperation(httpMethod = "POST", value = "根据手机号查询用户详细信息")
public JsonResult findUserInfoByPhone(@RequestParam(value = "phone") String phone) {
log.info("需要查询的用户phone, phone:" + phone);
......@@ -288,7 +328,6 @@ public class InnerController implements IBaseController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/205
*/
@RequestMapping("/user/getPhoneByUserIds")
@ApiOperation(httpMethod = "POST", value = "根据用户 ID 批量查询用户信息")
public JsonResult findByIds(@RequestParam(value = "userIds") String userIdsString, @RequestParam(required = false) Integer tenantId) {
log.info("批量查询用户的手机号列表, userIdsString:" + userIdsString + ", tenantId:" + tenantId);
//默认羊小咩租户
......@@ -312,7 +351,6 @@ public class InnerController implements IBaseController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/211
*/
@RequestMapping("/user/save")
@ApiOperation(httpMethod = "POST", value = "注册用户")
public JsonResult saveUser(String phoneNo, Long registeredFrom, Integer tenantId) {
log.info("保存用户,phoneNo:{},registeredFrom:{}", phoneNo, registeredFrom);
//参数验证
......@@ -353,7 +391,6 @@ public class InnerController implements IBaseController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/285
*/
@RequestMapping("/user_detail/save")
@ApiOperation(httpMethod = "POST", value = "填写用户详情")
public JsonResult saveUserDetail(@Min(value = 1, message = "用户id为空") @RequestParam Long userId,
String phoneNo,
@ChineseName @RequestParam String name,
......@@ -426,7 +463,6 @@ public class InnerController implements IBaseController {
*/
@AccessForbiddenValidator
@RequestMapping("/user_detail/search/userId")
@ApiOperation(httpMethod = "POST", value = "查询用户详情")
public JsonResult findUserDetailByUserId(Long userId, Integer tenantId) {
UserDetail userDetail = null;
// 增加容错性,防备DB中存在的脏数据触发异常
......@@ -450,7 +486,6 @@ public class InnerController implements IBaseController {
* @yapi http://yapi.quantgroups.com/project/17/interface/api/217
*/
@RequestMapping("/user/search/userId")
@ApiOperation(httpMethod = "POST", value = "查询用户基本信息")
public JsonResult findUserByUserId(Long userId, Integer tenantId) {
User user = userService.findById(userId);
if (user != null) {
......@@ -472,7 +507,6 @@ public class InnerController implements IBaseController {
*/
@AccessForbiddenValidator
@RequestMapping("/user_detail/search/phone")
@ApiOperation(httpMethod = "POST", value = "查询用户详情")
public JsonResult findUserDetailByPhone(String phoneNo, Integer tenantId) {
UserDetail userDetail = null;
userDetail = userDetailService.findSlaveByPhoneNo(phoneNo);
......@@ -496,7 +530,6 @@ public class InnerController implements IBaseController {
* @return
*/
@RequestMapping("/user_full_info/search/phone")
@ApiOperation(httpMethod = "POST", value = "查询用户全部信息(user+detail)")
public JsonResult findUserFullInfoByPhone(String phoneNo) {
if (StringUtils.isBlank(phoneNo)) {
log.warn("[findUserFullInfoByPhone]phoneNo为空");
......@@ -517,7 +550,6 @@ public class InnerController implements IBaseController {
* @return
*/
@RequestMapping("/user_full_info/search/uuid")
@ApiOperation(httpMethod = "POST", value = "查询用户全部信息(user+detail)")
public JsonResult findUserFullInfoByUUuid(String uuid) {
if (StringUtils.isBlank(uuid)) {
log.warn("[findUserFullInfoByUUuid]uuid为空");
......@@ -540,7 +572,6 @@ public class InnerController implements IBaseController {
* @return
*/
@RequestMapping("/user_detail/update")
@ApiOperation(httpMethod = "POST", value = "更新用户详情")
public JsonResult updateUserDetail(String qq, String email, Long userId) {
if (Objects.isNull(userId) || userId == 0L) {
return JsonResult.buildErrorStateResult("userId为空", null);
......@@ -555,7 +586,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/user_detail/update/qq")
@ApiOperation(httpMethod = "POST", value = "更新用户QQ")
public JsonResult updateUserQQ(String qq, Long userId) {
if (StringUtils.isEmpty(qq) || userId == null || userId == 0L) {
return JsonResult.buildErrorStateResult("参数校验失败,qq或用户id为空", null);
......@@ -565,7 +595,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/contact/search/user_id")
@ApiOperation(httpMethod = "POST", value = "查询用户联系人")
public JsonResult findContactsByUserId(Long userId) {
if (null == userId) {
return JsonResult.buildErrorStateResult(null, null);
......@@ -578,7 +607,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/contact/save/contacts")
@ApiOperation(httpMethod = "POST", value = "保存联系人")
public JsonResult save2Contact(Long userId, @RequestParam(value = "contacts") String contactsStr) {
if (Objects.isNull(userId) || StringUtils.isBlank(contactsStr)) {
log.warn("保存用户联系人:参数不完整:userId:{}, contacts:{}", userId, contactsStr);
......@@ -602,7 +630,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/contact/update/contact")
@ApiOperation(httpMethod = "POST", value = "更新用户联系人")
public JsonResult updateContact(@RequestParam Long contactId, @RequestParam(required = false) String name,
@RequestParam(required = false) String phoneNo,
@RequestParam(required = false) Relation relation, String key,
......@@ -635,7 +662,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/address/search/user_id")
@ApiOperation(httpMethod = "POST", value = "查询用户地址")
public JsonResult findAddressByUserId(Long userId) {
if (userId == null) {
return JsonResult.buildErrorStateResult(null, null);
......@@ -648,7 +674,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/address/save")
@ApiOperation(httpMethod = "POST", value = "保存用户地址")
public JsonResult saveAddress(
Long userId, Long provinceCode, Long cityCode, String city,
Long districtCode, String district, String address, String province) {
......@@ -675,7 +700,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/user_ext_info/update")
@ApiOperation(httpMethod = "POST", value = "更新用户扩展信息")
public JsonResult updateMarryStatus(
Long userId, IncomeEnum incomeEnum, IncomeRangeEnum incomeRangeEnum,
OccupationEnum occupationEnum, EducationEnum educationEnum, Boolean hasCar,
......@@ -738,8 +762,6 @@ public class InnerController implements IBaseController {
*/
@AccessForbiddenValidator
@RequestMapping("/user_detail/search_list")
@ApiOperation(httpMethod = "POST", value = "按照姓名、份证号或手机号查询用户实名信息 - 精确查询,供客服用,不限制入参正确性")
@TargetDataSource(type = DSType.SLAVE)
public JsonResult<List<UserDetailVO>> searchUserDetailList(String name, String phoneNo, String idNo) {
log.info("searchUserDetailList ,param.name:{},phone:{},idNo:{},ip:{}", name, phoneNo, idNo, getIp());
if (StringUtils.isBlank(name) && StringUtils.isBlank(phoneNo) && StringUtils.isBlank(idNo)) {
......@@ -757,12 +779,10 @@ public class InnerController implements IBaseController {
* @param userName - 用户姓名
* @return JsonResult<List < UserDetail>>
*/
@ApiOperation(httpMethod = "POST", value = "按照身份证号和手机号查询用户实名信息查询 - 模糊查询")
@RequestMapping("/user_detail/fuzzyQuery")
@TargetDataSource(type = DSType.SLAVE)
public JsonResult<List<UserDetail>> fuzzyQueryUserDetailList(@ApiParam(value = "手机号") String phoneNo,
@ApiParam(value = "身份证号") String idNo,
@ApiParam(value = "用户姓名") String userName) {
public JsonResult<List<UserDetail>> fuzzyQueryUserDetailList(String phoneNo,
String idNo,
String userName) {
log.info("fuzzyQueryUserDetailList, phone:{},idNo:{},userName:{},ip:{}", phoneNo, idNo, userName, getIp());
if (StringUtils.isBlank(phoneNo) && StringUtils.isBlank(idNo)) {
return JsonResult.buildErrorStateResult("查询条件不能为空", null);
......@@ -793,7 +813,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/user_ext_info/search/user_id")
@ApiOperation(httpMethod = "POST", value = "查询用户扩展信息")
public JsonResult searchUserExtInfoByUserId(Long userId) {
if (userId == null) {
return JsonResult.buildErrorStateResult("userId不能为空", null);
......@@ -806,7 +825,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/user/query/openId")
@ApiOperation(httpMethod = "POST", value = "查询微信openId")
public JsonResult queryOpenIdByUserId(Long userId) {
if (userId == null) {
return JsonResult.buildErrorStateResult("userId不能为空", null);
......@@ -832,7 +850,6 @@ public class InnerController implements IBaseController {
* }
*/
@RequestMapping("/user-association/search")
@ApiOperation(httpMethod = "POST", value = "查询用户user+userDetail")
public JsonResult findUserAssociationModel(Long id, String phoneNo, String uuid) {
User user = null;
if (!Objects.isNull(id) && id > 0) {
......@@ -920,15 +937,9 @@ public class InnerController implements IBaseController {
return bean;
}
@ApiResponses({
@ApiResponse(code = HttpStatus.SC_OK, message = "Nice!", responseContainer = "UserAssociationModel = {Long id, String uuid, String phoneNo, String idNo, String name, String gender, String marryStatus, String educationEnum, String occupationEnum, String qq, Long registerFrom, Long merchantId, List<AddressModel> addressList, List<ContactModel> contactList}"),
@ApiResponse(code = HttpStatus.SC_BAD_REQUEST, message = "Invalid params supplied", response = cn.quantgroup.xyqb.model.ApiResponse.class),
@ApiResponse(code = HttpStatus.SC_NOT_FOUND, message = "User not found", response = cn.quantgroup.xyqb.model.ApiResponse.class)
})
@ApiOperation(notes = "用户全量信息查询接口", value = "用户全量信息查询接口", nickname = "findUserAssociationModel")
@RequestMapping(path = "/user-association/search/userId", method = {RequestMethod.GET, RequestMethod.POST})
public JsonResult findUserAssociationModelByUserId(@ApiParam(value = "用户ID", required = false) @RequestParam(name = "userId", required = false) Long userId,
@ApiParam(value = "用户注册手机号", required = false) @RequestParam(name = "phoneNo", required = false) String phoneNo) {
public JsonResult findUserAssociationModelByUserId( @RequestParam(name = "userId", required = false) Long userId,
@RequestParam(name = "phoneNo", required = false) String phoneNo) {
boolean userIdOk = Objects.nonNull(userId) && userId > 0;
boolean phoneNoOk = ValidationUtil.validatePhoneNo(phoneNo);
if (!userIdOk && !phoneNoOk) {
......@@ -1083,7 +1094,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/user/spouse/save")
@ApiOperation(value = "保存配偶信息", httpMethod = "POST")
public JsonResult saveSpouse(Long userId, MaritalStatus status, String spousePhone, String spouseName) {
if (userId == null || userId == 0) {
return JsonResult.buildErrorStateResult("用户不能为空", null);
......@@ -1108,7 +1118,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/user/spouse/findByUserId")
@ApiOperation(value = "查询配偶信息", httpMethod = "POST")
public JsonResult querySpouse(Long userId) {
if (userId == null || userId == 0) {
return JsonResult.buildErrorStateResult("用户不能为空", null);
......@@ -1122,7 +1131,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/user/findByPhones")
@ApiOperation(value = "根据手机号查询用户信息", httpMethod = "POST")
public JsonResult getUserIdByPhones(@RequestParam("userPhones") String userPhones) {
if (StringUtils.isBlank(userPhones)) {
return JsonResult.buildErrorStateResult("传入用户手机号不可为空", null);
......@@ -1153,8 +1161,6 @@ public class InnerController implements IBaseController {
* @return
*/
@RequestMapping("/uuid/findByPhones")
@ApiOperation(value = "根据手机号批量查询UUID", httpMethod = "POST")
@TargetDataSource(type = DSType.SLAVE)
public JsonResult getUuidsByPhones(@RequestParam("userPhones") String userPhones) {
if (StringUtils.isBlank(userPhones)) {
return JsonResult.buildErrorStateResult("传入用户手机号不可为空", null);
......@@ -1187,7 +1193,6 @@ public class InnerController implements IBaseController {
* 保存用户信息,其中地址信息和联系人信息为非必要条件;注意:如果同时提供了province和address字段则需要保证Address的完整
*/
@RequestMapping("/user/save_multi")
@ApiOperation(value = "保存多种用户信息", httpMethod = "POST")
public JsonResult saveMulti(String registeredFrom, String channelId, String phoneNo, String name, String idNo, String provinceCode, String province, String cityCode, String city, String districtCode, String district, String address, String contacts, @RequestParam(defaultValue = "0", required = false) Long btRegisterChannelId) {
if (!NumberUtils.isDigits(registeredFrom)) {
return JsonResult.buildErrorStateResult("注册渠道异常.", null);
......@@ -1266,7 +1271,6 @@ public class InnerController implements IBaseController {
//根据日期时间段查询新注册用户信息并返回
@RequestMapping("/contract/queryRegisterUsers")
@ApiOperation(value = "根据日期时间段查询新注册用户信息并返回", httpMethod = "POST")
public JsonResult findRegisterUserByTime(String beginTime, String endTime) {
if (null == beginTime || endTime == null) {
return JsonResult.buildErrorStateResult(null, null);
......@@ -1285,7 +1289,6 @@ public class InnerController implements IBaseController {
* @return
*/
@RequestMapping("/verifyPhoneAndCode")
@ApiOperation(value = "验证手机号和验证码是否匹配", httpMethod = "POST")
public JsonResult verifyPhoneAndCode(
@RequestParam String phoneNo, @RequestParam String verificationCode,
@RequestParam String appChannel,
......@@ -1335,7 +1338,6 @@ public class InnerController implements IBaseController {
}
@RequestMapping("/login")
@ApiOperation(value = "登陆....怎么又一个...", httpMethod = "POST")
public JsonResult login(@RequestParam String phoneNo, @RequestParam String password) {
User user = checkPhoneNoAndPassword(phoneNo, password);
if (user == null) {
......@@ -1393,7 +1395,6 @@ public class InnerController implements IBaseController {
* @return
*/
@RequestMapping("/user/enable")
@ApiOperation(value = "查看用户是否存在,存在则返回id,uuid", httpMethod = "POST")
public JsonResult isEnable(String phoneNo) {
boolean flag = false;
Map validMap = Maps.newHashMap();
......@@ -1415,7 +1416,6 @@ public class InnerController implements IBaseController {
* @param userId
* @return
*/
@ApiOperation(notes = "激活/启用 用户 - 供内部系统免密调用", value = "激活/启用 用户", nickname = "activeUser")
@RequestMapping(path = "/user/active", method = RequestMethod.POST)
public JsonResult activeUser(Long userId) {
boolean flushed = flushUserStatus(userId, true);
......@@ -1430,7 +1430,6 @@ public class InnerController implements IBaseController {
* @param userId
* @return
*/
@ApiOperation(notes = "注销/禁用 用户 - 供内部系统免密调用", value = "注销/禁用 用户", nickname = "forbiddenUser")
@RequestMapping(path = "/user/disable", method = RequestMethod.POST)
public JsonResult forbiddenUser(Long userId) {
boolean flushed = flushUserStatus(userId, false);
......@@ -1446,7 +1445,6 @@ public class InnerController implements IBaseController {
* @param idNo - 身份证号
* @param name - 姓名
*/
@ApiOperation(notes = "重置用户实名信息接口 - 供内部系统免密调用", value = "重置用户实名信息", nickname = "resetName")
@RequestMapping(path = "/userDetail/reset/{userId}", method = RequestMethod.POST)
public JsonResult resetName(@PathVariable("userId") Long userId, @RequestParam("name") String name, @RequestParam("idNo") String idNo) {
log.info("重置用户实名信息 userId:{},name:{},idNo:{}", userId, name, idNo);
......@@ -1471,7 +1469,6 @@ public class InnerController implements IBaseController {
* 重置密码接口
* -- 供内部系统免密调用
*/
@ApiOperation(notes = "重置密码接口 - 供内部系统免密调用", value = "重置密码", nickname = "resetPassword")
@RequestMapping(path = "/user/password/reset", method = RequestMethod.POST)
public JsonResult resetPassword(@RequestParam("phone") String phone, @RequestParam(required = false) String password) {
if (ValidationUtil.validatePhoneNo(phone)) {
......@@ -1627,7 +1624,6 @@ public class InnerController implements IBaseController {
* @param userId 用户id
* @return 销户结果
*/
@ApiOperation(value = "注销用户", httpMethod = "GET", notes="注销用户")
@GetMapping("/user/delete/{userId}")
public JsonResult<?> deregister(@NotNull @PathVariable("userId") Long userId) {
......
package cn.quantgroup.xyqb.controller.internal.user;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import cn.quantgroup.xyqb.aspect.accessable.IpValidator;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
......@@ -29,6 +12,17 @@ import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.ValidationUtil;
import cn.quantgroup.xyqb.validator.ChineseName;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 同步用户数据,第三方模块访问时
......@@ -47,7 +41,6 @@ public class SyncUserController {
private IIdCardService idCardService;
@RequestMapping("/save_detail")
@ApiOperation(httpMethod = "POST", value = "保存/更新用户实名信息")
public JsonResult saveUserDetail(String key, String phoneNo, String idNo,
@ChineseName @RequestParam String name) {
if (!Objects.equals(KEY, key)) {
......@@ -104,7 +97,6 @@ public class SyncUserController {
}
@RequestMapping("/user")
@ApiOperation(httpMethod = "POST", value = "查询用户详情")
public JsonResult fetchUser(String key, String phoneNo) {
if (!Objects.equals(KEY, key) || !ValidationUtil.validatePhoneNo(phoneNo)) {
return JsonResult.buildErrorStateResult(null, null);
......@@ -142,7 +134,6 @@ public class SyncUserController {
*/
@IpValidator
@RequestMapping("/listByUserIds")
@ApiOperation(httpMethod = "POST", value = "根据用户主键批量获取用户实名信息")
public JsonResult listByUserIds(String userIds) {
// 过滤掉合法的多个数值串间的空白值
userIds = ValidationUtil.filterNumbers(userIds);
......
......@@ -11,16 +11,17 @@ import cn.quantgroup.xyqb.service.sms.ISmsService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.session.XyqbSessionContextHolder;
import cn.quantgroup.xyqb.util.ValidationUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import java.util.Objects;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Objects;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by FrankChow on 15/12/16.
......@@ -63,12 +64,10 @@ public class UserApiController {
* @param prolong - 是否延续生命期,可选参数,默认为: false - 不延续
* @return
*/
@ApiOperation(notes = "检查token是否有效,如果有效,可选择是否延续生命期(延续后有效期24Hour)", value = "Check token and then prolong session", nickname = "checkToken")
@IpValidator
@RequestMapping(value = "/valid/{token}", method = RequestMethod.POST)
public JsonResult checkToken(@ApiParam(value = "sid,session的id", required = true)
public JsonResult checkToken(
@PathVariable("token") String token,
@ApiParam(value = "是否延续生命期,可选参数,默认为: false - 不延续")
@RequestParam(name = "prolong", required = false, defaultValue = "false") Boolean prolong,
@RequestParam(name = "prolongTime", required = false, defaultValue = "86400") Long prolongTime) {
if (Objects.isNull(token) || !ValidationUtil.validateToken(token)) {
......
package cn.quantgroup.xyqb.controller.internal.user.center;
import cn.quantgroup.user.enums.*;
import cn.quantgroup.user.enums.BizType;
import cn.quantgroup.user.enums.EducationEnum;
import cn.quantgroup.user.enums.IncomeRangeEnum;
import cn.quantgroup.user.enums.MaritalStatus;
import cn.quantgroup.user.enums.OccupationEnum;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.aspect.forbidden.AccessForbiddenValidator;
import cn.quantgroup.xyqb.aspect.limit.PasswordFreeAccessValidator;
import cn.quantgroup.xyqb.aspect.lock.RedisLock;
import cn.quantgroup.xyqb.entity.*;
import cn.quantgroup.xyqb.entity.Address;
import cn.quantgroup.xyqb.entity.Contact;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserAttached;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.entity.UserExtInfo;
import cn.quantgroup.xyqb.event.UserExtInfoSaveEvent;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.user.*;
import cn.quantgroup.xyqb.service.user.IAddressService;
import cn.quantgroup.xyqb.service.user.IContactService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.IUserExtInfoService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.service.user.UserCenterService;
import cn.quantgroup.xyqb.util.TenantUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import io.swagger.annotations.ApiOperation;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* Created by 11 on 2017/3/22.
......@@ -86,7 +104,6 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/queryNick")
@ApiOperation(value = "查询昵称", notes = "查询用户昵称", httpMethod = "POST")
public JsonResult queryUserNick(String phoneNo) {
if (StringUtils.isEmpty(phoneNo)) {
log.error("手机号为空,phoneNo:{}", phoneNo);
......@@ -112,7 +129,6 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/saveNick")
@ApiOperation(value = "保存昵称", notes = "保存用户昵称", httpMethod = "POST")
public JsonResult saveUserNick(String phoneNo, String nick) {
if (StringUtils.isEmpty(phoneNo)) {
log.error("手机号为空,phoneNo:{}", phoneNo);
......@@ -127,7 +143,6 @@ public class UserCenterController {
}
@RequestMapping("/kdsp/saveNick")
@ApiOperation(value = "保存昵称", notes = "保存用户昵称", httpMethod = "POST")
public JsonResult saveUserNickForKdsp(Long userId, String nick) {
if (null == userId || userId == 0L) {
return JsonResult.buildErrorStateResult("该用户不存在", null);
......@@ -137,7 +152,6 @@ public class UserCenterController {
}
@RequestMapping("/kdsp/save/avatar")
@ApiOperation(value = "保存头像", notes = "保存用户头像", httpMethod = "POST")
public JsonResult saveUserAvatarAddrForKdsp(Long userId, String avatarUrl) {
if (StringUtils.isBlank(avatarUrl)) {
log.error("参数不合法:avatarUrl:{}}", avatarUrl );
......@@ -162,7 +176,6 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/save/avatar")
@ApiOperation(value = "保存头像", notes = "保存用户头像", httpMethod = "POST")
public JsonResult SaveUserAvatarAddr(String phoneNo, String avatarUrl) {
if (StringUtils.isBlank(avatarUrl) || StringUtils.isBlank(phoneNo)) {
log.error("参数不合法:avatarUrl:{}, phoneNo:{}", avatarUrl, phoneNo);
......@@ -190,7 +203,6 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/query/verified")
@ApiOperation(value = "查询用户是否实名认证", notes = "查询用户是否实名认证", httpMethod = "POST")
public JsonResult queryVerified(String phoneNo) {
if (StringUtils.isEmpty(phoneNo)) {
log.error("手机号为空,phoneNo:{}", phoneNo);
......@@ -217,7 +229,6 @@ public class UserCenterController {
@AccessForbiddenValidator
@PasswordFreeAccessValidator
@RequestMapping("/personalData")
@ApiOperation(value = "查询个人资料信息", notes = "查询个人资料信息", httpMethod = "POST")
public JsonResult personalData(String phoneNo) {
if (StringUtils.isBlank(phoneNo)) {
log.error("手机号为空,phoneNo:{}", phoneNo);
......@@ -260,7 +271,6 @@ public class UserCenterController {
*/
@AccessForbiddenValidator
@RequestMapping("/contacts/save")
@ApiOperation(value = "保存用户联系人", notes = "保存用户联系人", httpMethod = "POST")
public JsonResult saveUserContact(String phoneNo, String contactJson) {
if (StringUtils.isEmpty(phoneNo)) {
log.error("保存联系人,参数错误. phoneNo:{}", phoneNo);
......@@ -302,7 +312,6 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/address/save")
@ApiOperation(value = "保存用户地址", notes = "保存用户地址", httpMethod = "POST")
public JsonResult saveUserAddress(String phoneNo, String province, Long provinceCode, String city, Long cityCode, String address,
Long districtCode, String district) {
log.info("保存用户地址信息, phoneNo:{}, province:{}, provinceCode:{}, city:{}, cityCode:{},district:{}, address:{}", phoneNo, province, provinceCode, city, cityCode, district, address);
......@@ -338,7 +347,6 @@ public class UserCenterController {
* @return
*/
@RequestMapping("/searchAddress/phoneNo")
@ApiOperation(value = "查询用户地址", notes = "查询用户地址", httpMethod = "POST")
public JsonResult searchUserAddress(String phoneNo) {
if (StringUtils.isEmpty(phoneNo)) {
return JsonResult.buildErrorStateResult(null, null);
......@@ -360,7 +368,6 @@ public class UserCenterController {
*/
@AccessForbiddenValidator
@RequestMapping("/searchContacts/phoneNo")
@ApiOperation(value = "查询用户联系人", notes = "查询用户联系人", httpMethod = "POST")
public JsonResult searchUserContacts(String phoneNo) {
if (StringUtils.isEmpty(phoneNo)) {
return JsonResult.buildErrorStateResult(null, null);
......@@ -386,7 +393,6 @@ public class UserCenterController {
@AccessForbiddenValidator
@RequestMapping("/save/userExtInfo")
@RedisLock(prefix = "lock:user:ext:", key = "#this[0]")
@ApiOperation(value = "保存用户经济学历等信息", notes = "保存用户经济学历等信息", httpMethod = "POST")
public JsonResult saveUserExtInfo(String phoneNo, EducationEnum educationEnum, MaritalStatus maritalStatus, IncomeRangeEnum incomeRangeEnum, OccupationEnum occupationEnum) {
if (StringUtils.isEmpty(phoneNo)) {
return JsonResult.buildErrorStateResult(null, null);
......
package cn.quantgroup.xyqb.controller.internal.user.resp;
import cn.quantgroup.user.enums.BizType;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@Builder
@NoArgsConstructor
......
......@@ -7,13 +7,16 @@ import cn.quantgroup.xyqb.exception.DataException;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.middleoffice.applet.IAppletService;
import com.alibaba.fastjson.JSON;
import java.util.Arrays;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @author :dongjianhua
......
......@@ -4,9 +4,8 @@ import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.exception.DataException;
import cn.quantgroup.xyqb.util.BctyptPasswordUtil;
import cn.quantgroup.xyqb.util.PasswordUtil;
import org.springframework.stereotype.Component;
import java.util.Objects;
import org.springframework.stereotype.Component;
/**
* 密码校验策略
......
......@@ -3,9 +3,8 @@ package cn.quantgroup.xyqb.controller.middleoffice.common;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.exception.VerificationCodeErrorException;
import cn.quantgroup.xyqb.service.sms.ISmsService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
/**
* 基于短信策略的验证
......
package cn.quantgroup.xyqb.controller.middleoffice.common;
import cn.quantgroup.xyqb.util.ApplicationContextHolder;
import java.util.HashMap;
import java.util.Map;
......
......@@ -2,10 +2,9 @@ package cn.quantgroup.xyqb.controller.middleoffice.common.image;
import cn.quantgroup.xyqb.model.ClientType;
import cn.quantgroup.xyqb.service.captcha.IGeetestCaptchaService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
/**
* 极验验证码认证
......
package cn.quantgroup.xyqb.controller.middleoffice.common.image;
import cn.quantgroup.xyqb.util.ApplicationContextHolder;
import java.util.HashMap;
import java.util.Map;
......
package cn.quantgroup.xyqb.controller.middleoffice.common.image;
import cn.quantgroup.xyqb.service.captcha.IQuantgroupCaptchaService;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
/**
* 量化派验证码认证
......
......@@ -10,13 +10,17 @@ import cn.quantgroup.xyqb.model.Tuple;
import cn.quantgroup.xyqb.service.user.IContactService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.ValidationUtil;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 联系人
......
......@@ -2,13 +2,12 @@ package cn.quantgroup.xyqb.controller.middleoffice.contact.dto;
import cn.quantgroup.user.enums.BizType;
import cn.quantgroup.xyqb.entity.Contact;
import java.util.List;
import javax.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.NotEmpty;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@Validated
public class ContactSaveDto {
......
......@@ -8,15 +8,19 @@ import cn.quantgroup.xyqb.model.ClientType;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.captcha.IGeetestCaptchaService;
import cn.quantgroup.xyqb.service.captcha.IQuantgroupCaptchaService;
import org.apache.commons.codec.digest.Md5Crypt;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import javax.annotation.Resource;
import org.apache.commons.codec.digest.Md5Crypt;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 图形验证码
......
......@@ -2,10 +2,14 @@ package cn.quantgroup.xyqb.controller.middleoffice.login;
import cn.quantgroup.xyqb.controller.middleoffice.common.VerifyTypeEnum;
import cn.quantgroup.xyqb.model.JsonResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 注册与登陆
......
package cn.quantgroup.xyqb.controller.middleoffice.login;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR;
import cn.quantgroup.user.enums.LoginType;
import cn.quantgroup.xyqb.controller.middleoffice.common.VerifyStrategyFactory;
import cn.quantgroup.xyqb.controller.middleoffice.common.VerifyTypeEnum;
......@@ -10,13 +12,10 @@ import cn.quantgroup.xyqb.model.LoginProperties;
import cn.quantgroup.xyqb.service.register.IUserRegisterService;
import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.service.user.IUserService;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR;
/**
* 面向服务的聚合模块。
*/
......
......@@ -5,13 +5,12 @@ import cn.quantgroup.xyqb.controller.middleoffice.common.image.ImageDTO;
import cn.quantgroup.xyqb.controller.middleoffice.common.image.ImageVerifyStrategyFactory;
import cn.quantgroup.xyqb.controller.middleoffice.common.image.ImageVerifyTypeEnum;
import cn.quantgroup.xyqb.model.JsonResult;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* 短信
*/
......
......@@ -6,14 +6,19 @@ import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.TenantUtil;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 用户信息
......
......@@ -9,13 +9,16 @@ import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.auth.IIdCardService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.sql.Timestamp;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 用户实名信息
......
......@@ -13,8 +13,10 @@ import cn.quantgroup.xyqb.service.user.IContactService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.IUserExtInfoService;
import cn.quantgroup.xyqb.service.user.IUserService;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -24,10 +26,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
* 用户扩展信息
*/
......
......@@ -3,9 +3,8 @@ package cn.quantgroup.xyqb.controller.middleoffice.userext.req;
import cn.quantgroup.xyqb.entity.Address;
import cn.quantgroup.xyqb.entity.Contact;
import cn.quantgroup.xyqb.entity.UserExtInfo;
import lombok.Data;
import java.util.List;
import lombok.Data;
@Data
public class UserExtReq {
......
......@@ -8,14 +8,20 @@ import cn.quantgroup.xyqb.service.user.ITenantService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.service.wechat.IWechatService;
import cn.quantgroup.xyqb.util.TenantUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 微信
......
......@@ -10,11 +10,10 @@ import cn.quantgroup.xyqb.entity.ModifyPhoneNo;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.user.IModifyPhoneNoService;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationConfig;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.text.SimpleDateFormat;
import javax.annotation.Resource;
import javax.validation.Valid;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -23,12 +22,6 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
/**
* 用户手机号修改相关api
* <p>
......@@ -37,7 +30,6 @@ import java.text.SimpleDateFormat;
*
* @author: yangrui
*/
@Api(tags = "用户手机号修改相关api")
@RestController
@RequestMapping("/v1/user/modify/phone_no")
public class ModifyPhoneNoController implements IBaseController {
......@@ -45,7 +37,6 @@ public class ModifyPhoneNoController implements IBaseController {
@Resource
private IModifyPhoneNoService modifyPhoneNoService;
@ApiOperation("app - 查询用户手机号修改进度")
@GetMapping("/progress")
public JsonResult<ProgressResp> progress() {
User user = getCurrentUserFromRedis();
......@@ -62,7 +53,6 @@ public class ModifyPhoneNoController implements IBaseController {
* @param step1Req
* @return
*/
@ApiOperation("app - 申请修改手机号Step_1")
@PostMapping("/step_1")
public JsonResult step1(@Valid @RequestBody Step1Req step1Req) {
User user = getCurrentUserFromRedis();
......@@ -78,7 +68,6 @@ public class ModifyPhoneNoController implements IBaseController {
* @param step2Req
* @return
*/
@ApiOperation("app - 申请修改手机号Step_2")
@PostMapping("/step_2")
public JsonResult step2(@Valid @RequestBody Step2Req step2Req) {
modifyPhoneNoService.saveStep2(step2Req);
......@@ -90,7 +79,6 @@ public class ModifyPhoneNoController implements IBaseController {
/**
* 后台客服处理功能 - 查询列表
*/
@ApiOperation("后台客服处理功能 - 查询列表")
@GetMapping
public JsonResult<?> list(@Valid ModifyPhoneNoQueryReq modifyPhoneNoQueryReq) {
Page<ModifyPhoneNo> list = modifyPhoneNoService.list(modifyPhoneNoQueryReq);
......@@ -109,7 +97,6 @@ public class ModifyPhoneNoController implements IBaseController {
/**
* 后台客服处理功能 - 人工审核
*/
@ApiOperation("后台客服处理功能 - 人工审核")
@PostMapping("/audit")
public JsonResult audit(@Valid @RequestBody AuditReq auditReq) {
modifyPhoneNoService.audit(auditReq);
......@@ -119,7 +106,6 @@ public class ModifyPhoneNoController implements IBaseController {
/**
* 后台客服处理功能 - 反馈跟进
*/
@ApiOperation("后台客服处理功能 - 反馈跟进")
@PostMapping("/{id}/feedback")
public JsonResult feedback(@PathVariable Long id) {
modifyPhoneNoService.feedback(id);
......
package cn.quantgroup.xyqb.controller.modifyphoneno.req;
import cn.quantgroup.xyqb.model.ModifyPhoneNoApplyStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* Date: 2019/11/4
* Time: 上午11:53
......@@ -20,10 +18,10 @@ public class AuditReq implements Serializable {
private static final long serialVersionUID = 9183603336718659105L;
@NotNull(message = "id不能为空")
private Long id;
@ApiModelProperty("申请状态 1 通过; 2 不通过;")
//@ApiModelProperty("申请状态 1 通过; 2 不通过;")
@NotNull(message = "申请状态不能为空")
private ModifyPhoneNoApplyStatusEnum applyStatus;
@ApiModelProperty("申请状态补充原因")
//@ApiModelProperty("申请状态补充原因")
@Length(max = 256, message = "原因最长256字符")
private String applyStatusReason;
}
package cn.quantgroup.xyqb.controller.modifyphoneno.req;
import cn.quantgroup.xyqb.controller.req.Page;
import cn.quantgroup.xyqb.model.ModifyPhoneNoApplyStatusEnum;
import cn.quantgroup.xyqb.model.ModifyPhoneNoProcessingStatusEnum;
import cn.quantgroup.xyqb.controller.req.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
/**
* Date: 2019/11/5
......@@ -21,30 +19,30 @@ public class ModifyPhoneNoQueryReq extends Page implements Serializable {
/**
* 申请人旧手机号
*/
@ApiModelProperty("申请人旧手机号")
//@ApiModelProperty("申请人旧手机号")
private String phoneNo;
/**
* 开始时间
*/
@ApiModelProperty("开始时间")
//@ApiModelProperty("开始时间")
private String startAt;
/**
* 结束时间
*/
@ApiModelProperty("结束时间")
//@ApiModelProperty("结束时间")
private String endAt;
/**
* 申请状态 0处理中; 1修改完成; 2不允许修改;
*/
@ApiModelProperty("申请状态 0 处理中; 1 修改完成; 2 不允许修改;")
//@ApiModelProperty("申请状态 0 处理中; 1 修改完成; 2 不允许修改;")
private ModifyPhoneNoApplyStatusEnum applyStatus;
/**
* 处理状态 0待人工处理 1待用户反馈结果 2已反馈
*/
@ApiModelProperty("处理状态 0 待人工处理; 1 待用户反馈结果; 2 已反馈;")
//@ApiModelProperty("处理状态 0 待人工处理; 1 待用户反馈结果; 2 已反馈;")
private ModifyPhoneNoProcessingStatusEnum processingStatus;
}
......@@ -3,16 +3,13 @@ package cn.quantgroup.xyqb.controller.modifyphoneno.req;
import cn.quantgroup.xyqb.entity.ModifyPhoneNo;
import cn.quantgroup.xyqb.util.ValidationUtil;
import cn.quantgroup.xyqb.validator.IdCard;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.beans.BeanUtils;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;
/**
* Date: 2019/11/4
* Time: 上午11:29
......@@ -26,7 +23,7 @@ public class Step1Req implements Serializable {
/**
* 注册人真实姓名
*/
@ApiModelProperty("注册人真实姓名")
//@ApiModelProperty("注册人真实姓名")
@NotBlank(message = "注册人真实姓名不能为空")
@Length(max = 32, message = "注册人真实姓名最长32字符")
private String name;
......@@ -34,7 +31,7 @@ public class Step1Req implements Serializable {
/**
* 注册人身份证件号
*/
@ApiModelProperty("注册人身份证件号")
//@ApiModelProperty("注册人身份证件号")
@NotBlank(message = "注册人身份证件号不能为空")
@IdCard
private String idCard;
......@@ -42,7 +39,7 @@ public class Step1Req implements Serializable {
/**
* 当前手机号码
*/
@ApiModelProperty("当前手机号码")
//@ApiModelProperty("当前手机号码")
@NotBlank(message = "当前手机号码不能为空")
@Pattern(regexp = ValidationUtil.phoneRegExp, message = "当前手机号码格式错误")
private String prevPhoneNo;
......@@ -50,7 +47,7 @@ public class Step1Req implements Serializable {
/**
* 新手机号码
*/
@ApiModelProperty("新手机号码")
//@ApiModelProperty("新手机号码")
@NotBlank(message = "新手机号码不能为空")
@Pattern(regexp = ValidationUtil.phoneRegExp, message = "新手机号码格式错误")
private String curPhoneNo;
......@@ -58,7 +55,7 @@ public class Step1Req implements Serializable {
/**
* 新手机号码短信验证码
*/
@ApiModelProperty("新手机号码短信验证码")
//@ApiModelProperty("新手机号码短信验证码")
@NotBlank(message = "新手机号码短信验证码不能为空")
private String smsCode;
......
package cn.quantgroup.xyqb.controller.modifyphoneno.req;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* Date: 2019/11/4
* Time: 上午11:37
......@@ -27,7 +25,7 @@ public class Step2Req implements Serializable {
/**
* 身份证正面
*/
@ApiModelProperty("身份证正面")
//@ApiModelProperty("身份证正面")
@NotBlank(message = "身份证正面不能为空")
@Length(max = 256, message = "身份证正面图片地址最长256字符")
private String idCardFaceUrl;
......@@ -35,7 +33,7 @@ public class Step2Req implements Serializable {
/**
* 身份证背面
*/
@ApiModelProperty("身份证背面")
//@ApiModelProperty("身份证背面")
@NotBlank(message = "身份证背面不能为空")
@Length(max = 256, message = "身份证背面图片地址最长256字符")
private String idCardRearUrl;
......@@ -43,7 +41,7 @@ public class Step2Req implements Serializable {
/**
* 本人手持身份证照片
*/
@ApiModelProperty("本人手持身份证照片")
//@ApiModelProperty("本人手持身份证照片")
@NotBlank(message = "本人手持身份证照片不能为空")
@Length(max = 256, message = "本人手持身份证照片地址最长256字符")
private String idCardHoldUrl;
......
package cn.quantgroup.xyqb.controller.modifyphoneno.resp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import lombok.Data;
/**
* Date: 2019/11/4
......@@ -14,30 +12,30 @@ import java.util.Date;
@Data
public class ModifyPhoneNoResp {
private Long id;
@ApiModelProperty("申请编号")
// //@ApiModelProperty("申请编号")
private String applyNo;
@ApiModelProperty("申请人姓名")
// //@ApiModelProperty("申请人姓名")
private String name;
@ApiModelProperty("申请人身份证号")
// //@ApiModelProperty("申请人身份证号")
private String idCard;
@ApiModelProperty("申请人原手机号")
//@ApiModelProperty("申请人原手机号")
private String prevPhoneNo;
@ApiModelProperty("申请人现手机号")
//@ApiModelProperty("申请人现手机号")
private String curPhoneNo;
@ApiModelProperty("申请时间")
//@ApiModelProperty("申请时间")
private Date createdAt;
@ApiModelProperty("申请结果")
//@ApiModelProperty("申请结果")
private Integer applyStatus;
@ApiModelProperty("拒绝原因")
//@ApiModelProperty("拒绝原因")
private String applyStatusReason;
@ApiModelProperty("处理状态")
//@ApiModelProperty("处理状态")
private Integer processStatus;
@ApiModelProperty("最近更新时间")
//@ApiModelProperty("最近更新时间")
private Date updatedAt;
@ApiModelProperty("身份证正面")
//@ApiModelProperty("身份证正面")
private String idCardFaceUrl;
@ApiModelProperty("身份证背面")
//@ApiModelProperty("身份证背面")
private String idCardRearUrl;
@ApiModelProperty("本人手持身份证照片")
//@ApiModelProperty("本人手持身份证照片")
private String idCardHoldUrl;
}
package cn.quantgroup.xyqb.controller.req;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
......@@ -17,13 +16,13 @@ public class Page {
/**
* page
*/
@ApiModelProperty("one-based page index")
//@ApiModelProperty("one-based page index")
private Integer page = 1;
/**
* size
*/
@ApiModelProperty("the size of the page to be returned")
//@ApiModelProperty("the size of the page to be returned")
@Range(min = 1, max = 1000, message = "size参数必须在1到1000之间")
private Integer size = 30;
}
......@@ -3,13 +3,12 @@ package cn.quantgroup.xyqb.controller.risk;
import cn.quantgroup.xyqb.entity.enums.KeyType;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.risk.LoginRiskService;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author :dongjianhua
* @date :Created in 2020/12/14 15:02
......
......@@ -7,15 +7,14 @@ import cn.quantgroup.xyqb.service.user.IOauthClientDetailsService;
import cn.quantgroup.xyqb.service.user.IProductLoginService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.TenantUtil;
import java.util.ArrayList;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List;
@Slf4j
@RestController
@RequestMapping("/tenant")
......
package cn.quantgroup.xyqb.entity;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import lombok.Data;
/**
* Created by 11 on 2016/12/30.
......
package cn.quantgroup.xyqb.entity;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import lombok.Data;
/**
* 所有数据库实体,都要继承 BaseEntity
......
......@@ -4,16 +4,15 @@ import cn.quantgroup.user.enums.BizType;
import cn.quantgroup.user.enums.Relation;
import cn.quantgroup.xyqb.model.Tuple;
import cn.quantgroup.xyqb.util.ValidationUtil;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
/**
* Created by 11 on 2016/12/30.
*/
......
package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.entity.baseEntity.PartitionEntity;
import cn.quantgroup.xyqb.model.Gender;
import cn.quantgroup.xyqb.util.StringUtils;
import javax.persistence.*;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created with IntelliJ IDEA.
......
......@@ -3,10 +3,12 @@ package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.entity.baseEntity.PartitionEntity;
import cn.quantgroup.xyqb.util.StringUtils;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created with IntelliJ IDEA.
......
......@@ -2,14 +2,13 @@ package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.entity.converter.EncryptConverter;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* Created by 11 on 2016/12/30.
......
package cn.quantgroup.xyqb.entity;
import lombok.Data;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import lombok.Data;
/**
* Created by 11 on 2017/3/22.
......
package cn.quantgroup.xyqb.entity;
import lombok.Data;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import lombok.Data;
/**
* Created by 11 on 2016/12/30.
......
package cn.quantgroup.xyqb.entity;
import lombok.Data;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import lombok.Data;
/**
* Created by 11 on 2016/12/30.
......
package cn.quantgroup.xyqb.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import lombok.Data;
/**
* Date: 2019/11/4
......
......@@ -3,13 +3,12 @@ package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.entity.baseEntity.OptimisticEntity;
import cn.quantgroup.xyqb.util.StringUtils;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Objects;
/**
* Created with IntelliJ IDEA.
......
package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.entity.baseEntity.PartitionEntity;
import cn.quantgroup.xyqb.entity.converter.EncryptConverter;
import cn.quantgroup.xyqb.util.StringUtils;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Created with IntelliJ IDEA.
......
......@@ -2,12 +2,11 @@ package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.entity.baseEntity.OptimisticEntity;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
/**
* Created with IntelliJ IDEA.
......
package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.entity.converter.EncryptConverter;
import java.io.Serializable;
import java.util.Objects;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.apache.commons.lang.StringUtils;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;
/**
* Created by Miraculous on 15/7/4.
*/
......
package cn.quantgroup.xyqb.entity;
import lombok.Data;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import lombok.Data;
/**
* Created by 11 on 2017/3/22.
......
package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.model.AuthPattern;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.sql.Timestamp;
/**
* @author xufei on 2018/1/5.
*/
......
package cn.quantgroup.xyqb.entity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* Created by Administrator on 2017/5/16.
......
package cn.quantgroup.xyqb.entity;
import lombok.*;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* 销户记录
......
......@@ -3,17 +3,15 @@ package cn.quantgroup.xyqb.entity;
import cn.quantgroup.motan.retbean.XUserDetail;
import cn.quantgroup.xyqb.model.Gender;
import cn.quantgroup.xyqb.model.IdType;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
import java.util.Optional;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Optional;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
/**
* Created by FrankChow on 15/7/8.
......
package cn.quantgroup.xyqb.entity;
import cn.quantgroup.motan.retbean.XUserExtInfo;
import cn.quantgroup.user.enums.*;
import lombok.Data;
import javax.persistence.*;
import cn.quantgroup.user.enums.EducationEnum;
import cn.quantgroup.user.enums.IncomeEnum;
import cn.quantgroup.user.enums.IncomeRangeEnum;
import cn.quantgroup.user.enums.MaritalStatus;
import cn.quantgroup.user.enums.OccupationEnum;
import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import lombok.Data;
/**
* Created by 11 on 2016/12/30.
......
package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.util.HashUtil;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@Entity
......
package cn.quantgroup.xyqb.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import lombok.Data;
import javax.persistence.*;
import java.sql.Timestamp;
@Data
@Entity
@Table(name = "user_hash_phone_no_id_no_mapping")
......
package cn.quantgroup.xyqb.entity;
import lombok.Data;
import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
......@@ -9,11 +9,9 @@ import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.sql.Timestamp;
import lombok.Data;
/**
* Created by 11 on 2016/12/30.
......
......@@ -3,11 +3,16 @@ package cn.quantgroup.xyqb.entity;
import cn.quantgroup.user.enums.MaritalStatus;
import cn.quantgroup.xyqb.util.ValidationUtil;
import lombok.*;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
@Data
@Entity
......
package cn.quantgroup.xyqb.entity;
import java.io.Serializable;
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 javax.persistence.UniqueConstraint;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import javax.persistence.*;
import java.io.Serializable;
/**
* Created by Miraculous on 15/10/29.
*/
......
package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.util.EmojiUtil;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import lombok.Data;
/**
* 微信公众号和企业微信关注情况表
......
......@@ -2,14 +2,15 @@ package cn.quantgroup.xyqb.entity;
import cn.quantgroup.xyqb.entity.converter.EncryptConverter;
import cn.quantgroup.xyqb.util.EmojiUtil;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import lombok.Data;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
/**
* Created by 11 on 2017/1/17.
* 微信关联的用户信息
......
......@@ -3,11 +3,10 @@ package cn.quantgroup.xyqb.entity.converter;
import cn.quantgroup.security.AESEncryption;
import cn.quantgroup.security.CipherUtil;
import cn.quantgroup.xyqb.util.ApplicationContextHolder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
/**
* 通用字段加解密转换器
......
package cn.quantgroup.xyqb.entity.middleoffice;
import cn.quantgroup.xyqb.util.ValidationUtil;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import lombok.Getter;
import lombok.Setter;
/**
* @author :dongjianhua
......
......@@ -4,16 +4,15 @@ import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.UserRegisterParam;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
@Slf4j
@Component
public class BlackHoleRegisteredEventListener implements ApplicationListener<RegisterEvent> {
......
......@@ -5,11 +5,10 @@ import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserBtRegister;
import cn.quantgroup.xyqb.model.UserRegisterParam;
import cn.quantgroup.xyqb.service.user.IUserBtRegisterService;
import java.util.Objects;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import java.util.Objects;
//@Component
public class BtRegisteredEventListener implements ApplicationListener<RegisterEvent> {
......
......@@ -5,16 +5,15 @@ import cn.quantgroup.xyqb.model.session.SessionStruct;
import cn.quantgroup.xyqb.model.session.SessionValue;
import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.service.user.IUserService;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Slf4j
@Component
public class CacheEvictPhoneNoUpdateEventListener implements ApplicationListener<PhoneNoUpdateEvent> {
......
......@@ -4,12 +4,11 @@ import cn.quantgroup.xyqb.entity.Contact;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.UserRegisterParam;
import cn.quantgroup.xyqb.repository.IContactRepository;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.util.CollectionUtils;
import java.util.List;
/**
* 注册成功后, 保存联系人
*
......
package cn.quantgroup.xyqb.event;
import java.sql.Timestamp;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import lombok.extern.slf4j.Slf4j;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.model.IdCardInfo;
......@@ -19,6 +8,11 @@ import cn.quantgroup.xyqb.model.UserRegisterParam;
import cn.quantgroup.xyqb.service.auth.IIdCardService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.util.ValidationUtil;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
@Slf4j
@Component
......
......@@ -8,7 +8,6 @@ import cn.quantgroup.xyqb.util.JsonUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
/**
* 注册成功之后lkb
......
......@@ -4,14 +4,13 @@ import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.webchat.WechatEventMsg;
import cn.quantgroup.xyqb.repository.IUserRepository;
import com.google.common.collect.Maps;
import java.util.Map;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Map;
/**
* 微信绑定关系变动。通知某系统
*/
......
......@@ -6,14 +6,13 @@ import cn.quantgroup.xyqb.model.UserRegisterParam;
import cn.quantgroup.xyqb.repository.IUserHashMappingRepository;
import cn.quantgroup.xyqb.repository.IUserHashPhoneNoIdNoMappingRepository;
import cn.quantgroup.xyqb.util.encrypt.Md5Util;
import javax.annotation.Resource;
import javax.persistence.PersistenceException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import javax.annotation.Resource;
import javax.persistence.PersistenceException;
//@Component
@Slf4j
public class PhoneHashEventListener implements ApplicationListener<RegisterEvent> {
......
package cn.quantgroup.xyqb.event;
import org.springframework.context.ApplicationEvent;
import cn.quantgroup.xyqb.model.UserRegisterParam;
import lombok.Getter;
import lombok.Setter;
import cn.quantgroup.xyqb.model.UserRegisterParam;
import org.springframework.context.ApplicationEvent;
/**
* 注册成功发送事件
......
......@@ -4,13 +4,12 @@ import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.entity.UserHashMapping;
import cn.quantgroup.xyqb.repository.IUserHashMappingRepository;
import cn.quantgroup.xyqb.util.encrypt.Md5Util;
import javax.persistence.PersistenceException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import javax.persistence.PersistenceException;
/**
* userDetail 更新时, 保存 hashMapping 数据
......
......@@ -3,12 +3,11 @@ package cn.quantgroup.xyqb.event;
import com.sensorsdata.analytics.javasdk.ISensorsAnalytics;
import com.sensorsdata.analytics.javasdk.SensorsAnalytics;
import com.sensorsdata.analytics.javasdk.consumer.BatchConsumer;
import java.io.IOException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.io.IOException;
/**
* @author :hongzhi
*/
......
......@@ -3,13 +3,12 @@ package cn.quantgroup.xyqb.event;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.WechatUserInfo;
import cn.quantgroup.xyqb.service.wechat.IWechatService;
import java.util.Objects;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
import java.util.Objects;
@Slf4j
@Component
public class WechatPhoneNoUpdateEventListener implements ApplicationListener<PhoneNoUpdateEvent> {
......
package cn.quantgroup.xyqb.filter;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
/**
* Created by Miraculous on 15/7/5.
* 支持跨域
......
......@@ -6,18 +6,22 @@ import cn.quantgroup.xyqb.model.session.SessionStruct;
import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.session.XyqbSessionContextHolder;
import com.alibaba.fastjson.JSONObject;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Objects;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.http.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.AntPathMatcher;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Objects;
/**
* Created by 11 on 2016/12/29.
*/
......
package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.entity.Address;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
/**
* 地址信息数据模型
......
package cn.quantgroup.xyqb.model;
import java.io.Serializable;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
/**
* Created by ag on 16/3/16.
*/
......
package cn.quantgroup.xyqb.model;
import lombok.*;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* @author mengfan.feng
......
package cn.quantgroup.xyqb.model;
import java.security.Principal;
import lombok.Getter;
import lombok.Setter;
import java.security.Principal;
import java.util.Objects;
/**
* Created by Miraculous on 15/7/9.
*/
......
package cn.quantgroup.xyqb.model;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
/**
* Created by xuran on 2017/8/1.
......
......@@ -2,10 +2,9 @@ package cn.quantgroup.xyqb.model;
import cn.quantgroup.user.enums.Relation;
import cn.quantgroup.xyqb.entity.Contact;
import lombok.Data;
import java.io.Serializable;
import java.util.Optional;
import lombok.Data;
/**
* 联系人数据模型
......
......@@ -2,14 +2,13 @@ package cn.quantgroup.xyqb.model;
import cn.quantgroup.user.enums.Relation;
import cn.quantgroup.xyqb.entity.Contact;
import lombok.Data;
import org.apache.commons.collections.CollectionUtils;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import lombok.Data;
import org.apache.commons.collections.CollectionUtils;
/**
* Created by Miraculous on 2017/2/14.
......
package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.Constants;
import java.io.Serializable;
import lombok.Data;
import cn.quantgroup.xyqb.Constants;
/**
* Created by Miraculous on 15/7/5.
*/
......
package cn.quantgroup.xyqb.model;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
/**
* Created by zenglibin on 15/12/29.
......
package cn.quantgroup.xyqb.model;
import lombok.*;
import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
/**
* @author mengfan.feng
......
package cn.quantgroup.xyqb.model;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
/**
* Created by xuran on 2017/8/1.
......
......@@ -2,12 +2,11 @@ package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.entity.Address;
import cn.quantgroup.xyqb.entity.Contact;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import lombok.Data;
/**
* 用户综合信息数据模型
......
package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.entity.UserDetail;
import java.io.Serializable;
import lombok.Data;
import org.apache.commons.lang.StringUtils;
import java.io.Serializable;
/**
* Created by 11 on 2016/12/20.
*/
......
package cn.quantgroup.xyqb.model;
import cn.quantgroup.user.enums.*;
import cn.quantgroup.user.enums.EducationEnum;
import cn.quantgroup.user.enums.IncomeEnum;
import cn.quantgroup.user.enums.IncomeRangeEnum;
import cn.quantgroup.user.enums.MaritalStatus;
import cn.quantgroup.user.enums.OccupationEnum;
import cn.quantgroup.xyqb.entity.UserExtInfo;
import lombok.Data;
......
......@@ -2,10 +2,9 @@ package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
import lombok.Data;
import java.io.Serializable;
import java.util.Optional;
import lombok.Data;
/**
* user完整数据模型,包括user,user_detail
......
......@@ -2,11 +2,10 @@ package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
import java.io.Serializable;
import lombok.Data;
import org.springframework.util.Assert;
import java.io.Serializable;
/**
* Created by xuran on 2017/7/5.
*/
......
......@@ -2,11 +2,10 @@ package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
import lombok.Data;
import org.springframework.util.Assert;
import java.io.Serializable;
import java.util.Optional;
import lombok.Data;
import org.springframework.util.Assert;
/**
* Created by Miraculous on 15/12/29.
......
package cn.quantgroup.xyqb.model;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
/**
* Created by zenglibin on 2017/06/14.
......
package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.entity.User;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
/**
* Created by xuran on 2017/9/7.
......
package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.entity.Address;
import cn.quantgroup.xyqb.entity.Contact;
import cn.quantgroup.xyqb.entity.User;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import cn.quantgroup.xyqb.entity.Address;
import cn.quantgroup.xyqb.entity.Contact;
import cn.quantgroup.xyqb.entity.User;
/**
* Created by liqing on 2017/12/4 0004.
*/
......
package cn.quantgroup.xyqb.model;
import cn.quantgroup.xyqb.entity.User;
import java.io.Serializable;
import java.util.Objects;
import lombok.Data;
import cn.quantgroup.xyqb.entity.User;
import org.apache.commons.lang3.StringUtils;
/**
* Created by 11 on 2016/12/20.
*/
......
package cn.quantgroup.xyqb.model.session;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Created by 11 on 2016/12/28.
......
......@@ -4,11 +4,10 @@ import cn.quantgroup.xyqb.config.http.Timestamp2LongConverter;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.LoginProperties;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.sql.Timestamp;
import java.util.Map;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Created by Miraculous on 2016/12/28.
......
package cn.quantgroup.xyqb.model.webchat;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
/**
* Created by 11 on 2017/1/17.
......
package cn.quantgroup.xyqb.model.webchat;
import lombok.Data;
import java.io.Serializable;
import lombok.Data;
@Data
public class ContactInfoResponse implements Serializable {
......
package cn.quantgroup.xyqb.model.webchat;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
import lombok.Data;
/**
*
......
package cn.quantgroup.xyqb.model.webchat;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
/**
*
......
package cn.quantgroup.xyqb.model.webchat;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
/**
*
......
package cn.quantgroup.xyqb.model.webchat;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import lombok.Data;
/**
*
......
package cn.quantgroup.xyqb.model.webchat;
import lombok.Data;
import javax.persistence.Column;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
import lombok.Data;
@Data
public class WechatUserListResponse implements Serializable {
......
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.user.enums.BizType;
import cn.quantgroup.user.enums.Relation;
import cn.quantgroup.xyqb.entity.Contact;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Created by 11 on 2016/12/30.
*/
......
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.GeetestLogEntity;
import java.sql.Timestamp;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Timestamp;
import java.util.Date;
/**
* Created by 11 on 2016/12/30.
*/
......
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.LoginRecord;
import cn.quantgroup.xyqb.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
public interface ILoginRecordRepository extends JpaRepository<LoginRecord, Long>, JpaSpecificationExecutor<LoginRecord> {
......
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.ProductLoginEntity;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
* Li Jianhua
......
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.SmsTemplateEntity;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import java.util.Optional;
/**
* Created by hechao on 2020/2/17.
*/
......
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.UserAttached;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Created by 11 on 2017/3/22.
*/
......
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.UserDeregisterRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;
/**
* 销户 Repository
......
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.UserDetail;
import java.util.List;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
......@@ -8,8 +9,6 @@ import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author mengfan.feng
* @time 2015-09-11 11:22
......
......@@ -2,12 +2,9 @@ package cn.quantgroup.xyqb.repository;
import cn.quantgroup.user.enums.OccupationEnum;
import cn.quantgroup.xyqb.entity.UserExtInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import java.sql.Timestamp;
import java.util.List;
import static cn.quantgroup.user.enums.OccupationEnum.STUDENT;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* Created by 11 on 2016/12/30.
......
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.UserQueryLog;
import java.util.Date;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
/**
* Created by 11 on 2016/12/30.
*/
......
package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.User;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Created by Miraculous on 15/7/4.
......
......@@ -2,16 +2,12 @@ package cn.quantgroup.xyqb.repository;
import cn.quantgroup.xyqb.entity.WechatInfoRelation;
import cn.quantgroup.xyqb.entity.WechatUserInfo;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import static org.springframework.transaction.annotation.Propagation.MANDATORY;
public interface IWeChatInfoRelationRepository extends JpaRepository<WechatInfoRelation, Long> {
@Transactional(rollbackFor = Exception.class)
......
package cn.quantgroup.xyqb.repository;
import static org.springframework.transaction.annotation.Propagation.MANDATORY;
import cn.quantgroup.xyqb.entity.WechatUserInfo;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import static org.springframework.transaction.annotation.Propagation.MANDATORY;
/**
* Created by 11 on 2017/1/18.
* modify by djh 20200527 http://confluence.quantgroup.cn/pages/viewpage.action?pageId=30657427
......
......@@ -2,11 +2,14 @@ package cn.quantgroup.xyqb.risk.entity;
import cn.quantgroup.xyqb.entity.enums.Device;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedNativeQueries;
import javax.persistence.NamedNativeQuery;
import lombok.Data;
import lombok.ToString;
import javax.persistence.*;
/**
* 统计黑名单
*/
......
......@@ -2,11 +2,10 @@ package cn.quantgroup.xyqb.risk.entity;
import cn.quantgroup.xyqb.entity.BaseEntity;
import cn.quantgroup.xyqb.entity.enums.Device;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import lombok.Data;
/**
* @author :dongjianhua
......
......@@ -2,11 +2,10 @@ package cn.quantgroup.xyqb.risk.entity;
import cn.quantgroup.xyqb.entity.BaseEntity;
import cn.quantgroup.xyqb.entity.enums.KeyType;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import lombok.Data;
/**
* @author :dongjianhua
......
package cn.quantgroup.xyqb.risk.repository;
import cn.quantgroup.xyqb.risk.entity.WhiteList;
import cn.quantgroup.xyqb.entity.enums.KeyType;
import cn.quantgroup.xyqb.risk.entity.WhiteList;
import org.springframework.data.jpa.repository.JpaRepository;
public interface WhiteListRepository extends JpaRepository<WhiteList, Long> {
......
......@@ -2,8 +2,6 @@ package cn.quantgroup.xyqb.security;
import cn.quantgroup.xyqb.entity.enums.Device;
import java.util.Objects;
/**
* Created by Administrator on 2021/6/30 0030.
*/
......
package cn.quantgroup.xyqb.security;
import cn.quantgroup.xyqb.service.session.ISessionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import java.util.HashMap;
import java.util.Map;
import org.springframework.security.core.Authentication;
/**
* Created by Administrator on 2021/7/1 0001.
......
package cn.quantgroup.xyqb.security;
import javax.security.auth.Subject;
import java.security.Principal;
import javax.security.auth.Subject;
/**
* Created by Administrator on 2021/7/1 0001.
......
package cn.quantgroup.xyqb.security;
import java.lang.annotation.*;
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;
/**
* Created by Administrator on 2021/6/25 0025.
......
package cn.quantgroup.xyqb.security;
import java.security.Principal;
import java.util.Properties;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.util.StringUtils;
import java.security.Principal;
import java.util.Properties;
/**
* Created by Administrator on 2021/7/1 0001.
*/
......
package cn.quantgroup.xyqb.security;
import static cn.quantgroup.xyqb.security.SecurityConstant.DEFAULT_DEVICE_ID;
import cn.quantgroup.xyqb.entity.enums.Device;
import cn.quantgroup.xyqb.exception.DataException;
import javax.servlet.http.HttpServletRequest;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import static cn.quantgroup.xyqb.security.SecurityConstant.DEFAULT_DEVICE_ID;
/**
* Created by Administrator on 2021/6/30 0030.
*/
......
package cn.quantgroup.xyqb.security;
import javax.crypto.Cipher;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.util.Base64;
import javax.crypto.Cipher;
/**
* Created by Administrator on 2021/7/5 0005.
......
package cn.quantgroup.xyqb.service;
import static cn.quantgroup.xyqb.security.SecurityConstant.DEFAULT_DEVICE_ID;
import cn.quantgroup.xyqb.entity.enums.Device;
import cn.quantgroup.xyqb.model.LoginRefuseResult;
import cn.quantgroup.xyqb.risk.repository.LoginInfoRepository;
......@@ -10,8 +12,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import static cn.quantgroup.xyqb.security.SecurityConstant.DEFAULT_DEVICE_ID;
/**
* Created by Administrator on 2021/7/1 0001.
*/
......
package cn.quantgroup.xyqb.service.api;
import cn.quantgroup.xyqb.model.UserFullInfo;
import java.util.Optional;
/**
......
......@@ -6,11 +6,10 @@ import cn.quantgroup.xyqb.model.UserFullInfo;
import cn.quantgroup.xyqb.service.api.IUserApiService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.IUserService;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Optional;
/**
* Created by FrankChow on 15/12/16.
*/
......
package cn.quantgroup.xyqb.service.auth;
import cn.quantgroup.xyqb.model.IdCardInfo;
import java.text.ParseException;
/**
......
......@@ -5,16 +5,19 @@ import cn.quantgroup.xyqb.exception.IdCardException;
import cn.quantgroup.xyqb.model.Gender;
import cn.quantgroup.xyqb.model.IdCardInfo;
import cn.quantgroup.xyqb.service.auth.IIdCardService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.annotation.PostConstruct;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
/**
* Created by Miraculous on 15/7/10.
......
......@@ -7,18 +7,13 @@ import cn.quantgroup.xyqb.repository.IUserAuthorizedRepository;
import cn.quantgroup.xyqb.repository.IUserRepository;
import cn.quantgroup.xyqb.service.auth.IIdCardService;
import cn.quantgroup.xyqb.service.auth.IUserAuthorizedService;
import java.text.ParseException;
import java.util.Objects;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.text.ParseException;
import java.util.Objects;
/**
* @author xufei on 2018/1/5.
*/
......
......@@ -2,11 +2,6 @@ package cn.quantgroup.xyqb.service.captcha;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.util.encrypt.Md5Util;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpStatus;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStreamWriter;
......@@ -16,6 +11,10 @@ import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import lombok.extern.slf4j.Slf4j;
import org.apache.http.HttpStatus;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Java SDK
......
package cn.quantgroup.xyqb.service.captcha;
import cn.quantgroup.xyqb.model.ClientType;
import java.util.Map;
/**
......
......@@ -4,13 +4,12 @@ import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.model.ClientType;
import cn.quantgroup.xyqb.service.captcha.GeetestLib;
import cn.quantgroup.xyqb.service.captcha.IGeetestCaptchaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
* @author xufei on 2018/1/30.
......
......@@ -5,16 +5,15 @@ import cn.quantgroup.xyqb.model.ClientType;
import cn.quantgroup.xyqb.model.SettingType;
import cn.quantgroup.xyqb.repository.IGeetestLogRepository;
import cn.quantgroup.xyqb.service.captcha.IGeetestLogService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
/**
* @author xufei on 2018/1/30.
......
......@@ -4,14 +4,6 @@ import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.service.captcha.IQuantgroupCaptchaService;
import cn.quantgroup.xyqb.thirdparty.jcaptcha.AbstractManageableImageCaptchaService;
import com.octo.captcha.service.CaptchaServiceException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
......@@ -19,6 +11,13 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import javax.imageio.ImageIO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
/**
* @author xufei on 2018/1/30.
......
......@@ -6,6 +6,15 @@ import cn.quantgroup.xyqb.service.http.IHttpService;
import cn.quantgroup.xyqb.util.PasswordUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import javax.net.ssl.SSLContext;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.Charsets;
import org.apache.commons.collections.MapUtils;
......@@ -44,12 +53,6 @@ import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Service;
import javax.net.ssl.SSLContext;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.util.*;
/**
* @author mengfan.feng
* @time 2015-08-13 10:19
......
......@@ -5,14 +5,13 @@ import cn.quantgroup.xyqb.entity.MerchantConfig;
import cn.quantgroup.xyqb.repository.IMerchantConfigRepository;
import cn.quantgroup.xyqb.repository.IMerchantRepository;
import cn.quantgroup.xyqb.service.merchant.IMerchantService;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.PostConstruct;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
/**
* Created by Miraculous on 2017/1/3.
*/
......
package cn.quantgroup.xyqb.service.middleoffice.applet.impl;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_FREEZE_ERROR;
import cn.quantgroup.xyqb.controller.middleoffice.login.ILoginModule;
import cn.quantgroup.xyqb.controller.middleoffice.login.LoginVo;
import cn.quantgroup.xyqb.entity.User;
......@@ -18,8 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_FREEZE_ERROR;
/**
* @author :dongjianhua
* @date :Created in 2020/5/27 17:27
......
......@@ -2,9 +2,8 @@ package cn.quantgroup.xyqb.service.mq.impl;
import cn.quantgroup.xyqb.service.mq.IRegisterMqService;
import com.alibaba.fastjson.JSONObject;
import java.io.Serializable;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -12,8 +11,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.io.Serializable;
/**
* Created by xuran on 2017/9/7.
*/
......
......@@ -3,14 +3,13 @@ package cn.quantgroup.xyqb.service.mq.impl;
import cn.quantgroup.xyqb.model.UserStatistics;
import cn.quantgroup.xyqb.service.mq.IVestService;
import com.alibaba.fastjson.JSONObject;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* Created by xuran on 2017/6/21.
* 用户统计信息
......
......@@ -13,13 +13,12 @@ import cn.quantgroup.xyqb.service.user.IAddressService;
import cn.quantgroup.xyqb.service.user.IContactService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.IUserExtInfoService;
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 javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by Miraculous on 2017/1/3.
......
......@@ -2,8 +2,6 @@ package cn.quantgroup.xyqb.service.register;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDeregisterRecord;
import java.util.Date;
import java.util.List;
/**
......
......@@ -3,7 +3,6 @@ package cn.quantgroup.xyqb.service.register;
import cn.quantgroup.xyqb.entity.Address;
import cn.quantgroup.xyqb.entity.Contact;
import cn.quantgroup.xyqb.entity.User;
import java.util.List;
/**
......
......@@ -5,13 +5,12 @@ import cn.quantgroup.xyqb.entity.UserDeregisterRecord;
import cn.quantgroup.xyqb.repository.IUserDeregisterRecordRepository;
import cn.quantgroup.xyqb.service.register.IUserDeregisterService;
import cn.quantgroup.xyqb.util.encrypt.Md5Util;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
* 销户服务实现
......
package cn.quantgroup.xyqb.service.register.impl;
import static cn.quantgroup.xyqb.Constants.DELETE_USER_AGAIN_REGISTER_INTERVAL;
import cn.quantgroup.user.enums.RecordType;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.entity.Address;
......@@ -18,17 +20,19 @@ import cn.quantgroup.xyqb.util.DateUtils;
import cn.quantgroup.xyqb.util.PasswordUtil;
import cn.quantgroup.xyqb.util.TenantUtil;
import cn.quantgroup.xyqb.util.encrypt.Md5Util;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.UUID;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
import static cn.quantgroup.xyqb.Constants.DELETE_USER_AGAIN_REGISTER_INTERVAL;
/**
* @author liqing
* @date 2017/12/4 0004
......
......@@ -4,11 +4,10 @@ import cn.quantgroup.xyqb.entity.enums.KeyType;
import cn.quantgroup.xyqb.risk.entity.WhiteList;
import cn.quantgroup.xyqb.risk.repository.WhiteListRepository;
import cn.quantgroup.xyqb.service.risk.LoginRiskService;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author :dongjianhua
* @date :Created in 2020/12/14 15:07
......
......@@ -5,7 +5,6 @@ import cn.quantgroup.xyqb.model.AuthBean;
import cn.quantgroup.xyqb.model.LoginProperties;
import cn.quantgroup.xyqb.model.session.SessionStruct;
import cn.quantgroup.xyqb.model.session.SessionValue;
import java.util.List;
/**
......
package cn.quantgroup.xyqb.service.session.aspect;
import java.lang.annotation.*;
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;
/**
* 用户的白条注册信息填充标记
......
......@@ -14,6 +14,17 @@ import cn.quantgroup.xyqb.service.user.ILoginRecordService;
import cn.quantgroup.xyqb.util.MqUtils;
import cn.quantgroup.xyqb.util.TenantUtil;
import com.alibaba.fastjson.JSON;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
......@@ -25,11 +36,6 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
* session创建和续期
*
......
......@@ -5,6 +5,7 @@ import cn.quantgroup.sms.SmsSender;
import cn.quantgroup.tech.util.TechEnvironment;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.service.sms.ISmsService;
import java.util.Collections;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
......@@ -14,8 +15,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.Collections;
/**
* @author mengfan.feng
......
package cn.quantgroup.xyqb.service.user;
import cn.quantgroup.xyqb.entity.Address;
import java.util.List;
/**
......
......@@ -3,8 +3,6 @@ package cn.quantgroup.xyqb.service.user;
import cn.quantgroup.user.enums.BizType;
import cn.quantgroup.user.enums.Relation;
import cn.quantgroup.xyqb.entity.Contact;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
/**
......
......@@ -2,8 +2,6 @@ package cn.quantgroup.xyqb.service.user;
import cn.quantgroup.xyqb.entity.OauthClientDetailsEntity;
import cn.quantgroup.xyqb.entity.ProductLoginEntity;
import org.springframework.data.domain.Page;
import java.util.List;
/**
......
package cn.quantgroup.xyqb.service.user;
import cn.quantgroup.xyqb.entity.ProductLoginEntity;
import java.util.List;
/**
......
......@@ -5,14 +5,17 @@ import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.repository.ISmsTemplateRepository;
import cn.quantgroup.xyqb.util.GcodeUtils;
import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.inject.Inject;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import javax.inject.Inject;
import java.util.*;
/**
* Created by hechao on 2020/2/17.
*/
......
......@@ -4,7 +4,6 @@ import cn.quantgroup.xyqb.entity.CustomerInfoEntity;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.model.UserBrief;
import java.util.List;
/**
......
......@@ -2,11 +2,10 @@ package cn.quantgroup.xyqb.service.user;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.service.user.vo.UserDetailVO;
import java.util.List;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.data.domain.Page;
import java.util.List;
/**
* Created by 11 on 2016/12/29.
*/
......
package cn.quantgroup.xyqb.service.user;
import cn.quantgroup.user.enums.OccupationEnum;
import cn.quantgroup.xyqb.entity.UserExtInfo;
import java.sql.Timestamp;
import java.util.List;
import java.util.Map;
/**
* Created by Miraculous on 2017/1/3.
......
package cn.quantgroup.xyqb.service.user;
import cn.quantgroup.xyqb.entity.UserQueryLog;
import java.util.Date;
import java.util.List;
......
......@@ -6,10 +6,9 @@ import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.LoginProperties;
import cn.quantgroup.xyqb.model.UserInfo;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
/**
* Created by Miraculous on 15/7/5.
......
package cn.quantgroup.xyqb.service.user;
import cn.quantgroup.xyqb.entity.UserAttached;
import java.util.List;
/**
......
......@@ -5,14 +5,11 @@ import cn.quantgroup.xyqb.repository.IAddressRepository;
import cn.quantgroup.xyqb.service.user.IAddressService;
import cn.quantgroup.xyqb.util.AddressFilter;
import cn.quantgroup.xyqb.util.EmojiUtil;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import java.sql.Timestamp;
import java.util.List;
/**
* Created by Miraculous on 2017/1/3.
*/
......
......@@ -7,15 +7,6 @@ import cn.quantgroup.xyqb.service.user.CleanDataService;
import cn.quantgroup.xyqb.service.user.IUserExtInfoService;
import com.google.common.base.Stopwatch;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -24,6 +15,14 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
/**
* @author :dongjianhua
......
......@@ -5,6 +5,8 @@ import cn.quantgroup.user.enums.Relation;
import cn.quantgroup.xyqb.entity.Contact;
import cn.quantgroup.xyqb.repository.IContactRepository;
import cn.quantgroup.xyqb.service.user.IContactService;
import java.util.List;
import java.util.Objects;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -13,10 +15,6 @@ import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;
/**
* Created by Miraculous on 2017/1/3.
*/
......
......@@ -17,14 +17,12 @@ public class CustomerInfoServiceImpl implements ICustomerInfoService {
private ICustomerInfoRepository customerInfoRepository;
@Override
// @TargetDataSource(type = DSType.SLAVE)//查询从库
public CustomerInfoEntity findSlaveByCustomerId(Long customerId) {
CustomerInfoEntity customerInfo = customerInfoRepository.findByCustomerId(customerId);
return customerInfo;
}
@Override
// @TargetDataSource(type = DSType.SLAVE)//查询从库
public CustomerInfoEntity findSlaveByOpenId(String openId, String institutionId, String productId) {
CustomerInfoEntity customerInfo = customerInfoRepository.findByInstitutionIdAndProductIdAndSourceOpenId(institutionId, productId, openId);
return customerInfo;
......
package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.tech.db.DSType;
import cn.quantgroup.tech.db.TargetDataSource;
import cn.quantgroup.xyqb.entity.CustomerLoginEntity;
import cn.quantgroup.xyqb.repository.ICustomerLoginRepository;
import cn.quantgroup.xyqb.service.user.ICustomerLoginService;
......@@ -19,7 +17,6 @@ public class CustomerLoginServiceImpl implements ICustomerLoginService {
private ICustomerLoginRepository customerLoginRepository;
@Override
@TargetDataSource(type = DSType.SLAVE)//查询从库
public CustomerLoginEntity findSlaveByCustomerId(Long customerId) {
CustomerLoginEntity customerLogin = customerLoginRepository.findFirstByCustomerId(customerId);
return customerLogin;
......
......@@ -6,15 +6,14 @@ import cn.quantgroup.xyqb.service.user.ILkbUserService;
import cn.quantgroup.xyqb.util.JsonUtil;
import cn.quantgroup.xyqb.util.PasswordUtil;
import com.google.common.collect.Maps;
import java.util.Map;
import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Map;
import java.util.Optional;
/**
* @author mengfan.feng
......
......@@ -7,18 +7,15 @@ import cn.quantgroup.xyqb.service.user.ILockIpv4Service;
import cn.quantgroup.xyqb.util.DateUtils;
import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
/**
* IPV4锁机制Service实现
*
......
......@@ -5,14 +5,13 @@ import cn.quantgroup.xyqb.controller.IBaseController;
import cn.quantgroup.xyqb.entity.LoginRecord;
import cn.quantgroup.xyqb.repository.ILoginRecordRepository;
import cn.quantgroup.xyqb.service.user.ILoginRecordService;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
/**
* Created by Miraculous on 15/7/5.
*/
......
package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.xyqb.model.ModifyPhoneNoApplyStatusEnum;
import cn.quantgroup.xyqb.model.ModifyPhoneNoProcessingStatusEnum;
import cn.quantgroup.xyqb.aspect.limit.AccessLimit;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.AuditReq;
import cn.quantgroup.xyqb.controller.modifyphoneno.req.ModifyPhoneNoQueryReq;
......@@ -11,6 +9,8 @@ import cn.quantgroup.xyqb.controller.modifyphoneno.resp.ProgressResp;
import cn.quantgroup.xyqb.entity.ModifyPhoneNo;
import cn.quantgroup.xyqb.exception.DataException;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.ModifyPhoneNoApplyStatusEnum;
import cn.quantgroup.xyqb.model.ModifyPhoneNoProcessingStatusEnum;
import cn.quantgroup.xyqb.repository.IModifyPhoneNoRepository;
import cn.quantgroup.xyqb.repository.IUserDetailRepository;
import cn.quantgroup.xyqb.repository.IUserRepository;
......@@ -23,6 +23,12 @@ import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.qiniu.util.Auth;
import java.util.List;
import javax.annotation.Resource;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -35,11 +41,6 @@ import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.persistence.criteria.*;
import java.util.Date;
import java.util.List;
/**
* Date: 2019/11/4
* Time: 下午2:59
......
......@@ -2,19 +2,14 @@ package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.xyqb.entity.OauthClientDetailsEntity;
import cn.quantgroup.xyqb.entity.ProductLoginEntity;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.repository.IOauthClientDetailsRepository;
import cn.quantgroup.xyqb.service.user.IOauthClientDetailsService;
import java.util.ArrayList;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* Created by 11 on 2016/12/29.
*/
......
package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.xyqb.entity.*;
import cn.quantgroup.xyqb.entity.CustomerInfoEntity;
import cn.quantgroup.xyqb.entity.CustomerLoginEntity;
import cn.quantgroup.xyqb.entity.EntityBuilder;
import cn.quantgroup.xyqb.entity.OauthClientDetailsEntity;
import cn.quantgroup.xyqb.entity.ProductLoginEntity;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.middleoffice.AppletParamEntry;
import cn.quantgroup.xyqb.repository.ICustomerInfoRepository;
import cn.quantgroup.xyqb.repository.ICustomerLoginRepository;
......@@ -10,15 +15,13 @@ import cn.quantgroup.xyqb.service.user.IOauthLoginInfoService;
import cn.quantgroup.xyqb.service.user.IProductLoginService;
import cn.quantgroup.xyqb.util.AtomicSequencer;
import cn.quantgroup.xyqb.util.RandomSequencer;
import com.alibaba.fastjson.JSON;
import java.util.Date;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
/**
* Created by 11 on 2016/12/29.
*/
......
package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.tech.db.DSType;
import cn.quantgroup.tech.db.TargetDataSource;
import cn.quantgroup.xyqb.entity.ProductLoginEntity;
import cn.quantgroup.xyqb.repository.IProductLoginRepository;
import cn.quantgroup.xyqb.service.user.IProductLoginService;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* Created by 11 on 2016/12/29.
*/
......@@ -21,7 +18,6 @@ public class ProductLoginServiceImpl implements IProductLoginService {
private IProductLoginRepository productLoginRepository;
@Override
@TargetDataSource(type = DSType.SLAVE)//查询从库
public ProductLoginEntity findSlaveByPloginInfo(String institutionId, String productId, Long userId) {
ProductLoginEntity productLogin = productLoginRepository.findByInstitutionIdAndProductIdAndExtensionAccountId(institutionId, productId, userId);
return productLogin;
......@@ -34,7 +30,6 @@ public class ProductLoginServiceImpl implements IProductLoginService {
}
@Override
@TargetDataSource(type = DSType.SLAVE)//查询从库
public List<ProductLoginEntity> findSlaveByUserId(Long userId) {
List<ProductLoginEntity> productLoginEntityList = productLoginRepository.findAllByExtensionAccountId(userId);
return productLoginEntityList;
......
package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.xyqb.entity.*;
import cn.quantgroup.xyqb.entity.CustomerInfoEntity;
import cn.quantgroup.xyqb.entity.OauthClientDetailsEntity;
import cn.quantgroup.xyqb.entity.ProductLoginEntity;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.model.UserBrief;
import cn.quantgroup.xyqb.service.user.ICustomerInfoService;
import cn.quantgroup.xyqb.service.user.IOauthClientDetailsService;
import cn.quantgroup.xyqb.service.user.IProductLoginService;
import cn.quantgroup.xyqb.service.user.ITenantService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by 11 on 2016/12/29.
......
......@@ -3,13 +3,11 @@ package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.xyqb.entity.UserBtRegister;
import cn.quantgroup.xyqb.repository.IUserBtRegisterRepository;
import cn.quantgroup.xyqb.service.user.IUserBtRegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import javax.persistence.criteria.Predicate;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.criteria.Predicate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by Administrator on 2017/5/16.
......
package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.tech.db.DSType;
import cn.quantgroup.tech.db.TargetDataSource;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserAttached;
import cn.quantgroup.xyqb.repository.IUserAttachedRepository;
......@@ -10,6 +8,11 @@ import cn.quantgroup.xyqb.service.user.ITenantService;
import cn.quantgroup.xyqb.service.user.UserCenterService;
import cn.quantgroup.xyqb.util.EmojiUtil;
import cn.quantgroup.xyqb.util.TenantUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.exception.ConstraintViolationException;
......@@ -17,12 +20,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
/**
* Created by 11 on 2017/3/22.
*/
......@@ -40,7 +37,6 @@ public class UserCenterServiceImpl implements UserCenterService {
private ITenantService tenantService;
@Override
@TargetDataSource(type = DSType.SLAVE)//查询从库
// @Cacheable(value = "userAttachedCache", key = "'xyqbUserAttached' + #userId", unless = "#result == null", cacheManager = "cacheManager")
public UserAttached searchUserAttachedByUserId(long userId) {
return userAttachedRepository.findByUserId(userId);
......
package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.tech.db.DSType;
import cn.quantgroup.tech.db.TargetDataSource;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.event.UserDetailUpdateEvent;
import cn.quantgroup.xyqb.model.Gender;
......@@ -16,6 +13,12 @@ import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.vo.UserDetailVO;
import cn.quantgroup.xyqb.util.AddressFilter;
import cn.quantgroup.xyqb.util.ValidationUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Resource;
import javax.persistence.criteria.Predicate;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -26,15 +29,8 @@ import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.persistence.criteria.Predicate;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
/**
* Created by 11 on 2016/12/29.
*/
......@@ -63,7 +59,6 @@ public class UserDetailServiceImpl implements IUserDetailService {
}
@Override
@TargetDataSource(type = DSType.SLAVE)//查询从库
public UserDetail findSlaveByUserId(Long userId) {
UserDetail userDetail = userDetailRepository.findByUserId(userId);
if (null == userDetail) {
......@@ -91,7 +86,6 @@ public class UserDetailServiceImpl implements IUserDetailService {
}
@Override
@TargetDataSource(type = DSType.SLAVE)//查询从库
public UserDetail findSlaveByPhoneNo(String phoneNo) {
return userDetailRepository.findByPhoneNo(phoneNo);
}
......
package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.tech.db.DSType;
import cn.quantgroup.tech.db.TargetDataSource;
import cn.quantgroup.user.enums.OccupationEnum;
import cn.quantgroup.xyqb.entity.UserExtInfo;
import cn.quantgroup.xyqb.repository.IUserExtInfoRepository;
import cn.quantgroup.xyqb.service.user.IUserExtInfoService;
import java.sql.Timestamp;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Created by Miraculous on 2017/1/3.
*/
......@@ -46,7 +36,6 @@ public class UserExtInfoServiceImpl implements IUserExtInfoService {
}
@Override
@TargetDataSource(type = DSType.SLAVE)//查询从库
public List<UserExtInfo> findByCreatedAtAfterAndCreatedAtBeforeAndOccupationEnum(Timestamp start, Timestamp end) {
return userExtInfoRepository.findByCreatedAtAfterAndCreatedAtBeforeAndOccupationEnum(start, end, OccupationEnum.STUDENT);
}
......
......@@ -3,11 +3,10 @@ package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.xyqb.entity.UserQueryLog;
import cn.quantgroup.xyqb.repository.IUserQueryLogRepository;
import cn.quantgroup.xyqb.service.user.IUserQueryLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by zenglibin on 2017/06/13.
......
package cn.quantgroup.xyqb.service.user.impl;
import cn.quantgroup.tech.db.DSType;
import cn.quantgroup.tech.db.TargetDataSource;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR;
import cn.quantgroup.user.enums.BizType;
import cn.quantgroup.user.enums.IncomeRangeEnum;
import cn.quantgroup.user.enums.LoginType;
......@@ -9,25 +9,63 @@ import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.aspect.lock.RedisLock;
import cn.quantgroup.xyqb.controller.IBaseController;
import cn.quantgroup.xyqb.controller.internal.user.resp.UserFullResp;
import cn.quantgroup.xyqb.entity.*;
import cn.quantgroup.xyqb.entity.Address;
import cn.quantgroup.xyqb.entity.Merchant;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.entity.UserExtInfo;
import cn.quantgroup.xyqb.entity.UserHashMapping;
import cn.quantgroup.xyqb.entity.UserHashPhoneNoIdNoMapping;
import cn.quantgroup.xyqb.event.PhoneNoUpdateEvent;
import cn.quantgroup.xyqb.exception.DataException;
import cn.quantgroup.xyqb.exception.UserNotExistException;
import cn.quantgroup.xyqb.exception.UserRegisterLoginException;
import cn.quantgroup.xyqb.model.*;
import cn.quantgroup.xyqb.repository.*;
import cn.quantgroup.xyqb.model.AuthBean;
import cn.quantgroup.xyqb.model.FindByMd5Enum;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.LoginProperties;
import cn.quantgroup.xyqb.model.UserInfo;
import cn.quantgroup.xyqb.repository.IProductLoginRepository;
import cn.quantgroup.xyqb.repository.IUserAttachedRepository;
import cn.quantgroup.xyqb.repository.IUserBtRegisterRepository;
import cn.quantgroup.xyqb.repository.IUserHashMappingRepository;
import cn.quantgroup.xyqb.repository.IUserHashPhoneNoIdNoMappingRepository;
import cn.quantgroup.xyqb.repository.IUserRepository;
import cn.quantgroup.xyqb.repository.IUuidPhoneMappingRepository;
import cn.quantgroup.xyqb.repository.IWeChatUserRepository;
import cn.quantgroup.xyqb.service.captcha.IGeetestLogService;
import cn.quantgroup.xyqb.service.register.IUserDeregisterService;
import cn.quantgroup.xyqb.service.register.IUserRegisterService;
import cn.quantgroup.xyqb.service.session.ISessionService;
import cn.quantgroup.xyqb.service.user.*;
import cn.quantgroup.xyqb.service.user.IAddressService;
import cn.quantgroup.xyqb.service.user.IContactService;
import cn.quantgroup.xyqb.service.user.ILockIpv4Service;
import cn.quantgroup.xyqb.service.user.IOauthLoginInfoService;
import cn.quantgroup.xyqb.service.user.ITenantService;
import cn.quantgroup.xyqb.service.user.IUserDetailService;
import cn.quantgroup.xyqb.service.user.IUserExtInfoService;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.service.wechat.IWechatService;
import cn.quantgroup.xyqb.util.*;
import cn.quantgroup.xyqb.util.BctyptPasswordUtil;
import cn.quantgroup.xyqb.util.HashUtil;
import cn.quantgroup.xyqb.util.IpUtil;
import cn.quantgroup.xyqb.util.MqUtils;
import cn.quantgroup.xyqb.util.TenantUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.sensorsdata.analytics.javasdk.ISensorsAnalytics;
import com.sensorsdata.analytics.javasdk.bean.EventRecord;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -40,14 +78,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static cn.quantgroup.xyqb.constant.UserConstant.USER_ERROR_OR_ENABLE_ERROR;
/**
* Created by Miraculous on 15/7/5.
*/
......@@ -131,14 +161,12 @@ public class UserServiceImpl implements IUserService, IBaseController {
}
@Override
@TargetDataSource(type = DSType.SLAVE)//查询从库
// @Cacheable(value = "usercache", key = "'xyqbuser' + #phone", unless = "#result == null", cacheManager = "cacheManager")
public User findSlaveByPhoneInDb(String phone) {
return userRepository.findByPhoneNo(phone);
}
@Override
@TargetDataSource(type = DSType.SLAVE)//查询从库
public Map<Long, String> findPhoneByIdsInDb(List<Long> userIds, Integer tenantId) {
if (CollectionUtils.isEmpty(userIds)) {
return Maps.newHashMap();
......
......@@ -5,7 +5,6 @@ import cn.quantgroup.xyqb.repository.IUserSpouseRepository;
import cn.quantgroup.xyqb.service.user.IUserSpouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
@Service
......
......@@ -4,11 +4,10 @@ import cn.quantgroup.motan.retbean.XUserDetail;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.model.Gender;
import cn.quantgroup.xyqb.model.IdType;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.sql.Timestamp;
import java.util.Optional;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
......
package cn.quantgroup.xyqb.service.wechat;
import cn.quantgroup.xyqb.entity.WechatUserInfo;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.webchat.AccessTokenResponse;
import java.util.List;
public interface IWechatFollowService {
......
......@@ -2,7 +2,6 @@ package cn.quantgroup.xyqb.service.wechat;
import cn.quantgroup.xyqb.entity.WechatUserInfo;
import cn.quantgroup.xyqb.model.webchat.AccessTokenResponse;
import java.util.List;
/**
......
package cn.quantgroup.xyqb.service.wechat.impl;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.entity.WechatUserInfo;
import cn.quantgroup.xyqb.event.WechatBindEvent;
import cn.quantgroup.xyqb.exception.WechatRelateUserException;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.webchat.*;
import cn.quantgroup.xyqb.model.webchat.AccessTokenResponse;
import cn.quantgroup.xyqb.model.webchat.CustomerListResponse;
import cn.quantgroup.xyqb.model.webchat.DepartmentInfoResponse;
import cn.quantgroup.xyqb.model.webchat.DepartmentListResponse;
import cn.quantgroup.xyqb.model.webchat.WechatUserListResponse;
import cn.quantgroup.xyqb.repository.IWeChatInfoRelationRepository;
import cn.quantgroup.xyqb.repository.IWeChatUserRepository;
import cn.quantgroup.xyqb.service.http.IHttpService;
import cn.quantgroup.xyqb.service.wechat.IWechatFollowService;
import cn.quantgroup.xyqb.service.wechat.IWechatService;
import cn.quantgroup.xyqb.util.GcodeUtils;
import cn.quantgroup.xyqb.util.ValidationUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.ImmutableMap;
import com.google.gson.Gson;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -27,16 +30,8 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
/**
* Created by Miraculous on 2017/1/19.
*/
......
......@@ -12,6 +12,12 @@ import cn.quantgroup.xyqb.service.wechat.IWechatService;
import cn.quantgroup.xyqb.util.ValidationUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -22,13 +28,6 @@ import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
/**
* Created by Miraculous on 2017/1/19.
*/
......
......@@ -4,15 +4,14 @@ import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.model.session.SessionStruct;
import cn.quantgroup.xyqb.model.session.SessionValue;
import com.alibaba.fastjson.JSON;
import java.util.Objects;
import javax.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.util.Objects;
/**
* Created by Miraculous on 2016/12/29.
*/
......
......@@ -8,12 +8,11 @@ import com.octo.captcha.service.AbstractManageableCaptchaServiceMBean;
import com.octo.captcha.service.CaptchaService;
import com.octo.captcha.service.CaptchaServiceException;
import com.octo.captcha.service.captchastore.CaptchaStore;
import org.apache.commons.collections.FastHashMap;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Locale;
import org.apache.commons.collections.FastHashMap;
/**
* 类名称:AbstractManageableCaptchaService
......
......@@ -5,7 +5,6 @@ import com.octo.captcha.engine.CaptchaEngine;
import com.octo.captcha.service.CaptchaServiceException;
import com.octo.captcha.service.captchastore.CaptchaStore;
import com.octo.captcha.service.image.ImageCaptchaService;
import java.awt.image.BufferedImage;
import java.util.Locale;
......
......@@ -6,7 +6,6 @@ import com.octo.captcha.component.image.wordtoimage.WordToImage;
import com.octo.captcha.component.word.wordgenerator.WordGenerator;
import com.octo.captcha.image.ImageCaptcha;
import com.octo.captcha.image.gimpy.GimpyFactory;
import java.awt.image.BufferedImage;
import java.util.Locale;
......
package cn.quantgroup.xyqb.thirdparty.jcaptcha;
import com.octo.captcha.image.ImageCaptcha;
import org.apache.commons.lang3.StringUtils;
import java.awt.image.BufferedImage;
import org.apache.commons.lang3.StringUtils;
/**
* 类名称:SimpleCaptcha
......
......@@ -2,10 +2,16 @@ package cn.quantgroup.xyqb.urora;
import cn.quantgroup.xyqb.security.CustomerAuthenticationManager;
import cn.quantgroup.xyqb.security.RSADecrypt;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.*;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.security.authentication.BadCredentialsException;
......@@ -15,9 +21,6 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
import java.util.Arrays;
import java.util.List;
/**
* Created by Administrator on 2021/7/1 0001.
*/
......
package cn.quantgroup.xyqb.urora;
import org.springframework.security.authentication.AbstractAuthenticationToken;
import java.util.Collection;
import org.springframework.security.authentication.AbstractAuthenticationToken;
/**
* Created by Administrator on 2021/7/1 0001.
......
......@@ -2,16 +2,15 @@ package cn.quantgroup.xyqb.util;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
/**
* @author :dongjianhua
......
package cn.quantgroup.xyqb.util;
import cn.quantgroup.xyqb.Constants;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
/**
* AES编码器工具
* 使用AES加密解密 AES-128-ECB加密
......
package cn.quantgroup.xyqb.util;
import java.util.Map;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -7,8 +8,6 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
import java.util.Map;
/**
* Created by Miraculous on 15/7/12.
*/
......
package cn.quantgroup.xyqb.util;
import org.springframework.stereotype.Component;
import java.util.concurrent.atomic.AtomicLong;
import org.springframework.stereotype.Component;
/**
* @author hechao
......
package cn.quantgroup.xyqb.util;
import org.springframework.security.crypto.bcrypt.BCrypt;
import java.util.Objects;
import org.springframework.security.crypto.bcrypt.BCrypt;
/**
* Created by Miraculous on 15/7/5.
......
package cn.quantgroup.xyqb.util;
import java.util.Calendar;
import java.util.Date;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
/**
* joda-time
* <p>
......
......@@ -2,13 +2,12 @@ package cn.quantgroup.xyqb.util;
import cn.quantgroup.tech.util.TechEnvironment;
import com.google.common.collect.Sets;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.Objects;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
/**
* IP地址工具类
......
package cn.quantgroup.xyqb.util;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import java.util.Optional;
import lombok.extern.slf4j.Slf4j;
/**
* Created by liqing on 2017/12/4 0004.
......
package cn.quantgroup.xyqb.util;
import org.apache.commons.lang.StringUtils;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.model.UserRegisterMqMessage;
import cn.quantgroup.xyqb.model.UserRet;
import cn.quantgroup.xyqb.model.UserStatistics;
import cn.quantgroup.xyqb.service.mq.IRegisterMqService;
import cn.quantgroup.xyqb.service.mq.IVestService;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
/**
* Created by xuran on 2017/6/23.
......
......@@ -3,12 +3,11 @@ package cn.quantgroup.xyqb.util;
import cn.quantgroup.xyqb.Constants;
import com.alibaba.fastjson.JSON;
import com.google.common.base.Preconditions;
import org.apache.commons.lang.StringUtils;
import java.security.MessageDigest;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ThreadLocalRandom;
import org.apache.commons.lang.StringUtils;
/**
* Created by Miraculous on 15/7/5.
......
package cn.quantgroup.xyqb.util;
import java.util.Random;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.text.RandomStringGenerator;
import org.springframework.dao.InvalidDataAccessResourceUsageException;
......@@ -7,8 +8,6 @@ import org.springframework.data.redis.core.RedisCallback;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import java.util.Random;
/**
* RedisLock
* Created by Feng on 2017/6/5.
......
package cn.quantgroup.xyqb.util;
import org.springframework.core.env.Environment;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.Query;
import java.lang.management.ManagementFactory;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Set;
import javax.management.MBeanServer;
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
import javax.management.Query;
import org.springframework.core.env.Environment;
/**
* Created by hechao on 2020/1/21.
......
......@@ -2,13 +2,12 @@ package cn.quantgroup.xyqb.util;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.util.encrypt.Md5Util;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import java.util.Calendar;
import java.util.Objects;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
/**
* Created by Miraculous on 15/7/6.
......
package cn.quantgroup.xyqb.util.encrypt;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import lombok.extern.slf4j.Slf4j;
/**
* Created by tums on 2015/11/30.
......
package cn.quantgroup.xyqb.util.encrypt;
import lombok.extern.slf4j.Slf4j;
import javax.crypto.Cipher;
import java.io.ByteArrayOutputStream;
import java.math.BigInteger;
import java.security.*;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.Signature;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.HashMap;
import java.util.Map;
import javax.crypto.Cipher;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class Rsa {
......
package cn.quantgroup.xyqb.validator;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
......
package cn.quantgroup.xyqb.validator;
import cn.quantgroup.xyqb.util.ValidationUtil;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
......
package cn.quantgroup.xyqb.validator;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import javax.validation.Constraint;
import javax.validation.Payload;
/**
* @author 徐小光
......
package cn.quantgroup.xyqb.validator;
import cn.quantgroup.xyqb.util.IdcardValidator;
import org.apache.commons.lang3.StringUtils;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import org.apache.commons.lang3.StringUtils;
/**
* 身份证验证器, <IdCard,String> String 对应的是可以对哪些类型校验
......
package cn.quantgroup.xyqb.xxlJob;
import cn.quantgroup.xyqb.service.register.IUserDeregisterService;
import cn.quantgroup.xyqb.service.wechat.IWechatFollowService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
......
package cn.quantgroup.xyqb.xxlJob;
import cn.quantgroup.xyqb.service.captcha.IGeetestLogService;
import cn.quantgroup.xyqb.service.register.IUserDeregisterService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
......
package cn.quantgroup.xyqb.xxlJob;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.xxl.job.core.executor.impl.XxlJobSpringExecutor;
@Configuration
@Slf4j
......
/*
*
* Copyright 2015 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*
*/
package springfox.documentation.schema;
import com.fasterxml.jackson.annotation.JsonValue;
import com.google.common.base.Function;
import com.google.common.base.Optional;
import org.springframework.core.annotation.AnnotationUtils;
import springfox.documentation.service.AllowableListValues;
import springfox.documentation.service.AllowableValues;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import static com.google.common.base.Strings.isNullOrEmpty;
import static com.google.common.collect.Lists.transform;
import static java.util.Arrays.asList;
/**
* 增加对enum name 的支持
*/
public class Enums {
private Enums() {
throw new UnsupportedOperationException();
}
public static AllowableValues allowableValues(Class<?> type) {
if (type.isEnum()) {
List<String> enumValues = getEnumValues(type);
return new AllowableListValues(enumValues, "LIST");
}
return null;
}
static List<String> getEnumValues(final Class<?> subject) {
return transformUnique(subject.getEnumConstants(), new Function<Object, String>() {
@Override
public String apply(Object input) {
Optional<String> jsonValue = findJsonValueAnnotatedMethod(input)
.transform(evaluateJsonValue(input));
if (jsonValue.isPresent() && !isNullOrEmpty(jsonValue.get())) {
return jsonValue.get();
}
return ((Enum) input).name();
}
});
}
@SuppressWarnings("PMD")
private static Function<Method, String> evaluateJsonValue(final Object enumConstant) {
return new Function<Method, String>() {
@Override
public String apply(Method input) {
try {
return input.invoke(enumConstant).toString();
} catch (Exception ignored) {
}
return "";
}
};
}
private static <E> List<String> transformUnique(E[] values, Function<E, String> mapper) {
List<String> nonUniqueValues = transform(asList(values), mapper);
Set<String> uniqueValues = new LinkedHashSet<String>(nonUniqueValues);
return new ArrayList<String>(uniqueValues);
}
private static Optional<Method> findJsonValueAnnotatedMethod(Object enumConstant) {
for (Method each : enumConstant.getClass().getMethods()) {
JsonValue jsonValue = AnnotationUtils.findAnnotation(each, JsonValue.class);
if (jsonValue != null && jsonValue.value()) {
return Optional.of(each);
}
}
return Optional.absent();
}
public static AllowableValues emptyListValuesToNull(AllowableListValues values) {
if (!values.getValues().isEmpty()) {
return values;
}
return null;
}
}
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
\ No newline at end of file
import demo.*;
import demo.DynamicTest;
import demo.MockMvcTest;
import demo.MvcTest;
import demo.ParametersJunit4Test;
import demo.ParametersJunit5Test;
import demo.RepsitoryJpaTest;
import demo.RepsitoryTest;
import demo.ServiceTest;
import demo.WebTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
......
import cn.quantgroup.xyqb.security.RSADecrypt;
import cn.quantgroup.xyqb.util.PasswordUtil;
import org.springframework.util.Base64Utils;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import org.springframework.util.Base64Utils;
/**
* Created by Administrator on 2021/6/25 0025.
......
package common;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.util.AesUtil;
import cn.quantgroup.xyqb.util.ValidationUtil;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.util.AesUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.RandomStringUtils;
import org.junit.Assert;
......@@ -14,8 +14,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import cn.quantgroup.xyqb.util.ValidationUtil;
@Slf4j
@RunWith(JUnit4.class)
public class Jdk8Test {
......
package common;
import java.sql.Timestamp;
import org.apache.commons.codec.binary.Base64;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.model.IdType;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
......@@ -11,14 +9,13 @@ import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.gson.Gson;
import java.sql.Timestamp;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.binary.Base64;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import cn.quantgroup.xyqb.entity.UserDetail;
import cn.quantgroup.xyqb.model.IdType;
@Slf4j
@RunWith(JUnit4.class)
public class JsonTest {
......
package common;
import cn.quantgroup.xyqb.util.ValidationUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import cn.quantgroup.xyqb.util.ValidationUtil;
@Slf4j
@RunWith(JUnit4.class)
public class ValidationUtilTest {
......
package demo;
import org.junit.jupiter.api.*;
import org.junit.jupiter.api.function.ThrowingConsumer;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.DynamicContainer.dynamicContainer;
import static org.junit.jupiter.api.DynamicTest.dynamicTest;
import java.security.SecureRandom;
import java.util.*;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.function.Function;
import java.util.stream.IntStream;
import java.util.stream.Stream;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.DynamicContainer.dynamicContainer;
import static org.junit.jupiter.api.DynamicTest.dynamicTest;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.DynamicNode;
import org.junit.jupiter.api.Tag;
import org.junit.jupiter.api.TestFactory;
import org.junit.jupiter.api.function.ThrowingConsumer;
/**
......
package demo;
import static org.mockito.BDDMockito.given;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import cn.quantgroup.xyqb.Constants;
import cn.quantgroup.xyqb.config.data.JpaConfig;
import cn.quantgroup.xyqb.config.data.RedisConfig;
......@@ -7,6 +12,7 @@ import cn.quantgroup.xyqb.controller.external.UserController;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.service.user.IUserService;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import javax.annotation.Resource;
import org.json.JSONObject;
import org.junit.Assert;
import org.junit.Test;
......@@ -20,13 +26,6 @@ import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import javax.annotation.Resource;
import static org.mockito.BDDMockito.given;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@RunWith(SpringRunner.class)
@WebMvcTest({UserController.class})
......
package demo;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import cn.quantgroup.xyqb.Bootstrap;
import cn.quantgroup.xyqb.Constants;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import com.fasterxml.jackson.core.JsonProcessingException;
import javax.annotation.Resource;
import org.json.JSONObject;
import org.junit.Assert;
import org.junit.Before;
......@@ -19,10 +22,6 @@ import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import javax.annotation.Resource;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Bootstrap.class)
@ContextConfiguration(initializers = ApolloPropertySourceInitializer.class)
......
package demo;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import org.junit.jupiter.api.Tag;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.util.Arrays;
import java.util.Collection;
/**
* jUnit4风格参数化批量测试(用例)
* @author renwc
......
package demo;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
......@@ -9,8 +11,6 @@ import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* jUnit5风格参数化批量测试(用例)
* @author renwc
......
......@@ -5,6 +5,10 @@ import cn.quantgroup.xyqb.config.data.RedisConfig;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.repository.IUserRepository;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import java.sql.Timestamp;
import java.time.Instant;
import javax.annotation.Resource;
import javax.persistence.PersistenceException;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -16,11 +20,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.persistence.PersistenceException;
import java.sql.Timestamp;
import java.time.Instant;
/**
* 持久层测试用例
* @author renwc
......
......@@ -4,6 +4,9 @@ import cn.quantgroup.xyqb.Bootstrap;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.repository.IUserRepository;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import java.sql.Timestamp;
import java.time.Instant;
import javax.annotation.Resource;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -14,10 +17,6 @@ import org.springframework.test.context.junit4.AbstractTransactionalJUnit4Spring
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.time.Instant;
/**
* 持久层测试用例
......
......@@ -4,6 +4,9 @@ import cn.quantgroup.xyqb.Bootstrap;
import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.service.user.IUserService;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import java.sql.Timestamp;
import java.time.Instant;
import javax.annotation.Resource;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -14,10 +17,6 @@ import org.springframework.test.context.junit4.AbstractTransactionalJUnit4Spring
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.time.Instant;
/**
* 业务层测试用例
* @author renwc
......
......@@ -2,6 +2,7 @@ package demo;
import cn.quantgroup.xyqb.Bootstrap;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.Test;
......@@ -14,8 +15,6 @@ import org.springframework.http.ResponseEntity;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
/**
* 控制层测试用例
......
......@@ -9,6 +9,10 @@ import cn.quantgroup.xyqb.entity.Address;
import cn.quantgroup.xyqb.model.AuthBean;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.user.IAddressService;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpEntity;
......@@ -25,11 +29,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* Created by 11 on 2017/1/3.
*/
......
......@@ -6,6 +6,9 @@ import cn.quantgroup.xyqb.model.AuthPattern;
import cn.quantgroup.xyqb.repository.IUserAuthorizedRepository;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import demo.BaseParametersTest;
import java.util.Arrays;
import java.util.Collection;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.Test;
......@@ -17,10 +20,6 @@ import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Collection;
/**
* 业务层测试用例
* @author renwc
......
......@@ -5,6 +5,8 @@ import cn.quantgroup.xyqb.model.ClientType;
import cn.quantgroup.xyqb.service.captcha.IGeetestCaptchaService;
import cn.quantgroup.xyqb.util.PasswordUtil;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import java.util.Map;
import javax.annotation.Resource;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -12,9 +14,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.Map;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Bootstrap.class)
@ContextConfiguration(initializers = ApolloPropertySourceInitializer.class)
......
......@@ -3,6 +3,8 @@ package service;
import cn.quantgroup.xyqb.Bootstrap;
import cn.quantgroup.xyqb.service.captcha.IQuantgroupCaptchaService;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import java.util.Locale;
import javax.annotation.Resource;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -10,9 +12,6 @@ import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.util.Locale;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Bootstrap.class)
@ContextConfiguration(initializers = ApolloPropertySourceInitializer.class)
......
......@@ -7,6 +7,10 @@ import cn.quantgroup.xyqb.model.UserAuthorizedParam;
import cn.quantgroup.xyqb.service.auth.IUserAuthorizedService;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import demo.BaseParametersTest;
import java.util.Arrays;
import java.util.Collection;
import java.util.Optional;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.FixMethodOrder;
......@@ -19,11 +23,6 @@ import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Collection;
import java.util.Optional;
/**
* 业务层测试用例
* @author renwc
......
......@@ -6,6 +6,10 @@ import cn.quantgroup.xyqb.service.user.IAddressService;
import cn.quantgroup.xyqb.service.user.IContactService;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import com.google.common.collect.Lists;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.Before;
import org.junit.Test;
......@@ -17,13 +21,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.TestContextManager;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.sql.Timestamp;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
/**
* Created by xuran on 2017/12/26.
*/
......
......@@ -5,6 +5,8 @@ import cn.quantgroup.xyqb.model.AuthPattern;
import cn.quantgroup.xyqb.model.UserAuthorizedParam;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import demo.BaseParametersTest;
import java.util.Optional;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.Assert;
import org.junit.Test;
......@@ -18,9 +20,6 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Optional;
/**
* 业务层测试用例
* @author renwc
......
......@@ -6,17 +6,13 @@ import cn.quantgroup.xyqb.entity.WechatUserInfo;
import cn.quantgroup.xyqb.repository.IWeChatUserRepository;
import cn.quantgroup.xyqb.service.user.IAddressService;
import com.ctrip.framework.apollo.spring.config.ApolloPropertySourceInitializer;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
* @author :dongjianhua
......
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