Selaa lähdekoodia

refactor(api): update vpn service rest gw

Mustafa Arici 8 vuotta sitten
vanhempi
commit
de05a189d9
3 muutettua tiedostoa jossa 33 lisäystä ja 49 poistoa
  1. 31 30
      api/pb/vpn.pb.go
  2. 1 5
      api/pb/vpn.pb.gw.go
  3. 1 14
      api/pb/vpn.swagger.json

+ 31 - 30
api/pb/vpn.pb.go

@@ -385,35 +385,36 @@ var _VPNService_serviceDesc = grpc.ServiceDesc{
 func init() { proto.RegisterFile("vpn.proto", fileDescriptor1) }
 
 var fileDescriptor1 = []byte{
-	// 478 bytes of a gzipped FileDescriptorProto
+	// 481 bytes of a gzipped FileDescriptorProto
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x53, 0xcd, 0x6e, 0xd3, 0x40,
-	0x10, 0xc6, 0x8e, 0xeb, 0xc6, 0x43, 0x14, 0x9c, 0x49, 0x81, 0x25, 0xea, 0xa1, 0xf2, 0x29, 0xca,
-	0x21, 0x16, 0xe5, 0xd6, 0x03, 0x52, 0x49, 0x41, 0xed, 0x01, 0xb3, 0x4a, 0x68, 0xee, 0x9b, 0x76,
-	0xa9, 0xac, 0xa6, 0xbb, 0x8b, 0xbd, 0xc9, 0x03, 0xf0, 0x0a, 0xbd, 0xf0, 0x5e, 0xbc, 0x02, 0x4f,
-	0xc1, 0x09, 0x79, 0x6c, 0xc7, 0x31, 0x3f, 0xb7, 0x99, 0x6f, 0xfc, 0x7d, 0xfa, 0xe6, 0xdb, 0x31,
-	0x04, 0x5b, 0xa3, 0xa6, 0x26, 0xd3, 0x56, 0xa3, 0x6b, 0x56, 0xa3, 0xe3, 0x3b, 0xad, 0xef, 0xd6,
-	0x32, 0x16, 0x26, 0x8d, 0x85, 0x52, 0xda, 0x0a, 0x9b, 0x6a, 0x95, 0x97, 0x5f, 0x44, 0x08, 0xe1,
-	0x92, 0x27, 0x0b, 0x2b, 0xec, 0x26, 0x9f, 0xcb, 0xaf, 0x1b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0xe0, 0x9a, 0xc8, 0xf1, 0xb0,
+	0xbc, 0x82, 0xd6, 0xc5, 0x8d, 0x5f, 0xff, 0x83, 0x96, 0x26, 0x8e, 0x7e, 0xfc, 0xfa, 0xfd, 0x64,
+	0xfb, 0x38, 0x08, 0x77, 0xef, 0xc2, 0x9d, 0x4a, 0xc3, 0xdc, 0x88, 0x5c, 0x82, 0x53, 0x98, 0x45,
+	0x2c, 0x69, 0x7b, 0x97, 0x3a, 0x1e, 0xb5, 0xb0, 0x52, 0xe8, 0x0d, 0x09, 0x0d, 0x83, 0x7e, 0x25,
+	0x94, 0xa4, 0x89, 0x3e, 0xb3, 0xa6, 0xc8, 0xc1, 0x35, 0x3b, 0xd6, 0xc6, 0x5a, 0xb7, 0x55, 0x1b,
+	0x6b, 0x07, 0x11, 0xbc, 0x25, 0xbd, 0x51, 0x50, 0x1b, 0xdb, 0xd2, 0xfc, 0xcc, 0x9a, 0xae, 0x5d,
+	0xfa, 0xaf, 0xde, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xd8, 0x5e, 0xe6, 0x6b, 0x86, 0x03, 0x00,
+	0x00,
 }

+ 1 - 5
api/pb/vpn.pb.gw.go

@@ -32,10 +32,6 @@ func request_VPNService_Status_0(ctx context.Context, marshaler runtime.Marshale
 	var protoReq VPNStatusRequest
 	var metadata runtime.ServerMetadata
 
-	if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil {
-		return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
-	}
-
 	msg, err := client.Status(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
 	return msg, metadata, err
 
@@ -97,7 +93,7 @@ func RegisterVPNServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.Ser
 func RegisterVPNServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
 	client := NewVPNServiceClient(conn)
 
-	mux.Handle("POST", pattern_VPNService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+	mux.Handle("GET", pattern_VPNService_Status_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
 		ctx, cancel := context.WithCancel(ctx)
 		defer cancel()
 		if cn, ok := w.(http.CloseNotifier); ok {

+ 1 - 14
api/pb/vpn.swagger.json

@@ -42,7 +42,7 @@
       }
     },
     "/v1/vpn/status": {
-      "post": {
+      "get": {
         "operationId": "Status",
         "responses": {
           "200": {
@@ -52,16 +52,6 @@
             }
           }
         },
-        "parameters": [
-          {
-            "name": "body",
-            "in": "body",
-            "required": true,
-            "schema": {
-              "$ref": "#/definitions/pbVPNStatusRequest"
-            }
-          }
-        ],
         "tags": [
           "VPNService"
         ]
@@ -127,9 +117,6 @@
       ],
       "default": "NOPREF"
     },
-    "pbVPNStatusRequest": {
-      "type": "object"
-    },
     "pbVPNStatusResponse": {
       "type": "object",
       "properties": {