elseware/src/entity/gateway/entitygateway.rs

92 lines
3.0 KiB
Rust
Raw Normal View History

use thiserror::Error;
use crate::entity::account::*;
use crate::entity::character::*;
2019-12-09 23:11:27 -08:00
use crate::entity::item::*;
// TODO: better granularity?
//#[derive(Error, Debug)]
#[derive(Error, Debug)]
#[error("")]
pub enum GatewayError {
Error,
PgError(#[from] sqlx::Error)
}
2020-06-02 18:51:18 -06:00
#[async_trait::async_trait]
pub trait EntityGateway: Send + Sync + Clone {
async fn create_user(&mut self, _user: NewUserAccountEntity) -> Result<UserAccountEntity, GatewayError> {
unimplemented!()
}
async fn get_user_by_id(&self, _id: UserAccountId) -> Result<UserAccountEntity, GatewayError> {
unimplemented!();
}
async fn get_user_by_name(&self, _username: String) -> Result<UserAccountEntity, GatewayError> {
unimplemented!();
}
async fn save_user(&mut self, _user: &UserAccountEntity) -> Result<(), GatewayError> {
unimplemented!();
}
async fn create_user_settings(&mut self, _settings: NewUserSettingsEntity) -> Result<UserSettingsEntity, GatewayError> {
unimplemented!();
}
async fn get_user_settings_by_user(&self, _user: &UserAccountEntity) -> Result<UserSettingsEntity, GatewayError> {
unimplemented!();
}
async fn save_user_settings(&mut self, _settings: &UserSettingsEntity) -> Result<(), GatewayError> {
unimplemented!();
}
async fn create_character(&mut self, _char: NewCharacterEntity) -> Result<CharacterEntity, GatewayError> {
unimplemented!();
}
2020-10-03 17:23:39 -06:00
// TODO: just make this a vec sorted by slot order?
async fn get_characters_by_user(&self, _user: &UserAccountEntity) -> Result<[Option<CharacterEntity>; 4], GatewayError> {
unimplemented!();
}
async fn save_character(&mut self, _char: &CharacterEntity) -> Result<(), GatewayError> {
unimplemented!();
}
async fn get_guild_card_data_by_user(&self, _user: &UserAccountEntity) -> Result<GuildCardDataEntity, GatewayError> {
unimplemented!();
}
2019-12-09 23:11:27 -08:00
async fn create_item(&mut self, _item: NewItemEntity) -> Result<ItemEntity, GatewayError> {
unimplemented!();
}
async fn change_item(&mut self, _id: &ItemEntityId, _item: &ItemDetail) -> Result<(), GatewayError> {
2019-12-09 23:11:27 -08:00
unimplemented!();
}
async fn change_item_location(&mut self, _item_id: &ItemEntityId, _item_location: ItemLocation) -> Result<(), GatewayError> {
unimplemented!();
}
async fn feed_mag(&mut self, _mag_item_id: &ItemEntityId, _tool_item_id: &ItemEntityId) -> Result<(), GatewayError> {
2020-08-31 23:44:39 -06:00
unimplemented!();
}
async fn change_mag_owner(&mut self, _mag_item_id: &ItemEntityId, _character: &CharacterEntity) -> Result<(), GatewayError> {
2020-09-02 22:03:45 -06:00
unimplemented!();
}
async fn use_mag_cell(&mut self, _mag_item_id: &ItemEntityId, _mag_cell_id: &ItemEntityId) -> Result<(), GatewayError> {
2020-09-07 08:02:12 -06:00
unimplemented!();
}
async fn get_items_by_character(&self, _char_id: &CharacterEntityId) -> Result<Vec<ItemEntity>, GatewayError> {
2019-12-09 23:11:27 -08:00
unimplemented!();
}
}