Added /public to public endpoints. Updated version

This commit is contained in:
Max W. 2024-04-01 22:32:41 +02:00
parent 80610b774a
commit da5abba5b9
5 changed files with 9 additions and 9 deletions

View File

@ -5,7 +5,7 @@ plugins {
} }
group = 'de.w665' group = 'de.w665'
version = '1.1.1' version = '1.1.2'
java { java {
sourceCompatibility = '21' sourceCompatibility = '21'

View File

@ -32,7 +32,7 @@ export class CreditsComponent {
} }
getVersion() { getVersion() {
axios.get(this.developmentStore.getBaseUrl() + 'api/v1/version') axios.get(this.developmentStore.getBaseUrl() + 'api/v1/public/version')
.then((response) => { .then((response) => {
this.version = response.data; this.version = response.data;
}) })

View File

@ -99,7 +99,7 @@ export class DownloadComponent {
axios({ axios({
method: 'get', method: 'get',
url: this.developmentStore.getBaseUrl() + 'api/v1/speed-test', url: this.developmentStore.getBaseUrl() + 'api/v1/public/speed-test',
responseType: 'arraybuffer', responseType: 'arraybuffer',
}) })
.then(response => { .then(response => {
@ -119,7 +119,7 @@ export class DownloadComponent {
private getDownloadInfo() { private getDownloadInfo() {
axios({ axios({
method: 'get', method: 'get',
url: this.developmentStore.getBaseUrl() + 'api/v1/download-info?fileId=' + this.fileId, url: this.developmentStore.getBaseUrl() + 'api/v1/public/download-info?fileId=' + this.fileId,
responseType: 'json', responseType: 'json',
}) })
.then(response => { .then(response => {
@ -138,7 +138,7 @@ export class DownloadComponent {
this.fileDownloadStarted = true; this.fileDownloadStarted = true;
axios({ axios({
method: 'get', method: 'get',
url: this.developmentStore.getBaseUrl() + 'api/v1/download?fileId=' + this.fileId + '&password=' + this.filePassword, url: this.developmentStore.getBaseUrl() + 'api/v1/public/download?fileId=' + this.fileId + '&password=' + this.filePassword,
responseType: 'arraybuffer', responseType: 'arraybuffer',
onDownloadProgress: (progressEvent) => { onDownloadProgress: (progressEvent) => {
const endTime = new Date().getTime(); const endTime = new Date().getTime();

View File

@ -97,7 +97,7 @@ export class UploadComponent {
} }
}; };
axios.post(this.developmentStore.getBaseUrl() + 'api/v1/upload', formData, config) axios.post(this.developmentStore.getBaseUrl() + 'api/v1/public/upload', formData, config)
.then(response => { .then(response => {
console.log('Upload completed successfully!'); console.log('Upload completed successfully!');
console.log(response.data); console.log(response.data);
@ -119,7 +119,7 @@ export class UploadComponent {
passwordUrlPart = `&password=${fileDetails.password}`; passwordUrlPart = `&password=${fileDetails.password}`;
} }
const downloadUrl = `${baseUrl}download?fileId=${fileId}${passwordUrlPart}`; const downloadUrl = `${baseUrl}download?fileId=${fileId}${passwordUrlPart}`;
const deleteUrl = `${baseUrl}api/v1/deletefile?fileId=${fileId}${passwordUrlPart}`; const deleteUrl = `${baseUrl}api/v1/public/deletefile?fileId=${fileId}${passwordUrlPart}`;
const statusUrl = `${baseUrl}status?fileId=${fileId}${passwordUrlPart}`; const statusUrl = `${baseUrl}status?fileId=${fileId}${passwordUrlPart}`;
return { return {
downloadUrl, downloadUrl,
@ -151,7 +151,7 @@ export class UploadComponent {
axios({ axios({
method: 'post', method: 'post',
url: this.developmentStore.getBaseUrl() + 'api/v1/upload-speed-test', url: this.developmentStore.getBaseUrl() + 'api/v1/public/upload-speed-test',
data: uint8View, data: uint8View,
headers: { headers: {
'Content-Type': 'application/octet-stream', 'Content-Type': 'application/octet-stream',

View File

@ -4,6 +4,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/api/v1") @RequestMapping("/api/v1/public")
public abstract class ApiRestController { public abstract class ApiRestController {
} }