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

contributorFinder 支持返回用户元数据 #4645

Closed
wan92hen opened this issue Sep 22, 2023 · 6 comments · Fixed by #4705
Closed

contributorFinder 支持返回用户元数据 #4645

wan92hen opened this issue Sep 22, 2023 · 6 comments · Fixed by #4705
Assignees
Labels
area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature.

Comments

@wan92hen
Copy link
Collaborator

你当前使用的版本

No response

描述一下此特性

主题或插件中引入了用户元数据时,目前的 contributorFinder 无法返回这些元数据信息。

附加信息

No response

@ruibaby
Copy link
Member

ruibaby commented Sep 26, 2023

/kind feature
/area core

@f2c-ci-robot f2c-ci-robot bot added kind/feature Categorizes issue or PR as related to a new feature. area/core Issues or PRs related to the Halo Core labels Sep 26, 2023
@AirboZH
Copy link
Member

AirboZH commented Oct 10, 2023

/assign

@AirboZH
Copy link
Member

AirboZH commented Oct 10, 2023

@ruibaby

涉及一些关键信息,暴露出这些数据可以么。

最后登录时间这个功能是还没有实现么?

ContributorVo

  "metadata": {
    "name": "string", // 用户名
    "annotations": {
      "additionalProp1": "string",
    },
    "creationTimestamp": "2022-11-20T13:06:38.512Z",    // 创建时间
  },
  "spec": {
    "displayName": "string", // 显示名称
    "avatar": "string", // 头像
    "email": "string", // 邮箱
    "phone": "string", // 手机号
    "registeredAt": "2023-10-10T02:41:35.239117300Z", // 注册时间
    "bio": "string", // 描述
  },
  "status": {
    "lastLoginAt": "2023-10-10T02:41:35.239117300Z", // 最后登录时间
    "permalink": "string", // 作者的文章归档页面链接
  }

@AirboZH
Copy link
Member

AirboZH commented Oct 10, 2023

metadata应该可以全暴露出来吧
然后我在ContributorVo里写一个ContributorSpecVo内部类,不包括password twoFactorAuthEnabled和loginHistoryLimit
写一个ContributorStatusVo内部类不包括loginHistories

@AirboZH
Copy link
Member

AirboZH commented Oct 10, 2023

为了适配已开发的主题,不应该做上面这么大的变动😥。保留之前的属性

@guqing
Copy link
Member

guqing commented Oct 10, 2023

- public class ContributorVo {
+ public class ContributorVo implements ExtensionVoOperator {
+  MetadataOperator metadata;

f2c-ci-robot bot pushed a commit that referenced this issue Oct 11, 2023
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind improvement
/kind api-change
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
优化ContributorVo格式,支持更多信息。
#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #4645

#### Special notes for your reviewer:
none
#### Does this PR introduce a user-facing change?

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
contributorFinder 支持返回用户元数据、注册信息、用户权限等。
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants