仅返回链接

Raod 3 years ago
parent 2ffdf720e6
commit 1bf7694bf7

@ -21,7 +21,7 @@ public interface ReportShareService extends GaeaBaseService<ReportShareParam, Re
*/ */
ReportShare getDetail(Long id); ReportShare getDetail(Long id);
ReportShare insertShare(ReportShareDto dto); ReportShareDto insertShare(ReportShareDto dto);
ReportShare detailByCode(String shareCode); ReportShare detailByCode(String shareCode);
} }

@ -49,11 +49,14 @@ public class ReportShareServiceImpl implements ReportShareService {
} }
@Override @Override
public ReportShare insertShare(ReportShareDto dto) { public ReportShareDto insertShare(ReportShareDto dto) {
ReportShareDto reportShareDto = new ReportShareDto();
ReportShare entity = new ReportShare(); ReportShare entity = new ReportShare();
BeanUtils.copyProperties(dto, entity); BeanUtils.copyProperties(dto, entity);
insert(entity); insert(entity);
return entity; //将分享链接返回
reportShareDto.setShareUrl(entity.getShareUrl());
return reportShareDto;
} }
@Override @Override
@ -68,6 +71,19 @@ public class ReportShareServiceImpl implements ReportShareService {
public void processBeforeOperation(ReportShare entity, BaseOperationEnum operationEnum) throws BusinessException { public void processBeforeOperation(ReportShare entity, BaseOperationEnum operationEnum) throws BusinessException {
switch (operationEnum) { switch (operationEnum) {
case INSERT: case INSERT:
init(entity);
break;
default:
break;
}
}
/**
*
* @param entity
*/
private void init(ReportShare entity) {
//前端地址 window.location.href https://report.anji-plus.com/index.html#/report/bigscreen //前端地址 window.location.href https://report.anji-plus.com/index.html#/report/bigscreen
//截取#之前的内容 //截取#之前的内容
//http://localhost:9528/#/bigscreen/viewer?reportCode=bigScreen2 //http://localhost:9528/#/bigscreen/viewer?reportCode=bigScreen2
@ -82,12 +98,5 @@ public class ReportShareServiceImpl implements ReportShareService {
} }
entity.setShareValidTime(DateUtil.getFutureDateTmdHms(entity.getShareValidType())); entity.setShareValidTime(DateUtil.getFutureDateTmdHms(entity.getShareValidType()));
entity.setShareToken(JwtUtil.createToken(entity.getReportCode(), shareCode, entity.getShareValidTime())); entity.setShareToken(JwtUtil.createToken(entity.getReportCode(), shareCode, entity.getShareValidTime()));
break;
case UPDATE:
break;
default:
break;
}
} }
} }

Loading…
Cancel
Save