|
|
|
@ -100,8 +100,8 @@ public class VetTrainingVideoServiceImpl implements IVetTrainingVideoService { |
|
|
|
} |
|
|
|
|
|
|
|
// 权限校验:只能查看自己的视频或审核通过公开的视频 |
|
|
|
boolean canView = "1".equals(video.getAuditStatus()) && // 1-审核通过 |
|
|
|
"1".equals(video.getStatus()) || // 1-已上架/公开 |
|
|
|
boolean canView = ("2".equals(video.getAuditStatus()) && // 2-审核通过(新编码) |
|
|
|
"1".equals(video.getStatus())) || // 1-已上架/公开 |
|
|
|
currentVetId.equals(video.getUserId()); |
|
|
|
return canView ? video : null; |
|
|
|
} |
|
|
|
@ -115,8 +115,8 @@ public class VetTrainingVideoServiceImpl implements IVetTrainingVideoService { |
|
|
|
} |
|
|
|
|
|
|
|
// 权限校验:只能播放自己的视频或审核通过公开的视频 |
|
|
|
boolean canPlay = "1".equals(video.getAuditStatus()) && // 1-审核通过 |
|
|
|
"1".equals(video.getStatus()) || // 1-已上架/公开 |
|
|
|
boolean canPlay = ("2".equals(video.getAuditStatus()) && // 2-审核通过(新编码) |
|
|
|
"1".equals(video.getStatus())) || // 1-已上架/公开 |
|
|
|
currentVetId.equals(video.getUserId()); |
|
|
|
return canPlay ? video.getVideoUrl() : null; |
|
|
|
} |
|
|
|
@ -152,14 +152,14 @@ public class VetTrainingVideoServiceImpl implements IVetTrainingVideoService { |
|
|
|
} |
|
|
|
|
|
|
|
// 只能提交无需审核或审核拒绝的视频 |
|
|
|
if (!"3".equals(video.getAuditStatus()) && // 3-无需审核 |
|
|
|
!"2".equals(video.getAuditStatus())) { // 2-审核拒绝 |
|
|
|
if (!"4".equals(video.getAuditStatus()) && // 3-无需审核 |
|
|
|
!"3".equals(video.getAuditStatus())) { // 2-审核拒绝 |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// 更新为待审核状态 |
|
|
|
int result = videoMapper.updateAuditStatus(videoId, |
|
|
|
"0", // 0-待审核 |
|
|
|
"1", // 1-审核中 |
|
|
|
"已提交审核", |
|
|
|
null, |
|
|
|
new Date()); |
|
|
|
@ -175,14 +175,13 @@ public class VetTrainingVideoServiceImpl implements IVetTrainingVideoService { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// 只能取消待审核状态的视频 |
|
|
|
if (!"0".equals(video.getAuditStatus())) { // 0-待审核 |
|
|
|
if (!"1".equals(video.getAuditStatus())) { // 1-审核中 |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// 更新为无需审核状态 |
|
|
|
int result = videoMapper.updateAuditStatus(videoId, |
|
|
|
"3", // 3-无需审核 |
|
|
|
"4", // 4-无需审核 |
|
|
|
"用户取消审核", |
|
|
|
null, |
|
|
|
new Date()); |
|
|
|
@ -199,7 +198,7 @@ public class VetTrainingVideoServiceImpl implements IVetTrainingVideoService { |
|
|
|
} |
|
|
|
|
|
|
|
// 只能重新提交审核拒绝状态的视频 |
|
|
|
if (!"2".equals(video.getAuditStatus())) { // 2-审核拒绝 |
|
|
|
if (!"3".equals(video.getAuditStatus())) { // 2-审核拒绝 |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
@ -216,21 +215,22 @@ public class VetTrainingVideoServiceImpl implements IVetTrainingVideoService { |
|
|
|
@Transactional |
|
|
|
public boolean auditVideo(Long videoId, String auditStatus, String auditOpinion, Long auditUserId) { |
|
|
|
// 验证审核状态 |
|
|
|
if (!"1".equals(auditStatus) && // 1-审核通过 |
|
|
|
!"2".equals(auditStatus)) { // 2-审核拒绝 |
|
|
|
if (!"2".equals(auditStatus) && // 2-审核通过 |
|
|
|
!"3".equals(auditStatus)) { // 3-审核拒绝 |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
VetTrainingVideo video = videoMapper.selectVideoById(videoId); |
|
|
|
if (video == null) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
// 只能审核待审核状态的视频 |
|
|
|
if (!"0".equals(video.getAuditStatus())) { // 0-待审核 |
|
|
|
if (!"1".equals(video.getAuditStatus())) { // 1-审核中 |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int result = videoMapper.updateAuditStatus(videoId, |
|
|
|
auditStatus, |
|
|
|
auditOpinion, |
|
|
|
@ -238,7 +238,7 @@ public class VetTrainingVideoServiceImpl implements IVetTrainingVideoService { |
|
|
|
new Date()); |
|
|
|
|
|
|
|
// 如果审核通过,自动设置为私有状态,等待用户上架 |
|
|
|
if (result > 0 && "1".equals(auditStatus)) { // 1-审核通过 |
|
|
|
if (result > 0 && "2".equals(auditStatus)) { // 1-审核通过 |
|
|
|
videoMapper.updateStatus(videoId, "0"); // 0-未上架/私有 |
|
|
|
} |
|
|
|
|
|
|
|
@ -260,7 +260,7 @@ public class VetTrainingVideoServiceImpl implements IVetTrainingVideoService { |
|
|
|
} |
|
|
|
|
|
|
|
// 只能上架审核通过的视频 |
|
|
|
if (!"1".equals(video.getAuditStatus())) { // 1-审核通过 |
|
|
|
if (!"2".equals(video.getAuditStatus())) { // 1-审核通过 |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
@ -304,8 +304,8 @@ public class VetTrainingVideoServiceImpl implements IVetTrainingVideoService { |
|
|
|
} |
|
|
|
|
|
|
|
// 只能编辑无需审核、审核拒绝或私有状态的视频 |
|
|
|
boolean canEdit = "3".equals(existingVideo.getAuditStatus()) || // 3-无需审核 |
|
|
|
"2".equals(existingVideo.getAuditStatus()) || // 2-审核拒绝 |
|
|
|
boolean canEdit = "4".equals(existingVideo.getAuditStatus()) || // 4-无需审核 |
|
|
|
"3".equals(existingVideo.getAuditStatus()) || // 3-审核拒绝 |
|
|
|
"0".equals(existingVideo.getStatus()); // 0-未上架/私有 |
|
|
|
|
|
|
|
if (!canEdit) { |
|
|
|
|