openapi: '3.0.3' info: title: zzyxyz_user_np_api description: 用户节点权限相关操作(user_name and password) version: '1.0' servers: - url: http://localhost:8081/api description: 开发环境 - url: https://api.zzyxyz.com/api description: 生产环境 security: - ApiKeyAuth: [] paths: /auth/login: post: summary: 用户登录 description: 使用用户名和密码进行登录 requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/LoginRequest' responses: '200': description: 登录成功 content: application/json: schema: $ref: '#/components/schemas/LoginResponse' '400': description: 请求参数错误 '401': description: 认证失败 /auth/register: post: summary: 用户注册 description: 创建新用户账户 requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/RegisterRequest' responses: '201': description: 注册成功 '400': description: 请求参数错误 '409': description: 用户名已存在 /auth/password: put: summary: 修改密码 description: 修改已登录用户的密码 security: - ApiKeyAuth: [] requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/ChangePasswordRequest' responses: '200': description: 密码修改成功 '400': description: 请求参数错误 '401': description: 认证失败 components: schemas: LoginRequest: type: object required: - username - password properties: username: type: string password: type: string LoginResponse: type: object properties: token: type: string user_id: type: integer format: int64 RegisterRequest: type: object required: - username - password properties: username: type: string password: type: string email: type: string ChangePasswordRequest: type: object required: - old_password - new_password - user_name properties: old_password: type: string new_password: type: string user_name: type: string securitySchemes: ApiKeyAuth: type: apiKey in: header name: Authorization