# Generated with protoc-gen-openapi # https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi openapi: 3.0.3 info: title: "" version: 0.0.1 paths: /api/articles: get: tags: - Article description: 获取多篇文章,需要身份验证 operationId: Article_ListArticle parameters: - name: tag in: query schema: type: string - name: author in: query schema: type: string - name: favorited in: query schema: type: string - name: limit in: query schema: type: integer format: uint32 - name: offset in: query schema: type: integer format: uint32 responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.article.v1.ListArticleReply' post: tags: - Article description: 创建文章,需要身份验证 operationId: Article_CreateArticle requestBody: content: application/json: schema: $ref: '#/components/schemas/api.article.v1.CreateArticleRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.article.v1.ArticleReply' /api/articles/feed: get: tags: - Article description: 返回关注用户的多篇文章,需要身份验证 operationId: Article_FeedArticle parameters: - name: tag in: query schema: type: string - name: author in: query schema: type: string - name: favorited in: query schema: type: string - name: limit in: query schema: type: integer format: uint32 - name: offset in: query schema: type: integer format: uint32 responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.article.v1.ListArticleReply' /api/articles/{slug}: get: tags: - Article description: 获取单篇文章,无需身份验证 operationId: Article_GetArticle parameters: - name: slug in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.article.v1.ArticleReply' put: tags: - Article description: 更新文章,需要身份验证 operationId: Article_UpdateArticle parameters: - name: slug in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/api.article.v1.SaveArticleRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.article.v1.ArticleReply' delete: tags: - Article description: 删除文章,需要身份验证 operationId: Article_DeleteArticle parameters: - name: slug in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.article.v1.EmptyReply' /api/articles/{slug}/comments: get: tags: - Comment operationId: Comment_ListComment parameters: - name: slug in: path required: true schema: type: string - name: offset in: query schema: type: integer format: uint32 - name: limit in: query schema: type: integer format: uint32 responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.comment.v1.ListCommentReply' post: tags: - Comment operationId: Comment_CreateComment parameters: - name: slug in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/api.comment.v1.CreateCommentRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.comment.v1.CommentReply' /api/articles/{slug}/comments/{id}: delete: tags: - Comment operationId: Comment_DeleteComment parameters: - name: slug in: path required: true schema: type: string - name: id in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.comment.v1.DeleteCommentReply' /api/articles/{slug}/favorite: post: tags: - Article operationId: Article_FavoriteArticle parameters: - name: slug in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/api.article.v1.SlugRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.article.v1.ArticleReply' delete: tags: - Article operationId: Article_UnFavoriteArticle parameters: - name: slug in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.article.v1.ArticleReply' /api/profiles/{username}: get: tags: - Profile operationId: Profile_GetProfile parameters: - name: username in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/profile.v1.ProfileReply' /api/profiles/{username}/follow: post: tags: - Profile operationId: Profile_Follow parameters: - name: username in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/profile.v1.ProfileRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/profile.v1.ProfileReply' delete: tags: - Profile operationId: Profile_Unfollow parameters: - name: username in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/profile.v1.ProfileReply' /api/tags: get: tags: - Tag operationId: Tag_ListTag parameters: - name: offset in: query schema: type: integer format: uint32 - name: limit in: query schema: type: integer format: uint32 responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/api.tag.v1.ListTagReply' /api/user: get: tags: - UserApi operationId: UserApi_CurrentUser responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/user.v1.UserReply' put: tags: - UserApi operationId: UserApi_UpdateUser requestBody: content: application/json: schema: $ref: '#/components/schemas/user.v1.UpdateUserRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/user.v1.UserReply' /api/users: post: tags: - UserApi operationId: UserApi_Register requestBody: content: application/json: schema: $ref: '#/components/schemas/user.v1.RegisterRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/user.v1.UserReply' /api/users/login: post: tags: - UserApi operationId: UserApi_Login requestBody: content: application/json: schema: $ref: '#/components/schemas/user.v1.LoginRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/user.v1.UserReply' /helloworld/{name}: get: tags: - Greeter description: Sends a greeting operationId: Greeter_SayHello parameters: - name: name in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/helloworld.v1.HelloReply' components: schemas: api.article.v1.ArticleReply: type: object properties: slug: type: string title: type: string description: type: string tagList: type: array items: type: string createdAt: type: string updatedAt: type: string favorited: type: boolean favoritesCount: type: integer format: uint32 author: $ref: '#/components/schemas/api.article.v1.Author' api.article.v1.Author: type: object properties: username: type: string bio: type: string image: type: string following: type: boolean api.article.v1.CreateArticleRequest: type: object properties: article: $ref: '#/components/schemas/api.article.v1.CreateArticleRequest_Article' api.article.v1.CreateArticleRequest_Article: type: object properties: title: type: string description: type: string body: type: string tagList: type: array items: type: string api.article.v1.EmptyReply: type: object properties: {} api.article.v1.ListArticleReply: type: object properties: articles: type: array items: $ref: '#/components/schemas/api.article.v1.ArticleReply' articlesCount: type: integer format: uint32 api.article.v1.SaveArticleRequest: type: object properties: article: $ref: '#/components/schemas/api.article.v1.SaveArticleRequest_Article' slug: type: string api.article.v1.SaveArticleRequest_Article: type: object properties: title: type: string description: type: string body: type: string tagList: type: array items: type: string api.article.v1.SlugRequest: type: object properties: slug: type: string api.comment.v1.Author: type: object properties: username: type: string bio: type: string image: type: string following: type: boolean api.comment.v1.CommentInfoReply: type: object properties: id: type: string createdAt: type: string body: type: string author: $ref: '#/components/schemas/api.comment.v1.Author' api.comment.v1.CommentReply: type: object properties: comment: $ref: '#/components/schemas/api.comment.v1.CommentInfoReply' api.comment.v1.CreateCommentRequest: type: object properties: comment: $ref: '#/components/schemas/api.comment.v1.CreateCommentRequest_Comment' slug: type: string api.comment.v1.CreateCommentRequest_Comment: type: object properties: body: type: string api.comment.v1.DeleteCommentReply: type: object properties: {} api.comment.v1.ListCommentReply: type: object properties: comments: type: array items: $ref: '#/components/schemas/api.comment.v1.CommentInfoReply' api.tag.v1.ListTagReply: type: object properties: tags: type: array items: type: string helloworld.v1.HelloReply: type: object properties: message: type: string description: The response message containing the greetings profile.v1.Data: type: object properties: username: type: string bio: type: string image: type: string following: type: boolean profile.v1.ProfileReply: type: object properties: profile: $ref: '#/components/schemas/profile.v1.Data' profile.v1.ProfileRequest: type: object properties: username: type: string user.v1.LoginRequest: type: object properties: user: $ref: '#/components/schemas/user.v1.LoginRequest_Data' user.v1.LoginRequest_Data: type: object properties: email: type: string password: type: string user.v1.RegisterRequest: type: object properties: user: $ref: '#/components/schemas/user.v1.RegisterRequest_Data' user.v1.RegisterRequest_Data: type: object properties: email: type: string username: type: string password: type: string user.v1.UpdateUserRequest: type: object properties: user: $ref: '#/components/schemas/user.v1.UpdateUserRequest_Data' user.v1.UpdateUserRequest_Data: type: object properties: bio: type: string image: type: string username: type: string password: type: string user.v1.User: type: object properties: email: type: string token: type: string username: type: string bio: type: string image: type: string user.v1.UserReply: type: object properties: user: $ref: '#/components/schemas/user.v1.User' tags: - name: Article - name: Comment - name: Greeter description: The greeting service definition. - name: Profile - name: Tag - name: UserApi