Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-usercenter
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 6848c7da
authored
Jul 11, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
C端用户api
1 parent
c919121d
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
593 additions
and
0 deletions
src/main/java/cn/com/glsx/shield/modules/api/FeignCUserController.java
src/main/java/cn/com/glsx/shield/modules/entity/CustUser.java
src/main/java/cn/com/glsx/shield/modules/entity/CustUserAuthRel.java
src/main/java/cn/com/glsx/shield/modules/entity/CustUserLocalAccount.java
src/main/java/cn/com/glsx/shield/modules/entity/CustUserLocalAuth.java
src/main/java/cn/com/glsx/shield/modules/entity/CustUserThirdAuth.java
src/main/java/cn/com/glsx/shield/modules/entity/CustUserWechatAccount.java
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserAuthRelMapper.java
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserLocalAccountMapper.java
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserLocalAuthMapper.java
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserMapper.java
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserThirdAuthMapper.java
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserWechatAccountMapper.java
src/main/java/cn/com/glsx/shield/modules/service/CUserService.java
src/main/resources/mapper/CustUserAuthRelMapper.xml
src/main/resources/mapper/CustUserLocalAccountMapper.xml
src/main/resources/mapper/CustUserLocalAuthMapper.xml
src/main/resources/mapper/CustUserMapper.xml
src/main/resources/mapper/CustUserThirdAuthMapper.xml
src/main/resources/mapper/CustUserWechatAccountMapper.xml
src/main/java/cn/com/glsx/shield/modules/api/FeignCUserController.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
api
;
import
cn.com.glsx.shield.modules.service.CUserService
;
import
cn.com.glsx.usercenter.api.dto.response.CUser
;
import
com.glsx.plat.core.web.R
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Collection
;
import
java.util.List
;
/**
* feign用户服务接口
*
* @author payu
*/
@Slf4j
@Api
(
value
=
"C端用户微服务API"
,
tags
=
{
"C端用户微服务API"
})
@RestController
@RequestMapping
(
value
=
"/fcuser"
)
public
class
FeignCUserController
implements
cn
.
com
.
glsx
.
usercenter
.
api
.
feign
.
CUserService
{
@Autowired
private
CUserService
cUserService
;
@Override
public
R
<
List
<
CUser
>>
getLocalCUsers
(
Collection
<
Long
>
cuserIds
)
{
List
<
CUser
>
cUserList
=
cUserService
.
getLocalUsers
(
cuserIds
);
return
R
.
ok
().
data
(
cUserList
);
}
@Override
public
R
<
List
<
CUser
>>
getLocalRelCUsers
(
Collection
<
Long
>
relUserIds
)
{
List
<
CUser
>
cUserList
=
cUserService
.
getLocalRelUsers
(
relUserIds
);
return
R
.
ok
().
data
(
cUserList
);
}
@Override
public
R
<
List
<
CUser
>>
getWechatUsers
(
Collection
<
Long
>
cuserIds
)
{
List
<
CUser
>
cUserList
=
cUserService
.
getWechatUsers
(
cuserIds
);
return
R
.
ok
().
data
(
cUserList
);
}
}
src/main/java/cn/com/glsx/shield/modules/entity/CustUser.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
entity
;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Table
;
@Data
@Table
(
name
=
"t_cust_user"
)
public
class
CustUser
extends
BaseEntity
{
/**
* 登录token
*/
private
String
token
;
/**
* token过期时间
*/
@Column
(
name
=
"expire_in"
)
private
Long
expireIn
;
/**
* 登录失败次数
*/
@Column
(
name
=
"try_times"
)
private
Integer
tryTimes
;
/**
* 关联人(账户)id
*/
@Column
(
name
=
"rel_user_id"
)
private
Long
relUserId
;
/**
* 黑名单状态:1白名单,2临时封禁,3永久封禁
*/
private
Integer
blacklist
;
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/entity/CustUserAuthRel.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
entity
;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Table
;
@Data
@Table
(
name
=
"t_cust_user_auth_rel"
)
public
class
CustUserAuthRel
extends
BaseEntity
{
/**
* 用户id
*/
@Column
(
name
=
"user_id"
)
private
Long
cuserId
;
/**
* 认证id
*/
@Column
(
name
=
"auth_id"
)
private
Long
authId
;
/**
* 验证类型:local,third
*/
@Column
(
name
=
"auth_type"
)
private
String
authType
;
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/entity/CustUserLocalAccount.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
entity
;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Table
;
@Data
@Table
(
name
=
"t_cust_user_local_account"
)
public
class
CustUserLocalAccount
extends
BaseEntity
{
/**
* 认证id
*/
@Column
(
name
=
"auth_id"
)
private
Long
authId
;
/**
* 平台id
*/
@Column
(
name
=
"union_id"
)
private
String
unionId
;
/**
* 用户名/昵称
*/
private
String
username
;
/**
* 头像
*/
private
String
avatar
;
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/entity/CustUserLocalAuth.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
entity
;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
lombok.Data
;
import
javax.persistence.Table
;
@Data
@Table
(
name
=
"t_cust_user_local_auth"
)
public
class
CustUserLocalAuth
extends
BaseEntity
{
/**
* 用户账号
*/
private
String
account
;
/**
* 密码
*/
private
String
password
;
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/entity/CustUserThirdAuth.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
entity
;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Table
;
@Data
@Table
(
name
=
"t_cust_user_third_auth"
)
public
class
CustUserThirdAuth
extends
BaseEntity
{
/**
* 第三方用户唯一标识
*/
private
String
openid
;
/**
* 第三方平台标识(qq、wechat...)
*/
@Column
(
name
=
"login_type"
)
private
String
loginType
;
/**
* 第三方获取的access_token,校验使用
*/
@Column
(
name
=
"access_token"
)
private
String
accessToken
;
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/entity/CustUserWechatAccount.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
entity
;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Table
;
@Data
@Table
(
name
=
"t_cust_user_wechat_account"
)
public
class
CustUserWechatAccount
extends
BaseEntity
{
/**
* 认证id
*/
@Column
(
name
=
"auth_id"
)
private
Long
authId
;
/**
* 微信平台id
*/
@Column
(
name
=
"union_id"
)
private
String
unionId
;
/**
* 微信头像
*/
@Column
(
name
=
"wechat_avatar"
)
private
String
wechatAvatar
;
/**
* 微信名
*/
@Column
(
name
=
"wechat_name"
)
private
String
wechatName
;
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserAuthRelMapper.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
mapper
;
import
cn.com.glsx.shield.modules.entity.CustUserAuthRel
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
CustUserAuthRelMapper
extends
CommonBaseMapper
<
CustUserAuthRel
>
{
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserLocalAccountMapper.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
mapper
;
import
cn.com.glsx.shield.modules.entity.CustUserLocalAccount
;
import
cn.com.glsx.usercenter.api.dto.response.CUser
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Collection
;
import
java.util.List
;
@Mapper
public
interface
CustUserLocalAccountMapper
extends
CommonBaseMapper
<
CustUserLocalAccount
>
{
List
<
CUser
>
selectByUserIds
(
@Param
(
"cuserIds"
)
Collection
<
Long
>
cuserIds
);
List
<
CUser
>
selectByRelUserIds
(
@Param
(
"relUserIds"
)
Collection
<
Long
>
relUserIds
);
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserLocalAuthMapper.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
mapper
;
import
cn.com.glsx.shield.modules.entity.CustUserLocalAuth
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
CustUserLocalAuthMapper
extends
CommonBaseMapper
<
CustUserLocalAuth
>
{
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserMapper.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
mapper
;
import
cn.com.glsx.shield.modules.entity.CustUser
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
CustUserMapper
extends
CommonBaseMapper
<
CustUser
>
{
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserThirdAuthMapper.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
mapper
;
import
cn.com.glsx.shield.modules.entity.CustUserThirdAuth
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
CustUserThirdAuthMapper
extends
CommonBaseMapper
<
CustUserThirdAuth
>
{
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/mapper/CustUserWechatAccountMapper.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
mapper
;
import
cn.com.glsx.shield.modules.entity.CustUserWechatAccount
;
import
cn.com.glsx.usercenter.api.dto.response.CUser
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Collection
;
import
java.util.List
;
@Mapper
public
interface
CustUserWechatAccountMapper
extends
CommonBaseMapper
<
CustUserWechatAccount
>
{
List
<
CUser
>
selectByUserIds
(
@Param
(
"cuserIds"
)
Collection
<
Long
>
cuserIds
);
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/service/CUserService.java
0 → 100644
View file @
6848c7d
package
cn
.
com
.
glsx
.
shield
.
modules
.
service
;
import
cn.com.glsx.shield.modules.mapper.CustUserLocalAccountMapper
;
import
cn.com.glsx.shield.modules.mapper.CustUserWechatAccountMapper
;
import
cn.com.glsx.usercenter.api.dto.response.CUser
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
@Service
public
class
CUserService
{
@Resource
private
CustUserLocalAccountMapper
custUserLocalAccountMapper
;
@Resource
private
CustUserWechatAccountMapper
custUserWechatAccountMapper
;
/**
* 获取本地C端账号用户信息
*
* @param cuserIds
* @return
*/
public
List
<
CUser
>
getLocalUsers
(
Collection
<
Long
>
cuserIds
)
{
if
(
CollectionUtils
.
isEmpty
(
cuserIds
))
{
return
Lists
.
newArrayList
();
}
return
custUserLocalAccountMapper
.
selectByUserIds
(
cuserIds
);
}
public
Map
<
Long
,
CUser
>
getLocalUserMap
(
Collection
<
Long
>
userIds
)
{
List
<
CUser
>
userModelList
=
this
.
getLocalUsers
(
userIds
);
return
userModelList
.
stream
().
collect
(
Collectors
.
toMap
(
CUser:
:
getUserId
,
Function
.
identity
()));
}
/**
* 获取后台账号用户信息
*
* @param relUserIds
* @return
*/
public
List
<
CUser
>
getLocalRelUsers
(
Collection
<
Long
>
relUserIds
)
{
if
(
CollectionUtils
.
isEmpty
(
relUserIds
))
{
return
Lists
.
newArrayList
();
}
return
custUserLocalAccountMapper
.
selectByRelUserIds
(
relUserIds
);
}
public
Map
<
Long
,
CUser
>
getLocalRelUserMap
(
Collection
<
Long
>
relUserIds
)
{
List
<
CUser
>
userModelList
=
this
.
getLocalRelUsers
(
relUserIds
);
return
userModelList
.
stream
().
filter
(
um
->
um
.
getRelUserId
()
!=
null
).
collect
(
Collectors
.
toMap
(
CUser:
:
getRelUserId
,
Function
.
identity
()));
}
/**
* 获取微信账号用户信息
*
* @param cuserIds
* @return
*/
public
List
<
CUser
>
getWechatUsers
(
Collection
<
Long
>
cuserIds
)
{
if
(
CollectionUtils
.
isEmpty
(
cuserIds
))
{
return
Lists
.
newArrayList
();
}
return
custUserWechatAccountMapper
.
selectByUserIds
(
cuserIds
);
}
public
Map
<
Long
,
CUser
>
getWechatUserMap
(
Collection
<
Long
>
cuserIds
)
{
List
<
CUser
>
userModelList
=
this
.
getWechatUsers
(
cuserIds
);
return
userModelList
.
stream
().
collect
(
Collectors
.
toMap
(
CUser:
:
getUserId
,
Function
.
identity
()));
}
}
src/main/resources/mapper/CustUserAuthRelMapper.xml
0 → 100644
View file @
6848c7d
<?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=
"cn.com.glsx.shield.modules.mapper.CustUserAuthRelMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.shield.modules.entity.CustUserAuthRel"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"user_id"
jdbcType=
"INTEGER"
property=
"cuserId"
/>
<result
column=
"auth_id"
jdbcType=
"INTEGER"
property=
"authId"
/>
<result
column=
"auth_type"
jdbcType=
"VARCHAR"
property=
"authType"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, user_id, auth_id, auth_type, del_flag, created_date, created_by, updated_date,
updated_by
</sql>
</mapper>
\ No newline at end of file
\ No newline at end of file
src/main/resources/mapper/CustUserLocalAccountMapper.xml
0 → 100644
View file @
6848c7d
<?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=
"cn.com.glsx.shield.modules.mapper.CustUserLocalAccountMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.shield.modules.entity.CustUserLocalAccount"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"auth_id"
jdbcType=
"INTEGER"
property=
"authId"
/>
<result
column=
"union_id"
jdbcType=
"VARCHAR"
property=
"unionId"
/>
<result
column=
"username"
jdbcType=
"VARCHAR"
property=
"username"
/>
<result
column=
"avatar"
jdbcType=
"VARCHAR"
property=
"avatar"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, auth_id, union_id, username, avatar, del_flag, created_date, created_by, updated_date,
updated_by
</sql>
<select
id=
"selectByUserIds"
resultType=
"cn.com.glsx.usercenter.api.dto.response.CUser"
>
select tcuar.user_id userId, tcu.rel_user_id relUserId, tcula.account, tcula2.username, tcula2.avatar
from t_cust_user_auth_rel tcuar
inner join t_cust_user_local_auth tcula on tcuar.auth_id = tcula.id
left join t_cust_user tcu on tcuar.user_id = tcu.id
left join t_cust_user_local_account tcula2 on tcuar.auth_id = tcula2.auth_id
where tcuar.del_flag = 0
and tcuar.auth_type = 'local'
and tcuar.user_id in
<foreach
collection=
"cuserIds"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</select>
<select
id=
"selectByRelUserIds"
resultType=
"cn.com.glsx.usercenter.api.dto.response.CUser"
>
select tcuar.user_id userId, tcu.rel_user_id relUserId, tcula.account, tcula2.username, tcula2.avatar
from t_cust_user_auth_rel tcuar
inner join t_cust_user_local_auth tcula on tcuar.auth_id = tcula.id
inner join t_cust_user tcu on tcuar.user_id = tcu.id
left join t_cust_user_local_account tcula2 on tcuar.auth_id = tcula2.auth_id
where tcuar.del_flag = 0 and tcu.del_flag = 0
and tcuar.auth_type = 'local'
and tcu.rel_user_id in
<foreach
collection=
"relUserIds"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
\ No newline at end of file
src/main/resources/mapper/CustUserLocalAuthMapper.xml
0 → 100644
View file @
6848c7d
<?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=
"cn.com.glsx.shield.modules.mapper.CustUserLocalAuthMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.shield.modules.entity.CustUserLocalAuth"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"account"
jdbcType=
"VARCHAR"
property=
"account"
/>
<result
column=
"password"
jdbcType=
"VARCHAR"
property=
"password"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, account, `password`, del_flag, created_date, created_by, updated_date, updated_by
</sql>
</mapper>
\ No newline at end of file
\ No newline at end of file
src/main/resources/mapper/CustUserMapper.xml
0 → 100644
View file @
6848c7d
<?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=
"cn.com.glsx.shield.modules.mapper.CustUserMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.shield.modules.entity.CustUser"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"token"
jdbcType=
"VARCHAR"
property=
"token"
/>
<result
column=
"expire_in"
jdbcType=
"INTEGER"
property=
"expireIn"
/>
<result
column=
"try_times"
jdbcType=
"INTEGER"
property=
"tryTimes"
/>
<result
column=
"rel_user_id"
jdbcType=
"INTEGER"
property=
"relUserId"
/>
<result
column=
"blacklist"
jdbcType=
"TINYINT"
property=
"blacklist"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, token, expire_in, try_times, rel_user_id, blacklist, del_flag, created_date,
created_by, updated_date, updated_by
</sql>
</mapper>
\ No newline at end of file
\ No newline at end of file
src/main/resources/mapper/CustUserThirdAuthMapper.xml
0 → 100644
View file @
6848c7d
<?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=
"cn.com.glsx.shield.modules.mapper.CustUserThirdAuthMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.shield.modules.entity.CustUserThirdAuth"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"openid"
jdbcType=
"VARCHAR"
property=
"openid"
/>
<result
column=
"login_type"
jdbcType=
"VARCHAR"
property=
"loginType"
/>
<result
column=
"access_token"
jdbcType=
"VARCHAR"
property=
"accessToken"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, openid, login_type, access_token, del_flag, created_date, created_by, updated_date,
updated_by
</sql>
</mapper>
\ No newline at end of file
\ No newline at end of file
src/main/resources/mapper/CustUserWechatAccountMapper.xml
0 → 100644
View file @
6848c7d
<?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=
"cn.com.glsx.shield.modules.mapper.CustUserWechatAccountMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.shield.modules.entity.CustUserWechatAccount"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"auth_id"
jdbcType=
"INTEGER"
property=
"authId"
/>
<result
column=
"union_id"
jdbcType=
"VARCHAR"
property=
"unionId"
/>
<result
column=
"wechat_avatar"
jdbcType=
"VARCHAR"
property=
"wechatAvatar"
/>
<result
column=
"wechat_name"
jdbcType=
"VARCHAR"
property=
"wechatName"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, auth_id, union_id, wechat_avatar, wechat_name, del_flag, created_date, created_by,
updated_date, updated_by
</sql>
<select
id=
"selectByUserIds"
resultType=
"cn.com.glsx.usercenter.api.dto.response.CUser"
>
select tcuar.user_id userId, tcu.rel_user_id relUserId, tcuta.openid account, tcuwa.wechat_name username, tcuwa.wechat_avatar avatar
from t_cust_user_auth_rel tcuar
inner join t_cust_user_third_auth tcuta on tcuar.auth_id = tcuta.id
left join t_cust_user tcu on tcuar.user_id = tcu.id
left join t_cust_user_wechat_account tcuwa on tcuar.auth_id = tcuwa.auth_id
where tcuar.del_flag = 0
and tcuar.auth_type = 'third'
and tcuta.login_type = 'wechat'
and tcuar.user_id in
<foreach
collection=
"cuserIds"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment