Advertisement
Guest User

Untitled

a guest
May 17th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 10.15 KB | None | 0 0
  1. swagger: '2.0'
  2. info:
  3.   version: '0.0.1'
  4.   title: 'Abiturient Online mobile API'
  5. host: 'api.abit.herzen.spb.ru'
  6. basePath: /
  7. schemes:
  8.  - https
  9. produces:
  10.  - application/json
  11. consumes:
  12.  - application/json
  13. securityDefinitions:
  14.   token:
  15.     type: apiKey
  16.     in: header
  17.     name: api_key
  18. security:
  19.   - token: []
  20. paths:
  21.  # Authorization
  22.   /login:
  23.     post:
  24.       tags: ['Authorization']
  25.       description: Вход в систему
  26.       parameters:
  27.         - name: auth_data
  28.           in: body
  29.           description: "Логин и пароль"
  30.           required: true
  31.           schema:
  32.             type: object
  33.             properties:
  34.               username:
  35.                 type: string
  36.               password:
  37.                 type: string
  38.       responses:
  39.         200:
  40.           description: Успешный вход в систему
  41.           schema:
  42.             type: object
  43.             properties:
  44.               token:
  45.                 type: string
  46.                 description: Универсальный uuid сессии
  47.         401:
  48.           description: Ошибка при входе
  49.           schema:
  50.             $ref: '#/definitions/Status'
  51.   /logoff:
  52.     get:
  53.       tags: ['Authorization']
  54.       description: Покинуть систему в систему
  55.       responses:
  56.         200:
  57.           description: Успешно покинули систему
  58.           schema:
  59.             $ref: '#/definitions/Status'
  60.   # Dicts
  61.   /grades:
  62.     get:
  63.       tags: ['Dict']
  64.       description: Получить словарь уровней образования (бакалавриват и т.д.)
  65.       responses:
  66.         200:
  67.           description: Получен словарь уровней образования
  68.           schema:
  69.             type: array
  70.             items:
  71.               $ref: '#/definitions/DictItem'
  72.   /forms:
  73.     get:
  74.       tags: ['Dict']
  75.       description: Получить словарь форм образоваения (очная и т.д.)
  76.       responses:
  77.         200:
  78.           description: Получен словарь форм образоваения
  79.           schema:
  80.             type: array
  81.             items:
  82.               $ref: '#/definitions/DictItem'
  83.   /financing:
  84.     get:
  85.       tags: ['Dict']
  86.       description: Получить словарь форм финансирования (бюджет и т.д.)
  87.       responses:
  88.         200:
  89.           description: Получен словарь форм финансирования
  90.           schema:
  91.             type: array
  92.             items:
  93.               $ref: '#/definitions/DictItem'
  94.   /departments:
  95.     get:
  96.       tags: ['Dict']
  97.       description: Получить словарь факультетов (Факультет Информационных Технологий и т.д.)
  98.       responses:
  99.         200:
  100.           description: Получен словарь факультетов
  101.           schema:
  102.             type: array
  103.             items:
  104.               $ref: '#/definitions/DictItem'
  105.   # Competitive group
  106.   /cg/list/{grade}/{department}:
  107.     get:
  108.       tags: ['Competitive Group']
  109.       description: Получить информацию о конкурсных группах для уровня образования и факультета
  110.       parameters:
  111.         - name: grade
  112.           description: id уровня образования из словаря
  113.           in: path
  114.           type: number
  115.           required: true
  116.         - name: department
  117.           description: id факультета из словаря
  118.           in: path
  119.           type: number
  120.           required: true
  121.       responses:
  122.         200:
  123.           description: Получена информация о конкурсных группах
  124.           schema:
  125.             $ref: '#/definitions/FFGroup'
  126.   /cg/get/{cgid}:
  127.     get:
  128.       tags: ['Competitive Group']
  129.       description: Получить информацию о конкурсной группе с данным id
  130.       parameters:
  131.         - name: cgid
  132.           description: id конкурсной группы
  133.           in: path
  134.           type: number
  135.           required: true
  136.       responses:
  137.         200:
  138.           description: Получена информация о конкурсной группе
  139.           schema:
  140.             $ref: '#/definitions/CompetitionGroup'
  141.   # /cg/remove/{cgid}:
  142.   #   get:
  143.   #     parameters:
  144.   #       - name: cgid
  145.   #         description: id конкурсной группы
  146.   #         in: path
  147.   #         type: number
  148.   #         required: true
  149.   #     responses:
  150.   #       200:
  151.   #         description: Удаление выбранной конкурсной группы
  152.   #         schema:
  153.   #           $ref: '#/definitions/Status'
  154.   /applications/{cgid}:
  155.     get:
  156.       tags: ['Application']
  157.       parameters:
  158.         - name: cgid
  159.           description: id конкурсной группы
  160.           in: path
  161.           type: number
  162.           required: true
  163.       responses:
  164.         200:
  165.           description: Список заявлений на поступление для данной конкурсной группы
  166.           schema:
  167.             type: array
  168.             items:
  169.               $ref: '#/definitions/Application'
  170.   /personal_data:
  171.     get:
  172.       description: Запрос информации о текущем авторизованом пользователе
  173.       tags: ['Personal Data']
  174.       responses:
  175.         200:
  176.           description: Выдана информация о текущем пользователе
  177.           schema:
  178.             $ref: '#/definitions/PersonalData'
  179.         404:
  180.           description: Информация текущем пользователе не найдена в источнике
  181.           schema:
  182.             $ref: '#/definitions/Status'
  183. #    post:
  184. #      tags: ['Personal Data']
  185. #      responses:
  186. #        200:
  187. #          description: Данные обновлены
  188. #          schema:
  189. #            $ref: '#/definitions/Status'
  190. definitions:
  191.   DictItem:
  192.     type: object
  193.     properties:
  194.       id:
  195.         type: number
  196.         description: id записи в словоре
  197.       name:
  198.         type: string
  199.         description: Имя записи в словоре
  200.   Application:
  201.     type: object
  202.     properties:
  203.       login:
  204.         type: string
  205.       fio:
  206.         type: string
  207.       score:
  208.         type: number
  209.       # cond:
  210.       #   type: number
  211.       # candidate:
  212.       #   type: boolean
  213.       # status:
  214.       #   type: number
  215.       # same:
  216.       #   type: boolean
  217.       # original:
  218.       #   type: boolean
  219.       # priority:
  220.       #   type: number
  221.       # rating:
  222.       #   type: number
  223.   FFGroup:
  224.     type: array
  225.     items:
  226.       type: object
  227.       properties:
  228.         financing:
  229.           type: number
  230.           description: id формы финансирования
  231.         form:
  232.           type: number
  233.           description: id формы образоваения
  234.         groups:
  235.           type: array
  236.           description: Список конкурсных групп
  237.           items:
  238.             $ref: '#/definitions/CompetitionGroup'
  239.   CompetitionGroup:
  240.     type: object
  241.     properties:
  242.       id:
  243.         type: number
  244.         description: id конкурсной группы
  245.       num:
  246.         type: string
  247.         description: Номер конкурсной группы
  248.       name:
  249.         type: string
  250.         description: Имя конкурсной группы
  251.       profile:
  252.         type: string
  253.         description: Название профиля конкурсной группы
  254.       financing:
  255.         type: number
  256.         description: id формы финансирования
  257.       form:
  258.         type: number
  259.         description: id формы образоваения
  260.   PersonalData:
  261.     type: object
  262.     properties:
  263.      # scenario:
  264.       #   type: string
  265.       # date_issue_document:
  266.       #   type: string
  267.       # need_hostel:
  268.       #   type: string
  269.       # region:
  270.       #   type: string
  271.       # olympiad:
  272.       #   type: boolean
  273.       # phone:
  274.       #   type: string
  275.        gender:
  276.          type: string
  277.       # form_edu:
  278.       #   type: string
  279.       # level_edu:
  280.       #   type: string
  281.       firstname:
  282.         description: Имя абитуриента
  283.         type: string
  284.       middlename:
  285.         description: Отчество абитуриента
  286.         type: string
  287.       lastname:
  288.         description: Фамилия абитуриента
  289.         type: string
  290.       # birthdate:
  291.       #   type: string
  292.       # email:
  293.       #   type: string
  294.       # room:
  295.       #   type: string
  296.       # country:
  297.       #   type: string
  298.       # citizenship:
  299.       #   type: string
  300.       # region_edu:
  301.       #   type: string
  302.       document_type:
  303.         description: Тип документа, удостоверяющего личность
  304.         type: string
  305.       series_document:
  306.         description: Серия документа, удостоверяющего личность
  307.         type: string
  308.       number_document:
  309.         description: Номер документа, удостоверяющего личность
  310.         type: string
  311.       # address:
  312.       #   type: string
  313.       # locality:
  314.       #   type: string
  315.       # year_end_edu:
  316.       #   type: string
  317.       type_document_edu:
  318.         description: Тип документа об образовании
  319.         type: string
  320.       series_document_edu:
  321.         description: Серия документа об образовании
  322.         type: string
  323.       number_document_edu:
  324.         description: Номер документа об образовании
  325.         type: string
  326.       # issued_by_document:
  327.       #   type: string
  328.       # date_issue_document_edu:
  329.       #   type: string
  330.       # honour:
  331.       #   type: string
  332.       # name_edu:
  333.       #   type: string
  334.       # locality_edu:
  335.       #   type: string
  336.       # type_edu:
  337.       #   type: string
  338.   Status:
  339.     type: object
  340.     properties:
  341.       message:
  342.         type: string
  343.       text:
  344.         type: string
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement