{ "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "https" ], "swagger": "2.0", "info": { "version": "1.0" }, "basePath": "/", "paths": { "/api/v1/comments/{id}/like": { "post": { "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "点赞评论", "operationId": "communityLikeComment", "parameters": [ { "type": "integer", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "", "schema": { "type": "object" } } } }, "delete": { "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "取消点赞评论", "operationId": "communityUnlikeComment", "parameters": [ { "type": "integer", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "", "schema": { "type": "object" } } } } }, "/api/v1/posts": { "get": { "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "获取帖子列表", "operationId": "communityListPosts", "parameters": [ { "type": "integer", "default": 0, "example": 0, "name": "offset", "in": "query", "required": true }, { "type": "integer", "default": 20, "example": 20, "name": "limit", "in": "query", "required": true }, { "type": "string", "name": "tags", "in": "query", "allowEmptyValue": true }, { "type": "string", "name": "sortBy", "in": "query", "allowEmptyValue": true } ], "responses": { "200": { "description": "", "schema": { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "title", "content", "images", "tags", "likeCount", "commentCount", "liked", "author", "createdAt" ], "properties": { "author": { "type": "object", "required": [ "id", "username", "nickname", "avatar", "role", "verifiedRoles", "verificationStatus", "createdAt" ], "properties": { "avatar": { "type": "string" }, "bio": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "string" }, "nickname": { "type": "string" }, "phone": { "type": "string" }, "role": { "description": "consumer, player, owner, admin", "type": "string" }, "username": { "type": "string" }, "verificationStatus": { "type": "object", "additionalProperties": { "type": "string" } }, "verifiedRoles": { "type": "array", "items": { "type": "string" } } } }, "commentCount": { "type": "integer" }, "content": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "integer" }, "images": { "type": "array", "items": { "type": "string" } }, "likeCount": { "type": "integer" }, "liked": { "type": "boolean" }, "tags": { "type": "array", "items": { "type": "string" } }, "title": { "type": "string" } } } }, "meta": { "type": "object", "required": [ "total", "offset", "limit" ], "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total": { "type": "integer" } } } } } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "发布帖子", "operationId": "communityCreatePost", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "type": "object", "required": [ "title", "content", "images", "tags" ], "properties": { "content": { "type": "string" }, "images": { "type": "array", "items": { "type": "string" } }, "linkedOrderId": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "title": { "type": "string" } } } } ], "responses": { "200": { "description": "", "schema": { "type": "object", "properties": { "author": { "type": "object", "required": [ "id", "username", "nickname", "avatar", "role", "verifiedRoles", "verificationStatus", "createdAt" ], "properties": { "avatar": { "type": "string" }, "bio": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "string" }, "nickname": { "type": "string" }, "phone": { "type": "string" }, "role": { "description": "consumer, player, owner, admin", "type": "string" }, "username": { "type": "string" }, "verificationStatus": { "type": "object", "additionalProperties": { "type": "string" } }, "verifiedRoles": { "type": "array", "items": { "type": "string" } } } }, "commentCount": { "type": "integer" }, "content": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "integer" }, "images": { "type": "array", "items": { "type": "string" } }, "likeCount": { "type": "integer" }, "liked": { "type": "boolean" }, "tags": { "type": "array", "items": { "type": "string" } }, "title": { "type": "string" } } } } } } }, "/api/v1/posts/{id}": { "get": { "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "获取帖子详情", "operationId": "communityGetPost", "parameters": [ { "type": "integer", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "", "schema": { "type": "object", "properties": { "author": { "type": "object", "required": [ "id", "username", "nickname", "avatar", "role", "verifiedRoles", "verificationStatus", "createdAt" ], "properties": { "avatar": { "type": "string" }, "bio": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "string" }, "nickname": { "type": "string" }, "phone": { "type": "string" }, "role": { "description": "consumer, player, owner, admin", "type": "string" }, "username": { "type": "string" }, "verificationStatus": { "type": "object", "additionalProperties": { "type": "string" } }, "verifiedRoles": { "type": "array", "items": { "type": "string" } } } }, "commentCount": { "type": "integer" }, "content": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "integer" }, "images": { "type": "array", "items": { "type": "string" } }, "likeCount": { "type": "integer" }, "liked": { "type": "boolean" }, "tags": { "type": "array", "items": { "type": "string" } }, "title": { "type": "string" } } } } } } }, "/api/v1/posts/{id}/comments": { "get": { "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "获取帖子评论", "operationId": "communityListComments", "parameters": [ { "type": "integer", "name": "id", "in": "path", "required": true }, { "type": "integer", "default": 0, "example": 0, "name": "offset", "in": "query", "required": true }, { "type": "integer", "default": 20, "example": 20, "name": "limit", "in": "query", "required": true } ], "responses": { "200": { "description": "", "schema": { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "content", "author", "likeCount", "liked", "createdAt" ], "properties": { "author": { "type": "object", "required": [ "id", "username", "nickname", "avatar", "role", "verifiedRoles", "verificationStatus", "createdAt" ], "properties": { "avatar": { "type": "string" }, "bio": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "string" }, "nickname": { "type": "string" }, "phone": { "type": "string" }, "role": { "description": "consumer, player, owner, admin", "type": "string" }, "username": { "type": "string" }, "verificationStatus": { "type": "object", "additionalProperties": { "type": "string" } }, "verifiedRoles": { "type": "array", "items": { "type": "string" } } } }, "content": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "integer" }, "likeCount": { "type": "integer" }, "liked": { "type": "boolean" } } } }, "meta": { "type": "object", "required": [ "total", "offset", "limit" ], "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total": { "type": "integer" } } } } } } } }, "post": { "consumes": [ "application/json" ], "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "发表评论", "operationId": "communityCreateComment", "parameters": [ { "name": "body", "in": "body", "required": true, "schema": { "type": "object", "required": [ "content" ], "properties": { "content": { "type": "string" } } } } ], "responses": { "200": { "description": "", "schema": { "type": "object", "properties": { "author": { "type": "object", "required": [ "id", "username", "nickname", "avatar", "role", "verifiedRoles", "verificationStatus", "createdAt" ], "properties": { "avatar": { "type": "string" }, "bio": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "string" }, "nickname": { "type": "string" }, "phone": { "type": "string" }, "role": { "description": "consumer, player, owner, admin", "type": "string" }, "username": { "type": "string" }, "verificationStatus": { "type": "object", "additionalProperties": { "type": "string" } }, "verifiedRoles": { "type": "array", "items": { "type": "string" } } } }, "content": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "integer" }, "likeCount": { "type": "integer" }, "liked": { "type": "boolean" } } } } } } }, "/api/v1/posts/{id}/like": { "post": { "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "点赞帖子", "operationId": "communityLikePost", "parameters": [ { "type": "integer", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "", "schema": { "type": "object" } } } }, "delete": { "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "取消点赞帖子", "operationId": "communityUnlikePost", "parameters": [ { "type": "integer", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "", "schema": { "type": "object" } } } } }, "/api/v1/posts/{id}/pin": { "post": { "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "置顶帖子", "operationId": "communityPinPost", "parameters": [ { "type": "integer", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "", "schema": { "type": "object" } } } }, "delete": { "consumes": [ "application/x-www-form-urlencoded" ], "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "取消置顶", "operationId": "communityUnpinPost", "parameters": [ { "type": "integer", "name": "id", "in": "path", "required": true } ], "responses": { "200": { "description": "", "schema": { "type": "object" } } } } }, "/api/v1/users/{id}/posts": { "get": { "produces": [ "application/json" ], "schemes": [ "https" ], "summary": "获取用户帖子", "operationId": "communityListUserPosts", "parameters": [ { "type": "integer", "name": "id", "in": "path", "required": true }, { "type": "integer", "default": 0, "example": 0, "name": "offset", "in": "query", "required": true }, { "type": "integer", "default": 20, "example": 20, "name": "limit", "in": "query", "required": true } ], "responses": { "200": { "description": "", "schema": { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "required": [ "id", "title", "content", "images", "tags", "likeCount", "commentCount", "liked", "author", "createdAt" ], "properties": { "author": { "type": "object", "required": [ "id", "username", "nickname", "avatar", "role", "verifiedRoles", "verificationStatus", "createdAt" ], "properties": { "avatar": { "type": "string" }, "bio": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "string" }, "nickname": { "type": "string" }, "phone": { "type": "string" }, "role": { "description": "consumer, player, owner, admin", "type": "string" }, "username": { "type": "string" }, "verificationStatus": { "type": "object", "additionalProperties": { "type": "string" } }, "verifiedRoles": { "type": "array", "items": { "type": "string" } } } }, "commentCount": { "type": "integer" }, "content": { "type": "string" }, "createdAt": { "type": "string" }, "id": { "type": "integer" }, "images": { "type": "array", "items": { "type": "string" } }, "likeCount": { "type": "integer" }, "liked": { "type": "boolean" }, "tags": { "type": "array", "items": { "type": "string" } }, "title": { "type": "string" } } } }, "meta": { "type": "object", "required": [ "total", "offset", "limit" ], "properties": { "limit": { "type": "integer" }, "offset": { "type": "integer" }, "total": { "type": "integer" } } } } } } } } } }, "x-date": "2026-04-22 22:30:25", "x-description": "This is a goctl generated swagger file.", "x-github": "https://github.com/zeromicro/go-zero", "x-go-zero-doc": "https://go-zero.dev/", "x-goctl-version": "1.10.1" }