Ưu đãi trong tuần: Nhập mã UD50 giảm 50k cho đơn từ 300k!
Trang chủ
Menu

Build RESTFUL APIs using Kotlin and Spring Boot

Xây dựng RESTFUL APIs với Kotlin và Spring Boot

Xây dựng RESTFUL APIs với Kotlin và Spring Boot

Phương pháp thực hành toàn diện để học ngôn ngữ Kotlin và xây dựng Restful APIs bằng Kotlin SpringBoot.

4.5
(1,397 đánh giá)
9,452 học viên
Giảng viên
Pragmatic Code School
Phụ đề Việt chất lượng cao Phụ đề tiếng Anh Bán chạy Đánh giá cao
50.000đ 399.000đ -87%
✓ Xem giỏ hàng và thanh toán
Bao gồm phụ đề tiếng Việt, tiếng Anh
8.5 giờ video
93 bài giảng
Truy cập vĩnh viễn
Học trên mọi thiết bị
Cập nhật: 30/05/2026

Bạn sẽ học được gì

Ngôn ngữ lập trình Kotlin và những lợi ích của nó
Viết mã bằng ngôn ngữ lập trình Kotlin
Xây dựng ứng dụng bằng Kotlin
Xây dựng RestFul Services với SpringBoot và Kotlin
Kiểm thử Kotlin bằng JUnit5
Khả năng tương tác giữa Kotlin và Java
Tích hợp Spring Data JPA với Kotlin
Kiểm thử tích hợp tầng cơ sở dữ liệu bằng TestContainers & JUnit5
Kiểm thử đơn vị các lệnh gọi hàm bằng thư viện Mockk

Yêu cầu

Yêu cầu Java 11 trở lên
Có kinh nghiệm làm việc với bất kỳ IDE nào (Intellij, Eclipse)
Có kinh nghiệm làm việc với Java
Có kinh nghiệm xây dựng ứng dụng bằng SpringBoot
Bắt buộc có kinh nghiệm với công cụ Build Gradle hoặc Maven

Đối tượng phù hợp

Dành cho lập trình viên muốn học ngôn ngữ lập trình Kotlin
Dành cho lập trình viên muốn xây dựng ứng dụng bằng Kotlin và SpringBoot
Dành cho lập trình viên Java muốn học ngôn ngữ lập trình Kotlin

Nội dung khóa học

