From ee9e33515264f42e04261a07eec26b1c8a82945d Mon Sep 17 00:00:00 2001 From: khorshuheng Date: Tue, 22 Oct 2024 17:29:20 +0800 Subject: [PATCH] feat: add publish info to template --- libs/client-api/src/http_template.rs | 11 ++++--- libs/database-entity/src/dto.rs | 49 ++++++++++++++++++++++++---- src/api/template.rs | 10 +++--- src/biz/template/ops.rs | 13 ++++++-- tests/workspace/template.rs | 4 +++ 5 files changed, 69 insertions(+), 18 deletions(-) diff --git a/libs/client-api/src/http_template.rs b/libs/client-api/src/http_template.rs index ad52ca07..b7c55dd7 100644 --- a/libs/client-api/src/http_template.rs +++ b/libs/client-api/src/http_template.rs @@ -2,8 +2,8 @@ use client_api_entity::{ AccountLink, CreateTemplateCategoryParams, CreateTemplateCreatorParams, CreateTemplateParams, GetTemplateCategoriesQueryParams, GetTemplateCreatorsQueryParams, GetTemplatesQueryParams, Template, TemplateCategories, TemplateCategory, TemplateCategoryType, TemplateCreator, - TemplateCreators, Templates, UpdateTemplateCategoryParams, UpdateTemplateCreatorParams, - UpdateTemplateParams, + TemplateCreators, TemplateWithPublishInfo, Templates, UpdateTemplateCategoryParams, + UpdateTemplateCreatorParams, UpdateTemplateParams, }; use reqwest::Method; use shared_entity::response::{AppResponse, AppResponseError}; @@ -231,7 +231,10 @@ impl Client { .into_data() } - pub async fn get_template(&self, view_id: Uuid) -> Result { + pub async fn get_template( + &self, + view_id: Uuid, + ) -> Result { let url = template_resource_url(&self.base_url, view_id); let resp = self .http_client_without_auth(Method::GET, &url) @@ -239,7 +242,7 @@ impl Client { .send() .await?; - AppResponse::