|
@@ -9,6 +9,7 @@ import com.lqkj.link.module.zone.repository.ModelInfoRepository;
|
9
|
9
|
import com.lqkj.link.util.AliOSSUtils;
|
10
|
10
|
import com.lqkj.link.util.FileUtils;
|
11
|
11
|
import com.lqkj.link.util.Unzipper;
|
|
12
|
+import jakarta.servlet.http.HttpServletRequest;
|
12
|
13
|
import org.apache.commons.compress.archivers.ArchiveException;
|
13
|
14
|
import org.springframework.beans.factory.annotation.Autowired;
|
14
|
15
|
import org.springframework.data.domain.Page;
|
|
@@ -196,9 +197,9 @@ public class ResourceService {
|
196
|
197
|
* @param userCode
|
197
|
198
|
* @return
|
198
|
199
|
*/
|
199
|
|
- public String ossCheckCapacity(String userCode) {
|
|
200
|
+ public String ossCheckCapacity(String userCode, HttpServletRequest request) {
|
200
|
201
|
UserInfo userInfo = userInfoRepository.findByUserCode(userCode);
|
201
|
|
- Long aLong = aliOSSUtils.ossCheckCapacity("resource/model/" + userInfo.getUserId() + "/");
|
|
202
|
+ Long aLong = aliOSSUtils.ossCheckCapacity("resource/model/" + request.getLocalAddr() + "/" + request.getLocalPort() + request.getContextPath() + "/" + userInfo.getUserId() + "/");
|
202
|
203
|
return "个人库 已使用" + FileUtils.convertBytes(aLong) + "/20G";
|
203
|
204
|
}
|
204
|
205
|
}
|