21 phần • 93 bài giảng
1 Giới thiệu khóa học
2 Điều kiện tiên quyết
1 Slide bài giảng
2 Mã nguồn
1 Giới thiệu về Kotlin
2 Kotlin hoạt động với JVM như thế nào?
1 Thiết lập dự án
2 Hello Kotlin!
3 Biến val & var trong Kotlin
4 Các kiểu cơ bản - Int, Long, Double, String
5 Câu lệnh điều kiện - Khối If và when
6 Phạm vi (Ranges) & Vòng lặp
7 while & do-While
8 break, nhãn (labels) và return
1 Định nghĩa và gọi hàm
2 Tham số mặc định & Đối số được đặt tên
3 Hàm cấp cao nhất và Thuộc tính cấp cao nhất
1 Giới thiệu về lớp - Tạo một lớp và các đối tượng
2 Hàm tạo chính (Primary Constructors)
3 Hàm tạo phụ (Secondary Constructors)
4 Mã khởi tạo bằng khối init
5 Lớp dữ liệu (Data Classes)
6 Getter và Setter tùy chỉnh
7 Kế thừa - Mở rộng lớp
8 Kế thừa - Ghi đè hàm, biến
9 Từ khóa object để tạo thể hiện của lớp
10 Từ khóa companion object
11 Giao diện (Interfaces)
12 Giao diện - Xử lý các hàm xung đột
13 Giao diện - Định nghĩa và Ghi đè biến
14 Các bổ từ phạm vi truy cập (Visibility Modifiers)
15 Kiểm tra kiểu, Ép kiểu và Ép kiểu thông minh
16 Lớp enum
1 Kiểu Nullable & Non-Nullable trong Kotlin
2 Safe Call(?), Toán tử Elvis(?:), Non Null Assertion(!!) để xử lý giá trị Null
3 Gọi hoặc gán một Kiểu Nullable cho một Kiểu Non-Nullable
1 Giới thiệu về Bộ sưu tập (Collections)
2 Giới thiệu về Biểu thức Lamda
3 Lambda và Hàm bậc cao hơn (Higher Order Functions)
4 Thao tác Lọc trên Bộ sưu tập Kotlin
5 Thao tác Map trên Bộ sưu tập Kotlin
6 Thao tác FlatMap trong Bộ sưu tập
7 Làm việc với HashMaps
8 Đánh giá Lười biếng (Lazy Evaluation) của Bộ sưu tập bằng Sequences
9 Tính Nullable trong Bộ sưu tập
1 Xử lý ngoại lệ bằng try-catch
1 Giới thiệu về Hàm phạm vi
2 Hàm phạm vi apply & also
3 Hàm phạm vi let
4 Hàm phạm vi with & run
1 Tổng quan ứng dụng & Thiết lập dự án
2 Xây dựng một Endpoint đơn giản - Greeting Controller
3 Tiêm phụ thuộc qua hàm tạo (Constructor Injection) trong Spring
4 Thiết lập các hồ sơ (profiles) khác nhau trong Spring Boot
5 Thiết lập ghi nhật ký (Logging) trong Kotlin
1 Giới thiệu về Kiểm thử tự động & Thiết lập JUnit5
2 Kiểm thử tích hợp cho Controller
3 Kiểm thử đơn vị cho Controller - Sử dụng thư viện Mockk
1 Thiết lập Thực thể (Entity) Course & CourseDTO
2 Tạo CourseRepository & Cấu hình JPA trong file application.yml
3 Xây dựng Endpoint POST để thêm Khóa học mới
4 Kiểm thử tích hợp cho endpoint POST bằng JUnit5
5 Xây dựng Endpoint Get để lấy tất cả Khóa học
6 Kiểm thử tích hợp cho endpoint GET để lấy tất cả khóa học
7 Xây dựng Endpoint Update để cập nhật một Khóa học
8 Kiểm thử tích hợp cho endpoint PUT bằng JUnit5
9 Xây dựng endpoint DELETE để xóa một Khóa học
1 Thiết lập Kiểm thử đơn vị cho CourseController
2 Kiểm thử đơn vị cho Endpoint Post trong CourseController
3 Kiểm thử đơn vị cho Endpoint GET trong CourseController
4 Kiểm thử đơn vị cho Endpoint PUT trong CourseController
5 Kiểm thử đơn vị cho Endpoint DELETE trong CourseController
1 Đặt Name và Category là bắt buộc bằng Annotation @NotBlank
2 Triển khai Xử lý lỗi tùy chỉnh bằng mẫu ControllerAdvice
3 Xử lý RuntimeException toàn cục bằng mẫu ControllerAdvice
1 Truy xuất Khóa học theo Tên bằng JPA Query Creation Function
2 Truy xuất Khóa học theo Tên bằng truy vấn SQL gốc (Native)
3 Kiểm thử nhiều bộ dữ liệu bằng @Parameterized test
1 Sử dụng endpoint GET có sẵn để lấy Khóa học theo Tên
2 Viết kiểm thử tích hợp để lấy khóa học theo Tên
1 Thêm Thực thể Instructor vào Dịch vụ Danh mục Khóa học
2 Thêm quan hệ trong Lớp Thực thể
3 Instructor Controller để quản lý dữ liệu Instructor
4 Cập nhật CourseService để xác thực dữ liệu Instructor
5 Sửa các bài Kiểm thử tích hợp của CourseController
6 Sửa các bài Kiểm thử đơn vị của CourseController
1 Thiết lập Cơ sở dữ liệu Postgres và Ứng dụng để tương tác với Postgres
2 Kiểm thử ứng dụng với Cơ sở dữ liệu Postgres
1 Thiết lập TestContainers cho Kiểm thử tích hợp
2 Cấu hình @DataJpaTest với TestContainers
1 Gọi mã Kotlin từ Lớp Java
2 Gọi mã Java từ Kotlin
3 Các annotation JVM hữu ích trong Kotlin

