1
0
mirror of https://git.ngram.ca/OpenJam/rc-servers synced 2026-08-23 23:08:52 +00:00

Platoons social functionality (#91)

### Description

This implements and completes #87 (to the best of my knowledge)

### Game

Robocraft

### Please confirm

- [x] I am the legal owner or represent the owner of all work submitted
- [x] I consent to my submission being added to this FOSS project
- [ ] This PR used LLMs to generate some or all of the code changes

Reviewed-on: https://git.ngram.ca/OpenJam/rc-servers/pulls/91
Co-authored-by: NG (Graham) <ngniusness@gmail.com>
Co-committed-by: NG (Graham) <ngniusness@gmail.com>
This commit is contained in:
NG (Graham)
2026-02-19 01:57:03 +00:00
committed by NGnius
parent a82488ab3a
commit 50b396f34a
49 changed files with 1152 additions and 47 deletions

View File

@@ -46,6 +46,13 @@ impl Database {
.await
}
pub async fn users_by_public_id<'a>(&self, public_ids: impl std::iter::Iterator<Item=&'a String>) -> Result<Vec<crate::schema::user::Model>, sea_orm::DbErr> {
crate::schema::user::Entity::find()
.filter(crate::schema::user::Column::PublicId.is_in(public_ids))
.all(self.orm.as_ref())
.await
}
pub async fn user_by_some_social_id(&self, public_id: String) -> Result<Option<crate::schema::user::Model>, sea_orm::DbErr> {
let lower_public_id = public_id.to_lowercase();
crate::schema::user::Entity::find()
@@ -113,7 +120,7 @@ impl Database {
.await
}
pub async fn user_auxs_by_user_ids_and_descriptor(&self, user_ids: impl std::iter::IntoIterator<Item=i32>, descriptor: crate::schema::user_aux::Descriptor) -> Result<Vec<crate::schema::user_aux::Model>, sea_orm::DbErr> {
pub async fn user_auxs_by_user_ids_and_descriptor(&self, user_ids: impl std::iter::Iterator<Item=i32>, descriptor: crate::schema::user_aux::Descriptor) -> Result<Vec<crate::schema::user_aux::Model>, sea_orm::DbErr> {
crate::schema::user_aux::Entity::find()
.filter(crate::schema::user_aux::Column::UserId.is_in(user_ids))
.filter(crate::schema::user_aux::Column::Descriptor.eq(descriptor))