add admin interface, angular migration

This commit is contained in:
_Bastler
2025-11-09 01:58:54 +01:00
parent ff94ca05ce
commit 1acaf07825
100 changed files with 7129 additions and 50 deletions
@@ -0,0 +1,34 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
import { environment } from '../../../environments/environment';
@Injectable({
providedIn: 'root',
})
export class ShortenedUrlManagementService {
constructor(private http: HttpClient) {
}
getShortenedUrls(page: number = 0, size: number = 10, search: string = '') {
let params = new HttpParams()
.set('page', page.toString())
.set('size', size.toString())
.set('search', search);
return this.http.get(environment.apiUrl + "/url/shortener/manage", { params });
}
createOrUpdateShortenedUrl(shortenedUrl: any) {
return this.http.post(environment.apiUrl + "/url/shortener/manage", shortenedUrl);
}
deleteShortenedUrl(code: string, quota: boolean = false) {
let params = new HttpParams().set('quota', quota.toString());
return this.http.delete(environment.apiUrl + "/url/shortener/manage/" + code, { params });
}
deleteAll(owner: number, quota: boolean = false) {
let params = new HttpParams().set('quota', quota.toString());
return this.http.delete(environment.apiUrl + "/url/shortener/manage/all/" + owner, { params });
}
}