REST Web-Service responsible of maintaining a database of mobile numbers, that are assigned to clients, along with some related information.
Swagger OAS 3 definition of the designed / implemented API is located in the SWAGGER Folder
in the root of the application
- Install mysql
- Replace the connection string in the application.yaml file as well as the credentials to the installed mysql database credentials
spring:
datasource:
url: jdbc:mysql://localhost:3306/databasename?useUnicode=true&characterEncoding=utf8&useSSL=false
username: username
password: password
- Run project as spring boot project
All requests and response are sent via JSON
.
Base Access URL
http://localhost:8087/api
- Create Mobile Subscribers
POST /saveMobileSubscriber
Request:
{
"msisdn": "4343kolo",
"customerIdOwner": 1,
"customerIdUser": 1,
"serviceType": "MOBILE_PREPAID"
}
Response:
{
"id": 27,
"msisdn": "4787765678733",
"customerIdOwner": 1,
"customerIdUser": 1,
"serviceType": "MOBILE_PREPAID",
"serviceStartDate": "2021-04-20T17:49:45.3753744Z"
}
- Get all mobile scribers
GET /getMobileSubscribers
Response:
[
{
"id": 1,
"msisdn": "233244988371",
"customerIdOwner": 1,
"customerIdUser": 1,
"serviceType": "MOBILE_PREPAID",
"serviceStartDate": "2021-03-26T14:14:31Z"
}
]
- Get mobile numbers of mobile subscribers
GET /getMobileNumbers
Response:
[
"233244988371",
"234255986372"
]
- Get Mobile Subscribers matching search criteria
GET /getMobileSubscribers/{search}
Response:
[
{
"id": 27,
"msisdn": "4787765678733",
"customerIdOwner": 1,
"customerIdUser": 1,
"serviceType": "MOBILE_PREPAID",
"serviceStartDate": "2021-04-20T17:49:45Z"
}
]
- Get Mobile numbers matching search criteria
GET /getMobileNumbers/{search}
Response:
[
"4787765678733"
]
- Update mobile number plan, assign different owners or users
PUT /updateMobileSubscriber
Request:
{
"msisdn": "4787765678733",
"customerIdOwner": 2,
"customerIdUser": 2,
"serviceType": "MOBILE_POSTPAID"
}
Response:
{
"id": 27,
"msisdn": "4787765678733",
"customerIdOwner": 2,
"customerIdUser": 2,
"serviceType": "MOBILE_POSTPAID",
"serviceStartDate": "2021-04-20T17:59:48.456043Z"
}
- Delete Mobile Subscriber
DELETE /deleteSubscriber/{mobilenumber}
Response:
HTTP/1.1 200 OK
Date: Thu, 24 Feb 2011 12:36:31 GMT
Status: 200 OK