Language Migration #21
+16
-2
@@ -1,10 +1,24 @@
|
|||||||
|
use std::default::Default;
|
||||||
|
|
||||||
use crate::models;
|
use crate::models;
|
||||||
|
|
||||||
|
use super::syncer_base;
|
||||||
|
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
pub struct Delete {
|
pub struct Delete {
|
||||||
pub api: models::api::API,
|
pub api: models::api::API,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Delete {
|
impl Default for Delete {
|
||||||
pub fn delete_song(&self, token: &models::token::Token, song: &models::song::Song) {}
|
fn default() -> Self {
|
||||||
|
Delete {
|
||||||
|
api: models::api::API::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Delete {
|
||||||
|
pub fn delete_song(&self, token: &models::token::Token, song: &models::song::Song) {
|
||||||
|
let url = syncer_base::Syncer::retrieve_url(&self.api, &song);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +1,15 @@
|
|||||||
|
use std::default::Default;
|
||||||
|
|
||||||
|
use crate::models;
|
||||||
|
|
||||||
|
pub struct Download{
|
||||||
|
pub api: models::api::API,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for Download {
|
||||||
|
fn default() -> Self {
|
||||||
|
Download {
|
||||||
|
api: models::api::API::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +1,17 @@
|
|||||||
|
use std::default::Default;
|
||||||
|
|
||||||
|
use crate::models;
|
||||||
|
|
||||||
|
|
||||||
|
pub struct RetrieveRecords {
|
||||||
|
pub api: models::api::API,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
impl Default for RetrieveRecords {
|
||||||
|
fn default() -> Self {
|
||||||
|
RetrieveRecords {
|
||||||
|
api: models::api::API::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
use crate::models;
|
use crate::models;
|
||||||
|
|
||||||
struct Syncer {}
|
pub struct Syncer {
|
||||||
|
ok: i32,
|
||||||
|
unauthorized: i32,
|
||||||
|
not_found: i32,
|
||||||
|
}
|
||||||
|
|
||||||
impl Syncer {
|
impl Syncer {
|
||||||
pub fn retrieve_url(api: &models::api::API, song: &models::song::Song) -> String {
|
pub fn retrieve_url(api: &models::api::API, song: &models::song::Song) -> String {
|
||||||
@@ -14,4 +18,24 @@ impl Syncer {
|
|||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn ok() -> i32 {
|
||||||
|
return 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn unauthorized() -> i32 {
|
||||||
|
return 401;
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn not_found() -> i32 {
|
||||||
|
return 404;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub enum Result {
|
||||||
|
OK,
|
||||||
|
UNAUTHORIZED,
|
||||||
|
NOTFOUND,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,15 @@
|
|||||||
|
use std::default::Default;
|
||||||
|
|
||||||
|
use crate::models;
|
||||||
|
|
||||||
|
pub struct Upload {
|
||||||
|
pub api: models::api::API,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for Upload {
|
||||||
|
fn default() -> Self {
|
||||||
|
Upload {
|
||||||
|
api: models::api::API::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user