修改草稿api返回值类型
All checks were successful
build / build-rust (push) Successful in 2m23s

This commit is contained in:
soul-walker 2024-09-19 09:07:24 +08:00
parent 2a7a2ffc99
commit 50a0799f28

View File

@ -8,6 +8,7 @@ use rtss_db::RtssDbAccessor;
use rtss_dto::common::{DataType, IscsStyle}; use rtss_dto::common::{DataType, IscsStyle};
use serde::de::DeserializeOwned; use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use serde_json::Value;
use crate::pagination::PageQueryDto; use crate::pagination::PageQueryDto;
@ -277,7 +278,7 @@ pub struct DraftDataWithStringOptions {
pub id: i32, pub id: i32,
pub name: String, pub name: String,
pub data_type: rtss_dto::common::DataType, pub data_type: rtss_dto::common::DataType,
pub options: Option<String>, pub options: Option<Value>,
pub data: Option<Vec<u8>>, pub data: Option<Vec<u8>>,
pub user_id: i32, pub user_id: i32,
pub is_shared: bool, pub is_shared: bool,
@ -291,7 +292,7 @@ impl From<rtss_db::model::DraftDataModel> for DraftDataWithStringOptions {
id: value.id, id: value.id,
name: value.name, name: value.name,
data_type: DataType::try_from(value.data_type).unwrap(), data_type: DataType::try_from(value.data_type).unwrap(),
options: value.options.map(|o| serde_json::to_string(&o).unwrap()), options: value.options,
data: value.data, data: value.data,
user_id: value.user_id, user_id: value.user_id,
is_shared: value.is_shared, is_shared: value.is_shared,