bios_basic/rbum/dto/
rbum_domain_dto.rs1use serde::{Deserialize, Serialize};
2use tardis::basic::field::TrimString;
3use tardis::chrono::{DateTime, Utc};
4
5use tardis::db::sea_orm;
6
7use tardis::web::poem_openapi;
8
9use crate::rbum::rbum_enumeration::RbumScopeLevelKind;
10
11#[derive(Serialize, Deserialize, Debug, poem_openapi::Object)]
15pub struct RbumDomainAddReq {
16 #[oai(validator(min_length = "2", max_length = "255"))]
28 pub code: TrimString,
29 #[oai(validator(min_length = "2", max_length = "255"))]
33 pub name: TrimString,
34 #[oai(validator(min_length = "2", max_length = "2000"))]
38 pub note: Option<String>,
39 #[oai(validator(min_length = "2", max_length = "1000"))]
43 pub icon: Option<String>,
44 pub sort: Option<i64>,
48
49 pub scope_level: Option<RbumScopeLevelKind>,
50}
51
52#[derive(Serialize, Deserialize, Debug, poem_openapi::Object)]
56pub struct RbumDomainModifyReq {
57 #[oai(validator(min_length = "2", max_length = "255"))]
61 pub name: Option<TrimString>,
62 #[oai(validator(min_length = "2", max_length = "2000"))]
66 pub note: Option<String>,
67 #[oai(validator(min_length = "2", max_length = "1000"))]
71 pub icon: Option<String>,
72 pub sort: Option<i64>,
76 pub scope_level: Option<RbumScopeLevelKind>,
84}
85
86#[derive(Serialize, Deserialize, Debug, Clone, poem_openapi::Object, sea_orm::FromQueryResult)]
90pub struct RbumDomainSummaryResp {
91 pub id: String,
95 pub code: String,
99 pub name: String,
103 pub icon: String,
107 pub sort: i64,
111
112 pub own_paths: String,
113 pub owner: String,
114 pub create_time: DateTime<Utc>,
115 pub update_time: DateTime<Utc>,
116
117 pub scope_level: RbumScopeLevelKind,
118}
119
120#[derive(Serialize, Deserialize, Debug, poem_openapi::Object, sea_orm::FromQueryResult)]
124pub struct RbumDomainDetailResp {
125 pub id: String,
129 pub code: String,
133 pub name: String,
137 pub note: String,
141 pub icon: String,
145 pub sort: i64,
146
147 pub own_paths: String,
148 pub owner: String,
149 pub owner_name: Option<String>,
150 pub create_time: DateTime<Utc>,
151 pub update_time: DateTime<Utc>,
152
153 pub scope_level: RbumScopeLevelKind,
154}