-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat] 根据uuid查询用户信息 #24
Open
xiangZr-hhh
wants to merge
9
commits into
master
Choose a base branch
from
feat-user-info-getMyinfo
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
170e7b8
feat(业务):完成了根据uuid获取用户信息的接口
9fed915
patch(补丁):获取用户信息
e980669
patch(补丁):获取用户信息
61b7fa1
patch(补丁):获取用户信息
b03df05
Merge branch 'feat-user-info-getMyinfo' of https://github.com/fantast…
f035735
patch(补丁):根据uuid获取用户信息
ac87979
patch(补丁):根据uuid获取用户信息
dd19ca4
patch(补丁):根据uuid获取用户信息
0521e72
patch(补丁):根据uuid获取用户信息
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/main/kotlin/com/frontleaves/fantasticeditor/dao/VipDAO.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* ******************************************************************************* | ||
* Copyright (C) 2024-NOW(至今) 妙笔智编 | ||
* Author: 锋楪技术团队 | ||
* | ||
* 本文件包含 妙笔智编「FantasticEditor」 的源代码,该项目的所有源代码均遵循MIT开源许可证协议。 | ||
* 本代码仅允许在十三届软件杯比赛授权比赛方可直接使用 | ||
* ******************************************************************************* | ||
* 免责声明: | ||
* 使用本软件的风险由用户自担。作者或版权持有人在法律允许的最大范围内, | ||
* 对因使用本软件内容而导致的任何直接或间接的损失不承担任何责任。 | ||
* ******************************************************************************* | ||
*/ | ||
|
||
package com.frontleaves.fantasticeditor.dao | ||
|
||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper | ||
import com.baomidou.mybatisplus.extension.service.IService | ||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl | ||
import com.frontleaves.fantasticeditor.mappers.VipMapper | ||
import com.frontleaves.fantasticeditor.models.entity.sql.SqlVipDO | ||
import com.frontleaves.fantasticeditor.utility.Util | ||
import com.frontleaves.fantasticeditor.utility.redis.RedisUtil | ||
import org.springframework.stereotype.Repository | ||
|
||
/** | ||
* # 会员数据访问对象 | ||
* 用于定义会员数据访问对象; | ||
* | ||
* @since v1.0.0 | ||
* @see ServiceImpl | ||
* @property VipMapper 会员映射器 | ||
* @property SqlVipDO 会员实体类 | ||
* @constructor 创建一个会员数据访问对象 | ||
* @author zrx | ||
*/ | ||
@Repository | ||
class VipDAO(private val redisUtil: RedisUtil) : | ||
ServiceImpl<VipMapper, SqlVipDO>(), IService<SqlVipDO> { | ||
|
||
/** | ||
* ## 通过UUID获取会员 | ||
* 通过UUID获取会员的基本信息 | ||
* | ||
* @param vuuid 会员UUID | ||
* @return 会员实体类 | ||
*/ | ||
fun getVipByVUUID(vuuid: String): SqlVipDO? { | ||
return redisUtil.hashGet("vip:vuuid:$vuuid") | ||
.takeIf { !it.isNullOrEmpty() }?.let { | ||
Util.mapToObject(it, SqlVipDO::class.java) | ||
} ?: run { | ||
this.getOne(QueryWrapper<SqlVipDO>().eq("vuuid", vuuid)) | ||
} | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/kotlin/com/frontleaves/fantasticeditor/mappers/VipMapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* ******************************************************************************* | ||
* Copyright (C) 2024-NOW(至今) 妙笔智编 | ||
* Author: 锋楪技术团队 | ||
* | ||
* 本文件包含 妙笔智编「FantasticEditor」 的源代码,该项目的所有源代码均遵循MIT开源许可证协议。 | ||
* 本代码仅允许在十三届软件杯比赛授权比赛方可直接使用 | ||
* ******************************************************************************* | ||
* 免责声明: | ||
* 使用本软件的风险由用户自担。作者或版权持有人在法律允许的最大范围内, | ||
* 对因使用本软件内容而导致的任何直接或间接的损失不承担任何责任。 | ||
* ******************************************************************************* | ||
*/ | ||
|
||
package com.frontleaves.fantasticeditor.mappers | ||
|
||
import com.baomidou.mybatisplus.core.mapper.BaseMapper | ||
import com.frontleaves.fantasticeditor.models.entity.sql.SqlVipDO | ||
import org.apache.ibatis.annotations.Mapper | ||
|
||
/** | ||
* # 会员映射器 | ||
* 用于定义会员映射器; | ||
* | ||
* @since v1.0.0 | ||
* @constructor 创建一个会员映射器 | ||
* @author zrx | ||
*/ | ||
@Mapper | ||
interface VipMapper : BaseMapper<SqlVipDO> |
55 changes: 55 additions & 0 deletions
55
...ain/kotlin/com/frontleaves/fantasticeditor/models/entity/redis/RedisUserPublicInfoDO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* ******************************************************************************* | ||
* Copyright (C) 2024-NOW(至今) 妙笔智编 | ||
* Author: 锋楪技术团队 | ||
* | ||
* 本文件包含 妙笔智编「FantasticEditor」 的源代码,该项目的所有源代码均遵循MIT开源许可证协议。 | ||
* 本代码仅允许在十三届软件杯比赛授权比赛方可直接使用 | ||
* ******************************************************************************* | ||
* 免责声明: | ||
* 使用本软件的风险由用户自担。作者或版权持有人在法律允许的最大范围内, | ||
* 对因使用本软件内容而导致的任何直接或间接的损失不承担任何责任。 | ||
* ******************************************************************************* | ||
*/ | ||
|
||
package com.frontleaves.fantasticeditor.models.entity.redis; | ||
|
||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.Accessors; | ||
|
||
/** | ||
* Redis用户基本信息实体 | ||
* <p> | ||
* 用于存储用户基本信息的实体 | ||
* @since v1.0.0 | ||
* @version v1.0.0 | ||
* @author zrx | ||
* @date 2024/6/1 8:45 | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
@Accessors(chain = true) | ||
public class RedisUserPublicInfoDO { | ||
|
||
public String uuid; | ||
|
||
public String username; | ||
|
||
public String email; | ||
|
||
public String phone; | ||
|
||
public String basicInformation; | ||
|
||
public String roleId; | ||
|
||
public String roleName; | ||
|
||
public String vipId; | ||
|
||
public String vipName; | ||
|
||
} | ||
|
||
|
52 changes: 52 additions & 0 deletions
52
src/main/kotlin/com/frontleaves/fantasticeditor/models/vo/api/user/UserPublicInfoVO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* ******************************************************************************* | ||
* Copyright (C) 2024-NOW(至今) 妙笔智编 | ||
* Author: 锋楪技术团队 | ||
* | ||
* 本文件包含 妙笔智编「FantasticEditor」 的源代码,该项目的所有源代码均遵循MIT开源许可证协议。 | ||
* 本代码仅允许在十三届软件杯比赛授权比赛方可直接使用 | ||
* ******************************************************************************* | ||
* 免责声明: | ||
* 使用本软件的风险由用户自担。作者或版权持有人在法律允许的最大范围内, | ||
* 对因使用本软件内容而导致的任何直接或间接的损失不承担任何责任。 | ||
* ******************************************************************************* | ||
*/ | ||
|
||
package com.frontleaves.fantasticeditor.models.vo.api.user; | ||
|
||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.Accessors; | ||
|
||
/** | ||
* 用户基本信息 | ||
* <p> | ||
* | ||
* @author zrx | ||
* @date 2024/5/31 21:33 | ||
* @since v1.0.0 | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
@Accessors(chain = true) | ||
public class UserPublicInfoVO { | ||
public String uuid; | ||
|
||
public String username; | ||
|
||
public String email; | ||
|
||
public String phone; | ||
|
||
public String basicInformation; | ||
|
||
public String roleId; | ||
|
||
public String roleName; | ||
|
||
public String vipId; | ||
|
||
public String vipName; | ||
} | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
该部分内容不可删除