sentc_crypto_common/
content.rs

1use alloc::string::String;
2
3use serde::{Deserialize, Serialize};
4
5use crate::{CategoryId, ContentId, GroupId, UserId};
6
7#[derive(Serialize, Deserialize)]
8pub struct CreateData
9{
10	#[serde(skip_serializing_if = "Option::is_none")]
11	pub category: Option<CategoryId>,
12	pub item: String,
13}
14
15#[derive(Serialize, Deserialize)]
16pub struct ContentCreateOutput
17{
18	pub content_id: ContentId,
19}
20
21#[derive(Serialize, Deserialize)]
22pub struct ListContentItem
23{
24	pub id: ContentId,
25	pub item: String,
26	pub belongs_to_group: Option<GroupId>,
27	pub belongs_to_user: Option<UserId>,
28	pub creator: UserId,
29	pub time: u128,
30	pub category: Option<CategoryId>,
31	pub access_from_group: Option<GroupId>,
32}
33
34#[derive(Serialize, Deserialize)]
35pub struct ContentItemAccess
36{
37	pub access: bool,
38	pub access_from_group: Option<GroupId>,
39}