• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

doitsu2014 / my-cms / 14187034714

01 Apr 2025 04:12AM UTC coverage: 59.597% (+20.5%) from 39.058%
14187034714

push

github

web-flow
Feature/support multi language (#19)

* Enhance entity structure: add category and post translations, update migration dependencies, and improve README guidelines

* Add support for category translations: update create and modify handlers, requests, and tests

add TODO

* Add category translations support: update create, modify, and read handlers, and adjust request structures

* Refactor category translation requests: remove slug field and update handlers to set category ID for translations

* Add support for post translations: update create and modify requests, handlers, and models

* Update CI configuration and scripts for improved coverage reporting and toolchain management

* Update coverage configuration and scripts for improved reporting and toolchain management

* Update CI and coverage configurations for improved reporting and ignore patterns

* Update CI configuration and coverage scripts for improved reporting and cleanup

* Remove unused coverage step from CI configuration

* Update CI configuration to use fixed lcov report paths for coverage uploads

197 of 396 new or added lines in 19 files covered. (49.75%)

71 existing lines in 11 files now uncovered.

975 of 1636 relevant lines covered (59.6%)

26.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

38.89
/application_core/src/entities/posts.rs
1
//! `SeaORM` Entity. Generated by sea-orm-codegen 0.12.15
2

3
use sea_orm::entity::prelude::*;
4
use serde::{Deserialize, Serialize};
5

6
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
336✔
7
#[sea_orm(table_name = "posts")]
8
#[serde(rename_all = "camelCase")]
9
pub struct Model {
10
    #[sea_orm(primary_key, auto_increment = false)]
11
    pub id: Uuid,
12
    pub title: String,
13
    #[sea_orm(column_type = "Text", nullable)]
14
    pub preview_content: Option<String>,
15
    #[sea_orm(column_type = "Text")]
16
    pub content: String,
17
    pub thumbnail_paths: Vec<String>,
18
    #[sea_orm(unique)]
19
    pub slug: String,
20
    pub published: bool,
21
    pub created_by: String,
22
    pub created_at: DateTimeWithTimeZone,
23
    pub last_modified_by: Option<String>,
24
    pub last_modified_at: Option<DateTimeWithTimeZone>,
25
    pub category_id: Uuid,
26
    pub row_version: i32,
27
}
28

UNCOV
29
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
×
30
pub enum Relation {
31
    #[sea_orm(
32
        belongs_to = "super::categories::Entity",
33
        from = "Column::CategoryId",
34
        to = "super::categories::Column::Id",
35
        on_update = "NoAction",
36
        on_delete = "Cascade"
37
    )]
38
    Categories,
39
    #[sea_orm(has_many = "super::post_tags::Entity")]
40
    PostTags,
41
    #[sea_orm(has_many = "super::post_translations::Entity")]
42
    PostTranslations,
43
}
44

45
impl Related<super::categories::Entity> for Entity {
46
    fn to() -> RelationDef {
×
47
        Relation::Categories.def()
×
48
    }
×
49
}
50

51
impl Related<super::post_tags::Entity> for Entity {
52
    fn to() -> RelationDef {
×
53
        Relation::PostTags.def()
×
54
    }
×
55
}
56

57
impl Related<super::post_translations::Entity> for Entity {
NEW
58
    fn to() -> RelationDef {
×
NEW
59
        Relation::PostTranslations.def()
×
NEW
60
    }
×
61
}
62

63
impl Related<super::tags::Entity> for Entity {
64
    fn to() -> RelationDef {
9✔
65
        super::post_tags::Relation::Tags.def()
9✔
66
    }
9✔
67
    fn via() -> Option<RelationDef> {
9✔
68
        Some(super::post_tags::Relation::Posts.def().rev())
9✔
69
    }
9✔
70
}
71

72
impl ActiveModelBehavior for ActiveModel {}
73

74
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelatedEntity)]
×
75
pub enum RelatedEntity {
76
    #[sea_orm(entity = "super::categories::Entity")]
77
    Categories,
78
    #[sea_orm(entity = "super::post_tags::Entity")]
79
    PostTags,
80
    #[sea_orm(entity = "super::post_translations::Entity")]
81
    PostTranslations,
82
    #[sea_orm(entity = "super::tags::Entity")]
83
    Tags,
84
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc