Browse Source

【功能完善】【不创建userId索引】

koul 4 years ago
parent
commit
5f86d90792

+ 67 - 67
mianshi-service/src/main/java/cn/xyz/mianshi/vo/CompanyFans.java

@@ -1,67 +1,67 @@
-package cn.xyz.mianshi.vo;
-
-import org.bson.types.ObjectId;
-import org.mongodb.morphia.annotations.Entity;
-import org.mongodb.morphia.annotations.Id;
-import org.mongodb.morphia.annotations.Index;
-import org.mongodb.morphia.annotations.Indexes;
-
-/**
- * 企业的粉丝
- * <p>
- * 片键:companyId
- * 
- * @author luorc
- *
- */
-@Entity(value = "co_fans", noClassnameStored = true)
-@Indexes(@Index(name="CompanyFans_index",value="companyId,userId"))
-public class CompanyFans {
-	private int companyId;
-	private @Id ObjectId id;
-	private long time;
-	private int userId;
-
-	public CompanyFans() {
-		super();
-	}
-
-	public CompanyFans(int companyId, int userId) {
-		super();
-		this.companyId = companyId;
-		this.userId = userId;
-	}
-
-	public int getCompanyId() {
-		return companyId;
-	}
-
-	public ObjectId getId() {
-		return id;
-	}
-
-	public long getTime() {
-		return time;
-	}
-
-	public int getUserId() {
-		return userId;
-	}
-
-	public void setCompanyId(int companyId) {
-		this.companyId = companyId;
-	}
-
-	public void setId(ObjectId id) {
-		this.id = id;
-	}
-
-	public void setTime(long time) {
-		this.time = time;
-	}
-
-	public void setUserId(int userId) {
-		this.userId = userId;
-	}
-
-}
+package cn.xyz.mianshi.vo;
+
+import org.bson.types.ObjectId;
+import org.mongodb.morphia.annotations.Entity;
+import org.mongodb.morphia.annotations.Id;
+import org.mongodb.morphia.annotations.Index;
+import org.mongodb.morphia.annotations.Indexes;
+
+/**
+ * 企业的粉丝
+ * <p>
+ * 片键:companyId
+ * 
+ * @author luorc
+ *
+ */
+@Entity(value = "co_fans", noClassnameStored = true)
+/*@Indexes(@Index(name="CompanyFans_index",value="companyId,userId"))*/
+public class CompanyFans {
+	private int companyId;
+	private @Id ObjectId id;
+	private long time;
+	private int userId;
+
+	public CompanyFans() {
+		super();
+	}
+
+	public CompanyFans(int companyId, int userId) {
+		super();
+		this.companyId = companyId;
+		this.userId = userId;
+	}
+
+	public int getCompanyId() {
+		return companyId;
+	}
+
+	public ObjectId getId() {
+		return id;
+	}
+
+	public long getTime() {
+		return time;
+	}
+
+	public int getUserId() {
+		return userId;
+	}
+
+	public void setCompanyId(int companyId) {
+		this.companyId = companyId;
+	}
+
+	public void setId(ObjectId id) {
+		this.id = id;
+	}
+
+	public void setTime(long time) {
+		this.time = time;
+	}
+
+	public void setUserId(int userId) {
+		this.userId = userId;
+	}
+
+}

+ 5 - 5
mianshi-service/src/main/java/cn/xyz/mianshi/vo/Room.java

@@ -11,7 +11,7 @@ import org.mongodb.morphia.annotations.Indexes;
 import com.alibaba.fastjson.annotation.JSONField;
 
 @Entity(value = "shiku_room", noClassnameStored = true)
-@Indexes({ @Index(name="Room2_index",value="jid"), @Index(name="Room3_index",value="userId,jid") })
+@Indexes({@Index(name="Room2_index",value="jid"), @Index(name="Room3_index",value="userId,jid") })
 public class Room {
 
 	// 房间编号
@@ -268,8 +268,8 @@ public class Room {
 	}
 
 	@Entity(value = "shiku_room_notice")
-	@Indexes({ @Index("roomId"), @Index("userId") })
-	public static class Notice {
+	/*@Indexes({ @Index("roomId"), @Index("userId") })
+	*/public static class Notice {
 		@Id
 		@JSONField(serialize = false)
 		private ObjectId id;
@@ -331,8 +331,8 @@ public class Room {
 	}
 
 	@Entity(value = "shiku_room_member")
-	@Indexes({ @Index("roomId"), @Index("userId"), @Index("roomId,userId"), @Index("userId,role") })
-	public static class Member {
+	/*@Indexes({ @Index("roomId"), @Index("userId"), @Index("roomId,userId"), @Index("userId,role") })
+	*/public static class Member {
 		@Id
 		@JSONField(serialize = false)
 		private ObjectId id;