“mitao”
2026-02-11 504880873eeea15bcbe7d5a79608ccc4abacb0d2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.estate.expert.admin.domain.common;
 
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Value;
 
@ApiModel("实体引用")
@Value
@Builder
public class EntityRef {
 
    @ApiModelProperty("实体ID")
    Integer id;
 
    @ApiModelProperty("用户名")
    String name;
 
    @ApiModelProperty(value = "额外信息", notes = "对于部分实体,可能需要额外信息,如模型需要版本号等")
    Object info;
 
    public static EntityRef of(Integer id) {
        return EntityRef.builder().id(id).build();
    }
 
    public static EntityRef of(Integer id, String name) {
        return EntityRef.builder().id(id).name(name).build();
    }
 
    public static EntityRef of(Integer id, String name, Object info) {
        return EntityRef.builder().id(id).name(name).info(info).build();
    }
}