Giter Site home page Giter Site logo

drf_apis_for_trainers's Introduction

DRF API for trainers.

Install.

Clone project:

git clone https://github.com/AxmetES/DRF_apis_for_trainers.git

create docker image:

docker build -t my-django-app .

create and run container:

docker run -d -p 8000:8000 --name my-django-container my-django-app

swagger:

http://127.0.0.1:8000/swagger/

get start.

requests:

GET______________________

gyms list API by trainer, user should be login. work only for trainers GROUP.

GET request:
http://127.0.0.1:8000/trainerapi/getgymlist/

response:

[
  {
    "name": "Iron Man",
    "address": "Orynbor 10"
  },
  {
    "name": "Genesice",
    "address": "Москва, пл. Киевского Вокзала, 2"
  }
]

GET______________________

all programs by trainer or client, depends on login.

GET request:
http://127.0.0.1:8000/trainerapi/getprogramlist/

response:

[
  {
    "id": 11,
    "client": {
      "first_name": "Хосэ"
    },
    "trainer": {
      "first_name": "Баур"
    },
    "gym": {
      "name": "Gold Gym",
      "address": "Сабыр Ракымова 12"
    },
    "start_at": "2024-04-07T11:00:00Z",
    "end_at": "2024-04-07T12:00:00Z"
  },
  {
    "id": 12,
    "client": {
      "first_name": "Хосэ"
    },
    "trainer": {
      "first_name": "Баур"
    },
    "gym": {
      "name": "Gold Gym",
      "address": "Сабыр Ракымова 12"
    },
    "start_at": "2024-04-07T11:00:00Z",
    "end_at": "2024-04-07T12:00:00Z"
  }
]

GET______________________

all programs by trainer or client, depends on login.

GET request:
http://127.0.0.1:8000/trainerapi/getschedulelist/

response:

[
  {
    "trainer": "Баур",
    "gym_address": "Iron Man Orynbor 10",
    "start_at": "2024-04-04T10:00:00Z",
    "end_at": "2024-04-04T11:00:00Z"
  },
  {
    "trainer": "Баур",
    "gym_address": "Genesice Москва, пл. Киевского Вокзала, 2",
    "start_at": "2024-04-04T11:00:00Z",
    "end_at": "2024-04-04T12:00:00Z"
  },
  {
    "trainer": "Баур",
    "gym_address": "Gold Gym Сабыр Ракымова 12",
    "start_at": "2024-04-04T11:40:00Z",
    "end_at": "2024-04-04T13:00:00Z"
  }
]

POST______________________

all programs by trainer or client, depends on login.

POST request:
http://127.0.0.1:8000/trainerapi/makeprogram/

body:

{
    "client_email": "[email protected]",
    "date": "07.04.2024",
    "start_time": "11:00:00",
    "end_time": "12:00:00",
    "gym": "Gold Gym",
    "trainer_email": "[email protected]"
}

response:

{
  "id": 21,
  "client": {
    "first_name": "Хосэ"
  },
  "trainer": {
    "first_name": "Баур"
  },
  "gym": {
    "name": "Gold Gym",
    "address": "Сабыр Ракымова 12"
  },
  "start_at": "2024-04-07T11:00:00Z",
  "end_at": "2024-04-07T12:00:00Z"
}

drf_apis_for_trainers's People

Contributors

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