1667 lines
51 KiB
JSON
1667 lines
51 KiB
JSON
{
|
||
"swagger": "2.0",
|
||
"info": {
|
||
"description": "This is a sample server celler server.",
|
||
"title": "ApiDoc",
|
||
"termsOfService": "http://swagger.io/terms/",
|
||
"contact": {
|
||
"name": "UserName",
|
||
"url": "http://www.swagger.io/support",
|
||
"email": "support@swagger.io"
|
||
},
|
||
"license": {
|
||
"name": "Apache 2.0",
|
||
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
||
},
|
||
"version": "1.0"
|
||
},
|
||
"host": "localhost:8080",
|
||
"basePath": "/api/v1",
|
||
"paths": {
|
||
"/admin/auth": {
|
||
"post": {
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Auth"
|
||
],
|
||
"summary": "管理员登录",
|
||
"parameters": [
|
||
{
|
||
"description": "请求体",
|
||
"name": "body",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/admin.AuthBody"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"$ref": "#/definitions/admin.TokenResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/medias": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Medias"
|
||
],
|
||
"summary": "媒体列表",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"name": "keyword",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/requests.Pager"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"$ref": "#/definitions/models.Medium"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/medias/{id}": {
|
||
"get": {
|
||
"tags": [
|
||
"Admin Medias"
|
||
],
|
||
"summary": "媒体预览(跳转到签名 URL)",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "媒体 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"302": {
|
||
"description": "跳转",
|
||
"schema": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Medias"
|
||
],
|
||
"summary": "删除媒体",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "媒体 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"204": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/orders": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Orders"
|
||
],
|
||
"summary": "订单列表",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"name": "orderNumber",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "userID",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/requests.Pager"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"$ref": "#/definitions/services.OrderListItem"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/orders/{id}/refund": {
|
||
"post": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Orders"
|
||
],
|
||
"summary": "订单退款",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "订单 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/posts": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Posts"
|
||
],
|
||
"summary": "作品列表",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"name": "keyword",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/requests.Pager"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"$ref": "#/definitions/admin.PostItem"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"post": {
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Posts"
|
||
],
|
||
"summary": "创建作品",
|
||
"parameters": [
|
||
{
|
||
"description": "请求体",
|
||
"name": "form",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/admin.PostForm"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/posts/{id}": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Posts"
|
||
],
|
||
"summary": "作品详情",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "作品 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"$ref": "#/definitions/admin.PostItem"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"put": {
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Posts"
|
||
],
|
||
"summary": "更新作品",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "作品 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "请求体",
|
||
"name": "form",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/admin.PostForm"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
},
|
||
"delete": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Posts"
|
||
],
|
||
"summary": "删除作品",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "作品 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"204": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/posts/{id}/send-to/{userId}": {
|
||
"post": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Posts"
|
||
],
|
||
"summary": "赠送作品给用户",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "作品 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "用户 ID",
|
||
"name": "userId",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/statistics": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Statistics"
|
||
],
|
||
"summary": "仪表盘统计",
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"$ref": "#/definitions/admin.StatisticsResponse"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/uploads/post-uploaded-action": {
|
||
"post": {
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Uploads"
|
||
],
|
||
"summary": "上传完成回调处理",
|
||
"parameters": [
|
||
{
|
||
"description": "请求体",
|
||
"name": "body",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/admin.PostUploadedForm"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/uploads/pre-uploaded-check/{md5}.{ext}": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Uploads"
|
||
],
|
||
"summary": "预上传检查",
|
||
"parameters": [
|
||
{
|
||
"type": "string",
|
||
"description": "文件 MD5",
|
||
"name": "md5",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "文件扩展名(不含点)",
|
||
"name": "ext",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "文件 MIME 类型",
|
||
"name": "mime",
|
||
"in": "query",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"$ref": "#/definitions/admin.PreCheckResp"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/users": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Users"
|
||
],
|
||
"summary": "用户列表",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"name": "keyword",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/requests.Pager"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"$ref": "#/definitions/models.User"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/users/{id}": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Users"
|
||
],
|
||
"summary": "用户详情",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "用户 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"$ref": "#/definitions/models.User"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/users/{id}/articles": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Users"
|
||
],
|
||
"summary": "用户已购作品",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "用户 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "page",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/requests.Pager"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"$ref": "#/definitions/models.Post"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/admin/users/{id}/balance": {
|
||
"post": {
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Admin Users"
|
||
],
|
||
"summary": "调整用户余额",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "用户 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"description": "请求体",
|
||
"name": "balance",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/admin.UserBalance"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/auth/phone": {
|
||
"post": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Auth"
|
||
],
|
||
"summary": "手机验证",
|
||
"parameters": [
|
||
{
|
||
"description": "手机号",
|
||
"name": "form",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/http.PhoneValidationForm"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/auth/validate": {
|
||
"post": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Auth"
|
||
],
|
||
"summary": "手机验证",
|
||
"parameters": [
|
||
{
|
||
"description": "请求体",
|
||
"name": "body",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/http.PhoneValidationForm"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/medias/{id}": {
|
||
"post": {
|
||
"consumes": [
|
||
"multipart/form-data"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Demo"
|
||
],
|
||
"summary": "演示接口",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"description": "ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "搜索关键词",
|
||
"name": "search",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "内容类型",
|
||
"name": "Content-Type",
|
||
"in": "header"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"description": "上传到指定文件夹",
|
||
"name": "folder",
|
||
"in": "formData"
|
||
},
|
||
{
|
||
"type": "file",
|
||
"description": "上传文件",
|
||
"name": "file",
|
||
"in": "formData",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/requests.Pager"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"$ref": "#/definitions/v1.ResponseItem"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/posts": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Posts"
|
||
],
|
||
"summary": "作品列表",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"name": "keyword",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/requests.Pager"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"$ref": "#/definitions/http.PostItem"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/posts/mine": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Posts"
|
||
],
|
||
"summary": "我的已购作品",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"name": "limit",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "integer",
|
||
"name": "page",
|
||
"in": "query"
|
||
},
|
||
{
|
||
"type": "string",
|
||
"name": "keyword",
|
||
"in": "query"
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"allOf": [
|
||
{
|
||
"$ref": "#/definitions/requests.Pager"
|
||
},
|
||
{
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {
|
||
"$ref": "#/definitions/http.PostItem"
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/posts/{id}/buy": {
|
||
"post": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Posts"
|
||
],
|
||
"summary": "购买作品",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "作品 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功(余额支付返回 AppId=balance)",
|
||
"schema": {
|
||
"$ref": "#/definitions/wechat.JSAPIPayParams"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/posts/{id}/play": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Posts"
|
||
],
|
||
"summary": "获取播放地址",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "作品 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"$ref": "#/definitions/http.PlayUrl"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/posts/{id}/show": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Posts"
|
||
],
|
||
"summary": "作品详情",
|
||
"parameters": [
|
||
{
|
||
"type": "integer",
|
||
"format": "int64",
|
||
"description": "作品 ID",
|
||
"name": "id",
|
||
"in": "path",
|
||
"required": true
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"$ref": "#/definitions/http.PostItem"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/users/profile": {
|
||
"get": {
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Users"
|
||
],
|
||
"summary": "获取个人信息",
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {
|
||
"$ref": "#/definitions/http.UserInfo"
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"/v1/users/username": {
|
||
"put": {
|
||
"consumes": [
|
||
"application/json"
|
||
],
|
||
"produces": [
|
||
"application/json"
|
||
],
|
||
"tags": [
|
||
"Users"
|
||
],
|
||
"summary": "修改用户名",
|
||
"parameters": [
|
||
{
|
||
"description": "请求体",
|
||
"name": "form",
|
||
"in": "body",
|
||
"required": true,
|
||
"schema": {
|
||
"$ref": "#/definitions/http.ProfileForm"
|
||
}
|
||
}
|
||
],
|
||
"responses": {
|
||
"200": {
|
||
"description": "成功",
|
||
"schema": {}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"definitions": {
|
||
"admin.AuthBody": {
|
||
"type": "object",
|
||
"required": [
|
||
"password",
|
||
"username"
|
||
],
|
||
"properties": {
|
||
"password": {
|
||
"type": "string"
|
||
},
|
||
"username": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"admin.PostForm": {
|
||
"type": "object",
|
||
"properties": {
|
||
"content": {
|
||
"type": "string"
|
||
},
|
||
"discount": {
|
||
"type": "integer"
|
||
},
|
||
"head_images": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"introduction": {
|
||
"type": "string"
|
||
},
|
||
"medias": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "integer"
|
||
}
|
||
},
|
||
"price": {
|
||
"type": "integer"
|
||
},
|
||
"status": {
|
||
"$ref": "#/definitions/fields.PostStatus"
|
||
},
|
||
"title": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"admin.PostItem": {
|
||
"type": "object",
|
||
"properties": {
|
||
"assets": {
|
||
"$ref": "#/definitions/types.JSONType-array_fields_MediaAsset"
|
||
},
|
||
"bought_count": {
|
||
"type": "integer"
|
||
},
|
||
"content": {
|
||
"type": "string"
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"deleted_at": {
|
||
"$ref": "#/definitions/gorm.DeletedAt"
|
||
},
|
||
"description": {
|
||
"type": "string"
|
||
},
|
||
"discount": {
|
||
"type": "integer"
|
||
},
|
||
"head_images": {
|
||
"$ref": "#/definitions/types.JSONType-array_int64"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"likes": {
|
||
"type": "integer"
|
||
},
|
||
"medias": {
|
||
"type": "array",
|
||
"items": {
|
||
"$ref": "#/definitions/models.Medium"
|
||
}
|
||
},
|
||
"price": {
|
||
"type": "integer"
|
||
},
|
||
"status": {
|
||
"$ref": "#/definitions/fields.PostStatus"
|
||
},
|
||
"tags": {
|
||
"$ref": "#/definitions/types.JSONType-array_string"
|
||
},
|
||
"title": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"views": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"admin.PostUploadedForm": {
|
||
"type": "object",
|
||
"properties": {
|
||
"md5": {
|
||
"type": "string"
|
||
},
|
||
"mimeType": {
|
||
"type": "string"
|
||
},
|
||
"originalName": {
|
||
"type": "string"
|
||
},
|
||
"size": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"admin.PreCheckResp": {
|
||
"type": "object",
|
||
"properties": {
|
||
"exists": {
|
||
"type": "boolean"
|
||
},
|
||
"pre_sign": {
|
||
"$ref": "#/definitions/oss.PresignResult"
|
||
}
|
||
}
|
||
},
|
||
"admin.StatisticsResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"amount": {
|
||
"type": "integer"
|
||
},
|
||
"media": {
|
||
"type": "integer"
|
||
},
|
||
"order": {
|
||
"type": "integer"
|
||
},
|
||
"post_draft": {
|
||
"type": "integer"
|
||
},
|
||
"post_published": {
|
||
"type": "integer"
|
||
},
|
||
"user": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"admin.TokenResponse": {
|
||
"type": "object",
|
||
"properties": {
|
||
"token": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"admin.UserBalance": {
|
||
"type": "object",
|
||
"properties": {
|
||
"balance": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"fields.OrderStatus": {
|
||
"type": "integer",
|
||
"format": "int32",
|
||
"enum": [
|
||
0,
|
||
1,
|
||
2,
|
||
3,
|
||
4,
|
||
5,
|
||
6,
|
||
7
|
||
],
|
||
"x-enum-varnames": [
|
||
"OrderStatusPending",
|
||
"OrderStatusPaid",
|
||
"OrderStatusRefundSuccess",
|
||
"OrderStatusRefundClosed",
|
||
"OrderStatusRefundProcessing",
|
||
"OrderStatusRefundAbnormal",
|
||
"OrderStatusCancelled",
|
||
"OrderStatusCompleted"
|
||
]
|
||
},
|
||
"fields.PostStatus": {
|
||
"type": "integer",
|
||
"format": "int32",
|
||
"enum": [
|
||
0,
|
||
1
|
||
],
|
||
"x-enum-varnames": [
|
||
"PostStatusDraft",
|
||
"PostStatusPublished"
|
||
]
|
||
},
|
||
"fields.UserStatus": {
|
||
"type": "integer",
|
||
"format": "int32",
|
||
"enum": [
|
||
0,
|
||
1,
|
||
2
|
||
],
|
||
"x-enum-varnames": [
|
||
"UserStatusOk",
|
||
"UserStatusBanned",
|
||
"UserStatusBlocked"
|
||
]
|
||
},
|
||
"gorm.DeletedAt": {
|
||
"type": "object",
|
||
"properties": {
|
||
"time": {
|
||
"type": "string"
|
||
},
|
||
"valid": {
|
||
"description": "Valid is true if Time is not NULL",
|
||
"type": "boolean"
|
||
}
|
||
}
|
||
},
|
||
"http.PhoneValidationForm": {
|
||
"type": "object",
|
||
"properties": {
|
||
"code": {
|
||
"type": "string"
|
||
},
|
||
"phone": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"http.PlayUrl": {
|
||
"type": "object",
|
||
"properties": {
|
||
"url": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"http.PostItem": {
|
||
"type": "object",
|
||
"properties": {
|
||
"bought": {
|
||
"type": "boolean"
|
||
},
|
||
"content": {
|
||
"type": "string"
|
||
},
|
||
"description": {
|
||
"type": "string"
|
||
},
|
||
"discount": {
|
||
"type": "integer"
|
||
},
|
||
"head_images": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"likes": {
|
||
"type": "integer"
|
||
},
|
||
"price": {
|
||
"type": "integer"
|
||
},
|
||
"recharge_wechat": {
|
||
"type": "string"
|
||
},
|
||
"tags": {
|
||
"type": "array",
|
||
"items": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"title": {
|
||
"type": "string"
|
||
},
|
||
"views": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"http.ProfileForm": {
|
||
"type": "object",
|
||
"required": [
|
||
"username"
|
||
],
|
||
"properties": {
|
||
"username": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"http.UserInfo": {
|
||
"type": "object",
|
||
"properties": {
|
||
"avatar": {
|
||
"type": "string"
|
||
},
|
||
"balance": {
|
||
"type": "integer"
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"username": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"models.Medium": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"hash": {
|
||
"type": "string"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"metas": {
|
||
"$ref": "#/definitions/types.JSONType-fields_MediaMetas"
|
||
},
|
||
"mime_type": {
|
||
"type": "string"
|
||
},
|
||
"name": {
|
||
"type": "string"
|
||
},
|
||
"path": {
|
||
"type": "string"
|
||
},
|
||
"size": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"models.Post": {
|
||
"type": "object",
|
||
"properties": {
|
||
"assets": {
|
||
"$ref": "#/definitions/types.JSONType-array_fields_MediaAsset"
|
||
},
|
||
"content": {
|
||
"type": "string"
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"deleted_at": {
|
||
"$ref": "#/definitions/gorm.DeletedAt"
|
||
},
|
||
"description": {
|
||
"type": "string"
|
||
},
|
||
"discount": {
|
||
"type": "integer"
|
||
},
|
||
"head_images": {
|
||
"$ref": "#/definitions/types.JSONType-array_int64"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"likes": {
|
||
"type": "integer"
|
||
},
|
||
"price": {
|
||
"type": "integer"
|
||
},
|
||
"status": {
|
||
"$ref": "#/definitions/fields.PostStatus"
|
||
},
|
||
"tags": {
|
||
"$ref": "#/definitions/types.JSONType-array_string"
|
||
},
|
||
"title": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"views": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"models.User": {
|
||
"type": "object",
|
||
"properties": {
|
||
"auth_token": {
|
||
"$ref": "#/definitions/types.JSONType-fields_UserAuthToken"
|
||
},
|
||
"avatar": {
|
||
"type": "string"
|
||
},
|
||
"balance": {
|
||
"type": "integer"
|
||
},
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"deleted_at": {
|
||
"$ref": "#/definitions/gorm.DeletedAt"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"metas": {
|
||
"$ref": "#/definitions/types.JSONType-fields_UserMetas"
|
||
},
|
||
"open_id": {
|
||
"type": "string"
|
||
},
|
||
"phone": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"$ref": "#/definitions/fields.UserStatus"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"username": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"oss.PresignResult": {
|
||
"type": "object",
|
||
"properties": {
|
||
"expiration": {
|
||
"type": "string"
|
||
},
|
||
"method": {
|
||
"type": "string"
|
||
},
|
||
"signedHeaders": {
|
||
"type": "object",
|
||
"additionalProperties": {
|
||
"type": "string"
|
||
}
|
||
},
|
||
"url": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"requests.Pager": {
|
||
"type": "object",
|
||
"properties": {
|
||
"items": {},
|
||
"limit": {
|
||
"type": "integer"
|
||
},
|
||
"page": {
|
||
"type": "integer"
|
||
},
|
||
"total": {
|
||
"type": "integer"
|
||
}
|
||
}
|
||
},
|
||
"services.OrderListItem": {
|
||
"type": "object",
|
||
"properties": {
|
||
"created_at": {
|
||
"type": "string"
|
||
},
|
||
"currency": {
|
||
"type": "string"
|
||
},
|
||
"discount": {
|
||
"type": "integer"
|
||
},
|
||
"id": {
|
||
"type": "integer"
|
||
},
|
||
"meta": {
|
||
"$ref": "#/definitions/types.JSONType-fields_OrderMeta"
|
||
},
|
||
"order_no": {
|
||
"type": "string"
|
||
},
|
||
"payment_method": {
|
||
"type": "string"
|
||
},
|
||
"post_id": {
|
||
"type": "integer"
|
||
},
|
||
"post_title": {
|
||
"type": "string"
|
||
},
|
||
"price": {
|
||
"type": "integer"
|
||
},
|
||
"refund_transaction_id": {
|
||
"type": "string"
|
||
},
|
||
"status": {
|
||
"$ref": "#/definitions/fields.OrderStatus"
|
||
},
|
||
"sub_order_no": {
|
||
"type": "string"
|
||
},
|
||
"transaction_id": {
|
||
"type": "string"
|
||
},
|
||
"updated_at": {
|
||
"type": "string"
|
||
},
|
||
"user_id": {
|
||
"type": "integer"
|
||
},
|
||
"username": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
},
|
||
"types.JSONType-array_fields_MediaAsset": {
|
||
"type": "object"
|
||
},
|
||
"types.JSONType-array_int64": {
|
||
"type": "object"
|
||
},
|
||
"types.JSONType-array_string": {
|
||
"type": "object"
|
||
},
|
||
"types.JSONType-fields_MediaMetas": {
|
||
"type": "object"
|
||
},
|
||
"types.JSONType-fields_OrderMeta": {
|
||
"type": "object"
|
||
},
|
||
"types.JSONType-fields_UserAuthToken": {
|
||
"type": "object"
|
||
},
|
||
"types.JSONType-fields_UserMetas": {
|
||
"type": "object"
|
||
},
|
||
"v1.ResponseItem": {
|
||
"type": "object"
|
||
},
|
||
"wechat.JSAPIPayParams": {
|
||
"type": "object",
|
||
"properties": {
|
||
"appId": {
|
||
"type": "string"
|
||
},
|
||
"nonceStr": {
|
||
"type": "string"
|
||
},
|
||
"package": {
|
||
"type": "string"
|
||
},
|
||
"paySign": {
|
||
"type": "string"
|
||
},
|
||
"signType": {
|
||
"type": "string"
|
||
},
|
||
"timeStamp": {
|
||
"type": "string"
|
||
}
|
||
}
|
||
}
|
||
},
|
||
"securityDefinitions": {
|
||
"BasicAuth": {
|
||
"type": "basic"
|
||
}
|
||
},
|
||
"externalDocs": {
|
||
"description": "OpenAPI",
|
||
"url": "https://swagger.io/resources/open-api/"
|
||
}
|
||
} |