Skip to content

Commit

Permalink
fix: fix API no match
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Aug 16, 2023
1 parent 0f0dd77 commit 8c58067
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion counit-server.http
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Content-Type: application/json
GET http://127.0.0.1:8765/api/text-embedding?q="upload"

### Query API
GET http://127.0.0.1:8765/api/query?q="DiffChangeRepository find by id"&repo_ref=archguard&type=DatabaseMap
GET http://127.0.0.1:8765/api/query?q=role&repo_ref=mall&type=Code

### Upload Data by ArchGuard

Expand Down
1 change: 1 addition & 0 deletions counit-server/src/model/chapi_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ pub struct CodeFunction {
pub(crate) file_path: String,
#[serde(default = "String::new")]
pub(crate) package: String,
#[serde(default)]
pub(crate) return_type: String,
#[serde(default)]
pub(crate) multiple_returns: Vec<CodeProperty>,
Expand Down
9 changes: 5 additions & 4 deletions counit-server/src/server/archguard_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ pub async fn save_openapi(
Json(payload): Json<Vec<ApiCollection>>,
) -> (StatusCode, Json<()>) {
let repo_ref = params.repo_id.clone();
println!("save_openapi {:?}", repo_ref);

match app.semantic {
Some(ref semantic) => {
payload.iter().for_each(|collection| {
let _ = &collection.items.iter().for_each(|item| {
tokio::task::block_in_place(|| {
Handle::current().block_on(async {
println!("display_text {:?}", &item.display_text);
println!("openapi display_text {:?}", &item.display_text);
let _ = semantic.insert_points_for_buffer(
params.repo_id.as_str(),
repo_ref.as_str(),
Expand Down Expand Up @@ -86,7 +87,7 @@ pub async fn save_datamap(
Handle::current().block_on(async {
let display_text = &relation.to_string();

println!("display_text {:?}", &display_text);
println!("datamap display_text {:?}", &display_text);
let _ = semantic.insert_points_for_buffer(
params.repo_id.as_str(),
repo_ref.as_str(),
Expand Down Expand Up @@ -126,7 +127,7 @@ pub async fn save_class_items(
let display_text = &method.display();
let origin_content = &method.content;

println!("display_text {:?}", display_text);
println!("class_items display_text {:?}", display_text);
let _ = semantic.insert_points_for_buffer(
params.repo_id.as_str(),
repo_ref.as_str(),
Expand Down Expand Up @@ -166,7 +167,7 @@ pub async fn save_container(
tokio::task::block_in_place(|| {
Handle::current().block_on(async {
let display_text = resource.display();
println!("resource: {:?}", display_text);
println!("container resource: {:?}", display_text);
let _ = semantic.insert_points_for_buffer(
params.repo_id.as_str(),
repo_ref.as_str(),
Expand Down

0 comments on commit 8c58067

Please sign in to comment.