650 lines
21 KiB
YAML
Executable File
650 lines
21 KiB
YAML
Executable File
# 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:
|
|
/*:
|
|
post:
|
|
tags:
|
|
- Gateway
|
|
description: 增加用户
|
|
operationId: Gateway_API
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/api.gateway.GatewayRequest'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/api.gateway.GatewayResponse'
|
|
/class:
|
|
post:
|
|
tags:
|
|
- ClassService
|
|
description: 创建班级
|
|
operationId: ClassService_CreateClass
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/class.CreateClassRequest'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/class.CreateClassResponse'
|
|
/class/{classId}:
|
|
get:
|
|
tags:
|
|
- ClassService
|
|
description: 获取班级信息
|
|
operationId: ClassService_GetClass
|
|
parameters:
|
|
- name: classId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/class.GetClassResponse'
|
|
put:
|
|
tags:
|
|
- ClassService
|
|
description: 更新班级信息
|
|
operationId: ClassService_UpdateClass
|
|
parameters:
|
|
- name: classId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/class.UpdateClassRequest'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/class.UpdateClassResponse'
|
|
delete:
|
|
tags:
|
|
- ClassService
|
|
description: 删除班级
|
|
operationId: ClassService_DeleteClass
|
|
parameters:
|
|
- name: classId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/class.DeleteClassResponse'
|
|
/course:
|
|
post:
|
|
tags:
|
|
- CourseService
|
|
description: 创建课程
|
|
operationId: CourseService_CreateCourse
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/course.CreateCourseRequest'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/course.CreateCourseResponse'
|
|
/course/{courseId}:
|
|
get:
|
|
tags:
|
|
- CourseService
|
|
description: 获取课程信息
|
|
operationId: CourseService_GetCourse
|
|
parameters:
|
|
- name: courseId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/course.GetCourseResponse'
|
|
put:
|
|
tags:
|
|
- CourseService
|
|
description: 更新课程信息
|
|
operationId: CourseService_UpdateCourse
|
|
parameters:
|
|
- name: courseId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/course.UpdateCourseRequest'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/course.UpdateCourseResponse'
|
|
delete:
|
|
tags:
|
|
- CourseService
|
|
description: 删除课程
|
|
operationId: CourseService_DeleteCourse
|
|
parameters:
|
|
- name: courseId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/course.DeleteCourseResponse'
|
|
/exam:
|
|
post:
|
|
tags:
|
|
- ExamService
|
|
description: 创建考试
|
|
operationId: ExamService_CreateExam
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/exam.CreateExamRequest'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/exam.CreateExamResponse'
|
|
/exam/{examId}:
|
|
get:
|
|
tags:
|
|
- ExamService
|
|
description: 获取考试信息
|
|
operationId: ExamService_GetExam
|
|
parameters:
|
|
- name: examId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/exam.GetExamResponse'
|
|
put:
|
|
tags:
|
|
- ExamService
|
|
description: 更新考试信息
|
|
operationId: ExamService_UpdateExam
|
|
parameters:
|
|
- name: examId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/exam.UpdateExamRequest'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/exam.UpdateExamResponse'
|
|
delete:
|
|
tags:
|
|
- ExamService
|
|
description: 删除考试
|
|
operationId: ExamService_DeleteExam
|
|
parameters:
|
|
- name: examId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/exam.DeleteExamResponse'
|
|
/user:
|
|
post:
|
|
tags:
|
|
- UserService
|
|
description: 增加用户
|
|
operationId: UserService_AddUser
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/api.user.AddUserRequest'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/api.user.UserResponse'
|
|
/user/list/{role}:
|
|
get:
|
|
tags:
|
|
- UserService
|
|
description: 查询所有用户
|
|
operationId: UserService_GetUserList
|
|
parameters:
|
|
- name: role
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/api.user.GetUserListReply'
|
|
/user/{userId}:
|
|
get:
|
|
tags:
|
|
- UserService
|
|
description: 查询用户
|
|
operationId: UserService_GetUser
|
|
parameters:
|
|
- name: userId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/api.user.UserResponse'
|
|
put:
|
|
tags:
|
|
- UserService
|
|
description: 更新用户
|
|
operationId: UserService_UpdateUser
|
|
parameters:
|
|
- name: userId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/api.user.UpdateUserRequest'
|
|
required: true
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/api.user.UserResponse'
|
|
delete:
|
|
tags:
|
|
- UserService
|
|
description: 删除用户
|
|
operationId: UserService_DeleteUser
|
|
parameters:
|
|
- name: userId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: OK
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/api.user.UserResponse'
|
|
components:
|
|
schemas:
|
|
api.gateway.GatewayRequest:
|
|
type: object
|
|
properties: {}
|
|
api.gateway.GatewayResponse:
|
|
type: object
|
|
properties: {}
|
|
api.user.AddUserRequest:
|
|
type: object
|
|
properties:
|
|
username:
|
|
type: string
|
|
password:
|
|
type: string
|
|
email:
|
|
type: string
|
|
role:
|
|
type: string
|
|
description: 请求:增加用户
|
|
api.user.GetUserListReply:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
userList:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/api.user.User'
|
|
description: 获取所有用户信息
|
|
api.user.UpdateUserRequest:
|
|
type: object
|
|
properties:
|
|
userId:
|
|
type: string
|
|
username:
|
|
type: string
|
|
password:
|
|
type: string
|
|
email:
|
|
type: string
|
|
role:
|
|
type: string
|
|
description: 请求:更新用户
|
|
api.user.User:
|
|
type: object
|
|
properties:
|
|
userId:
|
|
type: string
|
|
username:
|
|
type: string
|
|
password:
|
|
type: string
|
|
email:
|
|
type: string
|
|
role:
|
|
type: string
|
|
description: 用户信息
|
|
api.user.UserResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
data:
|
|
$ref: '#/components/schemas/api.user.User'
|
|
description: 响应:用户响应
|
|
class.ClassInfo:
|
|
type: object
|
|
properties:
|
|
classId:
|
|
type: string
|
|
className:
|
|
type: string
|
|
teacherId:
|
|
type: string
|
|
description: 班级信息
|
|
class.CreateClassRequest:
|
|
type: object
|
|
properties:
|
|
className:
|
|
type: string
|
|
teacherId:
|
|
type: string
|
|
description: 请求:创建班级
|
|
class.CreateClassResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
classId:
|
|
type: string
|
|
description: 响应:创建班级响应
|
|
class.DeleteClassResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
description: 响应:删除班级响应
|
|
class.GetClassResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
classInfo:
|
|
$ref: '#/components/schemas/class.ClassInfo'
|
|
description: 响应:获取班级信息响应
|
|
class.UpdateClassRequest:
|
|
type: object
|
|
properties:
|
|
classId:
|
|
type: string
|
|
className:
|
|
type: string
|
|
teacherId:
|
|
type: string
|
|
description: 请求:更新班级信息
|
|
class.UpdateClassResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
description: 响应:更新班级信息响应
|
|
course.CourseInfo:
|
|
type: object
|
|
properties:
|
|
courseId:
|
|
type: string
|
|
courseName:
|
|
type: string
|
|
courseDescription:
|
|
type: string
|
|
description: 课程信息
|
|
course.CreateCourseRequest:
|
|
type: object
|
|
properties:
|
|
courseName:
|
|
type: string
|
|
courseDescription:
|
|
type: string
|
|
description: 请求:创建课程
|
|
course.CreateCourseResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
courseId:
|
|
type: string
|
|
description: 响应:创建课程响应
|
|
course.DeleteCourseResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
description: 响应:删除课程响应
|
|
course.GetCourseResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
courseInfo:
|
|
$ref: '#/components/schemas/course.CourseInfo'
|
|
description: 响应:获取课程信息响应
|
|
course.UpdateCourseRequest:
|
|
type: object
|
|
properties:
|
|
courseId:
|
|
type: string
|
|
courseName:
|
|
type: string
|
|
courseDescription:
|
|
type: string
|
|
description: 请求:更新课程信息
|
|
course.UpdateCourseResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
description: 响应:更新课程信息响应
|
|
exam.CreateExamRequest:
|
|
type: object
|
|
properties:
|
|
examName:
|
|
type: string
|
|
examTime:
|
|
type: string
|
|
examContent:
|
|
type: string
|
|
teacherId:
|
|
type: string
|
|
description: 请求:创建考试
|
|
exam.CreateExamResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
examId:
|
|
type: string
|
|
description: 响应:创建考试响应
|
|
exam.DeleteExamResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
description: 响应:删除考试响应
|
|
exam.ExamInfo:
|
|
type: object
|
|
properties:
|
|
examId:
|
|
type: string
|
|
examName:
|
|
type: string
|
|
examTime:
|
|
type: string
|
|
examContent:
|
|
type: string
|
|
teacherId:
|
|
type: string
|
|
description: 考试信息
|
|
exam.GetExamResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
examInfo:
|
|
$ref: '#/components/schemas/exam.ExamInfo'
|
|
description: 响应:获取考试信息响应
|
|
exam.UpdateExamRequest:
|
|
type: object
|
|
properties:
|
|
examId:
|
|
type: string
|
|
examName:
|
|
type: string
|
|
examTime:
|
|
type: string
|
|
examContent:
|
|
type: string
|
|
teacherId:
|
|
type: string
|
|
description: 请求:更新考试信息
|
|
exam.UpdateExamResponse:
|
|
type: object
|
|
properties:
|
|
code:
|
|
type: string
|
|
msg:
|
|
type: string
|
|
description: 响应:更新考试信息响应
|
|
tags:
|
|
- name: ClassService
|
|
description: ClassService 是班级管理服务的 gRPC 接口定义
|
|
- name: CourseService
|
|
description: CourseService 是课程管理服务的 gRPC 接口定义
|
|
- name: ExamService
|
|
description: ExamService 是考试管理服务的 gRPC 接口定义
|
|
- name: Gateway
|
|
- name: UserService
|