Coder Social home page Coder Social logo

banner_service's Introduction

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'

banner_service's People

Contributors

evgkhm avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.