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
提交
cc6e2800
提交
cc6e2800
编写于
11月 08, 2019
作者:
dong.an
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微信登录修改
上级
4a82b9a7
流水线
#16753
已失败 于阶段
in 0 second
变更
7
流水线
1
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
22 行增加
和
12 行删除
+22
-12
LoginController.java
...ud/account/account/server/controller/LoginController.java
+4
-4
DoctorMapper.java
...ica/cloud/account/account/server/mapper/DoctorMapper.java
+2
-0
LoginService.java
...ca/cloud/account/account/server/service/LoginService.java
+3
-3
LoginServiceImpl.java
...account/account/server/service/impl/LoginServiceImpl.java
+5
-3
AccountUnionEntityMapper.xml
...r/src/main/resources/mybatis/AccountUnionEntityMapper.xml
+2
-1
AccountWeChatInfoEntityMapper.xml
.../main/resources/mybatis/AccountWeChatInfoEntityMapper.xml
+2
-1
DoctorMapper.xml
server/src/main/resources/mybatis/DoctorMapper.xml
+4
-0
未找到文件。
server/src/main/java/com/pica/cloud/account/account/server/controller/LoginController.java
浏览文件 @
cc6e2800
...
@@ -120,16 +120,16 @@ public class LoginController extends AccountBaseController {
...
@@ -120,16 +120,16 @@ public class LoginController extends AccountBaseController {
@PostMapping
(
"/login/wechat/bind"
)
@PostMapping
(
"/login/wechat/bind"
)
public
PicaResponse
bindWeChat
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
public
PicaResponse
bindWeChat
(
@RequestBody
EncryptEntity
entity
)
throws
Exception
{
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
BaseRequest
request
=
CryptoUtil
.
decrypt
(
entity
,
BaseRequest
.
class
);
request
.
setAccId
(
super
.
getAcctId
()
);
long
doctorId
=
super
.
getDoctorIdByToken
(
);
loginService
.
bindWeChat
(
request
);
loginService
.
bindWeChat
(
doctorId
,
request
);
return
PicaResponse
.
toResponse
();
return
PicaResponse
.
toResponse
();
}
}
@ApiOperation
(
"微信解除绑定接口"
)
@ApiOperation
(
"微信解除绑定接口"
)
@PutMapping
(
"/login/wechat/unbind"
)
@PutMapping
(
"/login/wechat/unbind"
)
public
PicaResponse
unbindWeChat
()
{
public
PicaResponse
unbindWeChat
()
{
Integer
acctId
=
super
.
getAcctId
();
long
doctorId
=
super
.
getDoctorIdByToken
();
loginService
.
unbindWeChat
(
acct
Id
);
loginService
.
unbindWeChat
(
doctor
Id
);
return
PicaResponse
.
toResponse
();
return
PicaResponse
.
toResponse
();
}
}
...
...
server/src/main/java/com/pica/cloud/account/account/server/mapper/DoctorMapper.java
浏览文件 @
cc6e2800
...
@@ -92,4 +92,6 @@ public interface DoctorMapper {
...
@@ -92,4 +92,6 @@ public interface DoctorMapper {
* @return
* @return
*/
*/
//Long selectDoctorIdByMobile(String mobile);
//Long selectDoctorIdByMobile(String mobile);
Integer
getAcctIdByDoctorId
(
long
id
);
}
}
\ No newline at end of file
server/src/main/java/com/pica/cloud/account/account/server/service/LoginService.java
浏览文件 @
cc6e2800
...
@@ -39,9 +39,9 @@ public interface LoginService {
...
@@ -39,9 +39,9 @@ public interface LoginService {
/**
/**
* 解除绑定
* 解除绑定
*
*
* @param
acct
Id 账户id
* @param
doctor
Id 账户id
*/
*/
void
unbindWeChat
(
Integer
acct
Id
);
void
unbindWeChat
(
long
doctor
Id
);
/**
/**
...
@@ -49,7 +49,7 @@ public interface LoginService {
...
@@ -49,7 +49,7 @@ public interface LoginService {
*
*
* @param request 参数模型
* @param request 参数模型
*/
*/
void
bindWeChat
(
BaseRequest
request
);
void
bindWeChat
(
long
doctorId
,
BaseRequest
request
);
PICAPDoctor
queryDoctor
(
long
doctorId
);
PICAPDoctor
queryDoctor
(
long
doctorId
);
}
}
server/src/main/java/com/pica/cloud/account/account/server/service/impl/LoginServiceImpl.java
浏览文件 @
cc6e2800
...
@@ -260,7 +260,8 @@ public class LoginServiceImpl implements LoginService {
...
@@ -260,7 +260,8 @@ public class LoginServiceImpl implements LoginService {
@Override
@Override
@Transactional
@Transactional
public
void
unbindWeChat
(
Integer
acctId
)
{
public
void
unbindWeChat
(
long
doctorId
)
{
Integer
acctId
=
doctorInfoMapper
.
getAcctIdByDoctorId
(
doctorId
);
accountUnionMapper
.
updateUnbindByAcctId
(
acctId
);
accountUnionMapper
.
updateUnbindByAcctId
(
acctId
);
if
(
doubleWritingMode
)
{
if
(
doubleWritingMode
)
{
doctorService
.
unbindWeChat
(
acctId
);
doctorService
.
unbindWeChat
(
acctId
);
...
@@ -269,7 +270,7 @@ public class LoginServiceImpl implements LoginService {
...
@@ -269,7 +270,7 @@ public class LoginServiceImpl implements LoginService {
@Override
@Override
@Transactional
@Transactional
public
void
bindWeChat
(
BaseRequest
request
)
{
public
void
bindWeChat
(
long
doctorId
,
BaseRequest
request
)
{
WeChatEntity
weChatEntity
=
WeChatUtils
.
getAuthorizationInfo
(
appId
,
appSecret
,
request
.
getWeChatCode
());
WeChatEntity
weChatEntity
=
WeChatUtils
.
getAuthorizationInfo
(
appId
,
appSecret
,
request
.
getWeChatCode
());
Map
map
=
new
HashMap
();
Map
map
=
new
HashMap
();
map
.
put
(
"access_token"
,
weChatEntity
.
getAccess_token
());
map
.
put
(
"access_token"
,
weChatEntity
.
getAccess_token
());
...
@@ -281,7 +282,8 @@ public class LoginServiceImpl implements LoginService {
...
@@ -281,7 +282,8 @@ public class LoginServiceImpl implements LoginService {
if
(
entity
==
null
)
{
if
(
entity
==
null
)
{
processWeChatInfoUser
(
weChatUserInfoEntity
,
request
.
getWeChatLoginType
());
processWeChatInfoUser
(
weChatUserInfoEntity
,
request
.
getWeChatLoginType
());
}
}
processAccountUnion
(
request
.
getAccId
(),
unionId
);
Integer
acctId
=
doctorInfoMapper
.
getAcctIdByDoctorId
(
doctorId
);
processAccountUnion
(
acctId
,
unionId
);
}
}
/**
/**
...
...
server/src/main/resources/mybatis/AccountUnionEntityMapper.xml
浏览文件 @
cc6e2800
...
@@ -29,7 +29,8 @@
...
@@ -29,7 +29,8 @@
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from account_union
from account_union
where union_id = #{unionId}
where union_id = #{unionId} and delete_flag = 1
limit 1
</select>
</select>
<!--解除绑定关系-->
<!--解除绑定关系-->
...
...
server/src/main/resources/mybatis/AccountWeChatInfoEntityMapper.xml
浏览文件 @
cc6e2800
...
@@ -44,7 +44,8 @@
...
@@ -44,7 +44,8 @@
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
from account_wechat_info
from account_wechat_info
where unionid = #{id}
where unionid = #{id} and delete_flag = 1
limit 1
</select>
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Integer"
>
...
...
server/src/main/resources/mybatis/DoctorMapper.xml
浏览文件 @
cc6e2800
...
@@ -1026,4 +1026,8 @@
...
@@ -1026,4 +1026,8 @@
FROM p_doctor aa
FROM p_doctor aa
where aa.id = #{doctorId} and aa.delete_flag = 1
where aa.id = #{doctorId} and aa.delete_flag = 1
</select>
</select>
<select
id=
"getAcctIdByDoctorId"
resultType=
"java.lang.Integer"
parameterType=
"java.lang.Long"
>
select acct_id from p_doctor where id = #{id}
</select>
</mapper>
</mapper>
\ No newline at end of file
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录