Files
zzyxyz_go_api/config/user_np/user_np.yaml
zzy 24f238f377 refactor(bookmark): 重构书签服务入口文件并整合用户权限功能
将 bookmark.go 重命名为 main.go,并调整包引用路径。将 bookmarks 和 user_np
两个模块的处理逻辑合并到同一个服务中,统一注册路由。同时更新了相关 API
的引用路径,确保生成代码与内部实现正确绑定。

此外,移除了独立的 user_np 服务入口文件,其功能已整合至 bookmark 服务中。

配置文件中调整了 user_np 和 vfs 服务的端口及部分接口定义,完善了用户
相关操作的路径参数和请求体结构。
2025-09-25 09:50:35 +08:00

129 lines
2.8 KiB
YAML

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