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

期望为 Console 端的用户管理单独提供接口以支持更多筛选条件 #3290

Closed
ruibaby opened this issue Feb 12, 2023 · 11 comments · Fixed by #3320 or halo-dev/console#862
Closed
Assignees
Labels
area/console Issues or PRs related to the Halo Console area/core Issues or PRs related to the Halo Core kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@ruibaby
Copy link
Member

ruibaby commented Feb 12, 2023

你当前使用的版本

2.2.0

描述一下此特性

image

如图,目前用户管理仅支持通过关键词筛选(由前端实现),期望支持后端的关键词搜索,以及必要的条件筛选,比如角色。

/area core
/area console
/milestone 2.3.x

附加信息

No response

@f2c-ci-robot f2c-ci-robot bot added this to the 2.3.x milestone Feb 12, 2023
@f2c-ci-robot f2c-ci-robot bot added area/core Issues or PRs related to the Halo Core area/console Issues or PRs related to the Halo Console labels Feb 12, 2023
@ruibaby
Copy link
Member Author

ruibaby commented Feb 12, 2023

另外,建议将角色信息也聚合返回。

@JohnNiang
Copy link
Member

/kind feature

@f2c-ci-robot f2c-ci-robot bot added the kind/feature Categorizes issue or PR as related to a new feature. label Feb 12, 2023
@JackyLiang522
Copy link
Contributor

/assign

@JackyLiang522
Copy link
Contributor

现在api里的V1alpha1UserApiListv1alpha1UserRequest接口没有关键词和角色的属性。是不是要先修改api-client的代码才行?

@guqing
Copy link
Member

guqing commented Feb 14, 2023

现在api里的V1alpha1UserApiListv1alpha1UserRequest接口没有关键词和角色的属性。是不是要先修改api-client的代码才行?

api-client 是根据后端的 api 自动生成的,参考 localhost:8090/swagger-ui.html ,所以此 issue 需要改动到后端的 api 参数然后重新生成 api-client

@JackyLiang522
Copy link
Contributor

现在api里的V1alpha1UserApiListv1alpha1UserRequest接口没有关键词和角色的属性。是不是要先修改api-client的代码才行?

api-client 是根据后端的 api 自动生成的,参考 localhost:8090/swagger-ui.html ,所以此 issue 需要改动到后端的 api 参数然后重新生成 api-client

后端api的参数应该在哪里修改呢?以及改动后如何重新生成api-client?

@ruibaby
Copy link
Member Author

ruibaby commented Feb 14, 2023

@JustinLiang522 你可以先提交 Halo 的 PR,Console 这边的改动我可以来做。

@guqing
Copy link
Member

guqing commented Feb 14, 2023

目前用户管理列表的 api 还是自动生成的,要添加更多参数需要在 UserEndpoint 提供一个列表查询的 endpoint 叫 .GET("/users", ...)
可以参考这个示例:

.GET("/attachments", this::search,
builder -> {
builder
.operationId("SearchAttachments")
.tag(tag)
.response(
responseBuilder().implementation(generateGenericClass(Attachment.class))
);
buildParametersFromType(builder, ISearchRequest.class);
}
)

@JackyLiang522
Copy link
Contributor

@JustinLiang522 你可以先提交 Halo 的 PR,Console 这边的改动我可以来做。

OK :)

@JackyLiang522
Copy link
Contributor

所以除了关键词搜索外,后端需要实现的条件筛选有哪些呢?按照现在前端UserList的代码,应该是有状态,角色以及对登陆时间的排序这三个?

@ruibaby
Copy link
Member Author

ruibaby commented Feb 14, 2023

所以除了关键词搜索外,后端需要实现的条件筛选有哪些呢?按照现在前端UserList的代码,应该是有状态,角色以及对登陆时间的排序这三个?

目前应该仅有角色有用,状态暂时没有用到。排序目前提供创建时间升降序即可,登录时间暂时也没用上。

f2c-ci-robot bot pushed a commit to halo-dev/console that referenced this issue Feb 20, 2023
#### What type of PR is this?

/kind feature

#### What this PR does / why we need it:

用户管理列表支持条件筛选和排序,适配:halo-dev/halo#3320

#### Which issue(s) this PR fixes:

Fixes halo-dev/halo#3290

#### Screenshots:

<img width="922" alt="image" src="https://user-images.githubusercontent.com/21301288/219578426-de396dfb-7ece-496e-b740-d7a36321eafb.png">

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 halo-dev/halo#3320 分支。
2. Console 需要 `pnpm build:packages`
3. 测试用户管理的关键词、条件、排序筛选是否工作正常。

#### Does this PR introduce a user-facing change?

```release-note
Console 端的用户列表支持条件筛选和排序。
```
f2c-ci-robot bot pushed a commit that referenced this issue Feb 20, 2023
#### What type of PR is this?

/kind bug

#### What this PR does / why we need it:

为后端用户管理提供更多筛选接口,包括关键词、角色、创建时间排序

#### Which issue(s) this PR fixes:

Fixes #3290

```release-note
NONE
```
@ruibaby ruibaby modified the milestones: 2.3.x, 2.3.0 Feb 20, 2023
JohnNiang pushed a commit to JohnNiang/halo that referenced this issue Mar 2, 2023
…o-dev/console#862)

#### What type of PR is this?

/kind feature

#### What this PR does / why we need it:

用户管理列表支持条件筛选和排序,适配:halo-dev#3320

#### Which issue(s) this PR fixes:

Fixes halo-dev#3290

#### Screenshots:

<img width="922" alt="image" src="https://user-images.githubusercontent.com/21301288/219578426-de396dfb-7ece-496e-b740-d7a36321eafb.png">

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 halo-dev#3320 分支。
2. Console 需要 `pnpm build:packages`
3. 测试用户管理的关键词、条件、排序筛选是否工作正常。

#### Does this PR introduce a user-facing change?

```release-note
Console 端的用户列表支持条件筛选和排序。
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/console Issues or PRs related to the Halo Console 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
4 participants