Giter Club home page Giter Club logo

shop_service_prototype's Introduction

Application start

python -m venv env && source env/bin/activate
pip install -r requirements.txt

docker run --rm -d -p 127.0.0.1:27017:27017 --name shop-service mongo

python -m app

Tests (httpie/curl)

create product

http post localhost:13031/product \
product_id="000000000001" name="AMD Ryzen 9 3900X" \
params:='[{"core": 12}, {"L3": 64}]'
curl localhost:13031/product --request POST \
--data '{"product_id": "000000000001", "name": "AMD Ryzen 9 3900X",
"params": [{"core": 12}, {"L3": 64}]}'

find product by parameter

http get localhost:13031/products params:='{"core": 12}'
curl localhost:13031/products --request GET --data '{"params": {"core": 12}}'

find product by barcode value

http get localhost:13031/products product_id="000000000001"
curl localhost:13031/product --request GET --data '{"product_id": "000000000001"}'

multifilter

http get localhost:13031/products \
name="ryzen" params:='{"core": 6, "thread": 12}'
curl localhost:13031/products --request GET \
--data '{"name": "ryzen", "params": {"core": 6, "thread": 12}}'
[
    {
        "description": "Empty",
        "id": "5ee6883326d3f39b1c16e50d",
        "name": "AMD Ryzen 5 3600",
        "params": [
            {
                "core": 6
            },
            {
                "thread": 12
            },
            {
                "speed": 3.6
            },
            {
                "L3": 32
            }
        ],
        "product_id": "1234567891233"
    },
    {
        "description": "Сокет SocketAM4, ядро Pinnacle Ridge, ядер — 6, потоков — 12...",
        "id": "5ee6883326d3f39b1c16e50c",
        "name": "AMD Ryzen 5 2600",
        "params": [
            {
                "core": 6
            },
            {
                "thread": 12
            },
            {
                "speed": 3.4
            }
        ],
        "product_id": "123456789123"
    }
]

shop_service_prototype's People

Contributors

maratuska avatar

Watchers

 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.