| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- package com.uas.demo.model;
- import org.springframework.data.mongodb.core.index.CompoundIndex;
- import org.springframework.data.mongodb.core.index.Indexed;
- import org.springframework.data.mongodb.core.mapping.Document;
- import javax.persistence.Id;
- /**
- * 缓存用户或联系人信息
- */
- @Document(collection = "user_info")
- @CompoundIndex(name = "phone_user_id_unique", def = "{'phone': 1, 'userId': 1}", unique = true)
- public class UserInfo {
- /**
- * 主键
- */
- @Id
- private String id;
- /**
- * 手机号
- */
- @Indexed(unique = true)
- private String phone;
- /**
- * 用户User Id[IM]
- */
- @Indexed(unique = true)
- private String userId;
- /**
- * 资质
- */
- private String certification;
- /**
- * 用户名称
- */
- private String name;
- public UserInfo() {
- }
- public String getId() {
- return id;
- }
- public void setId(String id) {
- this.id = id;
- }
- public String getPhone() {
- return phone;
- }
- public void setPhone(String phone) {
- this.phone = phone;
- }
- public String getUserId() {
- return userId;
- }
- public void setUserId(String userId) {
- this.userId = userId;
- }
- public String getCertification() {
- return certification;
- }
- public void setCertification(String certification) {
- this.certification = certification;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- @Override
- public String toString() {
- return "UserInfo{" +
- "id='" + id + '\'' +
- ", phone='" + phone + '\'' +
- ", userId='" + userId + '\'' +
- ", certification='" + certification + '\'' +
- ", name='" + name + '\'' +
- '}';
- }
- }
|