Skip to content
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: add user fuzzy search #184

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Pleasurecruise
Copy link

#183 增加用户接口模糊搜索
但是算法还没有想好暂时只能精确搜索
格式如下

{
    "status_code": 200,
    "data": [
        {
            "id": "xxxxx",
            "user_name": "萨拉托加",
            "activated": false
        }
    ]
}

需要考虑汉拼转换,简繁转换,作者热度等...?
提供了PinYinUtil工具类为后续使用
p.s. pr融合了#182 的commit

@Pleasurecruise Pleasurecruise changed the title feat: add comment area ban function feat: add user fuzzy search Feb 12, 2025
Copy link
Member

@dragove dragove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢贡献,期待这个功能完成。

关于热度,目前不考虑提供作者热度的功能,这样对新作者稍微友好一点。(或者作者热度和作业一样有时间衰减严重的特性,这块得额外设计了)
使用拼音搜索应该需要把拼音和拼音缩写都存储到数据库中,得修改一下 MaaUser 的信息了。
评论区禁用相关功能看起来已经完成了,我有空测试一下。

后续代码提交后麻烦你手动执行一下 ./gradlew ktlintFormat 格式化一次代码,谢谢~

Comment on lines 503 to 505
val copilotOptional = copilotRepository.findByCopilotId(coplitId)
Assert.isTrue(copilotOptional != null, "copilot不存在")
val copilot = copilotOptional!!
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

val copilot = copilotRepository.findByCopilotId(coplitId)
checkNotNull(copilot) {
    "copilot不存在"
}

使用内置的 checkNotNull 可以smartcast到非空类型

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants