Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

TimeSlots is a service that provides a way to schedule appointments.

Notifications You must be signed in to change notification settings

pershin-daniil/backend_schedule_service

Repository files navigation

This project is archived and no longer supported. I made a telegram bot based on this idea, the code of which is available here.

TimeSlots

TimeSlots is a service that provides a way to schedule appointments, managing work schedules, and much more.

Installation

Before getting started, make sure you have Go installed on your machine. Then, execute the following commands:

git clone https://github.com/pershin-daniil/TimeSlots.git
cd TimeSlots
go build

Makefile commands

To start service.

make run

To start linter.

make lint

To start tests.

make integration

API methods description

You can also check swagger doc here.

addUser (POST)

# addUser
curl -X POST 'http://localhost:8080/api/v1/users' \
     -H 'Content-Type: application/json' \
     --data-raw \
'{
  "lastName":"Smith",
  "firstName":"John",
  "phone":"+79998887766",
  "email":"example@mail.com",
  "password":"secret"
}'

Response:

{
  "id":1234,
  "lastName":"Smith",
  "firstName":"John",
  "phone":"+79998887766",
  "email":"example@mail.com",
  "createdAt":"2023-03-14T14:18:27.034721+03:00",
  "updatedAt":"2023-03-14T14:18:27.034721+03:00"
}

login (POST)

# login
curl -X POST 'http://localhost:8080/api/v1/login'\
     -u '[phone]:[password]'
     

Response:

{"token":"eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySUQiOjE2LCJyb2xlIjoiY2xpZW50In0.K-ErDVSjkMSPcsDwKAqzGyWMaIWqDtU9rIYQBNt9zNaLCTB4upJMI-kwyKwvWKzv51WoUfT3r5O5EJT4oHB-F0FHJmvkGxM_GTqGNSCHWWb4pRnY4YJJpwa6t9cTXPhkiXZ8D-IQZEzAsApkk7pmWVtOidLAWc-8upBny1HMaQa6jqDsT__HubGudJHWwT6pvYA4RZgCkkTFS_1kBIKwAHU_29fPF0fvX4E_4m5UsT7ESmdnEUAJaw7QCDS6YmECV9qm1d0R2b5IzTbWHHJNzzqBxWQ4dRu9sxbhH9fFw1zV9SzyVYTJnQ0BLtymdj-l-ZtvRWq8LFOr7j4jZRvbCVFexqlzEzgZFyNcX698S9mrX3lYczodRdqSwrAlS-i4ob_ms-U1szPjT-Y668l9wrRihU7kHpgqNpdvkWZ4b2pfZ-KhusCJCaF_5NMjTSLyOZqjI-LpXBqj-4DP_cjrdFtSkEOewjc7ECQG-RZXKCFBCsIv7AGxdVsp6A8L4rBn"}

getUser (GET)

# getUser
curl -X GET 'http://localhost:8080/api/v1/users/{id}'\
     -H 'Authorization: Bearer
     [token]'

Response:

{
  "id":1234,
  "lastName":"Smith",
  "firstName":"John",
  "phone":"+79998887766",
  "email":"example@mail.com",
  "role":"",
  "createdAt":"2023-03-14T14:18:27.034721+03:00",
  "updatedAt":"2023-03-14T14:18:27.034721+03:00"
}

About

TimeSlots is a service that provides a way to schedule appointments.

Resources

Stars

Watchers

Forks

Languages