Git Product home page Git Product logo

bell_study's Introduction

Sber study project

REST-service that provides a set of operations for getting, saving, updating organizations, offices, and users' objects. It uses only two Http methods GET and POST.

The web service provides support queries to get the list citizenship with the name of the country and its code, as well as to get a list of document types with the name of the document and its code. To run that application it is required to have Java 11.


API description

  • How to start the application
  • How to send requests
  • Referencebook-related queries
  • Organization-related queries
  • Office-related queries
  • User-related queries

The descriptions below shows the usage of POSTMAN app as a client app that makes requests.


How to start the application

  • The application can be launched through IDE (like Intellij IDEA). Just download the repository and launch pom.xml as a project

How to send requests

  • For GET-requests, the address bar is enough. Example: http://localhost:8888/user/1
  • For POST-requests, you may want to use POSTMAN or something similar. It is essential to write the body of the request in an acceptable format.

Referencebook-related queries

Referencebook-related request to get a list of countries and their codes.

An example of a request to get a list of citizenship: request countries

To request a list of document types just use that link: http://localhost:8888/docs

As a response you will receive Json formatted output:

{
    "data": [
        {
            "name": "Russian federation",
            "code": "001"
        },
        {
            "name": "Ukraine",
            "code": "002"
        },
        {
            "name": "USA",
            "code": "003"
        },
        {
            "name": "UK",
            "code": "004"
        }
    ]
}

Organization-related queries

There are four allowed queries:

Almost the same as for list of organizations but you can write some more parameters into the body request. Example:

{
    "id": "1",
    "name": "TheBestBankEver",
    "fullName": "LLC TheBestBankEver ",
    "inn": "1111111",
    "kpp": "55555",
    "address": "Moscow, Green street, 4",
    "phone": "4959999999",
    "isActive": "true"
}

Attention, it is mandatory to write parameters into body request. At least a request must have parameter "id", "name", "fullName", "inn", "kpp", "address".

As a response you will receive Json formatted output:

{
    "data": {
        "result": "success"
    }
}

Almost the same as for an update organizations request but body parameters slightly different. Example:

{
    "name": "NotSoBestBankEver",
    "fullName": "LLC NotSoBestBankEver",
    "inn": "99999",
    "kpp": "5555",
    "address": "Moscow, Noname street, 99",
    "phone": "4956666666",
    "isActive": "false"
}

Attention, it is mandatory to write parameters into body request. At least a request must have parameter "name", "fullName", "kpp", "kpp", "address".

As a response you will receive Json formatted output:

{
    "data": {
        "result": "success"
    }
}

You can simply put that link into your browser and you will receive Json formatted output:

{
    "data": {
        "id": "2",
        "name": "Secondbank",
        "fullName": "LLC_Second_bank ",
        "inn": "0987654321",
        "kpp": "123456789",
        "address": "Boston, Green street, 4",
        "phone": "9897785432",
        "isActive": "true"
    }
}

Office-related queries

There are four allowed queries:

Almost the same as for list of offices but you can write some more parameters into body request. Example:

{
    "id": "1",
    "name": "UpdatedBank",
    "address": "Moscow, Red square, 1",
    "phone": "849911111",
    "isActive": "true"
}

Attention, it is mandatory to write parameters into body requests. At least a request must have parameter "id", "name", "address".

As a response you will receive Json formatted output:

{
    "data": {
        "result": "success"
    }
}

Almost the same as for update an office but body parameters slightly different. Example:

{
    "orgId": "1",
    "name": "OneMoreOffice",
    "address": "Moscow, Banana square, 1",
    "phone": "84999944",
    "isActive": "true"
}

Attention, it is mandatory to write parameters into body requests. At least a request must have the parameter "orgId".

As a response you will receive Json formatted output:

{
    "data": {
        "result": "success"
    }
}

You can simply put that link into your browser and you will receive Json formatted output:

{
    "data": {
        "id": "1",
        "name": "Head_office",
        "address": "Boston, Blue street, 5",
        "phone": "4959999958",
        "isActive": "true"
    }
}

User-related queries

There are four allowed queries:

Almost the same as for a list of user request but you can write some more parameters into the body request. Example:

{ 
  "id" : 4,
  "officeId":"01",
  "firstName":"newName",
  "secondName": "newSecondName",
  "middleName": "newMiddleName",
  "position": "Cgreat position",
  "phone": "899901200",
  "docName":"Passport",
  "docNumber":"77-33",
  "docDate":"2020-01-01",
  "citizenshipCode":"002",
  "isIdentified":true 
}

Attention, it is mandatory to write parameters into body requests. At least a request must have parameter "id", "firstName", "position".

As a response you will receive Json formatted output:

{
    "data": {
        "result": "success"
    }
}

Almost the same as for update an office but body parameters slightly different. Example:

{
    "officeId" : 3,
    "firstName": "Alex",
    "secondName": "Black",
    "middleName": "j",
    "position": "CIO",
    "phone" : "8495396363",
    "docCode" : "02",
    "docName" : "Passport",
    "docNumber" : "773-777",
    "docDate" : "2012-01-25",
    "citizenshipCode" : "001",
    "isIdentified" : false
}

Attention, it is mandatory to write parameters into body requests. At least a request must have parameter "officeId", "firstName", "position".

As a response you will receive Json formatted output:

{
    "data": {
        "result": "success"
    }
}

You can simply put that link into your browser and you will receive Json formatted output:

{
    "data": {
        "id": "1",
        "firstName": "Alexander",
        "secondName": "Vinogradov",
        "middleName": "Dmitrievich",
        "position": "CIO",
        "phone": "9999453378",
        "docName": "Passport",
        "docNumber": "778-887",
        "docDate": "2007-01-01",
        "citizenshipName": "Russian federation",
        "citizenshipCode": "001",
        "isIdentified": "true"
    }
}

bell_study's People

Contributors

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