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
div.main { | |
background-color: #eee; | |
padding: 21px; | |
font-family: "Times New Roman", Times, serif; | |
} | |
div.main div.content { | |
color: green; | |
} |
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.someaddress.test; | |
import com.someaddress.model.Product; | |
import com.someaddress.intent.DetailsUpdateIntent; | |
import java.math.BigDecimal; | |
import org.testng.Assert; | |
import org.testng.annotations.Test; | |
public class ProductTest { |
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.someaddress.endpoint; | |
import com.someaddress.modelo.Product; | |
import com.someaddress.repository.ProductRepository; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.stereotype.Controller; | |
import org.springframework.web.bind.annotation.*; | |
@Controller | |
@RequestMapping("/rest/products") |
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.someaddress.repository; | |
import com.someaddress.model.Product; | |
import org.springframework.data.jpa.repository.JpaRepository; | |
public interface ProductRepository extends JpaRepository<Product, String> { | |
} |
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.someaddress.model; | |
public class Product { | |
// properties (already defined before) | |
public Product() { } | |
// getters ... (see? no setters) |
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.someaddress.intent; | |
public class DetailsUpdateIntent { | |
private String id; | |
private String name; | |
private String description; | |
private BigDecimal price; | |
public DetailsUpdateIntent() { } | |
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.someaddress.model; | |
public class Product { | |
private String id; | |
private String name; | |
private String description; | |
private BigDecimal price; | |
private boolean active; | |
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 br.com.brunokrebs.rest; | |
// ... previously added imports ... | |
import br.com.brunokrebs.repository.UserRepository; | |
import java.util.List; | |
@RestController | |
public class UserRest { | |
@Autowired | |
private UserRepository userRepository; // our nice repository implementation |
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 br.com.brunokrebs.repository; | |
import br.com.brunokrebs.model.User; | |
import org.springframework.data.jpa.repository.JpaRepository; | |
public interface UserRepository extends JpaRepository<User, Long> { } |
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 br.com.brunokrebs.model; | |
import javax.persistence.Entity; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.Id; | |
@Entity | |
public class User { | |
@Id | |
@GeneratedValue |