feat(proxy): add render_config method and UpstreamService mock

- Add render_config to ProxyServiceTrait and implement it

- Add mockall automock to UpstreamService

- Remove unused OverrideRef import
This commit is contained in:
GW_MC
2026-07-05 05:29:19 +00:00
parent b7891ec200
commit a7863b9e87
3 changed files with 14 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ use sea_orm::{ActiveModelTrait, ActiveValue::Set, DatabaseConnection, EntityTrai
use uuid::Uuid;
use crate::service::proxy::types::{
OverrideRef, ProxyServiceError, ProxyServiceResult, UpstreamConfig,
ProxyServiceError, ProxyServiceResult, UpstreamConfig,
};
pub struct CreateUpstreamParams {
@@ -34,6 +34,7 @@ fn model_to_config(model: crate::db::entities::upstream::Model) -> UpstreamConfi
}
}
#[cfg_attr(test, mockall::automock)]
#[async_trait::async_trait]
pub trait UpstreamService: Send + Sync + 'static {
async fn get(&self, id: Uuid) -> ProxyServiceResult<UpstreamConfig>;