# Generated with protoc-gen-openapi # https://github.com/google/gnostic/tree/master/cmd/protoc-gen-openapi openapi: 3.0.3 info: title: MiniBlog API description: MiniBlog 定义了一个 MiniBlog RPC 服务 version: 0.0.1 paths: /login: post: tags: - MiniBlog description: 用户登录 operationId: MiniBlog_Login requestBody: content: application/json: schema: $ref: '#/components/schemas/v1.LoginRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.LoginResponse' /v1/posts: get: tags: - MiniBlog description: 列出所有文章 operationId: MiniBlog_ListPost parameters: - name: offset in: query schema: type: string - name: limit in: query schema: type: string - name: title in: query schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.ListPostResponse' post: tags: - MiniBlog description: 创建文章 operationId: MiniBlog_CreatePost requestBody: content: application/json: schema: $ref: '#/components/schemas/v1.CreatePostRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.CreatePostResponse' delete: tags: - MiniBlog description: 删除文章 operationId: MiniBlog_DeletePost parameters: - name: postIDs in: query schema: type: array items: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.DeletePostResponse' /v1/posts/{postID}: get: tags: - MiniBlog description: 获取文章信息 operationId: MiniBlog_GetPost parameters: - name: postID in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.GetPostResponse' put: tags: - MiniBlog description: 更新文章 operationId: MiniBlog_UpdatePost parameters: - name: postID in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/v1.UpdatePostRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.UpdatePostResponse' /v1/users: get: tags: - MiniBlog description: 列出所有用户 operationId: MiniBlog_ListUser parameters: - name: offset in: query schema: type: string - name: limit in: query schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.ListUserResponse' post: tags: - MiniBlog description: 创建用户 operationId: MiniBlog_CreateUser requestBody: content: application/json: schema: $ref: '#/components/schemas/v1.CreateUserRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.CreateUserResponse' /v1/users/{userID}: get: tags: - MiniBlog description: 获取用户信息 operationId: MiniBlog_GetUser parameters: - name: userID in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.GetUserResponse' put: tags: - MiniBlog description: 更新用户信息 operationId: MiniBlog_UpdateUser parameters: - name: userID in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/v1.UpdateUserRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.UpdateUserResponse' delete: tags: - MiniBlog description: 删除用户 operationId: MiniBlog_DeleteUser parameters: - name: userID in: path required: true schema: type: string responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.DeleteUserResponse' /v1/users/{userID}/change-password: put: tags: - MiniBlog description: 修改密码 operationId: MiniBlog_ChangePassword parameters: - name: userID in: path required: true schema: type: string requestBody: content: application/json: schema: $ref: '#/components/schemas/v1.ChangePasswordRequest' required: true responses: "200": description: OK content: application/json: schema: $ref: '#/components/schemas/v1.ChangePasswordResponse' components: schemas: v1.ChangePasswordRequest: type: object properties: userID: type: string oldPassword: type: string newPassword: type: string description: ChangePasswordRequest 表示修改密码请求 v1.ChangePasswordResponse: type: object properties: {} description: ChangePasswordResponse 表示修改密码响应 v1.CreatePostRequest: type: object properties: title: type: string content: type: string description: CreatePostRequest 表示创建文章请求 v1.CreatePostResponse: type: object properties: postID: type: string description: CreatePostResponse 表示创建文章响应 v1.CreateUserRequest: type: object properties: username: type: string password: type: string nickname: type: string email: type: string phone: type: string description: CreateUserRequest 表示创建用户请求 v1.CreateUserResponse: type: object properties: userID: type: string description: CreateUserResponse 表示创建用户响应 v1.DeletePostResponse: type: object properties: {} description: DeletePostResponse 表示删除文章响应 v1.DeleteUserResponse: type: object properties: {} description: DeleteUserResponse 表示删除用户响应 v1.GetPostResponse: type: object properties: post: $ref: '#/components/schemas/v1.Post' description: GetPostResponse 表示获取文章响应 v1.GetUserResponse: type: object properties: user: $ref: '#/components/schemas/v1.User' description: GetUserResponse 表示获取用户响应 v1.ListPostResponse: type: object properties: totalCount: type: string posts: type: array items: $ref: '#/components/schemas/v1.Post' description: ListPostResponse 表示获取文章列表响应 v1.ListUserResponse: type: object properties: totalCount: type: string users: type: array items: $ref: '#/components/schemas/v1.User' description: ListUserResponse 表示用户列表响应 v1.LoginRequest: type: object properties: username: type: string password: type: string description: LoginRequest 表示登录请求 v1.LoginResponse: type: object properties: token: type: string description: LoginResponse 表示登录响应 v1.Post: type: object properties: postID: type: string userID: type: string title: type: string content: type: string createdAt: type: string format: date-time updatedAt: type: string format: date-time description: Post 表示博客文章 v1.UpdatePostRequest: type: object properties: postID: type: string title: type: string content: type: string description: UpdatePostRequest 表示更新文章请求 v1.UpdatePostResponse: type: object properties: {} description: UpdatePostResponse 表示更新文章响应 v1.UpdateUserRequest: type: object properties: userID: type: string username: type: string nickname: type: string email: type: string phone: type: string description: UpdateUserRequest 表示更新用户请求 v1.UpdateUserResponse: type: object properties: {} description: UpdateUserResponse 表示更新用户响应 v1.User: type: object properties: userID: type: string username: type: string nickname: type: string email: type: string phone: type: string postCount: type: string createdAt: type: string format: date-time updatedAt: type: string format: date-time description: User 表示用户信息 tags: - name: MiniBlog