- .NET 8.0
- Visual Studio Code (or Visual Studio)
- C# Dev Kit extension(if you are using Visual Studio Code)
- PostgreSQL database
-
Clone the project
git clone [email protected]:sanka-fidenz/CustomerDataAPI.git
-
Create a database
-
Open using Visual Studio Code(it will automatically install packages)
-
Change the
ConnectionStrings.DefaultConnection
value inappsettings.json
with you DB ConnectionStrings -
Create initial table of database(run migrations)
dotnet ef database update
-
Build application
dotnet run
To test end points a JWT token is required. To generate a token, make POST
request to https://localhost:<port>/authenticate
with following payload (change the port number with the port number your application runs).
{
"username": "username",
"password": "password"
}
-
GET
Search customerhttp://localhost:5134/users?key=<searchKey>
-
GET
Get distancehttp://localhost:5134/users/<customerId>/get-distance?latitude=<latitude>&longitude=<longitude>
-
GET
Get customer list grouped by the zip codehttp://localhost:5134/users-group-by-zip-code
-
PUT
Edit customerhttp://localhost:5134/users/<customerId>
# payload
{
"name": "sanka"
}