|
|
@@ -16,6 +16,7 @@ import com.izouma.nineth.utils.excel.ExcelUtils;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
@@ -23,6 +24,7 @@ import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.concurrent.ExecutionException;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/asset")
|
|
|
@@ -128,6 +130,19 @@ public class AssetController extends BaseController {
|
|
|
public Map<String, BigDecimal> breakdown() {
|
|
|
return assetService.breakdown(SecurityUtils.getAuthenticatedUser().getId());
|
|
|
}
|
|
|
+
|
|
|
+ @PostMapping("/cdn")
|
|
|
+ @PreAuthorize("hasRole('ADMIN')")
|
|
|
+ public String cdn() throws ExecutionException, InterruptedException {
|
|
|
+ new Thread(() -> {
|
|
|
+ try {
|
|
|
+ assetService.transferCDN();
|
|
|
+ } catch (ExecutionException | InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ return "ok";
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|