Giter Club home page Giter Club logo

backend_liv2train_awanish_kumar_singh's Introduction

Backend_Liv2Train_Awanish_Kumar_singh

  • This is a repo for the purpose of the assignment given for the internship for the role of the backend developer role.

Post mapping url for the addition of the training center.

  • localhost:9001/center/

  • method : POST

  • input :

{

"centerName":"Narayan",
"centerCode":"O5Jpdsewj54a",
"address":{


    "detailAddress":"GOriakothi",
    "city":"Gopalganj",
    "state":"Bihar",
    "pinCode":"840435"
    
    
},


"studentCapacity":450,
"courses":["EE","SC","ssc"],
"contactEmail":"[email protected]",
"contactPhone":"9414253672"

}


output :

  • case 1 : when failed to load due to some error:

{

"timestamp": "2021-09-05T18:02:35.325+00:00",
"status": 404,
"error": "Not Found",

"message": "Validation failed for object='trainingCenter'. Error count: 1",
"errors":

[
    {
    
    
        "codes": [
            "Email.trainingCenter.contactEmail",
            "Email.contactEmail",
            "Email.java.lang.String",
            "Email"
        ],
        
        
        "arguments": [
            {
                "codes": [
                    "trainingCenter.contactEmail",
                    "contactEmail"
                ],
                "arguments": null,
                "defaultMessage": "contactEmail",
                "code": "contactEmail"
            },
            
            
            [],
            {
                "arguments": null,
                "defaultMessage": ".*",
                "codes": [
                    ".*"
                ]
            }
        ],
        
        
        "defaultMessage": "Email should be valid!!",
        "objectName": "trainingCenter",
        "field": "contactEmail",
        "rejectedValue": "ansih.com",
        "bindingFailure": false,
        "code": "Email"
    }
],


"path": "/center/"

}


case 2: when successfully saved in the database. {

"status": 0,
"result": {
    "id": 4,
    "centerName": "Narayan",
    "centerCode": "O5Jpdsewj54a",
    "address":
    
    {
        "detailAddress": "GOriakothi",
        "city": "Gopalganj",
        "state": "Bihar",
        "pinCode": "840435"
    },
    
    
    "studentCapacity": 450,
    "courses": [
        "EE",
        "SC",
        "ssc"
    ],
    
    
    "date": "2021-09-05T17:54:12.827+00:00",
    "contactEmail": "[email protected]",
    "contactPhone": "9414253672"
    
    
}

}


Api for the getting of the list of the saved centers

  • url : localhost:9001/center/
  • method : GET

Output: case 1: when there are some elements in the db.

{ "status": 0,

"result": [
    {
    
        "id": 1,
        "centerName": "new",
        "centerCode": "4578dsewj54a",
        "address": {
        
            "detailAddress": "vilage",
            "city": "siwan",
            "state": "bihar",
            "pinCode": "841434"
        },
        
        
        "studentCapacity": 20,
        "courses": [
            "awa",
            "man",
            "cse"
        ],
        
        
        "date": "2021-09-05T17:47:25.693+00:00",
        "contactEmail": "[email protected]",
        "contactPhone": "8414253652"
    },
    
    
    {
        "id": 2,
        "centerName": "DPS",
        "centerCode": "O57pdsewj54a",
        "address": {
            "detailAddress": "Mirjapur",
            "city": "Siwan",
            "state": "Bihar",
            "pinCode": "841435"
        },
        
        
        "studentCapacity": 20,
        "courses": [
            "ME",
            "SCE",
            "civil"
        ],
        
        
        "date": "2021-09-05T17:49:34.402+00:00",
        "contactEmail": "[email protected]",
        "contactPhone": "8414253672"
    },
    
    
    {
        "id": 3,
        "centerName": "DPS",
        "centerCode": "O57pdsewj54a",
        "address": {
            "detailAddress": "Mirjapur",
            "city": "Siwan",
            "state": "Bihar",
            "pinCode": "841435"
        },
        
        
        "studentCapacity": 20,
        "courses": [
            "ME",
            "SCE",
            "civil"
        ],
        
        
        "date": "2021-09-05T17:49:55.726+00:00",
        "contactEmail": "[email protected]",
        "contactPhone": "8414253672"
    },
    
    {
        "id": 4,
        "centerName": "Narayan",
        "centerCode": "O5Jpdsewj54a",
        "address": {
            "detailAddress": "GOriakothi",
            "city": "Gopalganj",
            "state": "Bihar",
            "pinCode": "840435"
        },
        
        
        "studentCapacity": 450,
        "courses": [
            "EE",
            "SC",
            "ssc"
        ],
        
        
        "date": "2021-09-05T17:54:12.827+00:00",
        "contactEmail": "[email protected]",
        "contactPhone": "9414253672"
        
        
    }
    
    
]

}


case 2: when there is no element in the db.

{

"status":0,
"result":[]

}

backend_liv2train_awanish_kumar_singh's People

Contributors

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