此博客用于个人学习,来源于网上,对知识点进行一个整理。
1. 创意索引对象定义与服务实现:
1.1 建立索引对象:
其中需要注意的是 update 方法,由于不一定是每个值都需要更新,所以需要添加这个方法来实现更新所需的数据。
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CreativeObject {
private Long adId;
private String name;
private Integer type;
private Integer materialType;
private Integer height;
private Integer width;
private Integer auditStatus;
private String adUrl;
public void update(CreativeObject newObject) {
if (null != newObject.getAdId()) {
this.adId = newObject.getAdId();
}
if (null != newObject.getName()) {
this.name = newObject.getName();
}
if (null != newObject.getType()) {
this.type = newObject.getType();
}
if (null != newObject.getMaterialType()) {
this.materialType = newObject.getMaterialType();
}
if (null != newObject.getHeight()) {
this.height = newObject.getHeight();
}
if (null != newObject.getWidth()) {
this.width = newObject.getWidth();
}
if (null != newObject.getAuditStatus()) {
this.auditStatus = newObject.getAuditStatus();
}
if (null != newObject.getAdUrl()