File tree Expand file tree Collapse file tree 4 files changed +6
-9
lines changed
http_service/ceobe_operation/release_version_service/src
libs/page_next_id/src/response
logic/ceobe_operation_logic/src/release_version Expand file tree Collapse file tree 4 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,7 @@ use ceobe_operation_logic::{
22 release_version:: ReleaseVersionLogic , CeobeOperationLogic ,
33} ;
44use page_next_id:: response:: ListWithNextId ;
5- use persistence:: {
6- ceobe_operate:: models:: version:: models:: ReleaseVersion ,
7- mongodb:: mongodb:: bson:: oid:: ObjectId ,
8- } ;
5+ use persistence:: ceobe_operate:: models:: version:: models:: ReleaseVersion ;
96use serve_utils:: {
107 axum:: extract:: Query ,
118 axum_resp_result:: { resp_result, MapReject } ,
@@ -38,7 +35,7 @@ impl crate::ReleaseVersionController {
3835 platform,
3936 first_id,
4037 } ) : MapRejecter < Query < QueryVersionNextIdFilter > > ,
41- ) -> Result < ListWithNextId < ReleaseVersion , ObjectId > > {
38+ ) -> Result < ListWithNextId < ReleaseVersion , String > > {
4239 let ret = logic. all_by_page_id ( first_id, platform, false ) . await ?;
4340
4441 Ok ( ret)
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ use serde::Deserialize;
1313use serve_utils:: { OptionField , OptionViewField , ValueField } ;
1414
1515#[ derive( Deserialize , Clone , Debug ) ]
16+ #[ serde( deny_unknown_fields) ]
1617pub struct QueryReleaseVersion <
1718 Version : OptionViewField < semver:: Version > = OptionField < semver:: Version > ,
1819> {
@@ -66,6 +67,7 @@ impl<D: Display + OptionViewField<bool>> Display for QueryVersionFilter<D> {
6667}
6768
6869#[ derive( Debug , Deserialize ) ]
70+ #[ serde( deny_unknown_fields) ]
6971pub struct QueryVersionNextIdFilter {
7072 pub platform : ReleasePlatform ,
7173 #[ serde( default ) ]
Original file line number Diff line number Diff line change 11use _private:: NextIdTrait ;
2- use mongodb:: bson:: oid:: ObjectId ;
32use serde:: Serialize ;
43
54#[ derive( Debug , Serialize ) ]
4342}
4443
4544// 支持成为NextId的类型
46- impl NextIdTrait for ObjectId { }
4745impl NextIdTrait for String { }
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ impl ReleaseVersionLogic {
153153 pub async fn all_by_page_id (
154154 & self , first_id : Option < ObjectId > , platform : ReleasePlatform ,
155155 deleted : bool ,
156- ) -> LogicResult < ListWithNextId < ReleaseVersion , ObjectId > > {
156+ ) -> LogicResult < ListWithNextId < ReleaseVersion , String > > {
157157 let list = task:: spawn ( {
158158 let mongodb = self . mongodb . clone ( ) ;
159159 async move {
@@ -182,6 +182,6 @@ impl ReleaseVersionLogic {
182182 let list = list. await ??;
183183 let next_id = next_id. await ??;
184184
185- Ok ( list. with_page_next_id_info ( next_id) )
185+ Ok ( list. with_page_next_id_info ( next_id. map ( |id| id . to_string ( ) ) ) )
186186 }
187187}
You can’t perform that action at this time.
0 commit comments