@@ -13,6 +13,8 @@ pub struct Config {
1313 pub max_items : usize ,
1414 pub retry_count : u8 ,
1515 pub priority : i32 ,
16+ pub separator : char ,
17+ pub delimiter : Option < char > ,
1618}
1719
1820#[ derive( Deserialize , Schema ) ]
@@ -25,6 +27,8 @@ pub struct UpdateConfigRequest {
2527 pub max_items : Option < usize > ,
2628 pub retry_count : Option < u8 > ,
2729 pub priority : Option < i32 > ,
30+ pub separator : Option < char > ,
31+ pub delimiter : Option < char > ,
2832}
2933
3034/// Get current config
@@ -38,6 +42,8 @@ pub async fn get_config() -> Json<Config> {
3842 max_items : 100 ,
3943 retry_count : 3 ,
4044 priority : 0 ,
45+ separator : ',' ,
46+ delimiter : Some ( '|' ) ,
4147 } )
4248}
4349
@@ -56,6 +62,8 @@ pub async fn update_config(Json(req): Json<UpdateConfigRequest>) -> Json<Config>
5662 max_items : 100 ,
5763 retry_count : 3 ,
5864 priority : 0 ,
65+ separator : ',' ,
66+ delimiter : Some ( '|' ) ,
5967 } ;
6068
6169 Json ( Config {
@@ -66,5 +74,7 @@ pub async fn update_config(Json(req): Json<UpdateConfigRequest>) -> Json<Config>
6674 max_items : req. max_items . unwrap_or ( current. max_items ) ,
6775 retry_count : req. retry_count . unwrap_or ( current. retry_count ) ,
6876 priority : req. priority . unwrap_or ( current. priority ) ,
77+ separator : req. separator . unwrap_or ( current. separator ) ,
78+ delimiter : req. delimiter . or ( current. delimiter ) ,
6979 } )
7080}
0 commit comments