Skip to content

Instantly share code, notes, and snippets.

@iamprafful
Created January 16, 2022 14:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save iamprafful/0002ba8bacaea325ecba02e096db6485 to your computer and use it in GitHub Desktop.
package com.example.api.model;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
@Document("users")
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class User {
@Id
private String userName;
private String firstName;
private String lastName;
@Indexed(unique = true)
private String email;
private String password;
private String role;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment