|
@@ -13,6 +13,8 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import java.util.Set;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @author reghao
|
|
* @author reghao
|
|
|
* @date 2022-08-05 13:49:28
|
|
* @date 2022-08-05 13:49:28
|
|
@@ -25,15 +27,17 @@ public class VideoService {
|
|
|
|
|
|
|
|
private final VideoPostMapper videoPostMapper;
|
|
private final VideoPostMapper videoPostMapper;
|
|
|
private final VideoErrorMapper videoErrorMapper;
|
|
private final VideoErrorMapper videoErrorMapper;
|
|
|
|
|
+ private final Set<Long> adminUsers;
|
|
|
|
|
|
|
|
public VideoService(VideoPostMapper videoPostMapper, VideoErrorMapper videoErrorMapper) {
|
|
public VideoService(VideoPostMapper videoPostMapper, VideoErrorMapper videoErrorMapper) {
|
|
|
this.videoPostMapper = videoPostMapper;
|
|
this.videoPostMapper = videoPostMapper;
|
|
|
this.videoErrorMapper = videoErrorMapper;
|
|
this.videoErrorMapper = videoErrorMapper;
|
|
|
|
|
+ this.adminUsers = Set.of(10001L, 10002L);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Result errorReport(VideoErrorReport videoErrorReport) {
|
|
public Result errorReport(VideoErrorReport videoErrorReport) {
|
|
|
long loginUser = UserContext.getUser();
|
|
long loginUser = UserContext.getUser();
|
|
|
- if (loginUser == -1 || loginUser > 10005) {
|
|
|
|
|
|
|
+ if (!adminUsers.contains(loginUser)) {
|
|
|
return Result.fail("no permission");
|
|
return Result.fail("no permission");
|
|
|
}
|
|
}
|
|
|
|
|
|