Евгений Колесников hace 3 años
padre
commit
1f9ee197dc
Se han modificado 3 ficheros con 31 adiciones y 5 borrados
  1. 2 0
      articles/f6_demo_1.md
  2. 1 1
      cinema/index.js
  3. 28 4
      cinema/swagger/cinema.yml

+ 2 - 0
articles/f6_demo_1.md

@@ -381,6 +381,8 @@ registrationButton.setOnItemClickListener { parent, view, position, id ->
     * обработка исключений при проверке результата регистрации
 * callback авторизации
     * проверка результата
+    * запоминание токена
+    * переход в основное окно (список фильмов)
     * обработка исключений при проверке результата авторизации
 
 ## Экран авторизации

+ 1 - 1
cinema/index.js

@@ -146,7 +146,7 @@ app.get('/movies', cors(), (req,res)=>{
     if (typeof req.query.filter == 'undefined')
       throw new Error('Filter is required parameter')
 
-    checkAuth(req)
+    // checkAuth(req)
 
     let filtered = movies
       .filter(m => m.filters.includes(req.query.filter))

+ 28 - 4
cinema/swagger/cinema.yml

@@ -25,6 +25,8 @@ tags:
     description: Регистрация и авторизация (получение токена)
   - name: movie
     description: Информация о киноновинках
+  - name: up
+    description: Ресурсы
 
 paths:
   /auth/register:
@@ -128,16 +130,38 @@ paths:
           content:
             application/json:
               schema:
-                $ref: '#/components/schemas/ArrayOfMovies'
+                $ref: '#/components/schemas/Movie'
         '400':
           description: Проблемы при запросе
+  /up/images/{imageName}:
+    get:
+      tags:
+        - up
+      summary: Получение картинки
+      parameters:
+        - in: path
+          name: imageName
+          schema:
+            type: string
+          required: true
+          description: Название картинки (с расширением), полученное при запросе списка фильмов
+      responses:
+        '200':
+          description: Файл картинки в произвольном формате
+          content:
+            image/png:
+              schema:
+                type: string
+                format: binary
+        '404':
+          description: Картинка не найдена на сервере
 components:
   securitySchemes:
     BearerAuth:
       type: http
       scheme: bearer
   schemas:
-    ArrayOfMovies:
+    Movie:
       type: array
       items:
         type: object
@@ -164,10 +188,10 @@ components:
             example: poster.png
             description: Название картинки постера
           tags:
-            $ref: '#/components/schemas/ArrayOfTags'
+            $ref: '#/components/schemas/Tag'
         required:
           - movieId
-    ArrayOfTags:
+    Tag:
       type: array
       items:
         type: object