|
|
@@ -1,27 +1,41 @@
|
|
|
package cn.reghao.dfs.store.task;
|
|
|
|
|
|
-import cn.reghao.dfs.store.db.mapper.ImageFileMapper;
|
|
|
import cn.reghao.dfs.store.db.repository.ObjectRepository;
|
|
|
-import lombok.extern.slf4j.Slf4j;
|
|
|
+import cn.reghao.dfs.store.model.vo.ObjectResult;
|
|
|
+import cn.reghao.dfs.store.task.processor.AudioFileProcessor;
|
|
|
+import cn.reghao.oss.api.dto.ObjectMeta;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import javax.annotation.PostConstruct;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* @author reghao
|
|
|
* @date 2023-08-29 18:03:39
|
|
|
*/
|
|
|
-@Slf4j
|
|
|
@Service
|
|
|
@Deprecated
|
|
|
public class FileTask {
|
|
|
- @Autowired
|
|
|
- ImageFileMapper imageFileMapper;
|
|
|
@Autowired
|
|
|
ObjectRepository objectRepository;
|
|
|
+ @Autowired
|
|
|
+ AudioFileProcessor audioFileProcessor;
|
|
|
+
|
|
|
+ public void exec() {
|
|
|
+ }
|
|
|
+
|
|
|
+ private void execTask() {
|
|
|
+ List<String> objectNames = List.of(
|
|
|
+ "audio/playback/vJPA6ZGzV2.mp3"
|
|
|
+ );
|
|
|
|
|
|
- //@PostConstruct
|
|
|
- public void update() {
|
|
|
+ for (String objectName : objectNames) {
|
|
|
+ ObjectMeta objectMeta = objectRepository.getObjectMeta(objectName);
|
|
|
+ String objectId = objectMeta.getObjectId();
|
|
|
+ int fileType = 1003;
|
|
|
+ String absolutePath = objectMeta.getAbsolutePath();
|
|
|
+ ObjectResult objectResult = new ObjectResult(objectName, objectId, fileType, absolutePath);
|
|
|
+ audioFileProcessor.process(objectResult);
|
|
|
+ }
|
|
|
}
|
|
|
}
|