forked from alemi/upub
chore: split inbox/outbox, added forgotten mods
This commit is contained in:
parent
65032ef606
commit
2ac7fa0588
5 changed files with 26 additions and 7 deletions
20
src/activitypub/inbox.rs
Normal file
20
src/activitypub/inbox.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
use axum::{extract::State, http::StatusCode, Json};
|
||||
use sea_orm::{EntityTrait, QueryOrder, QuerySelect};
|
||||
|
||||
use crate::{model, server::Context};
|
||||
|
||||
use super::JsonLD;
|
||||
|
||||
|
||||
pub async fn get(State(ctx) : State<Context>, Json(_object): Json<serde_json::Value>) -> Result<JsonLD<serde_json::Value>, StatusCode> {
|
||||
match model::activity::Entity::find()
|
||||
.order_by(model::activity::Column::Published, sea_orm::Order::Desc)
|
||||
.limit(20)
|
||||
.all(ctx.db())
|
||||
.await
|
||||
{
|
||||
Ok(x) => todo!(),
|
||||
Err(_e) => Err(StatusCode::INTERNAL_SERVER_ERROR),
|
||||
}
|
||||
}
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
pub mod user;
|
||||
pub mod inbox;
|
||||
pub mod outbox;
|
||||
pub mod object;
|
||||
pub mod activity;
|
||||
pub mod well_known;
|
||||
|
@ -53,10 +55,3 @@ pub async fn view(State(ctx): State<Context>) -> Result<Json<serde_json::Value>,
|
|||
))
|
||||
}
|
||||
|
||||
pub async fn inbox(State(_ctx) : State<Context>, Json(_object): Json<serde_json::Value>) -> Result<JsonLD<serde_json::Value>, StatusCode> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub async fn outbox(State(_db): State<Context>) -> Result<Json<serde_json::Value>, StatusCode> {
|
||||
todo!()
|
||||
}
|
||||
|
|
0
src/activitypub/outbox.rs
Normal file
0
src/activitypub/outbox.rs
Normal file
|
@ -6,6 +6,7 @@ mod m20240322_000002_add_likes_shares;
|
|||
mod m20240322_000003_add_indexes;
|
||||
mod m20240323_000001_add_user_configs;
|
||||
mod m20240323_000002_add_simple_credentials;
|
||||
mod m20240324_000001_add_addressing;
|
||||
|
||||
pub struct Migrator;
|
||||
|
||||
|
@ -19,6 +20,7 @@ impl MigratorTrait for Migrator {
|
|||
Box::new(m20240322_000003_add_indexes::Migration),
|
||||
Box::new(m20240323_000001_add_user_configs::Migration),
|
||||
Box::new(m20240323_000002_add_simple_credentials::Migration),
|
||||
Box::new(m20240324_000001_add_addressing::Migration),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,11 @@ pub mod user;
|
|||
pub mod config;
|
||||
|
||||
pub mod relation;
|
||||
pub mod addressing;
|
||||
pub mod share;
|
||||
pub mod like;
|
||||
pub mod credential;
|
||||
pub mod session;
|
||||
|
||||
pub mod faker;
|
||||
|
||||
|
|
Loading…
Reference in a new issue