This is a very simple archive manager for photos (only CRUD) and it just for refreshing my information about golang.
if you want to take this repository and complete this api you are welcome ^-^
`go get github.com/golang-jwt/jwt/v5 v5.2.1`
`go get github.com/gorilla/mux v1.8.1`
`go get github.com/jmoiron/sqlx v1.3.5`
`go get github.com/lib/pq v1.10.9`
`go get golang.org/x/crypto/bcrypt`
Route | Method | Description | Json body required | Expected Response |
---|---|---|---|---|
'/login' | POST | use it to login user and create serect token | `{"username":"...", "password":"..." }` | 200 ok if user found |
'/adduser' | POST | use it to register a new user | `{"name":"...", "password":"...", "email":"...", "mobile":"...", "password":"...", "permissions":"..." }` | 200 ok |
'/addphoto' | POST | use it to register a new photo | `{"name":"...", "photographer":"...", "tags":"..." }` | 200 ok |
'/addphotographer' | POST | use it to register a new photographer | `{"name":"...", "username":"...", "password":"..." }` | 200 ok |
'/users' | GET | use it to get a list of all users | 200 ok | |
'/users/{id}' | GET | use it to get a specific user by its id | 200 ok | |
'/photos' | GET | use it to get a list of all photos | 200 ok if user found | |
'/photos/{id}' | GET | use it to get a specific photo by its id | 200 ok | |
'/photoographers' | GET | use it to get a list of all photographers data | 200 ok | |
'/photographers/{id}' | GET | use it to get a specific photographer by its id | 200 ok | |
'/deleteuser/{id}' | DELETE | delete user by its id | 401 no content |
This is not public software, so only admins can add new users to the system.