use crate::db::{Dao, TenebrousDbConn}; use crate::errors::Error; use crate::models::characters::{Character, CharacterDataType, DynCharacterData, Visibility}; use crate::models::proto::{cofd::*, Proto}; use crate::models::users::User; use rocket_contrib::templates::Template; use serde::Serialize; use std::collections::HashMap; pub(crate) fn routes() -> Vec { routes![ cofd::update_basic_info, cofd::update_attributes, cofd::update_attribute, cofd::update_skills, cofd::add_condition, cofd::remove_condition ] } /// Protobuf-based REST endpoints for editing a character. mod cofd { use super::*; use crate::models::proto::{cofd::api::*, cofd::*, Proto}; #[post("/cofd///basic-info", data = "")] pub(super) fn update_basic_info<'a>( owner: String, character_id: i32, info: Proto, ) -> &'a str { "lol" } #[post("/cofd///attributes", data = "")] pub(super) fn update_attributes<'a>( owner: String, character_id: i32, info: Proto, ) -> &'a str { "lol" } #[post("/cofd///attribute/", data = "")] pub(super) fn update_attribute<'a>( owner: String, character_id: i32, attribute: String, info: Proto, ) -> &'a str { println!("incoming request is {:#?}", info); "lol" } #[post("/cofd///skills", data = "")] pub(super) fn update_skills<'a>( owner: String, character_id: i32, info: Proto, ) -> &'a str { "lol" } #[put("/cofd///conditions", data = "")] pub(super) fn add_condition<'a>( owner: String, character_id: i32, info: Proto, ) -> &'a str { "lol" } #[delete("/cofd///conditions", data = "")] pub(super) fn remove_condition<'a>( owner: String, character_id: i32, info: Proto, ) -> &'a str { "lol" } }