Editor
how to use the service design and debug panel at ApiHug Api design Copilot.
Go through the server design and debug panel in ApiHug Api design Copilot
A collection of API resources and paths can be composed into a service, which can be represented as the service
in Protocol Buffer files or the Controller
in the Spring world.
Please refer: apihug-full-demo admin/api.proto
service UserAdminService {
option (hope.swagger.svc) = {
path: "/user/admin";
description: "User admin server";
};
rpc SayHello (google.protobuf.Empty) returns (google.protobuf.Empty) {
option (hope.swagger.operation) = {
get: "/say-hello";
description: "Hello from the user admin server";
tags: "project";
priority: MIDDLE;
authorization:{
low_limit_risky_mode: ANONYMOUS
}
};
};
}
Please refer: apihug-full-demo UserAdminController.java
@RestController
@Generated("H.O.P.E. Infra Team")
public class OrderAdminController {
@GetMapping("/order/admin/hello-world")
public ResponseEntity<Result<String>> sayHello() {
final SimpleResultBuilder<String> builder = new SimpleResultBuilder<String>();
//Biz logic
}
}