Commit b36149a8 authored by hezhen's avatar hezhen

Merge branch 'master_source' into dev

# Conflicts:
#	ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/AuthService.java
#	ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/service/impl/AppAuthServiceImpl.java
parents 193a80b3 4d9cde1e
......@@ -84,9 +84,10 @@ public class AuthController {
@RequestParam(value="mobilecode",defaultValue="")String mobilecode,
@RequestParam(value="password",defaultValue="")String password,
@RequestParam(value="code",defaultValue="")String code,
@RequestParam(value="channel",defaultValue="1")Integer channel)throws Exception{
@RequestParam(value="channel",defaultValue="1")Integer channel,
@RequestParam(value="registerSource",defaultValue="")Integer registerSource)throws Exception{
log.info(username+"----require register...");
JSONObject data=appAuthService.register(username,mobilecode,password,code,channel);
JSONObject data=appAuthService.register(username,mobilecode,password,code,channel,registerSource);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JwtAuthenticationRequest authenticationRequest=new JwtAuthenticationRequest();
authenticationRequest.setUsername(username);
......@@ -108,11 +109,12 @@ public class AuthController {
@RequestParam(value="type",defaultValue="0")Integer type,
@RequestParam(value="isQQ",defaultValue="0")Integer isQQ,
@RequestParam(value="code",defaultValue="")String code,
@RequestParam(value="channel",defaultValue="1")Integer channel
@RequestParam(value="channel",defaultValue="1")Integer channel,
@RequestParam(value="registerSource",defaultValue="")Integer registerSource
)throws Exception{
log.info(username+"----require wxregister...");
JSONObject data=appAuthService.wxregister( username, mobilecode, password, nickname,
headimgurl, openid, unionid,type,isQQ,code,channel);
headimgurl, openid, unionid,type,isQQ,code,channel,registerSource);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JSONObject result=data.getJSONObject("data");
if(result==null){
......
......@@ -35,7 +35,8 @@ public interface IUserService {
@RequestParam(value="mobilecode",defaultValue="")String mobilecode,
@RequestParam(value="password",defaultValue="")String password,
@RequestParam(value="code")String code,
@RequestParam(value="channel",defaultValue="1")Integer channel);
@RequestParam(value="channel",defaultValue="1")Integer channel,
@RequestParam(value="registerSource",defaultValue="")Integer registerSource);
@RequestMapping(value = "/api/app/user/wxregister", method = RequestMethod.POST)
public JSONObject wxregister(
@RequestParam(value="username")String username,@RequestParam(value="mobilecode")String mobilecode,
......@@ -43,7 +44,8 @@ public interface IUserService {
@RequestParam(value="headimgurl")String headimgurl,@RequestParam(value="openid")String openid,
@RequestParam(value="unionid")String unionid,@RequestParam(value="type")Integer type,
@RequestParam(value="isQQ")Integer isQQ,@RequestParam(value="code")String code,
@RequestParam(value="channel",defaultValue="1")Integer channel);
@RequestParam(value="channel",defaultValue="1")Integer channel,
@RequestParam(value="registerSource",defaultValue="")Integer registerSource);
@RequestMapping(value = "/api/app/user/checkBindWechat",method = RequestMethod.POST)
public JSONObject checkBindWechat( @RequestParam(value="username")String username);
@RequestMapping(value = "/api/app/user/wxlogin",method = RequestMethod.POST)
......
......@@ -11,8 +11,8 @@ public interface AuthService {
String refresh(String oldToken) throws Exception;
void validate(String token) throws Exception;
JSONObject sendsms(String username, Integer type, String pointList) throws Exception;
JSONObject register(String username, String mobilecode, String password,String code, Integer channel) throws Exception;
JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code, Integer channel) throws Exception;
JSONObject register(String username, String mobilecode, String password,String code,Integer channel,Integer registerSource) throws Exception;
JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code,Integer channel,Integer registerSource) throws Exception;
JSONObject checkBindWechat(String username) throws Exception;
JSONObject wxlogin(String openid,Integer isQQ,String code) throws Exception;
JSONObject tlogin(String username, String password,String mobilecode,Integer type,String code) throws Exception;
......
......@@ -72,13 +72,13 @@ public class AppAuthServiceImpl implements AuthService {
}
@Override
public JSONObject register(String username, String mobilecode, String password,String code, Integer channel) throws Exception {
return userService.register(username,mobilecode,password,code,channel);
public JSONObject register(String username, String mobilecode, String password,String code,Integer channel,Integer registerSource) throws Exception {
return userService.register(username,mobilecode,password,code,channel,registerSource);
}
@Override
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code, Integer channel) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ,code,channel);
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code,Integer channel,Integer registerSource) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ,code,channel,registerSource);
}
@Override
......
......@@ -69,13 +69,13 @@ public class AuthServiceImpl implements AuthService {
return userService.sendsms(username,type, pointList);
}
@Override
public JSONObject register(String username, String mobilecode, String password,String code,Integer channel) throws Exception {
return userService.register(username,mobilecode,password,code,channel);
public JSONObject register(String username, String mobilecode, String password,String code,Integer channel,Integer registerSource) throws Exception {
return userService.register(username,mobilecode,password,code,channel,registerSource);
}
@Override
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code,Integer channel) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ,code,channel);
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code,Integer channel,Integer registerSource) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ,code,channel,registerSource);
}
@Override
......
......@@ -82,4 +82,8 @@ public class AppUserDetail {
@ApiModelProperty(value = "1-新人用户;2-未激活;3-激活")
@Column(name = "state")
private Integer state;
@ApiModelProperty(value = "注册来源")
@Column(name = "register_source")
private Integer registerSource;
}
......@@ -89,12 +89,13 @@ public class AppUserRest {
@RequestParam(value="mobilecode",defaultValue="")String mobilecode,
@RequestParam(value="password",defaultValue="")String password,
@RequestParam(value="code",defaultValue="")String code,
@RequestParam(value="channel",defaultValue="1")Integer channel
@RequestParam(value="channel",defaultValue="1")Integer channel,
@RequestParam(value="registerSource",defaultValue="")Integer registerSource
){
//默认昵称
String nickname=SystemConfig.USER_NIKENAME_DEFAULT+(int)((Math.random()*9+1)*100000);
return appPermissionService.register(username, password, SystemConfig.USER_HEADER_URL_DEFAULT,nickname,
mobilecode, null, null,0,code,channel);
mobilecode, null, null,0,code,channel,registerSource);
}
......@@ -123,7 +124,8 @@ public class AppUserRest {
@RequestParam(value="type",defaultValue="0")Integer type,
@RequestParam(value="isQQ",defaultValue="0")Integer isQQ,
@RequestParam(value="code",defaultValue="")String code,
@RequestParam(value="channel",defaultValue="1")Integer channel
@RequestParam(value="channel",defaultValue="1")Integer channel,
@RequestParam(value="registerSource",defaultValue="")Integer registerSource
){
if(StringUtils.isBlank(headimgurl)){
headimgurl=SystemConfig.USER_HEADER_URL_DEFAULT;
......@@ -131,7 +133,7 @@ public class AppUserRest {
if(StringUtils.isBlank(nickname)){
nickname=SystemConfig.USER_NIKENAME_DEFAULT+(int)((Math.random()*9+1)*100000);
}
return appPermissionService.weCahtRegister(username,password,openid, unionid,nickname,headimgurl,type,mobilecode,isQQ,code,channel);
return appPermissionService.weCahtRegister(username,password,openid, unionid,nickname,headimgurl,type,mobilecode,isQQ,code,channel,registerSource);
}
/**
* 手机号码检测是否已绑定
......
......@@ -251,7 +251,7 @@ public class AppPermissionService {
*/
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
public JSONObject register(String username, String password, String headimgurl,
String nickname, String mobilecode, String openId, String unionid, Integer type,String code,Integer channel) {
String nickname, String mobilecode, String openId, String unionid, Integer type,String code,Integer channel,Integer registerSource) {
log.info("register------code====="+code+"----开始进入方法---time===="+System.currentTimeMillis()/1000L);
String activityCode = null;
// 判断参数和验证码
......@@ -343,6 +343,7 @@ public class AppPermissionService {
//生成邀请码 长度改为8 不然重复率太高
rsUserDetail.setCode(ReferralCodeUtil.encode(userid));
rsUserDetail.setChannel(channel);
rsUserDetail.setRegisterSource(registerSource);
appUserDetailBiz.insertSelective(rsUserDetail);
log.info("注册:新增用户详情: " + userid+"---time===="+System.currentTimeMillis()/1000L);
/* //绑定上下线关系
......@@ -566,7 +567,7 @@ public class AppPermissionService {
*/
@Transactional
public JSONObject weCahtRegister(String username, String password, String openId,
String unionid, String nickname, String headimgurl, int type, String mobilecode, Integer isQQ,String code,Integer channel) {
String unionid, String nickname, String headimgurl, int type, String mobilecode, Integer isQQ,String code,Integer channel,Integer registerSource) {
// 校验参数和验证码
if (StringUtils.isBlank(username) || StringUtils.isBlank(mobilecode)) {
return JsonResultUtil.createFailedResult(ResultCode.NULL_CODE, "参数为空");
......@@ -626,6 +627,7 @@ public class AppPermissionService {
userDetail.setIsdel(0);
userDetail.setCrtHost(getIp());
userDetail.setChannel(channel);
userDetail.setRegisterSource(registerSource);
//setCreateIPInfo(userDetail);
appUserDetailBiz.insertSelective(userDetail);
......@@ -659,7 +661,7 @@ public class AppPermissionService {
}
} else if (type == 2) { // 新增
JSONObject register = register(username, password, headimgurl, nickname, mobilecode,
openId, unionid, isQQ,code,channel);
openId, unionid, isQQ,code,channel,registerSource);
if (register.getInteger("status") != ResultCode.SUCCESS_CODE) {
if (register.getInteger("status") == ResultCode.EXIST_CODE) {
return JsonResultUtil.createFailedResult(ResultCode.EXIST_CODE, "用户已存在");
......
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