|
|
|
@ -28,10 +28,12 @@ import org.springframework.scheduling.annotation.Scheduled;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
import ws.schild.jave.MultimediaObject;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
import java.time.ZoneOffset;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
@ -89,10 +91,11 @@ public class UtilsController {
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
|
res.put("fileName", fileName);
|
|
|
|
|
res.put("fileUrl", "/upload/" + newFileName);
|
|
|
|
|
res.put("duration",new MultimediaObject(dest).getInfo().getDuration());
|
|
|
|
|
res.put("fileType", FileTypeUtil.getcontentType((fileName.substring(fileName.lastIndexOf(".")))));
|
|
|
|
|
res.put("fileTypeNum", FileTypeUtil.getcontentTypeNum((fileName.substring(fileName.lastIndexOf(".")))));
|
|
|
|
|
return Result.success(res, "上传完成");
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
return Result.fail(HttpStatusEnum.CUSTOM_EXCEPTION, "上传失败");
|
|
|
|
@ -134,10 +137,11 @@ public class UtilsController {
|
|
|
|
|
res.replace("errno", 0);
|
|
|
|
|
JSONObject obj = new JSONObject();
|
|
|
|
|
obj.put("alt", fileName);
|
|
|
|
|
obj.put("duration",new MultimediaObject(dest).getInfo().getDuration());
|
|
|
|
|
obj.put("url", cdn + "/upload/" + newFileName);
|
|
|
|
|
res.put("data", obj);
|
|
|
|
|
return res;
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
res.put("message", "上传失败");
|
|
|
|
@ -164,4 +168,5 @@ public class UtilsController {
|
|
|
|
|
List<RankListVo> rankUserList = qywxDepartmentUserLinkMapper.getUserRankList(queryWrapper);
|
|
|
|
|
return Result.success(rankUserList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|