|
@@ -59,11 +59,6 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
if (StringUtils.isEmpty(barPerformance.getPerformancePoster())) {
|
|
if (StringUtils.isEmpty(barPerformance.getPerformancePoster())) {
|
|
|
throw new IllegalArgumentException("演出海报不能为空");
|
|
throw new IllegalArgumentException("演出海报不能为空");
|
|
|
}
|
|
}
|
|
|
- // 检查海报是否有多张(逗号分隔)
|
|
|
|
|
- String[] posterImages = barPerformance.getPerformancePoster().split(",");
|
|
|
|
|
- if (posterImages.length > 1) {
|
|
|
|
|
- throw new IllegalArgumentException("演出海报最多只能上传1张");
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
// 3. 演出类型和频次的关联验证:特邀演出(0)只能选单次(0)
|
|
// 3. 演出类型和频次的关联验证:特邀演出(0)只能选单次(0)
|
|
|
if (barPerformance.getPerformanceType() != null && barPerformance.getPerformanceType() == 0) {
|
|
if (barPerformance.getPerformanceType() != null && barPerformance.getPerformanceType() == 0) {
|
|
@@ -214,12 +209,18 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
// 调用AI内容审核接口,如果检测到违规内容会抛出异常
|
|
// 调用AI内容审核接口,如果检测到违规内容会抛出异常
|
|
|
AiContentModerationUtil.AuditResult auditResult = aiContentModerationUtil.auditContent(moderationText, imageUrls);
|
|
AiContentModerationUtil.AuditResult auditResult = aiContentModerationUtil.auditContent(moderationText, imageUrls);
|
|
|
if (auditResult == null || !auditResult.isPassed()) {
|
|
if (auditResult == null || !auditResult.isPassed()) {
|
|
|
|
|
+ // AI审核失败,设置审核状态为2(审核拒绝)并记录拒绝原因
|
|
|
String failureReason = (auditResult != null && StringUtils.isNotEmpty(auditResult.getFailureReason()))
|
|
String failureReason = (auditResult != null && StringUtils.isNotEmpty(auditResult.getFailureReason()))
|
|
|
? auditResult.getFailureReason()
|
|
? auditResult.getFailureReason()
|
|
|
: "内容包含违规信息";
|
|
: "内容包含违规信息";
|
|
|
|
|
+ barPerformance.setReviewStatus(2); // 审核拒绝
|
|
|
|
|
+ barPerformance.setRejectReason(failureReason);
|
|
|
log.warn("酒吧演出内容审核失败:{}", failureReason);
|
|
log.warn("酒吧演出内容审核失败:{}", failureReason);
|
|
|
throw new IllegalArgumentException("内容审核未通过:" + failureReason);
|
|
throw new IllegalArgumentException("内容审核未通过:" + failureReason);
|
|
|
}
|
|
}
|
|
|
|
|
+ // AI审核通过,设置审核状态为1(审核通过),清除拒绝原因
|
|
|
|
|
+ barPerformance.setReviewStatus(1); // 审核通过
|
|
|
|
|
+ barPerformance.setRejectReason(null); // 清除拒绝原因
|
|
|
log.info("酒吧演出内容审核通过");
|
|
log.info("酒吧演出内容审核通过");
|
|
|
|
|
|
|
|
Integer id = barPerformance.getId();
|
|
Integer id = barPerformance.getId();
|
|
@@ -232,15 +233,17 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
if (barPerformance.getDeleteFlag() == null) {
|
|
if (barPerformance.getDeleteFlag() == null) {
|
|
|
barPerformance.setDeleteFlag(0);
|
|
barPerformance.setDeleteFlag(0);
|
|
|
}
|
|
}
|
|
|
- // 设置默认状态为待审核(0)
|
|
|
|
|
|
|
+ // 设置默认状态为禁用(0)
|
|
|
if (barPerformance.getStatus() == null) {
|
|
if (barPerformance.getStatus() == null) {
|
|
|
barPerformance.setStatus(0);
|
|
barPerformance.setStatus(0);
|
|
|
}
|
|
}
|
|
|
- // 设置默认审核状态为待审核(0),对应数据库字段 review_status
|
|
|
|
|
|
|
+ // 审核状态已在AI审核结果后设置(1-审核通过 或 2-审核拒绝)
|
|
|
|
|
+ // 如果AI审核通过,reviewStatus已设置为1;如果AI审核失败,reviewStatus已设置为2
|
|
|
|
|
+ // 如果为null(理论上不应该出现,因为已经执行了AI审核),设置为0(待审核)
|
|
|
if (barPerformance.getReviewStatus() == null) {
|
|
if (barPerformance.getReviewStatus() == null) {
|
|
|
barPerformance.setReviewStatus(0);
|
|
barPerformance.setReviewStatus(0);
|
|
|
}
|
|
}
|
|
|
- // 设置默认上线状态为下线(0)
|
|
|
|
|
|
|
+ // 设置默认上线状态为下线(0),AI审核通过后仍然保持下线状态
|
|
|
if (barPerformance.getOnlineStatus() == null) {
|
|
if (barPerformance.getOnlineStatus() == null) {
|
|
|
barPerformance.setOnlineStatus(0);
|
|
barPerformance.setOnlineStatus(0);
|
|
|
}
|
|
}
|
|
@@ -270,9 +273,13 @@ public class BarPerformanceServiceImpl implements BarPerformanceService {
|
|
|
if (barPerformance.getStatus() == null) {
|
|
if (barPerformance.getStatus() == null) {
|
|
|
barPerformance.setStatus(0);
|
|
barPerformance.setStatus(0);
|
|
|
}
|
|
}
|
|
|
|
|
+ // 审核状态已在AI审核结果后设置(1-审核通过 或 2-审核拒绝)
|
|
|
|
|
+ // 如果AI审核通过,reviewStatus已设置为1;如果AI审核失败,reviewStatus已设置为2
|
|
|
|
|
+ // 如果为null(理论上不应该出现,因为已经执行了AI审核),设置为0(待审核)
|
|
|
if (barPerformance.getReviewStatus() == null) {
|
|
if (barPerformance.getReviewStatus() == null) {
|
|
|
barPerformance.setReviewStatus(0);
|
|
barPerformance.setReviewStatus(0);
|
|
|
}
|
|
}
|
|
|
|
|
+ // 设置默认上线状态为下线(0),AI审核通过后仍然保持下线状态
|
|
|
if (barPerformance.getOnlineStatus() == null) {
|
|
if (barPerformance.getOnlineStatus() == null) {
|
|
|
barPerformance.setOnlineStatus(0);
|
|
barPerformance.setOnlineStatus(0);
|
|
|
}
|
|
}
|