feat: add UserBlockInfo model to show block size instead of index
This commit is contained in:
		| @@ -54,6 +54,7 @@ docs/TemplateErrBadRequest.md | ||||
| docs/TemplateErrInternalServerError.md | ||||
| docs/TemplateErrNotFound.md | ||||
| docs/UploadBlockParams.md | ||||
| docs/UserBlockInfo.md | ||||
| docs/UserBlocksResponse.md | ||||
| docs/VerifyBlock.md | ||||
| docs/VerifyBlocksRequest.md | ||||
| @@ -117,6 +118,7 @@ src/models/template_err_bad_request.rs | ||||
| src/models/template_err_internal_server_error.rs | ||||
| src/models/template_err_not_found.rs | ||||
| src/models/upload_block_params.rs | ||||
| src/models/user_block_info.rs | ||||
| src/models/user_blocks_response.rs | ||||
| src/models/verify_block.rs | ||||
| src/models/verify_blocks_request.rs | ||||
|   | ||||
| @@ -95,6 +95,7 @@ Class | Method | HTTP request | Description | ||||
|  - [TemplateErrInternalServerError](docs/TemplateErrInternalServerError.md) | ||||
|  - [TemplateErrNotFound](docs/TemplateErrNotFound.md) | ||||
|  - [UploadBlockParams](docs/UploadBlockParams.md) | ||||
|  - [UserBlockInfo](docs/UserBlockInfo.md) | ||||
|  - [UserBlocksResponse](docs/UserBlocksResponse.md) | ||||
|  - [VerifyBlock](docs/VerifyBlock.md) | ||||
|  - [VerifyBlocksRequest](docs/VerifyBlocksRequest.md) | ||||
|   | ||||
							
								
								
									
										12
									
								
								rfs-client/openapi/docs/UserBlockInfo.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								rfs-client/openapi/docs/UserBlockInfo.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| # UserBlockInfo | ||||
|  | ||||
| ## Properties | ||||
|  | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **hash** | **String** | Block hash |  | ||||
| **size** | **i64** | Block size in bytes |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|  | ||||
|  | ||||
| @@ -5,7 +5,7 @@ | ||||
| Name | Type | Description | Notes | ||||
| ------------ | ------------- | ------------- | ------------- | ||||
| **all_blocks** | **i64** | Total number of all blocks |  | ||||
| **blocks** | [**Vec<models::BlockInfo>**](BlockInfo.md) | List of blocks with their indices |  | ||||
| **blocks** | [**Vec<models::UserBlockInfo>**](UserBlockInfo.md) | List of blocks with their sizes |  | ||||
| **total** | **i64** | Total number of blocks |  | ||||
|  | ||||
| [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) | ||||
|   | ||||
| @@ -92,6 +92,8 @@ pub mod template_err_not_found; | ||||
| pub use self::template_err_not_found::TemplateErrNotFound; | ||||
| pub mod upload_block_params; | ||||
| pub use self::upload_block_params::UploadBlockParams; | ||||
| pub mod user_block_info; | ||||
| pub use self::user_block_info::UserBlockInfo; | ||||
| pub mod user_blocks_response; | ||||
| pub use self::user_blocks_response::UserBlocksResponse; | ||||
| pub mod verify_block; | ||||
|   | ||||
							
								
								
									
										34
									
								
								rfs-client/openapi/src/models/user_block_info.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								rfs-client/openapi/src/models/user_block_info.rs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,34 @@ | ||||
| /* | ||||
|  * rfs | ||||
|  * | ||||
|  * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||||
|  * | ||||
|  * The version of the OpenAPI document: 0.2.0 | ||||
|  *  | ||||
|  * Generated by: https://openapi-generator.tech | ||||
|  */ | ||||
|  | ||||
| use crate::models; | ||||
| use serde::{Deserialize, Serialize}; | ||||
|  | ||||
| /// UserBlockInfo : Block information with hash and size | ||||
| #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] | ||||
| pub struct UserBlockInfo { | ||||
|     /// Block hash | ||||
|     #[serde(rename = "hash")] | ||||
|     pub hash: String, | ||||
|     /// Block size in bytes | ||||
|     #[serde(rename = "size")] | ||||
|     pub size: i64, | ||||
| } | ||||
|  | ||||
| impl UserBlockInfo { | ||||
|     /// Block information with hash and size | ||||
|     pub fn new(hash: String, size: i64) -> UserBlockInfo { | ||||
|         UserBlockInfo { | ||||
|             hash, | ||||
|             size, | ||||
|         } | ||||
|     } | ||||
| } | ||||
|  | ||||
| @@ -17,9 +17,9 @@ pub struct UserBlocksResponse { | ||||
|     /// Total number of all blocks | ||||
|     #[serde(rename = "all_blocks")] | ||||
|     pub all_blocks: i64, | ||||
|     /// List of blocks with their indices | ||||
|     /// List of blocks with their sizes | ||||
|     #[serde(rename = "blocks")] | ||||
|     pub blocks: Vec<models::BlockInfo>, | ||||
|     pub blocks: Vec<models::UserBlockInfo>, | ||||
|     /// Total number of blocks | ||||
|     #[serde(rename = "total")] | ||||
|     pub total: i64, | ||||
| @@ -27,7 +27,7 @@ pub struct UserBlocksResponse { | ||||
|  | ||||
| impl UserBlocksResponse { | ||||
|     /// Response for user blocks endpoint | ||||
|     pub fn new(all_blocks: i64, blocks: Vec<models::BlockInfo>, total: i64) -> UserBlocksResponse { | ||||
|     pub fn new(all_blocks: i64, blocks: Vec<models::UserBlockInfo>, total: i64) -> UserBlocksResponse { | ||||
|         UserBlocksResponse { | ||||
|             all_blocks, | ||||
|             blocks, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user