v1.0.1 changes #11

Manually merged
Raven merged 54 commits from betterauth into main 2025-03-21 23:36:08 -04:00
3 changed files with 33 additions and 3 deletions
Showing only changes of commit b01432501c - Show all commits

View File

@@ -11,6 +11,6 @@ fn main() {
tonic_build::configure() tonic_build::configure()
.build_server(false) // Generate gRPC client code .build_server(false) // Generate gRPC client code
.compile_well_known_types(true) .compile_well_known_types(true)
.compile_protos(&["../proto/user_db_api.proto", "../proto/auth.proto"], &["../proto"]) .compile_protos(&["../proto/user_db_api.proto", "../proto/character_db_api.proto", "../proto/auth.proto"], &["../proto"])
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e)); .unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
} }

View File

@@ -2,7 +2,7 @@ use tracing::debug;
use tonic::{Request, Response, Status}; use tonic::{Request, Response, Status};
use tracing::field::debug; use tracing::field::debug;
use crate::character_service::character::character_service_server::CharacterService; use crate::character_service::character::character_service_server::CharacterService;
use crate::character_service::character::{Character, GetCharacterListRequest, GetCharacterListResponse}; use crate::character_service::character::{Character, CreateCharacterRequest, DeleteCharacterRequest, Empty, GetCharacterListRequest, GetCharacterListResponse, GetCharacterRequest};
pub mod character { pub mod character {
tonic::include_proto!("character"); tonic::include_proto!("character");
@@ -50,4 +50,16 @@ impl CharacterService for MyCharacterService {
let response = GetCharacterListResponse { characters }; let response = GetCharacterListResponse { characters };
Ok(Response::new(response)) Ok(Response::new(response))
} }
async fn create_character(&self, request: Request<CreateCharacterRequest>) -> Result<Response<Empty>, Status> {
todo!()
}
async fn delete_character(&self, request: Request<DeleteCharacterRequest>) -> Result<Response<Empty>, Status> {
todo!()
}
async fn get_character(&self, request: Request<GetCharacterRequest>) -> Result<Response<Empty>, Status> {
todo!()
}
} }

View File

@@ -4,6 +4,9 @@ package character;
service CharacterService { service CharacterService {
rpc GetCharacterList(GetCharacterListRequest) returns (GetCharacterListResponse); rpc GetCharacterList(GetCharacterListRequest) returns (GetCharacterListResponse);
rpc CreateCharacter(CreateCharacterRequest) returns (Empty);
rpc DeleteCharacter(DeleteCharacterRequest) returns (Empty);
rpc GetCharacter(GetCharacterRequest) returns (Empty);
} }
message GetCharacterListRequest { message GetCharacterListRequest {
@@ -14,6 +17,19 @@ message GetCharacterListResponse {
repeated Character characters = 1; repeated Character characters = 1;
} }
message CreateCharacterRequest {
string user_id = 1;
}
message DeleteCharacterRequest {
string user_id = 1;
string char_id = 2;
}
message GetCharacterRequest {
string user_id = 1;
}
message Character { message Character {
string character_id = 1; // Unique ID for the character string character_id = 1; // Unique ID for the character
string name = 2; // Name of the character string name = 2; // Name of the character
@@ -33,3 +49,5 @@ message EquippedItem {
int32 socket = 3; int32 socket = 3;
int32 grade = 4; int32 grade = 4;
} }
message Empty {}