Giới thiệu khóa học

Kotlin is the Modern, concise and safe programming language and  is one of the popular JVM language in this day and age.

It’s also interoperable with Java and other languages, and provides many ways to reuse code between multiple platforms for productive programming.

This course will focus on using Kotlin for Server-Side Development using SpringBoot framework. This is a pure hands-on oriented course which covers these two topics:

  • Covers Kotlin Fundamentals thats necessary for Java Developers

  • Build RestFul APIs using SpringBoot and Kotlin

Section 1: Getting Started With the Course

  • This section covers the course objectives and the prerequisites that are needed to make the most out of this course.

Section 2: Getting Started with Kotlin Programming Language

  • In this section, I will introduce you to Kotlin Programming Language and why its a powerful language for enterprise development.

    • Introduction to Kotlin

    • How Kotlin Works with the JVM?

Section 3: Kotlin Fundamentals

  • In this section, we will explore the fundamentals of Kotlin.

    • val & var variables in Kotlin

    • Basic Types - Int, Long, Double, String

    • Conditionals - If and when block

    • Ranges , Loops

    • while & do-While

    • break, labels and return

Section 4: Functions in Kotlin

  • In this section, we will learn about functions in Kotlin and different ways of declaring and using them

    • Defining and Invoking Functions

    • Default Value Parameters & Named Arguments

    • Top-Level Functions and Top-level Properties

Section 5: Classes, Interfaces and Inheritance

  • In this section, we will learn about classes, inheritance and interfaces in detail.

    • Introduction to class - Creating a class and objects

    • Primary Constructors

    • Secondary Constructors

    • initializer code using init block

    • Data Classes

    • Custom Getters and Setters

    • Inheritance - Extending Classes

    • Inheritance - Override Functions, Variables

    • object keyword for creating instance of the class

    • companion object Keyword

    • Interfaces

    • Interfaces - Handling Conflicting Functions

    • Interfaces - Defining and Overrding Variables

    • Visibility Modifiers

    • Type Checking, Casting and Smart Cast

    • Enum class

Section 6: Nulls in Kotlin

  • In this section, we will learn about handling nulls in Kotlin

    • Nullable & Non-Nullable types in Kotlin

    • Safe Call(?) , Elvis Operator(?:) & Non Null Assertion(!!) to deal with Null Values

    • Invoking or assigning a Nullable Type to a Non-Nullable Type

Section 7: Collections, Arrays & Lamda Expressions

  • In this section, I will introduce you to collections, arrays and lambda expressions in Kotlin

    • Introduction to Collections

    • Introduction to Lamda Expressions

    • Lambdas and Higher Order Functions

    • Filter Operations on Kotlin Collections

    • Map Operations on Kotlin Collections

    • FlatMap Operations in Collections

    • Working With HashMaps

    • Lazy Evaluation of Collections using Sequences

    • Nullability in Collections

Section 8 : Exceptions In Kotlin

  • In this section, I will cover the exceptions in kotlin and the techniques to handle them.

    • Handling Exceptions using try-catch

Section 9 : Scope Functions

  • In this section, I will introduce you all to scope functions in Kotlin and its usage.

    • Introduction to Scope Functions

    • apply & also Scope Function

    • let Scope Function

    • with & run Scope Function

Section 10 : Getting Started with Kotlin and Spring Boot

  • In this section, I will explain the overview of the app we are going to build and build a very simple API.

    • Overview of the app & Project Setup

    • Build a Simple Endpoint - Greeting Controller

    • Constructor Injection in Spring

    • Setting up different profiles in Spring Boot

    • Set up Logging in Kotlin

