Skip to content

evgkhm/banner_service

Repository files navigation

Getting started

git clone https://github.com/evgkhm/banner_service
cd banner_service
make run

Schema

Alt-текст

Tests

make test

Start linter

make lint

Postman collection

BANNER.postman_collection

Examples

  1. Активный баннер пользователя
curl -X 'GET' \
'http://localhost:8080/user_banner?tag_id=1&feature_id=1&use_last_revision=true' \
-H 'accept: application/json' \
-H 'token: user_token'
  1. Неактивный баннер пользователя, токен юзера
curl -X 'GET' \
   'http://localhost:8080/user_banner?tag_id=3&feature_id=2&use_last_revision=true' \
   -H 'accept: application/json' \
   -H 'token: user_token'
  1. Неактивный баннер пользователя, токен админа
curl -X 'GET' \
   'http://localhost:8080/user_banner?tag_id=3&feature_id=2&use_last_revision=true' \
   -H 'accept: application/json' \
   -H 'token: admin_token'
  1. Баннер пользователя, прочий токен
curl -X 'GET' \
   'http://localhost:8080/user_banner?tag_id=3&feature_id=2&use_last_revision=true' \
   -H 'accept: application/json' \
   -H 'token: wrong_token'
  1. Получение всех баннеров с фильтрацией по фиче и/или тегу
curl -X 'GET' \
   'http://localhost:8080/banner?feature_id=1&tag_id=3&limit=10&offset=0' \
   -H 'accept: application/json' \
   -H 'token: admin_token'
  1. Создание нового баннера
curl -X 'POST' \
   'http://localhost:8080/banner' \
   -H 'accept: application/json' \
   -H 'token: admin_token' \
   -H 'Content-Type: application/json' \
   -d '{
   "tag_ids": [
   0
   ],
   "feature_id": 0,
   "content": {
   "title": "some_title",
   "text": "some_text",
   "url": "some_url"
   },
   "is_active": true
   }'
  1. Обновление содержимого баннера
curl -X 'PATCH' \
   'http://localhost:8080/banner/3' \
   -H 'accept: */*' \
   -H 'token: admin_token' \
   -H 'Content-Type: application/json' \
   -d '{
   "tag_ids": [
   10
   ],
   "feature_id": 10,
   "content": {
   "title": "some_title",
   "text": "some_text",
   "url": "some_url"
   },
   "is_active": true
   }'
  1. Удаление баннера по идентификатору
curl -X 'DELETE' \
  'http://localhost:8080/banner/3' \
  -H 'accept: */*' \
  -H 'token: admin_token'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages