Skip to content
Clone

refactor(issues): remove issue_repo_rel types (inlined)

zhenyi committed
parent e811f19 commit 53453a3 Browse files

1 file changed

+0 −34

Deleted lib/issues/features/issue_repo_rel/types.rs
@@ -1,34 +0,0 @@
1use db::issue::issue_relation_repo as repo_rel_entity;
2use serde::{Deserialize, Serialize};
3use time::OffsetDateTime;
4use time::format_description::well_known::Rfc3339;
5use utoipa::ToSchema;
6use uuid::Uuid;
7
8fn fmt_ts(ts: OffsetDateTime) -> String {
9 ts.format(&Rfc3339).unwrap_or_default()
10}
11
12#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
13pub struct RepoRelView {
14 pub id: Uuid,
15 pub issue_id: Uuid,
16 pub repo_id: Uuid,
17 pub created_at: String,
18}
19
20impl From<repo_rel_entity::Model> for RepoRelView {
21 fn from(m: repo_rel_entity::Model) -> Self {
22 Self {
23 id: m.id,
24 issue_id: m.issue_id,
25 repo_id: m.repo_id,
26 created_at: fmt_ts(m.created_at),
27 }
28 }
29}
30
31#[derive(Debug, Clone, Serialize, Deserialize, ToSchema)]
32pub struct CreateRepoRelOption {
33 pub repo_id: Uuid,
34}
No newline at end of file