Standardize URLs
This commit is contained in:
+3
-2
@@ -8,16 +8,17 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/settings")
|
||||
public class AppSettingController {
|
||||
|
||||
private AppSettingService appSettingService;
|
||||
|
||||
@GetMapping("/api/settings")
|
||||
@GetMapping
|
||||
public AppSettings getAppSettings() {
|
||||
return appSettingService.getAppSettings();
|
||||
}
|
||||
|
||||
@PutMapping("/api/settings")
|
||||
@PutMapping
|
||||
public void updateSetting(@RequestBody SettingRequest settingRequest) {
|
||||
appSettingService.updateSetting(settingRequest.getCategory(), settingRequest.getName(), settingRequest.getValue());
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RequestMapping("/v1/author")
|
||||
@RequestMapping("/api/v1/author")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class AuthorController {
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
@RequestMapping("/v1/book")
|
||||
@RequestMapping("/api/v1/book")
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
public class BookController {
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.io.IOException;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/epub")
|
||||
@RequestMapping("/api/v1/epub")
|
||||
public class EpubController {
|
||||
|
||||
private final EpubService epubService;
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/v1/library")
|
||||
@RequestMapping("/api/v1/library")
|
||||
@AllArgsConstructor
|
||||
public class LibraryController {
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/v1/metadata")
|
||||
@RequestMapping("/v1/v1/metadata")
|
||||
@AllArgsConstructor
|
||||
public class MetadataController {
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/v1/path")
|
||||
@RequestMapping("/api/v1/path")
|
||||
@AllArgsConstructor
|
||||
public class PathController {
|
||||
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping(("/v1/shelf"))
|
||||
@RequestMapping(("/api/v1/shelf"))
|
||||
public class ShelfController {
|
||||
|
||||
private final ShelfService shelfService;
|
||||
|
||||
@@ -11,7 +11,7 @@ import {API_CONFIG} from '../../config/api-config';
|
||||
})
|
||||
export class BookService {
|
||||
|
||||
private readonly url = `${API_CONFIG.BASE_URL}/v1/book`;
|
||||
private readonly url = `${API_CONFIG.BASE_URL}/api/v1/book`;
|
||||
|
||||
private bookStateSubject = new BehaviorSubject<BookState>({
|
||||
books: null,
|
||||
|
||||
@@ -6,7 +6,7 @@ import {API_CONFIG} from '../../config/api-config';
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class FileService {
|
||||
private readonly url = `${API_CONFIG.BASE_URL}/v1/book`;
|
||||
private readonly url = `${API_CONFIG.BASE_URL}/api/v1/book`;
|
||||
private readonly http = inject(HttpClient);
|
||||
|
||||
downloadFile(bookId: number): void {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {API_CONFIG} from '../../config/api-config';
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class LibraryService {
|
||||
private readonly url = `${API_CONFIG.BASE_URL}/v1/library`;
|
||||
private readonly url = `${API_CONFIG.BASE_URL}/api/v1/library`;
|
||||
|
||||
private libraryStateSubject = new BehaviorSubject<LibraryState>({
|
||||
libraries: null,
|
||||
|
||||
@@ -12,7 +12,7 @@ import {API_CONFIG} from '../../config/api-config';
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ShelfService {
|
||||
private readonly url = `${API_CONFIG.BASE_URL}/v1/shelf`;
|
||||
private readonly url = `${API_CONFIG.BASE_URL}/api/v1/shelf`;
|
||||
private shelfStateSubject = new BehaviorSubject<ShelfState>({
|
||||
shelves: null,
|
||||
loaded: false,
|
||||
|
||||
@@ -8,7 +8,7 @@ import {API_CONFIG} from '../../config/api-config';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AppSettingsService {
|
||||
private readonly apiUrl = `${API_CONFIG.BASE_URL}/api/settings`;
|
||||
private readonly apiUrl = `${API_CONFIG.BASE_URL}/api/v1/settings`;
|
||||
|
||||
private appSettingsSubject = new BehaviorSubject<AppSettings | null>(null);
|
||||
appSettings$ = this.appSettingsSubject.asObservable();
|
||||
|
||||
@@ -7,7 +7,7 @@ import {API_CONFIG} from '../../config/api-config';
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EpubService {
|
||||
private baseUrl = `${API_CONFIG.BASE_URL}/api/epub`;
|
||||
private baseUrl = `${API_CONFIG.BASE_URL}/api/v1/epub`;
|
||||
|
||||
private http = inject(HttpClient);
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import {API_CONFIG} from '../../config/api-config';
|
||||
})
|
||||
export class MetadataService {
|
||||
|
||||
private readonly url = `${API_CONFIG.BASE_URL}/v1/metadata`;
|
||||
private readonly url = `${API_CONFIG.BASE_URL}/api/v1/metadata`;
|
||||
|
||||
private http = inject(HttpClient);
|
||||
private bookService = inject(BookService);
|
||||
|
||||
@@ -8,7 +8,7 @@ import {API_CONFIG} from '../../../config/api-config';
|
||||
})
|
||||
export class UtilityService {
|
||||
|
||||
private pathUrl = `${API_CONFIG.BASE_URL}/v1/path`;
|
||||
private pathUrl = `${API_CONFIG.BASE_URL}/api/v1/path`;
|
||||
|
||||
private http = inject(HttpClient);
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@ export class UrlHelperService {
|
||||
private readonly baseUrl = API_CONFIG.BASE_URL;
|
||||
|
||||
getCoverUrl(bookId: number, coverUpdatedOn?: string): string {
|
||||
return `${this.baseUrl}/v1/book/${bookId}/cover?${coverUpdatedOn || ''}`;
|
||||
return `${this.baseUrl}/api/v1/book/${bookId}/cover?${coverUpdatedOn || ''}`;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user