1. Editor
  2. 004 Service Design and Debug Panel

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.

ApiHug Service Manager

Proto Sample

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
      }
    };
  };
}

Java Sample

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
    }
}

Reference

  1. ApiHug101-Bilibili
  2. ApiHug101-Youtube