Fix all compilation issues.
This commit is contained in:
@@ -4,6 +4,7 @@ use crate::user::validator::validator;
|
||||
use actix_web::web::ServiceConfig;
|
||||
use actix_web::{get, web, HttpResponse, Responder};
|
||||
use actix_web_httpauth::middleware::HttpAuthentication;
|
||||
use crate::video::handler::download_file;
|
||||
|
||||
pub mod user;
|
||||
pub mod video;
|
||||
@@ -14,6 +15,7 @@ async fn health() -> impl Responder {
|
||||
}
|
||||
|
||||
pub fn init(cfg: &mut ServiceConfig) {
|
||||
cfg.service(download_file);
|
||||
cfg.default_service(web::to(not_found));
|
||||
}
|
||||
|
||||
|
||||
@@ -2,8 +2,8 @@ use actix_web::{delete, get, post, put, web, HttpMessage, HttpRequest, HttpRespo
|
||||
use std::io::ErrorKind;
|
||||
use std::sync::Arc;
|
||||
use uuid::Uuid;
|
||||
use surveillant_systeme_application::user::service::UserService;
|
||||
use surveillant_systeme_domain::user::model::Claims;
|
||||
use lumiere_application::user::service::UserService;
|
||||
use lumiere_domain::user::model::Claims;
|
||||
use crate::user::model::request::{CreateFirstUserRequestDto, CreateUserRequestDto, LoginRequestDto, UpdateUserPasswordRequestDto, UpdateUserRequestDto};
|
||||
use crate::user::model::response::{LoginResponseDto, UserDto};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use chrono::{DateTime, Utc};
|
||||
use serde::Serialize;
|
||||
use uuid::Uuid;
|
||||
use surveillant_systeme_domain::user::model::{LoginResponse, RefreshToken, User};
|
||||
use lumiere_domain::user::model::{LoginResponse, RefreshToken, User};
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct UserDto {
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::env;
|
||||
use actix_web::{dev, HttpMessage};
|
||||
use actix_web_httpauth::extractors::bearer::BearerAuth;
|
||||
use jsonwebtoken::{decode, Algorithm, DecodingKey, Validation};
|
||||
use surveillant_systeme_domain::user::model::Claims;
|
||||
use lumiere_domain::user::model::Claims;
|
||||
|
||||
fn get_jwt_secret() -> String {
|
||||
env::var("JWT_SECRET").expect("JWT_SECRET must be set.")
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
use actix_web::{get, HttpResponse};
|
||||
use actix_web::{get, HttpResponse, Responder};
|
||||
use tokio::fs::File;
|
||||
use tokio_util::codec::{BytesCodec, FramedRead};
|
||||
use futures_util::stream::StreamExt;
|
||||
|
||||
#[get("/download")]
|
||||
pub async fn download_file() -> HttpResponse {
|
||||
pub async fn download_file() -> impl Responder {
|
||||
HttpResponse::Ok()
|
||||
.content_type("application/octet-stream")
|
||||
.streaming(async_stream::stream! {
|
||||
let file = File::open("/home/florian/Video/2019-06-02 17-09-30.flv").await.expect("Failed to open file");
|
||||
let file = File::open("/home/florian/Videos/Kaamelott_Le_film.avi").await.expect("Failed to open file");
|
||||
let mut stream = FramedRead::new(file, BytesCodec::new());
|
||||
while let Some(chunk) = stream.next().await {
|
||||
yield chunk.map(|bytes| bytes.freeze());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use surveillant_systeme_domain::video::model::VideoFormat;
|
||||
use lumiere_domain::video::model::VideoFormat;
|
||||
|
||||
pub fn map_to_content_type(video_format: &VideoFormat) -> &'static str {
|
||||
match video_format {
|
||||
|
||||
Reference in New Issue
Block a user