|
@@ -0,0 +1,1335 @@
|
|
|
+// Code generated by swaggo/swag. DO NOT EDIT.
|
|
|
+
|
|
|
+package docs
|
|
|
+
|
|
|
+import "github.com/swaggo/swag"
|
|
|
+
|
|
|
+const docTemplate = `{
|
|
|
+ "schemes": {{ marshal .Schemes }},
|
|
|
+ "swagger": "2.0",
|
|
|
+ "info": {
|
|
|
+ "description": "{{escape .Description}}",
|
|
|
+ "title": "{{.Title}}",
|
|
|
+ "termsOfService": "http://swagger.io/terms/",
|
|
|
+ "contact": {},
|
|
|
+ "license": {
|
|
|
+ "name": "Apache 2.0",
|
|
|
+ "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
|
+ },
|
|
|
+ "version": "{{.Version}}"
|
|
|
+ },
|
|
|
+ "host": "{{.Host}}",
|
|
|
+ "basePath": "{{.BasePath}}",
|
|
|
+ "paths": {
|
|
|
+ "/appraise/create": {
|
|
|
+ "post": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "评论模块"
|
|
|
+ ],
|
|
|
+ "summary": "创建评论",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "评价信息",
|
|
|
+ "name": "json",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.AppraiseJson"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/appraise/delete/{id}": {
|
|
|
+ "delete": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "评论模块"
|
|
|
+ ],
|
|
|
+ "summary": "删除评论",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "评论id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/appraise/revise": {
|
|
|
+ "post": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "评论模块"
|
|
|
+ ],
|
|
|
+ "summary": "修改评论",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "评价信息",
|
|
|
+ "name": "json",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.Appraise"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/appraise/user": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "评论模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取用户评价",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "用户id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/category": {
|
|
|
+ "get": {
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "分类模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取所有分类",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/category/create": {
|
|
|
+ "post": {
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "分类模块"
|
|
|
+ ],
|
|
|
+ "summary": "创建分类",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "分类数据",
|
|
|
+ "name": "json",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.CategoryJson"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/category/delete/{id}": {
|
|
|
+ "delete": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "分类模块"
|
|
|
+ ],
|
|
|
+ "summary": "根据分类id删除某个分类",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "分类id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/chat": {
|
|
|
+ "get": {
|
|
|
+ "tags": [
|
|
|
+ "聊天模块"
|
|
|
+ ],
|
|
|
+ "summary": "与服务端进行websocket连接,请使用postman测试",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/chat/from": {
|
|
|
+ "get": {
|
|
|
+ "tags": [
|
|
|
+ "聊天模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取未过期且来源为特定用户的聊天记录",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "用户id",
|
|
|
+ "name": "uid",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/chat/to": {
|
|
|
+ "get": {
|
|
|
+ "tags": [
|
|
|
+ "聊天模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取未过期且目标为特定用户的聊天记录",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "用户id",
|
|
|
+ "name": "uid",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/goods/category/{page}/{pageSize}": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "商品模块"
|
|
|
+ ],
|
|
|
+ "summary": "按分类查找商品并分页显示",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "页数",
|
|
|
+ "name": "page",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "一页的大小",
|
|
|
+ "name": "pageSize",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "商品分类id",
|
|
|
+ "name": "category",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/goods/create": {
|
|
|
+ "post": {
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "商品模块"
|
|
|
+ ],
|
|
|
+ "summary": "创建商品",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "商品信息",
|
|
|
+ "name": "json",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.GoodsJson"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/goods/delete/{id}": {
|
|
|
+ "delete": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "商品模块"
|
|
|
+ ],
|
|
|
+ "summary": "删除商品",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "商品id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/goods/detail/{id}": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "商品模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取商品详细信息",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "商品id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/goods/recommend/{page}/{pageSize}": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "商品模块"
|
|
|
+ ],
|
|
|
+ "summary": "分页获取推荐商品",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "用户id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "页数",
|
|
|
+ "name": "page",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "一页的大小",
|
|
|
+ "name": "pageSize",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/goods/revise": {
|
|
|
+ "post": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "商品模块"
|
|
|
+ ],
|
|
|
+ "summary": "修改商品信息",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "商品信息",
|
|
|
+ "name": "json",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.Goods"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/goods/search/{page}/{pageSize}": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "商品模块"
|
|
|
+ ],
|
|
|
+ "summary": "搜索商品并分页显示",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "页数",
|
|
|
+ "name": "page",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "一页的大小",
|
|
|
+ "name": "pageSize",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "搜素关键词",
|
|
|
+ "name": "keyword",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/goods/user/{id}": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "商品模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取某个用户的所有商品",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "用户id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/goods/{page}/{pageSize}": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "商品模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取所有商品",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "页数",
|
|
|
+ "name": "page",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "一页的大小",
|
|
|
+ "name": "pageSize",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/message": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "信息模块"
|
|
|
+ ],
|
|
|
+ "summary": "传入用户id获取用户消息记录",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "用户id",
|
|
|
+ "name": "uid",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/message/conv": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "信息模块"
|
|
|
+ ],
|
|
|
+ "summary": "传入用户id和聊天对象id获取消息记录",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "用户id",
|
|
|
+ "name": "uid",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "对象id",
|
|
|
+ "name": "targetId",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/order": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "订单模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取所有订单",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/order/create": {
|
|
|
+ "post": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "订单模块"
|
|
|
+ ],
|
|
|
+ "summary": "创建订单",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "订单信息",
|
|
|
+ "name": "json",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.OrderJson"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/order/delete/{id}": {
|
|
|
+ "delete": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "订单模块"
|
|
|
+ ],
|
|
|
+ "summary": "删除订单",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "订单id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/order/revise": {
|
|
|
+ "post": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "订单模块"
|
|
|
+ ],
|
|
|
+ "summary": "修改订单的状态",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "订单id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "formData",
|
|
|
+ "required": true
|
|
|
+ },
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "订单状态",
|
|
|
+ "name": "state",
|
|
|
+ "in": "formData",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/order/user": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "订单模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取用户的所有订单",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "用户id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/pic": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "图片模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取所有图片",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/pic/delete/{id}": {
|
|
|
+ "delete": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "图片模块"
|
|
|
+ ],
|
|
|
+ "summary": "删除图片",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "图片id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/pic/upload": {
|
|
|
+ "post": {
|
|
|
+ "consumes": [
|
|
|
+ "multipart/form-data"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "图片模块"
|
|
|
+ ],
|
|
|
+ "summary": "上传图片",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "file",
|
|
|
+ "description": "图片",
|
|
|
+ "name": "pic",
|
|
|
+ "in": "formData",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/relation/bad": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "用户关系模块"
|
|
|
+ ],
|
|
|
+ "summary": "传入用户id获取用户黑名单列表",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "用户id",
|
|
|
+ "name": "uid",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/relation/create": {
|
|
|
+ "post": {
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "用户关系模块"
|
|
|
+ ],
|
|
|
+ "summary": "添加用户间的关系,关系类型有1:好友关系,2:黑名单关系",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "关系数据",
|
|
|
+ "name": "json",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.RelationJson"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/relation/delete/{id}": {
|
|
|
+ "delete": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "用户关系模块"
|
|
|
+ ],
|
|
|
+ "summary": "根据关系id删除关系",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "关系id",
|
|
|
+ "name": "id",
|
|
|
+ "in": "path",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/relation/friend": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "用户关系模块"
|
|
|
+ ],
|
|
|
+ "summary": "传入用户id获取用户好友列表",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "integer",
|
|
|
+ "description": "用户id",
|
|
|
+ "name": "uid",
|
|
|
+ "in": "query",
|
|
|
+ "required": true
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/user/info": {
|
|
|
+ "get": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "用户模块"
|
|
|
+ ],
|
|
|
+ "summary": "获取用户信息",
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/user/login": {
|
|
|
+ "post": {
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "用户模块"
|
|
|
+ ],
|
|
|
+ "summary": "登录",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "type": "string",
|
|
|
+ "description": "微信ID",
|
|
|
+ "name": "vid",
|
|
|
+ "in": "formData"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/user/modify": {
|
|
|
+ "post": {
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "用户模块"
|
|
|
+ ],
|
|
|
+ "summary": "修改用户信息",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "用户信息",
|
|
|
+ "name": "json",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.User"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "/user/register": {
|
|
|
+ "post": {
|
|
|
+ "consumes": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "produces": [
|
|
|
+ "application/json"
|
|
|
+ ],
|
|
|
+ "tags": [
|
|
|
+ "用户模块"
|
|
|
+ ],
|
|
|
+ "summary": "创建用户",
|
|
|
+ "parameters": [
|
|
|
+ {
|
|
|
+ "description": "用户信息",
|
|
|
+ "name": "json",
|
|
|
+ "in": "body",
|
|
|
+ "required": true,
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/model.UserJson"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "responses": {
|
|
|
+ "200": {
|
|
|
+ "description": "OK",
|
|
|
+ "schema": {
|
|
|
+ "$ref": "#/definitions/response.Response"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "definitions": {
|
|
|
+ "model.Appraise": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "buyerId": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "content": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "goodsId": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "star": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "time": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.AppraiseJson": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "buyerId": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "content": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "goodsId": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "star": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "time": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.CategoryJson": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "pic": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.Goods": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "desc": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "integrity": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "ownerId": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "picId": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "place": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "price": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "state": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "title": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.GoodsJson": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "categories": {
|
|
|
+ "type": "array",
|
|
|
+ "items": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "desc": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "integrity": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "ownerId": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "pic_id": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "place": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "price": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "state": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "title": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.OrderJson": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "buyerId": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "goodsId": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "phone": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "place": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "state": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "time": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.RelationJson": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "owner": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "target": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "type": {
|
|
|
+ "type": "integer"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.User": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "avatar": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "phone": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "uid": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "vid": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "model.UserJson": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "avatar": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "name": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "phone": {
|
|
|
+ "type": "string"
|
|
|
+ },
|
|
|
+ "vid": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ "response.Response": {
|
|
|
+ "type": "object",
|
|
|
+ "properties": {
|
|
|
+ "code": {
|
|
|
+ "type": "integer"
|
|
|
+ },
|
|
|
+ "data": {},
|
|
|
+ "message": {
|
|
|
+ "type": "string"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}`
|
|
|
+
|
|
|
+// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
+var SwaggerInfo = &swag.Spec{
|
|
|
+ Version: "1.0",
|
|
|
+ Host: "127.0.0.1:8084",
|
|
|
+ BasePath: "/WeChatTrading/trading-go",
|
|
|
+ Schemes: []string{},
|
|
|
+ Title: "二手交易",
|
|
|
+ Description: "一个基于微信小程序的校园二手交易平台的api文档",
|
|
|
+ InfoInstanceName: "swagger",
|
|
|
+ SwaggerTemplate: docTemplate,
|
|
|
+ LeftDelim: "{{",
|
|
|
+ RightDelim: "}}",
|
|
|
+}
|
|
|
+
|
|
|
+func init() {
|
|
|
+ swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
|
+}
|