validation: golang public fields must be upper case gg

This commit is contained in:
Quaternions 2024-12-10 19:59:15 -08:00
parent 1d545f4413
commit 03e71f09fc
3 changed files with 25 additions and 22 deletions

View File

@ -4,30 +4,33 @@
// Requests are sent from maps-service to validator
// Validation invokes the REST api to update the submissions
#[allow(nonstandard_style)]
#[derive(serde::Deserialize)]
pub struct ValidateRequest{
// submission_id is passed back in the response message
pub submission_id:i64,
pub model_id:u64,
pub model_version:u64,
pub validated_model_id:Option<u64>,
pub SubmissionID:i64,
pub ModelID:u64,
pub ModelVersion:u64,
pub ValidatedModelID:Option<u64>,
}
// Create a new map
#[allow(nonstandard_style)]
#[derive(serde::Deserialize)]
pub struct PublishNewRequest{
pub submission_id:i64,
pub model_id:u64,
pub model_version:u64,
pub creator:String,
pub display_name:String,
pub SubmissionID:i64,
pub ModelID:u64,
pub ModelVersion:u64,
pub Creator:String,
pub DisplayName:String,
//games:HashSet<GameID>,
}
#[allow(nonstandard_style)]
#[derive(serde::Deserialize)]
pub struct PublishFixRequest{
pub submission_id:i64,
pub model_id:u64,
pub model_version:u64,
pub target_asset_id:u64,
pub SubmissionID:i64,
pub ModelID:u64,
pub ModelVersion:u64,
pub TargetAssetID:u64,
}

View File

@ -52,13 +52,13 @@ impl Publisher{
// download the map model version
let model_data=self.roblox_cookie.get_asset(rbx_asset::cookie::GetAssetRequest{
asset_id:publish_info.model_id,
version:Some(publish_info.model_version),
asset_id:publish_info.ModelID,
version:Some(publish_info.ModelVersion),
}).await.map_err(PublishError::Get)?;
// upload the map to the strafesnet group
let upload_response=self.roblox_cookie.create(rbx_asset::cookie::CreateRequest{
name:publish_info.display_name,
name:publish_info.DisplayName,
description:"".to_owned(),
ispublic:false,
allowComments:false,
@ -70,7 +70,7 @@ impl Publisher{
// mark submission as published
self.api.action_submission_publish(
api::SubmissionID(publish_info.submission_id)
api::SubmissionID(publish_info.SubmissionID)
).await.map_err(PublishError::ApiActionSubmissionPublish)?;
Ok(())

View File

@ -69,8 +69,8 @@ impl Validator{
// download map
let data=self.roblox_cookie.get_asset(rbx_asset::cookie::GetAssetRequest{
asset_id:validate_info.model_id,
version:Some(validate_info.model_version),
asset_id:validate_info.ModelID,
version:Some(validate_info.ModelVersion),
}).await.map_err(ValidateError::Get)?;
// decode dom (slow!)
@ -149,7 +149,7 @@ impl Validator{
rbx_binary::to_writer(&mut data,&dom,&[dom.root_ref()]).map_err(ValidateError::WriteDom)?;
// upload a model lol
let (model_id,model_version)=if let Some(model_id)=validate_info.validated_model_id{
let (model_id,model_version)=if let Some(model_id)=validate_info.ValidatedModelID{
// upload to existing id
let response=self.roblox_cookie.upload(rbx_asset::cookie::UploadRequest{
assetid:model_id,
@ -176,7 +176,7 @@ impl Validator{
// update the submission to use the validated model
self.api.update_submission_model(api::UpdateSubmissionModelRequest{
ID:validate_info.submission_id,
ID:validate_info.SubmissionID,
ModelID:model_id,
ModelVersion:model_version,
}).await.map_err(ValidateError::ApiUpdateSubmissionModel)?;
@ -184,7 +184,7 @@ impl Validator{
// update the submission model status to validated
self.api.action_submission_validate(
api::SubmissionID(validate_info.submission_id)
api::SubmissionID(validate_info.SubmissionID)
).await.map_err(ValidateError::ApiActionSubmissionValidate)?;
Ok(())