Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

BC Java - Assignment 11 - JSON

Status Java IntelliJ IDEA

Requirements

Question 1: Phân tích JSON và viết API trả ra JSON với giao diện tương ứng cho FE

  • Requirement: UI for question 1

  • Solution: Full source: Question 1

  • API: http://localhost:8080/q1/products

  • Response:

    [
        {
            "discount": 0.27,
            "id": "camera-1",
            "name": "Camera IP 360 Độ 3MP IMOU TA32CP-L",
            "originalPrice": 650000,
            "price": 474500,
            "rating": 4.9,
            "sold": 142900,
            "thumbnail": "https://image-camera-1.png"
        },
        {
            "discount": 0.2,
            "id": "camera-2",
            "name": "Camera IP 360 Độ 2MP TP-Link Tapo C200C",
            "originalPrice": 490000,
            "price": 392000,
            "rating": 5,
            "sold": 264000,
            "thumbnail": "https://image-camera-2.png"
        }
    ]

Question 2: Hãy phân tích JSON cho giao diện sau và viết API trả ra JSON đã phân tích

  • Requirement: UI for question 2

  • Solution: Full source: Question 2

  • API: http://localhost:8080/q2/products/phone-1

  • Response:

    {
        "discount": 0.2,
        "id": "phone-1",
        "images": [
            "https://phone-1-image-1.jpg",
            "https://phone-1-image-2.jpg",
            "https://phone-1-image-3.jpg"
        ],
        "name": "Điện thoại TECNO Pova 6 - RAM 8+8GB - 256GB",
        "originalPrice": 5430000,
        "price": 4344000,
        "rating": 4.9,
        "thumbnail": "https://phone-1.jpg",
        "versions": [
            {
                "id": "phone-1-v-1",
                "name": "Gray",
                "originalPrice": 5250000,
                "thumbnail": "https://phone-1-version-1.jpg"
            }
        ]
    }

Prerequisites

Project Structure

./
│   .gitattributes
│   .gitignore
│   mvnw
│   mvnw.cmd
│   pom.xml
│   README.md
│
├───.mvn
│   └───wrapper
│           maven-wrapper.properties
│
├───assets
│
└───src
    └───main
        ├───java
        │   └───com
        │       └───cybersoft
        │           └───json
        │               │   SubmitBcJava11JsonApplication.java
        │               │
        │               ├───q1
        │               │   ├───controller
        │               │   ├───dto
        │               │   ├───model
        │               │   ├───repository
        │               │   └───service
        │               │
        │               └───q2
        │                   ├───controller
        │                   ├───dto
        │                   ├───model
        │                   ├───repository
        │                   └───service
        │
        └───resources
            └───application.properties

Environment

  • IDE: IntelliJ
  • Java 21

Author

Khang Nguyen

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages