Creating a controller

Now, create a controller class named AppController.kt and annotate it with @RestController to convert it into a controller class:

@RestController
class AppController {
-----
-----
}

Now autowire the repositories, as shown in the following code:

@Autowired
private lateinit var profileRepository: ProfileRepository

@Autowired
private lateinit var userExist: UserExistRepository

@Autowired
private lateinit var postRepository: PostRepository

@Autowired
private lateinit var commentRepository: CommentRepository

@Autowired
private lateinit var likeRepository: LikeRepository

@Autowired
private lateinit var deletePCLRepository : DeletePCLRepository

Then create HTTP function requests. We won't discuss this here because we have already described the use of the HTTP requests in Chapter 4Spring Modules for Android.