Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica-cloud-account
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
1
合并请求
1
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
com.pica.cloud.account
pica-cloud-account
提交
460bdb45
提交
460bdb45
编写于
2月 25, 2020
作者:
fengyuan.wan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
一键登录接口
上级
53595cd3
变更
12
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
441 行增加
和
36 行删除
+441
-36
LoginController.java
...ud/account/account/server/controller/LoginController.java
+3
-1
LogLoginOnekey.java
...a/cloud/account/account/server/entity/LogLoginOnekey.java
+135
-0
LoginResult.java
...pica/cloud/account/account/server/entity/LoginResult.java
+10
-0
QueryMobileEntity.java
...loud/account/account/server/entity/QueryMobileEntity.java
+9
-10
LogLoginOnekeyMapper.java
...d/account/account/server/mapper/LogLoginOnekeyMapper.java
+17
-0
OneClickProcessor.java
...cloud/account/account/server/model/OneClickProcessor.java
+31
-11
OneClickLoginReq.java
...ca/cloud/account/account/server/req/OneClickLoginReq.java
+24
-5
LoginServiceImpl.java
...account/account/server/service/impl/LoginServiceImpl.java
+18
-7
RegisterServiceImpl.java
...ount/account/server/service/impl/RegisterServiceImpl.java
+1
-0
HttpUtil.java
.../com/pica/cloud/account/account/server/util/HttpUtil.java
+2
-2
LogLoginEntityMapper.xml
server/src/main/resources/mybatis/LogLoginEntityMapper.xml
+3
-0
LogLoginOnekeyMapper.xml
server/src/main/resources/mybatis/LogLoginOnekeyMapper.xml
+188
-0
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/controller/LoginController.java
浏览文件 @
460bdb45
...
@@ -240,7 +240,9 @@ public class LoginController extends AccountBaseController {
...
@@ -240,7 +240,9 @@ public class LoginController extends AccountBaseController {
@PostMapping
(
"/login/one-click"
)
@PostMapping
(
"/login/one-click"
)
public
PicaResponse
<
LoginResult
>
oneClickLogin
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
public
PicaResponse
<
LoginResult
>
oneClickLogin
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
OneClickLoginReq
req
=
CryptoUtil
.
decrypt
(
entity
,
OneClickLoginReq
.
class
);
OneClickLoginReq
req
=
CryptoUtil
.
decrypt
(
entity
,
OneClickLoginReq
.
class
);
req
.
setType
(
super
.
getSourceType
());
req
.
setProductType
(
super
.
getProductType
());
req
.
setSourceType
(
super
.
getSourceType
());
req
.
setLoginIp
(
super
.
getIpAddr
());
LoginResult
oneClickLoginResultVo
=
loginService
.
oneClickLogin
(
req
);
LoginResult
oneClickLoginResultVo
=
loginService
.
oneClickLogin
(
req
);
return
PicaResponse
.
toResponse
(
oneClickLoginResultVo
);
return
PicaResponse
.
toResponse
(
oneClickLoginResultVo
);
}
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/entity/LogLoginOnekey.java
0 → 100644
浏览文件 @
460bdb45
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
entity
;
import
java.util.Date
;
public
class
LogLoginOnekey
{
private
Integer
id
;
private
Integer
logLoginId
;
private
Byte
deviceType
;
private
String
mobile
;
private
String
tradeNo
;
private
Byte
fanqizha
;
private
String
tag
;
private
String
info
;
private
Integer
deleteFlag
;
private
Integer
createId
;
private
Date
createTime
;
private
Integer
modifyId
;
private
Date
modifyTime
;
public
Integer
getId
()
{
return
id
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
Integer
getLogLoginId
()
{
return
logLoginId
;
}
public
void
setLogLoginId
(
Integer
logLoginId
)
{
this
.
logLoginId
=
logLoginId
;
}
public
Byte
getDeviceType
()
{
return
deviceType
;
}
public
void
setDeviceType
(
Byte
deviceType
)
{
this
.
deviceType
=
deviceType
;
}
public
String
getMobile
()
{
return
mobile
;
}
public
void
setMobile
(
String
mobile
)
{
this
.
mobile
=
mobile
==
null
?
null
:
mobile
.
trim
();
}
public
String
getTradeNo
()
{
return
tradeNo
;
}
public
void
setTradeNo
(
String
tradeNo
)
{
this
.
tradeNo
=
tradeNo
==
null
?
null
:
tradeNo
.
trim
();
}
public
Byte
getFanqizha
()
{
return
fanqizha
;
}
public
void
setFanqizha
(
Byte
fanqizha
)
{
this
.
fanqizha
=
fanqizha
;
}
public
String
getTag
()
{
return
tag
;
}
public
void
setTag
(
String
tag
)
{
this
.
tag
=
tag
==
null
?
null
:
tag
.
trim
();
}
public
String
getInfo
()
{
return
info
;
}
public
void
setInfo
(
String
info
)
{
this
.
info
=
info
==
null
?
null
:
info
.
trim
();
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
void
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
}
public
Integer
getCreateId
()
{
return
createId
;
}
public
void
setCreateId
(
Integer
createId
)
{
this
.
createId
=
createId
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Integer
getModifyId
()
{
return
modifyId
;
}
public
void
setModifyId
(
Integer
modifyId
)
{
this
.
modifyId
=
modifyId
;
}
public
Date
getModifyTime
()
{
return
modifyTime
;
}
public
void
setModifyTime
(
Date
modifyTime
)
{
this
.
modifyTime
=
modifyTime
;
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/entity/LoginResult.java
浏览文件 @
460bdb45
...
@@ -28,6 +28,16 @@ public class LoginResult {
...
@@ -28,6 +28,16 @@ public class LoginResult {
@ApiModelProperty
(
"用户id,已经加密处理"
)
@ApiModelProperty
(
"用户id,已经加密处理"
)
private
String
doctorId
;
private
String
doctorId
;
private
Integer
logLoginId
;
public
Integer
getLogLoginId
()
{
return
logLoginId
;
}
public
void
setLogLoginId
(
Integer
logLoginId
)
{
this
.
logLoginId
=
logLoginId
;
}
public
String
getToken
()
{
public
String
getToken
()
{
return
token
;
return
token
;
}
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/entity/QueryMobileEntity.java
浏览文件 @
460bdb45
...
@@ -11,6 +11,15 @@ public class QueryMobileEntity {
...
@@ -11,6 +11,15 @@ public class QueryMobileEntity {
private
String
message
;
private
String
message
;
private
Integer
chargeStatus
;
private
Integer
chargeStatus
;
private
MobileDataEntity
data
;
private
MobileDataEntity
data
;
private
String
mobile
;
public
String
getMobile
()
{
return
mobile
;
}
public
void
setMobile
(
String
mobile
)
{
this
.
mobile
=
mobile
;
}
public
String
getCode
()
{
public
String
getCode
()
{
return
code
;
return
code
;
...
@@ -43,14 +52,4 @@ public class QueryMobileEntity {
...
@@ -43,14 +52,4 @@ public class QueryMobileEntity {
public
void
setData
(
MobileDataEntity
data
)
{
public
void
setData
(
MobileDataEntity
data
)
{
this
.
data
=
data
;
this
.
data
=
data
;
}
}
@Override
public
String
toString
()
{
return
"QueryMobileEntity{"
+
"code='"
+
code
+
'\''
+
", message='"
+
message
+
'\''
+
", chargeStatus="
+
chargeStatus
+
", data="
+
data
+
'}'
;
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/mapper/LogLoginOnekeyMapper.java
0 → 100644
浏览文件 @
460bdb45
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
mapper
;
import
com.pica.cloud.account.account.server.entity.LogLoginOnekey
;
public
interface
LogLoginOnekeyMapper
{
int
deleteByPrimaryKey
(
Integer
id
);
int
insert
(
LogLoginOnekey
record
);
int
insertSelective
(
LogLoginOnekey
record
);
LogLoginOnekey
selectByPrimaryKey
(
Integer
id
);
int
updateByPrimaryKeySelective
(
LogLoginOnekey
record
);
int
updateByPrimaryKey
(
LogLoginOnekey
record
);
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/model/OneClickProcessor.java
浏览文件 @
460bdb45
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
model
;
package
com
.
pica
.
cloud
.
account
.
account
.
server
.
model
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pica.cloud.account.account.server.entity.LogLoginOnekey
;
import
com.pica.cloud.account.account.server.entity.MobileDataEntity
;
import
com.pica.cloud.account.account.server.entity.MobileDataEntity
;
import
com.pica.cloud.account.account.server.entity.QueryMobileEntity
;
import
com.pica.cloud.account.account.server.entity.QueryMobileEntity
;
import
com.pica.cloud.account.account.server.mapper.LogLoginOnekeyMapper
;
import
com.pica.cloud.account.account.server.util.AESUtil
;
import
com.pica.cloud.account.account.server.util.AESUtil
;
import
com.pica.cloud.account.account.server.util.HttpUtil
;
import
com.pica.cloud.account.account.server.util.HttpUtil
;
import
com.pica.cloud.account.account.server.util.MD5
;
import
com.pica.cloud.account.account.server.util.MD5
;
...
@@ -12,8 +15,10 @@ import org.slf4j.Logger;
...
@@ -12,8 +15,10 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -45,9 +50,10 @@ public class OneClickProcessor {
...
@@ -45,9 +50,10 @@ public class OneClickProcessor {
@Value
(
"${shanyan.ios.appKey}"
)
@Value
(
"${shanyan.ios.appKey}"
)
private
String
iosAppKey
;
private
String
iosAppKey
;
@Autowired
private
LogLoginOnekeyMapper
logLoginOnekeyMapper
;
public
QueryMobileEntity
tokenExchangeMobile
(
String
token
,
Integer
type
)
{
public
String
tokenExchangeMobile
(
String
token
,
Integer
type
)
{
if
(
type
==
null
)
{
if
(
type
==
null
)
{
return
null
;
return
null
;
}
}
...
@@ -62,15 +68,15 @@ public class OneClickProcessor {
...
@@ -62,15 +68,15 @@ public class OneClickProcessor {
}
else
{
}
else
{
return
null
;
return
null
;
}
}
String
returnMobile
=
null
;
//从SDK获取的token参数
//从SDK获取的token参数
QueryMobileEntity
queryMobileEntity
=
null
;
try
{
try
{
Map
<
String
,
String
>
params
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"token"
,
token
);
params
.
put
(
"token"
,
token
);
params
.
put
(
"appId"
,
appId
);
params
.
put
(
"appId"
,
appId
);
params
.
put
(
"encryptType"
,
encryptType
);
//可以不传,不传则解密直接使用AES解密
params
.
put
(
"encryptType"
,
encryptType
);
//可以不传,不传则解密直接使用AES解密
params
.
put
(
"sign"
,
SignUtils
.
getSign
(
params
,
appKey
));
params
.
put
(
"sign"
,
SignUtils
.
getSign
(
params
,
appKey
));
QueryMobileEntity
queryMobileEntity
=
(
QueryMobileEntity
)
HttpUtil
.
postForm
(
mobileQueryUrl
,
params
,
QueryMobileEntity
.
class
);
queryMobileEntity
=
HttpUtil
.
postForm
(
mobileQueryUrl
,
params
,
QueryMobileEntity
.
class
);
if
(
null
!=
queryMobileEntity
)
{
if
(
null
!=
queryMobileEntity
)
{
String
code
=
queryMobileEntity
.
getCode
();
//返回码 200000为成功
String
code
=
queryMobileEntity
.
getCode
();
//返回码 200000为成功
if
(
"200000"
.
equals
(
code
))
{
if
(
"200000"
.
equals
(
code
))
{
...
@@ -82,16 +88,30 @@ public class OneClickProcessor {
...
@@ -82,16 +88,30 @@ public class OneClickProcessor {
}
else
if
(
rsaEncryptType
.
equals
(
encryptType
))
{
}
else
if
(
rsaEncryptType
.
equals
(
encryptType
))
{
mobile
=
RSAUtil
.
decryptByPrivateKeyForLongStr
(
mobile
,
privateKey
);
mobile
=
RSAUtil
.
decryptByPrivateKeyForLongStr
(
mobile
,
privateKey
);
}
}
mobileDataEntity
.
setMobileName
(
mobile
);
queryMobileEntity
.
setMobile
(
mobile
);
returnMobile
=
mobileDataEntity
.
getMobileName
();
}
else
{
throw
new
RuntimeException
();
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
logger
.
error
(
e
.
getMessage
());
throw
new
PicaException
(
"token换取手机号调用失败!"
);
}
}
return
returnMobile
;
return
queryMobileEntity
;
}
@Async
public
void
savelogLoginOnekey
(
QueryMobileEntity
queryMobileEntity
,
Integer
type
,
Integer
logLoginId
)
{
LogLoginOnekey
l
=
new
LogLoginOnekey
();
l
.
setDeviceType
(
type
.
byteValue
());
MobileDataEntity
data
=
queryMobileEntity
.
getData
();
l
.
setFanqizha
(
data
.
getFanqizha
().
byteValue
());
l
.
setTradeNo
(
data
.
getTradeNo
());
l
.
setMobile
(
AESUtil
.
encryptV0
(
data
.
getMobileName
()));
l
.
setLogLoginId
(
logLoginId
);
l
.
setInfo
(
JSONObject
.
toJSONString
(
queryMobileEntity
));
Date
d
=
new
Date
();
l
.
setCreateId
(-
1
);
l
.
setCreateTime
(
d
);
l
.
setModifyId
(-
1
);
l
.
setModifyTime
(
d
);
logLoginOnekeyMapper
.
insertSelective
(
l
);
}
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/req/OneClickLoginReq.java
浏览文件 @
460bdb45
...
@@ -7,16 +7,28 @@ package com.pica.cloud.account.account.server.req;
...
@@ -7,16 +7,28 @@ package com.pica.cloud.account.account.server.req;
* @create: 2020-02-12 15:58
* @create: 2020-02-12 15:58
*/
*/
public
class
OneClickLoginReq
{
public
class
OneClickLoginReq
{
private
Integer
t
ype
;
private
Integer
sourceT
ype
;
private
String
token
=
""
;
private
String
token
=
""
;
public
Integer
getType
()
{
private
String
loginIp
;
return
type
;
private
int
productType
;
public
String
getLoginIp
()
{
return
loginIp
;
}
}
public
void
setType
(
Integer
type
)
{
public
void
setLoginIp
(
String
loginIp
)
{
this
.
type
=
type
;
this
.
loginIp
=
loginIp
;
}
public
int
getProductType
()
{
return
productType
;
}
public
void
setProductType
(
int
productType
)
{
this
.
productType
=
productType
;
}
}
public
String
getToken
()
{
public
String
getToken
()
{
...
@@ -27,4 +39,11 @@ public class OneClickLoginReq {
...
@@ -27,4 +39,11 @@ public class OneClickLoginReq {
this
.
token
=
token
;
this
.
token
=
token
;
}
}
public
Integer
getSourceType
()
{
return
sourceType
;
}
public
void
setSourceType
(
Integer
sourceType
)
{
this
.
sourceType
=
sourceType
;
}
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/LoginServiceImpl.java
浏览文件 @
460bdb45
...
@@ -28,6 +28,7 @@ import com.pica.cloud.account.account.server.vo.OneClickLoginResultVo;
...
@@ -28,6 +28,7 @@ import com.pica.cloud.account.account.server.vo.OneClickLoginResultVo;
import
com.pica.cloud.foundation.encryption.common.constants.EncryptConstants
;
import
com.pica.cloud.foundation.encryption.common.constants.EncryptConstants
;
import
com.pica.cloud.foundation.encryption.util.EncryptUtils
;
import
com.pica.cloud.foundation.encryption.util.EncryptUtils
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.entity.PicaException
;
import
com.pica.cloud.foundation.entity.PicaResultCode
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.redis.ICacheClient
;
import
com.pica.cloud.foundation.utils.utils.HttpClientUtil
;
import
com.pica.cloud.foundation.utils.utils.HttpClientUtil
;
import
com.pica.cloud.foundation.utils.utils.ValidateUtils
;
import
com.pica.cloud.foundation.utils.utils.ValidateUtils
;
...
@@ -251,6 +252,7 @@ public class LoginServiceImpl implements LoginService {
...
@@ -251,6 +252,7 @@ public class LoginServiceImpl implements LoginService {
}
}
/**
/**
* 登录逻辑处理
* 登录逻辑处理
* 登录逻辑处理
*
*
* @param baseRequest
* @param baseRequest
...
@@ -279,6 +281,7 @@ public class LoginServiceImpl implements LoginService {
...
@@ -279,6 +281,7 @@ public class LoginServiceImpl implements LoginService {
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
baseRequest
.
getProductType
(),
baseRequest
.
getSourceType
(),
LogLoginEntity
entity
=
AccountLogEntityUtils
.
getLogLoginEntity
(
acctId
,
baseRequest
.
getProductType
(),
baseRequest
.
getSourceType
(),
loginType
,
baseRequest
.
getLoginIp
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
());
loginType
,
baseRequest
.
getLoginIp
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
());
picaLogUtils
.
info
(
entity
);
picaLogUtils
.
info
(
entity
);
result
.
setLogLoginId
(
entity
.
getId
());
return
result
;
return
result
;
}
}
...
@@ -486,22 +489,30 @@ public class LoginServiceImpl implements LoginService {
...
@@ -486,22 +489,30 @@ public class LoginServiceImpl implements LoginService {
@Override
@Override
public
LoginResult
oneClickLogin
(
OneClickLoginReq
req
)
{
public
LoginResult
oneClickLogin
(
OneClickLoginReq
req
)
{
OneClickLoginResultVo
o
=
new
OneClickLoginResultVo
();
QueryMobileEntity
queryMobileEntity
=
oneClickProcessor
.
tokenExchangeMobile
(
req
.
getToken
(),
req
.
getSourceType
());
String
mobile
=
oneClickProcessor
.
tokenExchangeMobile
(
req
.
getToken
(),
req
.
getType
());
if
(
queryMobileEntity
==
null
||
StringUtils
.
isBlank
(
queryMobileEntity
.
getMobile
())
||
!
ValidateUtils
.
isMobile
(
queryMobileEntity
.
getMobile
()))
{
if
(
StringUtils
.
isBlank
(
mobile
)){
throw
new
PicaException
(
PicaResultCode
.
INTERFACE_INVOKE_EXCEPTION
.
code
(),
"获取手机号失败!"
);
}
}
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
AESUtil
.
encryptV0
(
mobile
));
AccountInfoEntity
accountInfoEntity
=
accountInfoDetailMapper
.
selectByMobile
(
AESUtil
.
encryptV0
(
queryMobileEntity
.
getMobile
()
));
BaseRequest
baseRequest
=
new
BaseRequest
();
BaseRequest
baseRequest
=
new
BaseRequest
();
baseRequest
.
setMobile
(
queryMobileEntity
.
getMobile
());
baseRequest
.
setSourceType
(
req
.
getSourceType
());
baseRequest
.
setProductType
(
req
.
getProductType
());
baseRequest
.
setLoginIp
(
req
.
getLoginIp
());
LoginResult
result
;
if
(
accountInfoEntity
==
null
)
{
if
(
accountInfoEntity
==
null
)
{
//说明是注册功能
//说明是注册功能
re
turn
registerService
.
register
(
baseRequest
);
re
sult
=
registerService
.
register
(
baseRequest
);
}
else
{
}
else
{
//登录功能
//登录功能
re
turn
processLogin
(
baseRequest
,
accountInfoEntity
.
getId
(),
AccountTypeEnum
.
LOGIN_CODE
.
getCode
());
re
sult
=
processLogin
(
baseRequest
,
accountInfoEntity
.
getId
(),
AccountTypeEnum
.
LOGIN_CODE
.
getCode
());
}
}
oneClickProcessor
.
savelogLoginOnekey
(
queryMobileEntity
,
req
.
getSourceType
(),
result
.
getLogLoginId
());
return
result
;
}
}
private
String
processDoctorAvatar
(
String
avatar_image_url
)
{
private
String
processDoctorAvatar
(
String
avatar_image_url
)
{
if
(
StringUtils
.
isEmpty
(
avatar_image_url
))
{
if
(
StringUtils
.
isEmpty
(
avatar_image_url
))
{
return
DEFAULT_DOCTOR_PICTURE_URL
;
return
DEFAULT_DOCTOR_PICTURE_URL
;
...
...
server/src/main/java/com/pica/cloud/account/account/server/service/impl/RegisterServiceImpl.java
浏览文件 @
460bdb45
...
@@ -153,6 +153,7 @@ public class RegisterServiceImpl implements RegisterService {
...
@@ -153,6 +153,7 @@ public class RegisterServiceImpl implements RegisterService {
AccountTypeEnum
.
LOGIN_REGISTER
.
getCode
(),
baseRequest
.
getLoginIp
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOGIN_REGISTER
.
getCode
(),
baseRequest
.
getLoginIp
(),
AccountTypeEnum
.
LOGIN_STATUS_SUCCESS
.
getCode
(),
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
());
AccountTypeEnum
.
LOG_TYPE_LOGIN
.
getCode
());
picaLogUtils
.
info
(
entity
);
picaLogUtils
.
info
(
entity
);
result
.
setLogLoginId
(
entity
.
getId
());
processAgreement
(
userId
);
processAgreement
(
userId
);
processRoleMap
(
userId
);
processRoleMap
(
userId
);
redisClient
.
del
(
REPEAT_REGISTER_PREFIX
+
mobile
);
redisClient
.
del
(
REPEAT_REGISTER_PREFIX
+
mobile
);
...
...
server/src/main/java/com/pica/cloud/account/account/server/util/HttpUtil.java
浏览文件 @
460bdb45
...
@@ -36,7 +36,7 @@ public class HttpUtil {
...
@@ -36,7 +36,7 @@ public class HttpUtil {
hc
=
HttpClients
.
custom
().
setConnectionManager
(
cm
).
build
();
hc
=
HttpClients
.
custom
().
setConnectionManager
(
cm
).
build
();
}
}
public
static
Object
postForm
(
String
url
,
Map
<
String
,
String
>
params
,
Class
clazz
)
throws
IOException
,
URISyntaxException
{
public
static
<
T
>
T
postForm
(
String
url
,
Map
<
String
,
String
>
params
,
Class
<
T
>
clazz
)
throws
IOException
,
URISyntaxException
{
URIBuilder
builder
=
new
URIBuilder
(
url
);
URIBuilder
builder
=
new
URIBuilder
(
url
);
if
(
params
!=
null
&&
params
.
size
()
>
0
)
{
if
(
params
!=
null
&&
params
.
size
()
>
0
)
{
params
.
forEach
((
k
,
v
)
->
{
params
.
forEach
((
k
,
v
)
->
{
...
@@ -45,7 +45,7 @@ public class HttpUtil {
...
@@ -45,7 +45,7 @@ public class HttpUtil {
}
}
HttpPost
post
=
new
HttpPost
(
builder
.
build
());
HttpPost
post
=
new
HttpPost
(
builder
.
build
());
CloseableHttpResponse
resp
=
null
;
CloseableHttpResponse
resp
=
null
;
Object
data
;
T
data
;
try
{
try
{
resp
=
hc
.
execute
(
post
);
resp
=
hc
.
execute
(
post
);
String
buf
=
IOUtils
.
toString
(
resp
.
getEntity
().
getContent
(),
"utf-8"
);
String
buf
=
IOUtils
.
toString
(
resp
.
getEntity
().
getContent
(),
"utf-8"
);
...
...
server/src/main/resources/mybatis/LogLoginEntityMapper.xml
浏览文件 @
460bdb45
...
@@ -33,6 +33,9 @@
...
@@ -33,6 +33,9 @@
</delete>
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.LogLoginEntity"
>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.LogLoginEntity"
>
<selectKey
resultType=
"java.lang.Integer"
order=
"AFTER"
keyProperty=
"id"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into log_login ( acct_id, acct_name,
insert into log_login ( acct_id, acct_name,
product_type, source_type, login_type,
product_type, source_type, login_type,
login_ip, login_time, login_status,
login_ip, login_time, login_status,
...
...
server/src/main/resources/mybatis/LogLoginOnekeyMapper.xml
0 → 100644
浏览文件 @
460bdb45
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pica.cloud.account.account.server.mapper.LogLoginOnekeyMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pica.cloud.account.account.server.entity.LogLoginOnekey"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"log_login_id"
property=
"logLoginId"
jdbcType=
"INTEGER"
/>
<result
column=
"device_type"
property=
"deviceType"
jdbcType=
"TINYINT"
/>
<result
column=
"mobile"
property=
"mobile"
jdbcType=
"VARCHAR"
/>
<result
column=
"trade_no"
property=
"tradeNo"
jdbcType=
"VARCHAR"
/>
<result
column=
"fanqizha"
property=
"fanqizha"
jdbcType=
"TINYINT"
/>
<result
column=
"tag"
property=
"tag"
jdbcType=
"VARCHAR"
/>
<result
column=
"info"
property=
"info"
jdbcType=
"VARCHAR"
/>
<result
column=
"delete_flag"
property=
"deleteFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"create_id"
property=
"createId"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"modify_id"
property=
"modifyId"
jdbcType=
"INTEGER"
/>
<result
column=
"modify_time"
property=
"modifyTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, log_login_id, device_type, mobile, trade_no, fanqizha, tag, info, delete_flag,
create_id, create_time, modify_id, modify_time
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Integer"
>
select
<include
refid=
"Base_Column_List"
/>
from log_login_onekey
where id = #{id,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
delete from log_login_onekey
where id = #{id,jdbcType=INTEGER}
</delete>
<insert
id=
"insert"
parameterType=
"com.pica.cloud.account.account.server.entity.LogLoginOnekey"
>
insert into log_login_onekey (id, log_login_id, device_type,
mobile, trade_no, fanqizha,
tag, info, delete_flag,
create_id, create_time, modify_id,
modify_time)
values (#{id,jdbcType=INTEGER}, #{logLoginId,jdbcType=INTEGER}, #{deviceType,jdbcType=TINYINT},
#{mobile,jdbcType=VARCHAR}, #{tradeNo,jdbcType=VARCHAR}, #{fanqizha,jdbcType=TINYINT},
#{tag,jdbcType=VARCHAR}, #{info,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=INTEGER},
#{createId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=INTEGER},
#{modifyTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogLoginOnekey"
>
insert into log_login_onekey
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"logLoginId != null"
>
log_login_id,
</if>
<if
test=
"deviceType != null"
>
device_type,
</if>
<if
test=
"mobile != null"
>
mobile,
</if>
<if
test=
"tradeNo != null"
>
trade_no,
</if>
<if
test=
"fanqizha != null"
>
fanqizha,
</if>
<if
test=
"tag != null"
>
tag,
</if>
<if
test=
"info != null"
>
info,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</if>
<if
test=
"createId != null"
>
create_id,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"modifyId != null"
>
modify_id,
</if>
<if
test=
"modifyTime != null"
>
modify_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=INTEGER},
</if>
<if
test=
"logLoginId != null"
>
#{logLoginId,jdbcType=INTEGER},
</if>
<if
test=
"deviceType != null"
>
#{deviceType,jdbcType=TINYINT},
</if>
<if
test=
"mobile != null"
>
#{mobile,jdbcType=VARCHAR},
</if>
<if
test=
"tradeNo != null"
>
#{tradeNo,jdbcType=VARCHAR},
</if>
<if
test=
"fanqizha != null"
>
#{fanqizha,jdbcType=TINYINT},
</if>
<if
test=
"tag != null"
>
#{tag,jdbcType=VARCHAR},
</if>
<if
test=
"info != null"
>
#{info,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"createId != null"
>
#{createId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
#{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
#{modifyTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.pica.cloud.account.account.server.entity.LogLoginOnekey"
>
update log_login_onekey
<set
>
<if
test=
"logLoginId != null"
>
log_login_id = #{logLoginId,jdbcType=INTEGER},
</if>
<if
test=
"deviceType != null"
>
device_type = #{deviceType,jdbcType=TINYINT},
</if>
<if
test=
"mobile != null"
>
mobile = #{mobile,jdbcType=VARCHAR},
</if>
<if
test=
"tradeNo != null"
>
trade_no = #{tradeNo,jdbcType=VARCHAR},
</if>
<if
test=
"fanqizha != null"
>
fanqizha = #{fanqizha,jdbcType=TINYINT},
</if>
<if
test=
"tag != null"
>
tag = #{tag,jdbcType=VARCHAR},
</if>
<if
test=
"info != null"
>
info = #{info,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
delete_flag = #{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"createId != null"
>
create_id = #{createId,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"modifyId != null"
>
modify_id = #{modifyId,jdbcType=INTEGER},
</if>
<if
test=
"modifyTime != null"
>
modify_time = #{modifyTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.pica.cloud.account.account.server.entity.LogLoginOnekey"
>
update log_login_onekey
set log_login_id = #{logLoginId,jdbcType=INTEGER},
device_type = #{deviceType,jdbcType=TINYINT},
mobile = #{mobile,jdbcType=VARCHAR},
trade_no = #{tradeNo,jdbcType=VARCHAR},
fanqizha = #{fanqizha,jdbcType=TINYINT},
tag = #{tag,jdbcType=VARCHAR},
info = #{info,jdbcType=VARCHAR},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_id = #{createId,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
modify_id = #{modifyId,jdbcType=INTEGER},
modify_time = #{modifyTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
\ No newline at end of file
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录