40 lines
645 B
Java
40 lines
645 B
Java
package com.example.survey.entity;
|
|
|
|
import lombok.*;
|
|
import org.bson.types.ObjectId;
|
|
import org.springframework.data.mongodb.core.index.Indexed;
|
|
import org.springframework.data.mongodb.core.mapping.DBRef;
|
|
import org.springframework.data.mongodb.core.mapping.Document;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* @author Pope
|
|
*/
|
|
@Data
|
|
@Document(collection = "department")
|
|
public class Department {
|
|
|
|
/**
|
|
* id
|
|
*/
|
|
private ObjectId id;
|
|
|
|
/**
|
|
* 部门名
|
|
*/
|
|
private String name;
|
|
|
|
/**
|
|
* 子部门
|
|
*/
|
|
@DBRef
|
|
private List<Department> children;
|
|
|
|
/**
|
|
* 父部门
|
|
*/
|
|
private String parent;
|
|
|
|
}
|