Code Monkey home page Code Monkey logo

saipa's Introduction

/authnz/register/ no authorization

Post
    username min 5 max 20 char
    password min 5 max 10 char

example input

    {"username":"saeed1", "password": "123456"}

example output

    {"data": {
        "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjozLCJ1c2VybmFtZSI6InNhZWVkMiIsImV4cCI6MTU4NzU3MjU2NiwiZW1haWwiOiIiLCJvcmlnX2lhdCI6MTU4NDk4MDU2Nn0.-8DZiYaO55fHnJbc9JgyeQ7Tgx16W24soy_BjbrxhY0"
    },
    "message": null,
    "current_time": 1584980566,
    "success": true,
    "index": null,
    "total": null}

/authnz/login/ no authorization

Post
    username min 5 max 20 char
    password min 5 max 10 char

example input

    {"username":"saeed1", "password": "123456"}

example output

    {"data": {
        "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjozLCJ1c2VybmFtZSI6InNhZWVkMiIsImV4cCI6MTU4NzU3MjU2NiwiZW1haWwiOiIiLCJvcmlnX2lhdCI6MTU4NDk4MDU2Nn0.-8DZiYaO55fHnJbc9JgyeQ7Tgx16W24soy_BjbrxhY0"
    },
    "message": null,
    "current_time": 1584980566,
    "success": true,
    "index": null,
    "total": null}

/upload_excel/ need authorization, need superuser access

Post

example input

    {"file": file_upload} in postman use body form-data

example output

    {"data": {},
    "message": null,
    "current_time": 1584980927,
    "success": true,
    "index": null,
    "total": null}

/car/list/ need authorization, need superuser access

Get

    pagination using index=0&size=20
    
example output

    {"data": [
        {
            "name": "Pride 131",
            "total": 2000,
            "total_sold": 1000
        },
        {
            "name": "Pride 132",
            "total": 4000,
            "total_sold": 0
        },
        .
        .
        .
        {
            "name": "212",
            "total": 38000,
            "total_sold": 0
        },
        {
            "name": "213",
            "total": 40000,
            "total_sold": 0
        }
    ],
    "message": null,
    "current_time": 1584980980,
    "success": true,
    "index": 0,
    "total": 32}

/car_stock/list/ need authorization

Get

    pagination using index=0&size=20
   
{"data": [
    {
        "name": "Pride 131",
        "date": "11/10/1398",
        "total": 1000,
        "total_sold": 1000
    },
    {
        "name": "Pride 132",
        "date": "12/10/1398",
        "total": 2000,
        "total_sold": 0
    },
    .
    .
    .
    {
        "name": "212",
        "date": "01/01/1399",
        "total": 19000,
        "total_sold": 0
    },
    {
        "name": "213",
        "date": "01/01/1399",
        "total": 20000,
        "total_sold": 0
    }
],
"message": null,
"current_time": 1584981191,
"success": true,
"index": 0,
"total": 64}

/car/buy/ need authorization

Post
    name car name max 20 min 2
    date "day/month/year" max 10 min 8  convert jalali to georgian, system default is georgian
    count optional int default is 1

example input

    {"name":"Pride 131", "date": "11/10/1398", "count": 10}

example output

    {"data": null,
    "message": "Done",
    "current_time": 1584981662,
    "success": true,
    "index": null,
    "total": null}

JWT Authorization

set in headet

    Authorization: JWT YOUR_JWT_TOKEN

DB SETUP

mysql -h 127.0.0.1 -P 3306 -u root -p  # connect to db

CREATE DATABASE saipa;  # create database
CREATE USER 'saipa'@'%' IDENTIFIED WITH mysql_native_password BY 'saipapass';   # create user and pass
GRANT ALL ON saipa.* TO 'saipa'@'%';    # grant access to database

OR to grant all privileges:

    GRANT ALL PRIVILEGES ON *.* TO 'saipa'@'%';

Locust, Performance testing

locust -f stress_test.py

saipa's People

Contributors

sbabashahi avatar

Stargazers

 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.