Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Breaking

- **删除 `openlark-user` 幻影 `SystemStatusResource::get()` / `SystemStatusGetRequest`(#377)**:
飞书 `personal_settings/v1/system_status` 仅有 6 个 API(batch_close / batch_open /
create / delete / list / patch),无 `get`("获取系统状态"对应 `list`)。既有
`get` 实现 URL 畸形(双段 `personal-settings` + 连字符 + `/get` 后缀),调用即失败。
直接移除 `get.rs`、`SystemStatusGetRequest`/`SystemStatusGetResponse`、以及
`SystemStatusResource::get()` accessor;文档与契约测试改为 6 个真实构建器。
**无迁移路径**:旧 `get` 对真实飞书本就 404;请改用 `list()` /
`SystemStatusListRequest`。

- **删除 `openlark-helpdesk` 幻影/孤儿 API(#380)**:#351 helpdesk e2e catalog 核对发现
(1) `faq/faq_image` 与 `faq/image` 生产代码完全重复且从未 re-export/挂到 `Faq`——删除孤儿
`faq_image` 模块,保留 `image`(含 wiremock e2e);(2) `notification/list`
Expand Down Expand Up @@ -176,13 +185,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
配合 v0.18 deprecated 清理节奏,下个 breaking 窗口删除。**非 breaking**:仅 deprecation
warning,旧调用仍可编译。

- **user `SystemStatusResource::get()` 标 `#[deprecated]`**(#377):`personal_settings/v1/
system_status::get` 是幻影 API——飞书该目录无 `get` 接口("获取系统状态"对应 `list`),URL
畸形且被暴露为 `service.get()` 公共方法(调用即打不存在的端点)。标记 deprecated,note 指明
替代(`SystemStatusResource::list` / `SystemStatusListRequest`)。配合 v0.18 deprecated 清理
节奏,下个 breaking 窗口连同 `get.rs` / `SystemStatusGetRequest` 一并删除。**非 breaking**:
仅 deprecation warning,旧调用仍可编译。

### Breaking Changes

- **openlark-analytics 修 7 个 search/v2 + report 残缺 stub(#351 第 4 批)**:
Expand Down
4 changes: 2 additions & 2 deletions crates/openlark-user/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//!
//! ## 功能特性
//!
//! - **个人设置**: system_status 资源(list / get / create / patch / delete / batch_open / batch_close)
//! - **个人设置**: system_status 资源(list / create / patch / delete / batch_open / batch_close)
//!
//! ## 模块组织
//!
Expand All @@ -24,7 +24,7 @@
//!
//! let user_service = UserService::new(config);
//!
//! // 经 system_status() 直达(7 个真实构建器)
//! // 经 system_status() 直达(6 个真实构建器)
//! let system_status = user_service.system_status();
//! let _list_req = system_status.list();
//! ```
Expand Down
18 changes: 3 additions & 15 deletions crates/openlark-user/src/personal_settings/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Personal Settings 模块
//!
//! `SystemStatusResource` 由 `UserService::system_status()` 直接返回(ADR 0001:砍
//! `PersonalSettingsResource` 单转发中间层),收敛 system_status 7 个真实请求构建器,
//! `PersonalSettingsResource` 单转发中间层),收敛 system_status 6 个真实请求构建器,
//! 避免写 `personal_settings::personal_settings::v1::system_status::*` 三重嵌套模块全路径。

pub mod personal_settings;
Expand All @@ -12,10 +12,10 @@ use std::sync::Arc;
use crate::personal_settings::personal_settings::v1::system_status::{
batch_close::BatchCloseSystemStatusRequest, batch_open::SystemStatusBatchOpenRequest,
create::SystemStatusCreateRequest, delete::SystemStatusDeleteRequest,
get::SystemStatusGetRequest, list::SystemStatusListRequest, patch::SystemStatusPatchRequest,
list::SystemStatusListRequest, patch::SystemStatusPatchRequest,
};

/// system_status 资源(7 个真实请求构建器)。
/// system_status 资源(6 个真实请求构建器)。
#[derive(Debug, Clone)]
pub struct SystemStatusResource {
config: Arc<Config>,
Expand All @@ -37,18 +37,6 @@ impl SystemStatusResource {
SystemStatusListRequest::new(self.config.clone())
}

/// 获取系统状态详情。
///
/// ⚠️ **幻影 API**:飞书 `personal_settings/v1/system_status` 无 `get` 接口(目录里
/// "获取系统状态"对应的是 [`list`](SystemStatusResource::list)),此方法请求的是一个不
/// 存在的端点。将在 v0.18.0 移除(#377);请改用 [`list`](SystemStatusResource::list)。
#[deprecated(
note = "幻影 API:飞书无 system_status get 接口,将在 v0.18.0 移除;请改用 list(SystemStatusListRequest)(#377)"
)]
pub fn get(&self) -> SystemStatusGetRequest {
SystemStatusGetRequest::new(self.config.clone())
}

/// 创建系统状态。
pub fn create(&self) -> SystemStatusCreateRequest {
SystemStatusCreateRequest::new(self.config.clone())
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ pub mod batch_close;
pub mod batch_open;
pub mod create;
pub mod delete;
pub mod get;
pub mod list;
pub mod patch;
6 changes: 3 additions & 3 deletions crates/openlark-user/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::sync::Arc;
/// 用户设置服务
///
/// 提供个人设置(system_status)功能的统一入口(ADR 0001:砍 `PersonalSettingsResource`
/// 单转发中间层,`system_status()` 直达 7 个真实构建器)。
/// 单转发中间层,`system_status()` 直达 6 个真实构建器)。
#[derive(Debug, Clone)]
pub struct UserService {
/// 客户端配置
Expand All @@ -32,9 +32,9 @@ impl UserService {
self.config.clone()
}

/// system_status 资源入口(7 个真实请求构建器)。
/// system_status 资源入口(6 个真实请求构建器)。
///
/// 直达 `SystemStatusResource`(list / get / create / patch / delete / batch_open /
/// 直达 `SystemStatusResource`(list / create / patch / delete / batch_open /
/// batch_close),消除原 `service.personal_settings().system_status()` 中
/// `PersonalSettingsResource` 单转发中间层。
pub fn system_status(&self) -> crate::personal_settings::SystemStatusResource {
Expand Down
4 changes: 1 addition & 3 deletions crates/openlark-user/tests/user_contract_models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ fn user_service_config_roundtrip() {
// ---------------------------------------------------------------------------

#[test]
#[allow(deprecated)] // get() 是幻影 API(#377),v0.18 移除前仍验证其可达
fn system_status_service_access_contract() {
use openlark_core::config::Config;
use openlark_user::UserService;
Expand All @@ -206,10 +205,9 @@ fn system_status_service_access_contract() {
// service config 可达
assert_eq!(service.config().app_id(), "cli_ps_test");

// system_status() 直达(7 个真实构建器)
// system_status() 直达(6 个真实构建器;飞书无 get,#377 已移除幻影 get
let system_status = service.system_status();
let _list = system_status.list();
let _get = system_status.get();
let _create = system_status.create();
let _patch = system_status.patch();
let _delete = system_status.delete();
Expand Down
Loading