This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.newhorizons.takeitnow.item.domain.entity; | |
| public class Item { | |
| private Product product; | |
| private Long quantity; | |
| public Item() { | |
| } | |
| public Item(Product product, Long quantity) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.newhorizons.takeitnow.item.application.mainmodule.mapper; | |
| import com.newhorizons.takeitnow.item.application.mainmodule.dto.ProductDto; | |
| import com.newhorizons.takeitnow.item.domain.entity.Product; | |
| import org.mapstruct.InheritInverseConfiguration; | |
| import org.mapstruct.Mapper; | |
| import org.mapstruct.Mapping; | |
| import org.mapstruct.Mappings; | |
| import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.newhorizons.takeitnow.item.infrastructure.repository.rest; | |
| import com.newhorizons.takeitnow.item.application.mainmodule.dto.ItemDto; | |
| import com.newhorizons.takeitnow.item.application.mainmodule.dto.ProductDto; | |
| import com.newhorizons.takeitnow.item.application.mainmodule.mapper.IProductMapper; | |
| import com.newhorizons.takeitnow.item.domain.entity.Product; | |
| import com.newhorizons.takeitnow.item.domain.repository.IItemRepository; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.stereotype.Repository; | |
| import org.springframework.web.client.RestTemplate; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.newhorizons.takeitnow.item.infrastructure.feign; | |
| import com.newhorizons.takeitnow.item.application.mainmodule.dto.ProductDto; | |
| import org.springframework.cloud.openfeign.FeignClient; | |
| import org.springframework.web.bind.annotation.GetMapping; | |
| import org.springframework.web.bind.annotation.PathVariable; | |
| import org.springframework.web.bind.annotation.RequestMapping; | |
| import java.util.List; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.newhorizons.takeitnow.item.infrastructure.repository.feign; | |
| import com.newhorizons.takeitnow.item.application.mainmodule.dto.ItemDto; | |
| import com.newhorizons.takeitnow.item.application.mainmodule.dto.ProductDto; | |
| import com.newhorizons.takeitnow.item.application.mainmodule.mapper.IProductMapper; | |
| import com.newhorizons.takeitnow.item.domain.entity.Product; | |
| import com.newhorizons.takeitnow.item.domain.repository.IItemRepository; | |
| import com.newhorizons.takeitnow.item.infrastructure.feign.IProductFeign; | |
| import org.springframework.beans.factory.annotation.Autowired; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.newhorizons.takeitnow.item.infrastructure.feign; | |
| import com.newhorizons.takeitnow.item.domain.entity.Product; | |
| import org.springframework.cloud.openfeign.FeignClient; | |
| import org.springframework.web.bind.annotation.GetMapping; | |
| import org.springframework.web.bind.annotation.PathVariable; | |
| import org.springframework.web.bind.annotation.RequestMapping; | |
| import java.util.List; | |
| @FeignClient(name = "product-service", url = "http://localhost:8001/", path = "/takeitnow/api") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.newhorizons.takeitnow.products.presentation.web.controller; | |
| import com.newhorizons.takeitnow.products.application.mainmodule.dto.ProductDto; | |
| import com.newhorizons.takeitnow.products.application.mainmodule.service.IProductService; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.core.env.Environment; | |
| import org.springframework.web.bind.annotation.GetMapping; | |
| import org.springframework.web.bind.annotation.PathVariable; | |
| import org.springframework.web.bind.annotation.RequestMapping; | |
| import org.springframework.web.bind.annotation.RestController; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git config --global user.name "Toffee De la Rosa" | |
| git config --global user.email "[email protected]" | |
| git init | |
| git add . | |
| git commit -m "Mi primer commit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| INSERT INTO `users` (username, password, active, first_name, last_name, email) VALUES ('srdelarosab','$2a$10$ykhXmCAam5FUEF9GN.4Z8OwwWJidvMii6VFYe77cmS2X6oF6p4W86',1, 'Renato', 'De la Rosa','[email protected]'); | |
| INSERT INTO `users` (username, password, active, first_name, last_name, email) VALUES ('admin','$2a$10$qGyDfZLBB.SgLv7GCP3uZe3oM38fVtr58T1iZ1LNOvO61loNUAAaK',1, 'Sergio', 'De la Rosa','[email protected]'); | |
| INSERT INTO `roles` (name) VALUES ('ROLE_USER'); | |
| INSERT INTO `roles` (name) VALUES ('ROLE_ADMIN'); | |
| INSERT INTO `users_roles` (user_id, role_id) VALUES (1, 1); | |
| INSERT INTO `users_roles` (user_id, role_id) VALUES (2, 2); | |
| INSERT INTO `users_roles` (user_id, role_id) VALUES (2, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.newhorizons.takeitnow.security.domain.service; | |
| import com.newhorizons.takeitnow.security.domain.entity.UserApplication; | |
| import com.newhorizons.takeitnow.security.domain.repository.IUserRepository; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.security.core.GrantedAuthority; | |
| import org.springframework.security.core.authority.SimpleGrantedAuthority; | |
| import org.springframework.security.core.userdetails.User; |