Skip to content

Instantly share code, notes, and snippets.

@RyanSusana
Last active March 24, 2019 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RyanSusana/12779e1570430139f7e0f0ff56ad051b to your computer and use it in GitHub Desktop.
Save RyanSusana/12779e1570430139f7e0f0ff56ad051b to your computer and use it in GitHub Desktop.
import com.elepy.annotations.*;
import com.elepy.models.TextType;
@RestModel(slug = "/products", name = "Name")
public class Product {
@Identifier
private String id;
@Number(minimum = 0)
private BigDecimal price;
@Unique
@Searchable
private String name;
@DateTime(maximumDate = "2050-01-01")
private Date expirationDate;
@Text(TextType.TEXTAREA)
private String shortDescription;
@Text(TextType.HTML)
@PrettyName("This is a detailed description of the Product")
private String longDescription;
// Getters and setters. I like to use Project Lombok to automate this :D
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment