longyu 2 年之前
父节点
当前提交
4e271b1b66
共有 3 个文件被更改,包括 134 次插入0 次删除
  1. 19 0
      routers/commentsRouter_controllers.go
  2. 69 0
      swagger/swagger.json
  3. 46 0
      swagger/swagger.yml

+ 19 - 0
routers/commentsRouter_controllers.go

@@ -0,0 +1,19 @@
+package routers
+
+import (
+	beego "github.com/beego/beego/v2/server/web"
+	"github.com/beego/beego/v2/server/web/context/param"
+)
+
+func init() {
+
+    beego.GlobalControllerRouter["hongze/hongze_public_api/controllers:ImageController"] = append(beego.GlobalControllerRouter["hongze/hongze_public_api/controllers:ImageController"],
+        beego.ControllerComments{
+            Method: "Base64Upload",
+            Router: "/svg_to_png",
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+}

+ 69 - 0
swagger/swagger.json

@@ -0,0 +1,69 @@
+{
+    "swagger": "2.0",
+    "info": {
+        "title": "beego Test API",
+        "description": "beego has a very cool tools to autogenerate documents for your API",
+        "version": "1.0.0",
+        "termsOfService": "http://beego.me/",
+        "contact": {
+            "email": "astaxie@gmail.com"
+        },
+        "license": {
+            "name": "Apache 2.0",
+            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
+        }
+    },
+    "basePath": "/v1",
+    "paths": {
+        "/image/svg_to_png": {
+            "post": {
+                "tags": [
+                    "image"
+                ],
+                "description": "图片上传接口",
+                "operationId": "ImageController.图片上传",
+                "parameters": [
+                    {
+                        "in": "query",
+                        "name": "Img",
+                        "description": "图片base64字符串",
+                        "required": true,
+                        "type": "string"
+                    },
+                    {
+                        "in": "query",
+                        "name": "Sign",
+                        "description": "策略组提供的资源id",
+                        "required": true,
+                        "type": "string"
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "新增成功"
+                    }
+                }
+            }
+        },
+        "/wechat/send_template_msg": {
+            "post": {
+                "tags": [
+                    "wechat"
+                ],
+                "description": "推送模板消息",
+                "operationId": "WechatController.推送模板消息",
+                "responses": {
+                    "200": {
+                        "description": "新增成功"
+                    }
+                }
+            }
+        }
+    },
+    "tags": [
+        {
+            "name": "wechat",
+            "description": "发送模板消息\n"
+        }
+    ]
+}

+ 46 - 0
swagger/swagger.yml

@@ -0,0 +1,46 @@
+swagger: "2.0"
+info:
+  title: beego Test API
+  description: beego has a very cool tools to autogenerate documents for your API
+  version: 1.0.0
+  termsOfService: http://beego.me/
+  contact:
+    email: astaxie@gmail.com
+  license:
+    name: Apache 2.0
+    url: http://www.apache.org/licenses/LICENSE-2.0.html
+basePath: /v1
+paths:
+  /image/svg_to_png:
+    post:
+      tags:
+      - image
+      description: 图片上传接口
+      operationId: ImageController.图片上传
+      parameters:
+      - in: query
+        name: Img
+        description: 图片base64字符串
+        required: true
+        type: string
+      - in: query
+        name: Sign
+        description: 策略组提供的资源id
+        required: true
+        type: string
+      responses:
+        "200":
+          description: 新增成功
+  /wechat/send_template_msg:
+    post:
+      tags:
+      - wechat
+      description: 推送模板消息
+      operationId: WechatController.推送模板消息
+      responses:
+        "200":
+          description: 新增成功
+tags:
+- name: wechat
+  description: |
+    发送模板消息