feat: 支持按用户名搜索用户 / 兑换可用昵称 - #34
Merged
Merged
Conversation
- PublicUserInfoByUserId falls back to name lookup when user_id does not match, only when the name is unique, so redeem can accept a nickname - add GET /v1/user/search (access token required) returning at most 20 users with id, name, avatar and user_id
- revert PublicUserInfoByUserId to match user_id only
- add GET /v1/user/info/identity/{userIdOrName}/public: exact user_id
match first, then unique name match
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
改动内容
GET /v1/user/info/identity/{userIdOrName}/public(NoAuth,与现有 public info 接口一致):先精确匹配user_id,匹配不到再按昵称查找,仅当昵称全局唯一时返回(name 不保证唯一,撞名返回 UserNotExist,避免定位到错误用户)。easyjapanese 的/app/public/v1/redeem/use通过该接口实现"用户ID 或 昵称"兑换。GET /v1/user/search?name=xxx(AccessTokenAuthMiddleware,需有效 token):按 name 模糊查询,最多返回 20 条,每条含id、name、avatar、user_id,供管理后台查询用户ID 使用。GET /v1/user/info/{userId}/public保持不变,仍只按user_id查询。关联 PR
feat/admin-user-search-by-name(identity 接口透出兑换链路 + 管理端搜索 API)feat/redeem-code-use部署顺序
本服务需最先部署。