Giter Club home page Giter Club logo

pig-market's Introduction

pig_market

Test project for learning Crystal / PostgreSQL.

See installation steps in INSTALL.md

Usage

Use your API_KEY (defined in .env) as a query parameter with all your API queries.

Users

index.cr
List users:

http://localhost:5000/api/users?api_key=any-string

show.cr
User info, addresses and orders (replace 123 with a user id):

http://localhost:5000/api/users/123?api_key=any-string

bonuses.cr
Earned bonuses for a user (replace 123 with a user id):

http://localhost:5000/api/users/123/bonuses?api_key=any-string

delivery_points.cr
Used delivery points for a user (replace 123 with a user id):

http://localhost:5000/api/users/123/delivery_points?api_key=any-string

user_orders.cr
List orders for this user as a customer (replace 123 with a user id):

http://localhost:5000/api/users/123/user_orders?api_key=any-string

store_orders.cr
List orders for this user as a worker of a store (replace 123 with a user id):

http://localhost:5000/api/users/123/store_orders?api_key=any-string

Units

index.cr
List units:

http://localhost:5000/api/units?api_key=any-string

show.cr
What goods are destributed in this unit (package)? Replace 123 with a unit id:

http://localhost:5000/api/units/123?api_key=any-string

Goods

index.cr
List goods:

http://localhost:5000/api/goods?api_key=any-string

show.cr
More info about selected goods (replace 123 with a goods id):

http://localhost:5000/api/goods/123?api_key=any-string

Categories

index.cr
List categories:

http://localhost:5000/api/categories?api_key=any-string

show.cr
List goods in selected category and nested categories (replace 123 with a category id):

http://localhost:5000/api/categories/123?api_key=any-string

User Orders

index.cr
List user orders (for customers, b2c):

http://localhost:5000/api/user_orders?api_key=any-string

show.cr
User order info (replace 123 with an order id):

http://localhost:5000/api/user_orders/123?api_key=any-string

Store Orders

index.cr
List store orders (from stores to stores, b2b):

http://localhost:5000/api/store_orders?api_key=any-string

show.cr
Store order info (replace 123 with an order id):

http://localhost:5000/api/store_orders/123?api_key=any-string

Stores

index.cr
List stores:

http://localhost:5000/api/stores?api_key=any-string

show.cr
Goods in selected store (replace 123 with a store id):

http://localhost:5000/api/stores/123?api_key=any-string

Delivery Points

index.cr
List delivery points:

http://localhost:5000/api/delivery_points?api_key=any-string

Addresses

index.cr
List addresses:

http://localhost:5000/api/addresses?api_key=any-string

show.cr
Address info (replace 123 with an address id):

http://localhost:5000/api/addresses/123?api_key=any-string

pig-market's People

Contributors

crosspath 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.