Section 11 : Integration/Unit Testing using Junit 5

  • In this section, I will code and explain about the techniques to write different types of test cases using spring boot and Kotlin.

    • Introduction to Automated Tests & Setting up JUnit5

    • Integration Test for Controller

    • Unit Test for Controller - Using the Mockk Mocking library

Section 12 : Build the Course Catalog Service

  • In this section, we will build the Course Catalog Service to manage the Courses

    • Set up the Course Entity & CourseDTO

    • Create CourseRepository & Configure JPA in application.yml file

    • Build the POST Endpoint for adding new Course I

    • ntegration test for the POST endpoint using JUnit5

    • Build the Get Endpoint to retrieve all Courses

    • Integration test for the GET endpoint to retrieve all the courses

    • Build the Update Endpoint to update a Course

    • Integration test for the PUT endpoint using JUnit5

    • Build the DELETE endpoint to delete a Course

Section 13: Unit Testing Controller layer (Web Tier)

  • In this section, we will code and learn about how to write unit tests for the controller

    • Setting up the Unit Test for the CourseController

    • Unit test for the Post Endpoint in CourseController

    • Unit test for the GET Endpoint in CourseController

    • Unit test for the PUT Endpoint in CourseController

    • Unit test for the DELETE Endpoint in CourseController

Section 14 : Bean Validation using Validators and ControllerAdvice

  • In this section, we will code and learn the different techniques to apply bean validations and handle exceptions using the ControllerAdvice Pattern

    • Name and Category as Mandatory using @NotBlank Annotation

    • Implement Custom Error Handling using ControllerAdvice pattern

    • Handle Global RuntimeException using ControllerAdvice Pattern

Section 15 : Custom JPA queries using Spring Data JPA and DB Layer testing using @DataJpaTest

  • In this lecture, we will learn about the techniques to write custom JPA queries and the techniques to test the DB layer using the DataJpaTest

    • Retrieve Courses By Name using JPA Query Creation Function

    • Retrieve Courses By Name using Native SQL query

    • Testing Mutliple sets of Data using @Parameterized test

Section 16: GET Endpoint to retrieve Courses By Name using @RequestParam

  • In this section, we will code and learn about the usage of RequestParam in the controller endpoint.

    • Use existing GET endpoint to retrieve Courses by Name

    • Write Integration test to retrieve course by Name

Section 17 : Entity RelationShips using Spring Data JPA

  • In this section, I will explain the technique to express the relationships in JPA using Entity and Data classes in Kotlin

    • Adding Instructor Entity in to the Course Catalog Service

    • Adding the relationship in the Entity Class

    • Instructor Controller to Manage Instructor Data

    • Update CourseService to validate Instructor Data

    • Fix the CourseController Integration Tests

    • Fix the CourseController Unit Tests

Section 18 : Integrating with Postgres DB

  • In this section, we will code and learn to integrate the postgres DB in to the course catalog service.

    • Setting up the Postgres DB and App to interact with Postgres

    • Test the app with Postgres DB

Section 19 : Integration Testing using TestContainers

  • In this section, we will code and learn to integrate the testcontainers to run integration test.

    • Setting Up TestContainers for the Integration Test

    • Configure @DataJpaTest with TestContainers

Section 20 : Java & Kotlin Interoperability

  • In this section, we will code and learn about the interoperability between Java and Kotlin.

    • Invoking Kotlin Code from Java Class

    • Invoking Java Code from Kotlin

    • Useful JVM annotations in Kotlin

By the end of this course, you will be comfortable writing code using the Koltin Programming language and Build RestFuL APIs using SpringBoot and Kotlin.

Khóa học liên quan

Khám phá thêm các khoá học cùng chủ đề

Hiển thị tất cả khoá học Backend Development
Hiển thị tất cả khoá học Kotlin
Hiển thị tất cả khoá học Restful Apis
Hiển thị tất cả khoá học Spring Boot
Zalo
Tôi có thể tư vấn khoá học cho bạn 😊