Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1 You are writing an endpoint that returns the total number of items bought in your online store by a given user. Orders in

Task 1
You are writing an endpoint that returns the total number of items bought in your online store by a given user.
Orders in your system are stored in an external service called
OrdersService 2. Your task is to:
write an endpoint in the given UsersController rass;
write a method in the given UsersService class that counts the number of items bought by the given user;
configure the UsersController and UsersService classes.
Solving this task requires from you editing the following three files. Please make sure they are all present in your final solution.
com.codility. app. AppConfiguration
com.codility. app. UsersController
com.codility. app. UsersService
Interfaces
The UsersService class declares:
a field ordersService : private ordersService ordersService
a method getNumberofItemsBought 0 : public int getNumber0fItemsBought (String username)
The Uselscontroller class declares:
a field usersservice private UsersService usersService
a method totalt temaBought in public Man
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions

Question

1. What are the pros and cons of diversity for an organisation?

Answered: 1 week ago

Question

1. Explain the concept of diversity and equality in the workplace.

Answered: 1 week ago