From ab0cb732f00403dcffb8f0b4fe293f6868ec7360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=B6=85=E8=B6=8A?= <993921@qq.com> Date: Sat, 2 Mar 2024 10:39:18 +0800 Subject: [PATCH] chore: swagger update --- docs/docs.go | 34 ++++++++++++++++----- docs/swagger.json | 29 +++++++++++++++--- docs/swagger.yaml | 22 ++++++++++--- rpc_server/api/v1/get_support_entrypoint.go | 2 +- rpc_server/api/v1/get_support_strategy.go | 2 +- 5 files changed, 69 insertions(+), 20 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 9f6757d1..5247479e 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1,4 +1,5 @@ -// Package docs Code generated by swaggo/swag. DO NOT EDIT +// Package docs GENERATED BY SWAG; DO NOT EDIT +// This file was generated by swaggo/swag package docs import "github.com/swaggo/swag" @@ -15,12 +16,31 @@ const docTemplate = `{ "host": "{{.Host}}", "basePath": "{{.BasePath}}", "paths": { - "/api/v1/sponsor-user-operation": { - "post": { - "description": "sponsor the userOp", + "/api/v1/get-support-entrypoint": { + "get": { + "description": "get the support entrypoint", + "consumes": [ + "application/json" + ], + "tags": [ + "Sponsor" + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/v1/get-support-strategy": { + "get": { + "description": "get the support strategy", "consumes": [ "application/json" ], + "produces": [ + "application/json" + ], "tags": [ "Sponsor" ], @@ -31,9 +51,9 @@ const docTemplate = `{ } } }, - "/api/v1/validate-user-operation": { + "/api/v1/try-pay-user-operation": { "post": { - "description": "validate the userOp for sponsor", + "description": "sponsor the userOp", "consumes": [ "application/json" ], @@ -60,8 +80,6 @@ var SwaggerInfo = &swag.Spec{ Description: "", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, - LeftDelim: "{{", - RightDelim: "}}", } func init() { diff --git a/docs/swagger.json b/docs/swagger.json index c6aee7bd..41dd4b4c 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -4,12 +4,31 @@ "contact": {} }, "paths": { - "/api/v1/sponsor-user-operation": { - "post": { - "description": "sponsor the userOp", + "/api/v1/get-support-entrypoint": { + "get": { + "description": "get the support entrypoint", + "consumes": [ + "application/json" + ], + "tags": [ + "Sponsor" + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/v1/get-support-strategy": { + "get": { + "description": "get the support strategy", "consumes": [ "application/json" ], + "produces": [ + "application/json" + ], "tags": [ "Sponsor" ], @@ -20,9 +39,9 @@ } } }, - "/api/v1/validate-user-operation": { + "/api/v1/try-pay-user-operation": { "post": { - "description": "validate the userOp for sponsor", + "description": "sponsor the userOp", "consumes": [ "application/json" ], diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 58b6deff..58a335ad 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1,21 +1,33 @@ info: contact: {} paths: - /api/v1/sponsor-user-operation: - post: + /api/v1/get-support-entrypoint: + get: consumes: - application/json - description: sponsor the userOp + description: get the support entrypoint responses: "200": description: OK tags: - Sponsor - /api/v1/validate-user-operation: + /api/v1/get-support-strategy: + get: + consumes: + - application/json + description: get the support strategy + produces: + - application/json + responses: + "200": + description: OK + tags: + - Sponsor + /api/v1/try-pay-user-operation: post: consumes: - application/json - description: validate the userOp for sponsor + description: sponsor the userOp responses: "200": description: OK diff --git a/rpc_server/api/v1/get_support_entrypoint.go b/rpc_server/api/v1/get_support_entrypoint.go index 705a1216..f0cb381c 100644 --- a/rpc_server/api/v1/get_support_entrypoint.go +++ b/rpc_server/api/v1/get_support_entrypoint.go @@ -14,7 +14,7 @@ import ( // @Accept json // @Product json // @Router /api/v1/get-support-entrypoint [get] -// @Success 200 {object} gin.H +// @Success 200 func GetSupportEntrypoint(c *gin.Context) { //1.TODO API validate //2. recall service diff --git a/rpc_server/api/v1/get_support_strategy.go b/rpc_server/api/v1/get_support_strategy.go index 7d4f5cbe..afbb2d4f 100644 --- a/rpc_server/api/v1/get_support_strategy.go +++ b/rpc_server/api/v1/get_support_strategy.go @@ -13,7 +13,7 @@ import ( // @Description get the support strategy // @Accept json // @Produce json -// @Success 200 {object} gin.H +// @Success 200 // @Router /api/v1/get-support-strategy [get] func GetSupportStrategy(c *gin.Context) { //1.TODO API validate