Skip to content

Comments

Some changes for apex interview#1

Open
baiu wants to merge 1 commit intoalidadasb:masterfrom
baiu:june-test-bair
Open

Some changes for apex interview#1
baiu wants to merge 1 commit intoalidadasb:masterfrom
baiu:june-test-bair

Conversation

@baiu
Copy link

@baiu baiu commented Jun 23, 2023

No description provided.

import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
@EnableJpaRepositories
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need for this since
already used the spring-boot-starter-data-jpa


@RestController
@RequiredArgsConstructor
@RequestMapping(value = "api/inventory/product")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe "api/inventories/products"

public interface InventoryRepository extends JpaRepository<Product, Integer> {}
public interface InventoryRepository extends JpaRepository<Product, Integer> {

@Query("SELECT p FROM Product p WHERE not exists (select rp from RecalledProduct rp where rp.name = p.name)")
Copy link
Author

@baiu baiu Jun 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

work on DB side (faster)
Reduced waiting time for I/O operations.

* @return all the products that are not recalled
*/
@GetMapping
public ResponseEntity<Collection<Product>> getAllProducts() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RestController

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant