Merge branch 'frontend'
Add bott settings page
This commit is contained in:
@@ -13,4 +13,100 @@ export class BotService {
|
||||
private http: HttpClient,
|
||||
private tokenStorage: TokenStorageService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @returns Observable
|
||||
*/
|
||||
public getKeywords(): Observable<any> {
|
||||
return this.http.get(API_URL + 'keywords', {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
responseType: 'text',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} keyword
|
||||
* @returns Observable
|
||||
*/
|
||||
public createKeyword(keyword: string): Observable<any> {
|
||||
return this.http.post(
|
||||
API_URL + 'keyword',
|
||||
{
|
||||
keyword,
|
||||
},
|
||||
{
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} keyword
|
||||
* @returns Observable
|
||||
*/
|
||||
public deleteKeyword(keyword: string): Observable<any> {
|
||||
return this.http.delete(API_URL + 'keyword', {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
body: {
|
||||
keyword,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns Observable
|
||||
*/
|
||||
public getSymbols(): Observable<any> {
|
||||
return this.http.get(API_URL + 'shares', {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
responseType: 'text',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} keyword
|
||||
* @returns Observable
|
||||
*/
|
||||
public createShare(symbol: string): Observable<any> {
|
||||
return this.http.post(
|
||||
API_URL + 'share',
|
||||
{
|
||||
symbol,
|
||||
},
|
||||
{
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} share
|
||||
* @returns Observable
|
||||
*/
|
||||
public deleteShare(share: string): Observable<any> {
|
||||
return this.http.delete(API_URL + 'share', {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
body: {
|
||||
share,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@@ -57,7 +57,6 @@ export class DataService {
|
||||
): Observable<any> {
|
||||
time = time + 'T12:00:00.000Z';
|
||||
price.toFixed(2);
|
||||
console.log(this.tokenStorage.getToken());
|
||||
return this.http.post(
|
||||
API_URL + 'transaction',
|
||||
{
|
||||
|
Reference in New Issue
Block a user