事件(将用户触发的事件封装成一个对象)
| 15 | * 事件(将用户触发的事件封装成一个对象) |
| 16 | */ |
| 17 | public class Event { |
| 18 | |
| 19 | private String topic; // 事件的主题 |
| 20 | private int userId; // 事件的来源,触发的人 |
| 21 | private int entityType; // 事件发生在哪种类型上 |
| 22 | private int entityId; // 事件发生在的实体的id |
| 23 | private int entityUserId; //事件发生的实体对应的作者的id |
| 24 | private Map<String,Object> data = new HashMap<>(); |
| 25 | |
| 26 | public String getTopic() { |
| 27 | return topic; |
| 28 | } |
| 29 | |
| 30 | public Event setTopic(String topic) { |
| 31 | this.topic = topic; |
| 32 | return this; |
| 33 | } |
| 34 | |
| 35 | public int getUserId() { |
| 36 | return userId; |
| 37 | } |
| 38 | |
| 39 | public Event setUserId(int userId) { |
| 40 | this.userId = userId; |
| 41 | return this; |
| 42 | } |
| 43 | |
| 44 | public int getEntityType() { |
| 45 | return entityType; |
| 46 | } |
| 47 | |
| 48 | public Event setEntityType(int entityType) { |
| 49 | this.entityType = entityType; |
| 50 | return this; |
| 51 | } |
| 52 | |
| 53 | public int getEntityId() { |
| 54 | return entityId; |
| 55 | } |
| 56 | |
| 57 | public Event setEntityId(int entityId) { |
| 58 | this.entityId = entityId; |
| 59 | return this; |
| 60 | } |
| 61 | |
| 62 | public int getEntityUserId() { |
| 63 | return entityUserId; |
| 64 | } |
| 65 | |
| 66 | public Event setEntityUserId(int entityUserId) { |
| 67 | this.entityUserId = entityUserId; |
| 68 | return this; |
| 69 | } |
| 70 | |
| 71 | public Map<String, Object> getData() { |
| 72 | return data; |
| 73 | } |
| 74 |
nothing calls this directly
no outgoing calls
no test coverage detected