bios_basic/rbum/dto/rbum_rel_env_dto.rs
1use serde::{Deserialize, Serialize};
2use tardis::chrono::{DateTime, Utc};
3
4use tardis::db::sea_orm;
5
6use tardis::web::poem_openapi;
7
8use crate::rbum::rbum_enumeration::RbumRelEnvKind;
9
10/// Add request for resource relationship environment condition
11///
12/// 资源关联环境条件添加请求
13#[derive(Serialize, Deserialize, Debug, poem_openapi::Object)]
14pub struct RbumRelEnvAddReq {
15 /// Relationship environment type
16 ///
17 /// 关联的环境类型
18 pub kind: RbumRelEnvKind,
19 /// Relationship environment value1
20 ///
21 /// 关联环境值1
22 #[oai(validator(min_length = "1", max_length = "2000"))]
23 pub value1: String,
24 /// Relationship environment value2
25 ///
26 /// 关联环境值2
27 #[oai(validator(min_length = "1", max_length = "2000"))]
28 pub value2: Option<String>,
29 /// Associated [relationship](crate::rbum::dto::rbum_rel_dto::RbumRelDetailResp) id
30 ///
31 /// 关联的[资源关联](crate::rbum::dto::rbum_rel_dto::RbumRelDetailResp) id
32 #[oai(validator(min_length = "2", max_length = "255"))]
33 pub rel_rbum_rel_id: String,
34}
35
36/// Modify request for resource relationship environment condition
37///
38/// 资源关联环境条件修改请求
39#[derive(Serialize, Deserialize, Debug, poem_openapi::Object)]
40pub struct RbumRelEnvModifyReq {
41 /// Relationship environment value1
42 ///
43 /// 关联环境值1
44 #[oai(validator(min_length = "1", max_length = "2000"))]
45 pub value1: Option<String>,
46 /// Relationship environment value2
47 ///
48 /// 关联环境值2
49 #[oai(validator(min_length = "1", max_length = "2000"))]
50 pub value2: Option<String>,
51}
52
53/// Resource relationship environment condition detail information
54///
55/// 资源关联环境条件详细信息
56#[derive(Serialize, Deserialize, Clone, Debug, poem_openapi::Object, sea_orm::FromQueryResult)]
57pub struct RbumRelEnvDetailResp {
58 /// Relationship environment id
59 ///
60 /// 关联环境id
61 pub id: String,
62 /// Relationship environment type
63 ///
64 /// 关联的环境类型
65 pub kind: RbumRelEnvKind,
66 /// Relationship environment value1
67 ///
68 /// 关联环境值1
69 pub value1: String,
70 /// Relationship environment value2
71 ///
72 /// 关联环境值2
73 pub value2: String,
74 /// Associated [relationship](crate::rbum::dto::rbum_rel_dto::RbumRelDetailResp) id
75 ///
76 /// 关联的[资源关联](crate::rbum::dto::rbum_rel_dto::RbumRelDetailResp) id
77 pub rel_rbum_rel_id: String,
78
79 pub own_paths: String,
80 pub owner: String,
81 pub owner_name: Option<String>,
82 pub create_time: DateTime<Utc>,
83 pub update_time: DateTime<Utc>,
84}