Browse Source

usecase

master
esoe 2 weeks ago
parent
commit
d6c47b3685
  1. 103
      docs/usecase.puml
  2. 17
      main/api-swagger/components.yaml
  3. 10
      main/api-swagger/main.yaml
  4. 45
      main/api-swagger/organizations.yaml
  5. 31
      main/api-swagger/paths/api.v1.accounts.yaml
  6. 31
      main/api-swagger/paths/api.v1.organizations.yaml
  7. 38
      main/api-swagger/paths/api.v1.positions.yaml
  8. 7
      main/api-swagger/paths/hello.yaml
  9. 50
      main/api-swagger/positions.yml

103
docs/usecase.puml

@ -7,11 +7,22 @@ note top of admin : Администратор учебного центра (з
actor "Монитор" as monitor actor "Монитор" as monitor
note top of monitor : Заказчик, проверяющий результаты обучений и тестирований note top of monitor : Заказчик, проверяющий результаты обучений и тестирований
rectangle exam-service { ' rectangle exam-service {
usecase "Создание курса" as courseCreate usecase "Создание курса" as courseCreate
usecase "Создание теста" as testCreate usecase "Создание теста" as testCreate
usecase "Создание вопроса" as questionCreate
usecase "Создание ответа" as answerCreate
usecase "Создание темы" as themeCreate
usecase "Создание структуры курса" as schemeCreate
usecase "Оформление содержимого курса" as courseEdit
courseCreate <-- admin courseCreate <-- admin
testCreate <-- admin testCreate <-- admin
questionCreate <-- admin
answerCreate <-- admin
schemeCreate <-- admin
themeCreate <-- admin
courseEdit <-- admin
usecase "Назначение задания" as target usecase "Назначение задания" as target
target <-- admin target <-- admin
@ -20,19 +31,19 @@ rectangle exam-service {
monitor --> resultsView monitor --> resultsView
usecase "Авторизация" as auth usecase "Авторизация" as auth
rectangle "Авторизация" as examServiceAuth { ' rectangle "Авторизация" as examServiceAuth {
usecase "Внесение сведений об организации" as organization usecase "Внесение сведений об организации" as organization
usecase "Внесение сведений о должности" as position usecase "Внесение сведений о должности" as position
usecase "внесение кода действующей учетной записи" as code35 usecase "внесение кода действующей учетной записи" as code35
auth ..> organization auth ..> organization
auth ..> position auth ..> position
auth ..> code35 auth ..> code35
} ' }
usecase "Просмотр перечня доступных курсов" as task usecase "Просмотр перечня доступных курсов" as task
usecase "Просмотр статусов о прохождении курса" as status usecase "Просмотр статусов о прохождении курса" as status
usecase "Изучение контента курса" as learn usecase "Изучение контента курса" as learn
rectangle "Обучение" as examServiceLearn { ' rectangle "Обучение" as examServiceLearn {
usecase "Просмотр текста" as text usecase "Просмотр текста" as text
usecase "Скачивание документов" as doc usecase "Скачивание документов" as doc
usecase "Просмотр изображений" as image usecase "Просмотр изображений" as image
@ -42,14 +53,19 @@ rectangle exam-service {
learn ..> image learn ..> image
learn ..> video learn ..> video
text <.. courseCreate ' text <.. courseCreate
doc <.. courseCreate ' doc <.. courseCreate
image <.. courseCreate ' image <.. courseCreate
video <.. courseCreate ' video <.. courseCreate
} ' }
text <.. courseEdit
doc <.. courseEdit
image <.. courseEdit
video <.. courseEdit
usecase "Прохождение проверки знаний" as test usecase "Прохождение проверки знаний" as test
rectangle "Проверка знаний" as examServiceTest { ' rectangle "Проверка знаний" as examServiceTest {
usecase "Просмотр вопросов и доступных ответов" as quiz usecase "Просмотр вопросов и доступных ответов" as quiz
usecase "Выбор ответов" as answer usecase "Выбор ответов" as answer
usecase "Отправка ответов в базу" as postAttampt usecase "Отправка ответов в базу" as postAttampt
@ -57,10 +73,10 @@ rectangle exam-service {
test ..> answer test ..> answer
test ..> postAttampt test ..> postAttampt
quiz <.. testCreate ' quiz <.. testCreate
answer <.. testCreate ' answer <.. testCreate
postAttampt <.. testCreate ' postAttampt <.. testCreate
} ' }
user --> auth user --> auth
user --> task user --> task
@ -69,9 +85,62 @@ rectangle exam-service {
user --> status user --> status
monitor --> status monitor --> status
examServiceTest <.. target usecase "Актуализация перечня организаций" as organizationsActuator
examServiceLearn <.. target usecase "Актуализация перечня должностей" as positionsActuator
target <-- organizationsActuator
target <-- positionsActuator
organizationsActuator <-- admin
positionsActuator <-- admin
rectangle "API" as api #Pink {
usecase "/organizations" as organizations
usecase "/positions" as positions
usecase "/accounts" as accounts
usecase "/targets" as targets
usecase "/courses" as courses
usecase "/schemes" as schemes
usecase "/themes" as themes
usecase "/questions" as questions
usecase "/answers" as answers
usecase "/quizes" as quizes
usecase "/results" as results
}
organization <.. organizations
position <.. positions
code35 <.. accounts
targets <.. target
task <.. targets
status <.. results
resultsView <.. results
quizes <.. testCreate
target <.. testCreate
target <.. courseCreate
courses <.. courseCreate
themes <.. themeCreate
schemes <.. schemeCreate
quiz <.. quizes
questions <.. questionCreate
answers <.. answerCreate
status <.. accounts
' results <.. accounts
' targets <-- courses
organizations <.. organizationsActuator
positions <.. positionsActuator
@ -80,6 +149,6 @@ rectangle exam-service {
} ' }
@enduml @enduml

17
main/api-swagger/components.yaml

@ -26,3 +26,20 @@ components:
type: integer type: integer
name: name:
type: string type: string
accounts:
type: object
required:
- id
- code
- position
properties:
id:
type: integer
code:
type: string
position:
type: object
properties:
id:
type: integer

10
main/api-swagger/main.yaml

@ -6,4 +6,14 @@ info:
version: '1.0' version: '1.0'
servers: servers:
- url: http://localhost:100 - url: http://localhost:100
paths:
/hello:
$ref: "./paths/hello.yaml#/paths/hello"
/api/v1/positions:
$ref: "./paths/api.v1.positions.yaml#/paths/api.v1.positions"
/api/v1/organizations:
$ref: "./paths/api.v1.organizations.yaml#/paths/api.v1.organizations"
/api/v1/accounts:
$ref: "./paths/api.v1.accounts.yaml#/paths/api.v1.accounts"

45
main/api-swagger/organizations.yaml

@ -1,45 +0,0 @@
openapi: '3.0.3'
info:
title: exam-api
description: API for exam
termsOfService: 'http://localhost:100/hello'
version: '1.0'
servers:
- url: http://localhost:100
paths:
/hello:
get:
responses:
'200':
description: OK
/api/v1/organizations:
get:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "./components.yaml#/components/schemas/organization"
description: Get all organizations
post:
summary: repo.createOrganization() Возвращает полный список организаци в базе
description: Создание новой должности
requestBody:
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "./components.yaml#/components/schemas/organization"

31
main/api-swagger/paths/api.v1.accounts.yaml

@ -0,0 +1,31 @@
paths:
api.v1.accounts:
get:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "../components.yaml#/components/schemas/accounts"
description: Получение перечня аккаунтов
post:
summary: repo.createAccount() Создание нового аккаунта.
description: Предварительно должны быть созданы организации и должности
requestBody:
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "../components.yaml#/components/schemas/accounts"

31
main/api-swagger/paths/api.v1.organizations.yaml

@ -0,0 +1,31 @@
paths:
api.v1.organizations:
get:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "../components.yaml#/components/schemas/organization"
description: Get all organizations
post:
summary: repo.createOrganization() Создает в базе запись о новой организации
description: Предварительных требований не предусмотрено
requestBody:
content:
application/json:
schema:
type: object
required:
- name
properties:
name:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "../components.yaml#/components/schemas/organization"

38
main/api-swagger/paths/api.v1.positions.yaml

@ -0,0 +1,38 @@
paths:
api.v1.positions:
get:
summary: repo.find() Возвращает полный список должностей
description: Для разных организаций должности могут повторяться. Предусмотреть пагинацию при получении должностей, список может быть огромным
responses:
'200':
description: Получение списка должностей
content:
application/json:
schema:
$ref: "../components.yaml#/components/schemas/position"
post:
summary: repo.create() Создает в базе запись о новой должности
description: Предварительно должна существовать организация. Должность привязываетс для каждой организации, для разных организаций должности могут повторяться.
requestBody:
content:
application/json:
schema:
type: object
required:
- name
- organization
properties:
name:
type: string
organization:
type: object
properties:
id:
type: integer
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "../components.yaml#/components/schemas/position"

7
main/api-swagger/paths/hello.yaml

@ -0,0 +1,7 @@
paths:
hello:
summary: Возвращает текущую страницу описания сервиса
get:
responses:
'200':
description: Справка по структуре приложения hello/main.md

50
main/api-swagger/positions.yml

@ -1,50 +0,0 @@
openapi: '3.0.3'
info:
title: exam-api
description: API for exam
termsOfService: 'http://localhost:100/hello'
version: '1.0'
servers:
- url: http://localhost:100
paths:
/hello:
get:
responses:
'200':
description: OK
/api/v1/positions:
get:
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "./components.yaml#/components/schemas/position"
description: Get all positions
post:
summary: repo.create() Возвращает полный список должностей в базе
description: Создание новой должности
requestBody:
content:
application/json:
schema:
type: object
required:
- name
- organization
properties:
name:
type: string
organization:
type: object
properties:
id:
type: integer
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "./components.yaml#/components/schemas/position"
Loading…
Cancel
Save