feat(REQ-2106): 联调优化
1. banner详情展示时间段格式调整 2. 素材详情展示终端字段返回
This commit is contained in:
parent
cfafafe137
commit
cfed4d69fd
@ -73,9 +73,6 @@ public interface MaterialApi {
|
||||
/**
|
||||
* 根据广告位编码(bannerCode)查询素材
|
||||
* <p>
|
||||
* 对于cms和cmp需要传入当前登录人所在的workspaceId,ouId和所担任的jobCode
|
||||
* </p>
|
||||
* <p>
|
||||
* 1. 通过广告位code获取该广告位下的所有素材(默认查询上架状态且在有效期范围内的素材)
|
||||
* 2. 根据广告位投放人群进行过滤
|
||||
* 3. 根据广告位投放规则频次进行过滤
|
||||
|
||||
@ -8,6 +8,8 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.sql.Time;
|
||||
|
||||
/**
|
||||
* @author chenwenjian
|
||||
* @version 1.0
|
||||
@ -44,11 +46,11 @@ public class DetailBannerResp extends PageBannerResp {
|
||||
/**
|
||||
* 展示时间段-开始时间
|
||||
*/
|
||||
private String startTime;
|
||||
private Time startTime;
|
||||
|
||||
/**
|
||||
* 展示时间段-结束时间
|
||||
*/
|
||||
private String endTime;
|
||||
private Time endTime;
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package cn.axzo.nanopart.api.response;
|
||||
import cn.axzo.nanopart.api.enums.MaterialDisplayFrequencyTypeEnum;
|
||||
import cn.axzo.nanopart.api.enums.MaterialTargetUserTypeEnum;
|
||||
import cn.axzo.nanopart.api.enums.MaterialTypeEnum;
|
||||
import cn.axzo.nanopart.api.enums.PlatformTypeEnum;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.AllArgsConstructor;
|
||||
@ -12,6 +13,7 @@ import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -111,4 +113,18 @@ public class MaterialResp extends PageMaterialResp {
|
||||
*/
|
||||
private Long updateBy;
|
||||
|
||||
/**
|
||||
* 所属终端,取值:CMS:安心筑CMS,CM,CMP:安心筑工人端APP,安心筑管理端APP
|
||||
* <p>
|
||||
* 素材
|
||||
* </p>
|
||||
* {@link PlatformTypeEnum}
|
||||
*/
|
||||
private PlatformTypeEnum terminal;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
protected Date createAt;
|
||||
|
||||
}
|
||||
|
||||
@ -233,11 +233,14 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
|
||||
private void checkDisplayTimeType(Object obj) {
|
||||
if (obj instanceof CreateBannerReq) {
|
||||
CreateBannerReq req = (CreateBannerReq) obj;
|
||||
// 为自定义时间段
|
||||
if (Objects.equals(req.getDisplayTimeType().getName(), DisplayTimeTypeEnum.CUSTOM.getName())) {
|
||||
if (Objects.isNull(req.getStartTime()) || Objects.isNull(req.getEndTime())) {
|
||||
throw new RuntimeException("请设置展示时间段");
|
||||
}
|
||||
return;
|
||||
}
|
||||
// 此处为防止选定展示时间段类型后又手动设置了起止时间
|
||||
req.setStartTime(req.getDisplayTimeType().getStartTime());
|
||||
req.setEndTime(req.getDisplayTimeType().getEndTime());
|
||||
} else if (obj instanceof UpdateBannerReq) {
|
||||
@ -248,6 +251,7 @@ public class BannerServiceImpl extends ServiceImpl<BannerDao, Banner> implements
|
||||
}
|
||||
return;
|
||||
}
|
||||
// 此处为防止选定展示时间段类型后又手动设置了起止时间
|
||||
req.setStartTime(req.getDisplayTimeType().getStartTime());
|
||||
req.setEndTime(req.getDisplayTimeType().getEndTime());
|
||||
}
|
||||
|
||||
@ -265,7 +265,20 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialDao, Material> impl
|
||||
if (Objects.isNull(req.getId()) || req.getId() == 0) {
|
||||
return null;
|
||||
}
|
||||
return BeanUtil.copyProperties(getById(req.getId()), MaterialResp.class);
|
||||
|
||||
Material material = getById(req.getId());
|
||||
if (Objects.isNull(material)){
|
||||
return null;
|
||||
}
|
||||
// 获取所属广告位
|
||||
Banner banner = bannerService.selectByCode(material.getBannerCode());
|
||||
if (Objects.isNull(banner)){
|
||||
log.warn("广告位不存在,广告位code:{},素材id:{}", material.getBannerCode(),material.getId());
|
||||
throw new ServiceException("数据异常");
|
||||
}
|
||||
MaterialResp materialResp = BeanUtil.copyProperties(material, MaterialResp.class);
|
||||
materialResp.setTerminal(banner.getTerminal());
|
||||
return materialResp;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user