Add documentation
This commit is contained in:
455
frontend/documentation/injectables/AuthService.html
Normal file
455
frontend/documentation/injectables/AuthService.html
Normal file
@@ -0,0 +1,455 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>aktienbot documentation</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<link rel="stylesheet" href="../styles/dark.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs">
|
||||
<a href="../" class="navbar-brand">aktienbot documentation</a>
|
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
||||
</div>
|
||||
|
||||
<div class="xs-menu menu" id="mobile-menu">
|
||||
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid main">
|
||||
<div class="row main">
|
||||
<div class="hidden-xs menu">
|
||||
<compodoc-menu mode="normal"></compodoc-menu>
|
||||
</div>
|
||||
<!-- START CONTENT -->
|
||||
<div class="content injectable">
|
||||
<div class="content-data">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li>Injectables</li>
|
||||
<li >AuthService</li>
|
||||
</ol>
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="active">
|
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
|
||||
</li>
|
||||
<li >
|
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active in" id="c-info">
|
||||
<p class="comment">
|
||||
<h3>File</h3>
|
||||
</p>
|
||||
<p class="comment">
|
||||
<code>src/app/Services/auth.service.ts</code>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="index">Index</h3>
|
||||
<table class="table table-sm table-bordered index-table">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<h6><b>Methods</b></h6>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<ul class="index-list">
|
||||
<li>
|
||||
<a href="#login" >login</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#register" >register</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="constructor">Constructor</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>constructor(http: <a href="https://angular.io/api/common/http/HttpClient" target="_blank">HttpClient</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="13" class="link-to-prism">src/app/Services/auth.service.ts:13</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div>
|
||||
<b>Parameters :</b>
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>http</td>
|
||||
|
||||
<td>
|
||||
<code><a href="https://angular.io/api/common/http/HttpClient" target="_blank" >HttpClient</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<h3 id="methods">
|
||||
Methods
|
||||
</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="login"></a>
|
||||
<span class="name">
|
||||
<span ><b>login</b></span>
|
||||
<a href="#login"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>login(email: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, password: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="21"
|
||||
class="link-to-prism">src/app/Services/auth.service.ts:21</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>email</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>password</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="register"></a>
|
||||
<span class="name">
|
||||
<span ><b>register</b></span>
|
||||
<a href="#register"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>register(email: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, username: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, password: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="34"
|
||||
class="link-to-prism">src/app/Services/auth.service.ts:34</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>email</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>username</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>password</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
const AUTH_API = 'https://gruppe1.testsites.info/api/user';
|
||||
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({ 'Content-Type': 'application/json' }),
|
||||
};
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class AuthService {
|
||||
constructor(private http: HttpClient) {}
|
||||
|
||||
/**
|
||||
* @param {string} email
|
||||
* @param {string} password
|
||||
* @returns Observable
|
||||
*/
|
||||
login(email: string, password: string): Observable<any> {
|
||||
return this.http.post(AUTH_API + '/login', {
|
||||
email,
|
||||
password,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} email
|
||||
* @param {string} username
|
||||
* @param {string} password
|
||||
* @returns Observable
|
||||
*/
|
||||
register(email: string, username: string, password: string): Observable<any> {
|
||||
return this.http.post(
|
||||
AUTH_API + '/register',
|
||||
{
|
||||
email,
|
||||
password,
|
||||
username,
|
||||
},
|
||||
httpOptions
|
||||
);
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results">
|
||||
<div class="has-results">
|
||||
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
||||
<ul class="search-results-list"></ul>
|
||||
</div>
|
||||
<div class="no-results">
|
||||
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="dark-mode-switch">
|
||||
<input type="checkbox">
|
||||
<span class="slider">
|
||||
<svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<script>
|
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable';
|
||||
var COMPODOC_CURRENT_PAGE_URL = 'AuthService.html';
|
||||
var MAX_SEARCH_RESULTS = 15;
|
||||
</script>
|
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script>
|
||||
<script src="../js/libs/lit-html.js"></script>
|
||||
|
||||
<script src="../js/menu-wc.js" defer></script>
|
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
||||
|
||||
<script src="../js/libs/bootstrap-native.js"></script>
|
||||
|
||||
<script src="../js/libs/es6-shim.min.js"></script>
|
||||
<script src="../js/libs/EventDispatcher.js"></script>
|
||||
<script src="../js/libs/promise.min.js"></script>
|
||||
<script src="../js/libs/zepto.min.js"></script>
|
||||
|
||||
<script src="../js/compodoc.js"></script>
|
||||
|
||||
<script src="../js/tabs.js"></script>
|
||||
<script src="../js/menu.js"></script>
|
||||
<script src="../js/libs/clipboard.min.js"></script>
|
||||
<script src="../js/libs/prism.js"></script>
|
||||
<script src="../js/sourceCode.js"></script>
|
||||
<script src="../js/search/search.js"></script>
|
||||
<script src="../js/search/lunr.min.js"></script>
|
||||
<script src="../js/search/search-lunr.js"></script>
|
||||
<script src="../js/search/search_index.js"></script>
|
||||
<script src="../js/lazy-load-graphs.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
767
frontend/documentation/injectables/BotService.html
Normal file
767
frontend/documentation/injectables/BotService.html
Normal file
@@ -0,0 +1,767 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>aktienbot documentation</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<link rel="stylesheet" href="../styles/dark.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs">
|
||||
<a href="../" class="navbar-brand">aktienbot documentation</a>
|
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
||||
</div>
|
||||
|
||||
<div class="xs-menu menu" id="mobile-menu">
|
||||
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid main">
|
||||
<div class="row main">
|
||||
<div class="hidden-xs menu">
|
||||
<compodoc-menu mode="normal"></compodoc-menu>
|
||||
</div>
|
||||
<!-- START CONTENT -->
|
||||
<div class="content injectable">
|
||||
<div class="content-data">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li>Injectables</li>
|
||||
<li >BotService</li>
|
||||
</ol>
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="active">
|
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
|
||||
</li>
|
||||
<li >
|
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active in" id="c-info">
|
||||
<p class="comment">
|
||||
<h3>File</h3>
|
||||
</p>
|
||||
<p class="comment">
|
||||
<code>src/app/Services/bot.service.ts</code>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="index">Index</h3>
|
||||
<table class="table table-sm table-bordered index-table">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<h6><b>Methods</b></h6>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<ul class="index-list">
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#createKeyword" >createKeyword</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#createShare" >createShare</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#deleteKeyword" >deleteKeyword</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#deleteShare" >deleteShare</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#getKeywords" >getKeywords</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#getSymbols" >getSymbols</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="constructor">Constructor</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>constructor(http: <a href="https://angular.io/api/common/http/HttpClient" target="_blank">HttpClient</a>, tokenStorage: <a href="../injectables/TokenStorageService.html" target="_self">TokenStorageService</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="11" class="link-to-prism">src/app/Services/bot.service.ts:11</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div>
|
||||
<b>Parameters :</b>
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>http</td>
|
||||
|
||||
<td>
|
||||
<code><a href="https://angular.io/api/common/http/HttpClient" target="_blank" >HttpClient</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>tokenStorage</td>
|
||||
|
||||
<td>
|
||||
<code><a href="../injectables/TokenStorageService.html" target="_self" >TokenStorageService</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<h3 id="methods">
|
||||
Methods
|
||||
</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="createKeyword"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>createKeyword</b></span>
|
||||
<a href="#createKeyword"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>createKeyword(keyword: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="34"
|
||||
class="link-to-prism">src/app/Services/bot.service.ts:34</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>keyword</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="createShare"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>createShare</b></span>
|
||||
<a href="#createShare"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>createShare(isin: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, comment: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="82"
|
||||
class="link-to-prism">src/app/Services/bot.service.ts:82</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>isin</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>comment</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="deleteKeyword"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>deleteKeyword</b></span>
|
||||
<a href="#deleteKeyword"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>deleteKeyword(keyword: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="53"
|
||||
class="link-to-prism">src/app/Services/bot.service.ts:53</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>keyword</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="deleteShare"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>deleteShare</b></span>
|
||||
<a href="#deleteShare"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>deleteShare(symbol: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="102"
|
||||
class="link-to-prism">src/app/Services/bot.service.ts:102</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>symbol</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="getKeywords"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>getKeywords</b></span>
|
||||
<a href="#getKeywords"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>getKeywords()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="20"
|
||||
class="link-to-prism">src/app/Services/bot.service.ts:20</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="getSymbols"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>getSymbols</b></span>
|
||||
<a href="#getSymbols"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>getSymbols()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="68"
|
||||
class="link-to-prism">src/app/Services/bot.service.ts:68</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { TokenStorageService } from './token.service';
|
||||
|
||||
const API_URL = 'https://gruppe1.testsites.info/api/';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class BotService {
|
||||
constructor(
|
||||
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(isin: string, comment: string): Observable<any> {
|
||||
return this.http.post(
|
||||
API_URL + 'share',
|
||||
{
|
||||
comment,
|
||||
isin,
|
||||
},
|
||||
{
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} symbol
|
||||
* @returns Observable
|
||||
*/
|
||||
public deleteShare(symbol: string): Observable<any> {
|
||||
return this.http.delete(API_URL + 'share', {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
body: {
|
||||
symbol,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results">
|
||||
<div class="has-results">
|
||||
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
||||
<ul class="search-results-list"></ul>
|
||||
</div>
|
||||
<div class="no-results">
|
||||
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="dark-mode-switch">
|
||||
<input type="checkbox">
|
||||
<span class="slider">
|
||||
<svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<script>
|
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable';
|
||||
var COMPODOC_CURRENT_PAGE_URL = 'BotService.html';
|
||||
var MAX_SEARCH_RESULTS = 15;
|
||||
</script>
|
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script>
|
||||
<script src="../js/libs/lit-html.js"></script>
|
||||
|
||||
<script src="../js/menu-wc.js" defer></script>
|
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
||||
|
||||
<script src="../js/libs/bootstrap-native.js"></script>
|
||||
|
||||
<script src="../js/libs/es6-shim.min.js"></script>
|
||||
<script src="../js/libs/EventDispatcher.js"></script>
|
||||
<script src="../js/libs/promise.min.js"></script>
|
||||
<script src="../js/libs/zepto.min.js"></script>
|
||||
|
||||
<script src="../js/compodoc.js"></script>
|
||||
|
||||
<script src="../js/tabs.js"></script>
|
||||
<script src="../js/menu.js"></script>
|
||||
<script src="../js/libs/clipboard.min.js"></script>
|
||||
<script src="../js/libs/prism.js"></script>
|
||||
<script src="../js/sourceCode.js"></script>
|
||||
<script src="../js/search/search.js"></script>
|
||||
<script src="../js/search/lunr.min.js"></script>
|
||||
<script src="../js/search/search-lunr.js"></script>
|
||||
<script src="../js/search/search_index.js"></script>
|
||||
<script src="../js/lazy-load-graphs.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
602
frontend/documentation/injectables/DataService.html
Normal file
602
frontend/documentation/injectables/DataService.html
Normal file
@@ -0,0 +1,602 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>aktienbot documentation</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<link rel="stylesheet" href="../styles/dark.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs">
|
||||
<a href="../" class="navbar-brand">aktienbot documentation</a>
|
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
||||
</div>
|
||||
|
||||
<div class="xs-menu menu" id="mobile-menu">
|
||||
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid main">
|
||||
<div class="row main">
|
||||
<div class="hidden-xs menu">
|
||||
<compodoc-menu mode="normal"></compodoc-menu>
|
||||
</div>
|
||||
<!-- START CONTENT -->
|
||||
<div class="content injectable">
|
||||
<div class="content-data">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li>Injectables</li>
|
||||
<li >DataService</li>
|
||||
</ol>
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="active">
|
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
|
||||
</li>
|
||||
<li >
|
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active in" id="c-info">
|
||||
<p class="comment">
|
||||
<h3>File</h3>
|
||||
</p>
|
||||
<p class="comment">
|
||||
<code>src/app/Services/data.service.ts</code>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="index">Index</h3>
|
||||
<table class="table table-sm table-bordered index-table">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<h6><b>Methods</b></h6>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<ul class="index-list">
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#createTransaction" >createTransaction</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#getKeywords" >getKeywords</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#getStockData" >getStockData</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#getTransactionData" >getTransactionData</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="constructor">Constructor</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>constructor(http: <a href="https://angular.io/api/common/http/HttpClient" target="_blank">HttpClient</a>, tokenStorage: <a href="../injectables/TokenStorageService.html" target="_self">TokenStorageService</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="9" class="link-to-prism">src/app/Services/data.service.ts:9</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div>
|
||||
<b>Parameters :</b>
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>http</td>
|
||||
|
||||
<td>
|
||||
<code><a href="https://angular.io/api/common/http/HttpClient" target="_blank" >HttpClient</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>tokenStorage</td>
|
||||
|
||||
<td>
|
||||
<code><a href="../injectables/TokenStorageService.html" target="_self" >TokenStorageService</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<h3 id="methods">
|
||||
Methods
|
||||
</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="createTransaction"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>createTransaction</b></span>
|
||||
<a href="#createTransaction"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>createTransaction(comment: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, isin: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, time: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, count: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>, price: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="52"
|
||||
class="link-to-prism">src/app/Services/data.service.ts:52</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>comment</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>isin</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>time</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>count</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>price</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="getKeywords"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>getKeywords</b></span>
|
||||
<a href="#getKeywords"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>getKeywords()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="82"
|
||||
class="link-to-prism">src/app/Services/data.service.ts:82</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="getStockData"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>getStockData</b></span>
|
||||
<a href="#getStockData"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>getStockData()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="22"
|
||||
class="link-to-prism">src/app/Services/data.service.ts:22</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="getTransactionData"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>getTransactionData</b></span>
|
||||
<a href="#getTransactionData"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>getTransactionData()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="35"
|
||||
class="link-to-prism">src/app/Services/data.service.ts:35</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable, OnInit } from '@angular/core';
|
||||
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { delay, Observable } from 'rxjs';
|
||||
import { TokenStorageService } from './token.service';
|
||||
const API_URL = 'https://gruppe1.testsites.info/api/';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class DataService {
|
||||
/**
|
||||
* @param {HttpClient} privatehttp
|
||||
* @param {TokenStorageService} privatetokenStorage
|
||||
*/
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private tokenStorage: TokenStorageService
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @returns Observable
|
||||
*/
|
||||
public getStockData(): Observable<any> {
|
||||
return this.http.get(API_URL + 'portfolio', {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
responseType: 'text',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns Observable
|
||||
*/
|
||||
public getTransactionData(): Observable<any> {
|
||||
return this.http.get(API_URL + 'transactions', {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
responseType: 'text',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} symbol
|
||||
* @param {Date} time
|
||||
* @param {number} count
|
||||
* @param {number} price
|
||||
* @returns Observable
|
||||
*/
|
||||
public createTransaction(
|
||||
comment: string,
|
||||
isin: string,
|
||||
time: string,
|
||||
count: number,
|
||||
price: number
|
||||
): Observable<any> {
|
||||
time = time + 'T12:00:00.000Z';
|
||||
price.toFixed(2);
|
||||
return this.http.post(
|
||||
API_URL + 'transaction',
|
||||
{
|
||||
comment,
|
||||
count,
|
||||
isin,
|
||||
price,
|
||||
time,
|
||||
},
|
||||
{
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @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',
|
||||
});
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results">
|
||||
<div class="has-results">
|
||||
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
||||
<ul class="search-results-list"></ul>
|
||||
</div>
|
||||
<div class="no-results">
|
||||
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="dark-mode-switch">
|
||||
<input type="checkbox">
|
||||
<span class="slider">
|
||||
<svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<script>
|
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable';
|
||||
var COMPODOC_CURRENT_PAGE_URL = 'DataService.html';
|
||||
var MAX_SEARCH_RESULTS = 15;
|
||||
</script>
|
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script>
|
||||
<script src="../js/libs/lit-html.js"></script>
|
||||
|
||||
<script src="../js/menu-wc.js" defer></script>
|
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
||||
|
||||
<script src="../js/libs/bootstrap-native.js"></script>
|
||||
|
||||
<script src="../js/libs/es6-shim.min.js"></script>
|
||||
<script src="../js/libs/EventDispatcher.js"></script>
|
||||
<script src="../js/libs/promise.min.js"></script>
|
||||
<script src="../js/libs/zepto.min.js"></script>
|
||||
|
||||
<script src="../js/compodoc.js"></script>
|
||||
|
||||
<script src="../js/tabs.js"></script>
|
||||
<script src="../js/menu.js"></script>
|
||||
<script src="../js/libs/clipboard.min.js"></script>
|
||||
<script src="../js/libs/prism.js"></script>
|
||||
<script src="../js/sourceCode.js"></script>
|
||||
<script src="../js/search/search.js"></script>
|
||||
<script src="../js/search/lunr.min.js"></script>
|
||||
<script src="../js/search/search-lunr.js"></script>
|
||||
<script src="../js/search/search_index.js"></script>
|
||||
<script src="../js/lazy-load-graphs.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
423
frontend/documentation/injectables/HelperService.html
Normal file
423
frontend/documentation/injectables/HelperService.html
Normal file
@@ -0,0 +1,423 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>aktienbot documentation</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<link rel="stylesheet" href="../styles/dark.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs">
|
||||
<a href="../" class="navbar-brand">aktienbot documentation</a>
|
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
||||
</div>
|
||||
|
||||
<div class="xs-menu menu" id="mobile-menu">
|
||||
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid main">
|
||||
<div class="row main">
|
||||
<div class="hidden-xs menu">
|
||||
<compodoc-menu mode="normal"></compodoc-menu>
|
||||
</div>
|
||||
<!-- START CONTENT -->
|
||||
<div class="content injectable">
|
||||
<div class="content-data">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li>Injectables</li>
|
||||
<li >HelperService</li>
|
||||
</ol>
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="active">
|
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
|
||||
</li>
|
||||
<li >
|
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active in" id="c-info">
|
||||
<p class="comment">
|
||||
<h3>File</h3>
|
||||
</p>
|
||||
<p class="comment">
|
||||
<code>src/app/Helpers/helper.service.ts</code>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="index">Index</h3>
|
||||
<table class="table table-sm table-bordered index-table">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<h6><b>Methods</b></h6>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<ul class="index-list">
|
||||
<li>
|
||||
<a href="#delay" >delay</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#formatKeywordsData" >formatKeywordsData</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#formatShareData" >formatShareData</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="constructor">Constructor</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>constructor(botService: <a href="../injectables/BotService.html" target="_self">BotService</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="8" class="link-to-prism">src/app/Helpers/helper.service.ts:8</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div>
|
||||
<b>Parameters :</b>
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>botService</td>
|
||||
|
||||
<td>
|
||||
<code><a href="../injectables/BotService.html" target="_self" >BotService</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<h3 id="methods">
|
||||
Methods
|
||||
</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="delay"></a>
|
||||
<span class="name">
|
||||
<span ><b>delay</b></span>
|
||||
<a href="#delay"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>delay(ms: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="14"
|
||||
class="link-to-prism">src/app/Helpers/helper.service.ts:14</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>ms</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="formatKeywordsData"></a>
|
||||
<span class="name">
|
||||
<span ><b>formatKeywordsData</b></span>
|
||||
<a href="#formatKeywordsData"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>formatKeywordsData()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="31"
|
||||
class="link-to-prism">src/app/Helpers/helper.service.ts:31</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="../interfaces/Keyword.html" target="_self" >Keyword[]</a></code>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="formatShareData"></a>
|
||||
<span class="name">
|
||||
<span ><b>formatShareData</b></span>
|
||||
<a href="#formatShareData"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>formatShareData()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="18"
|
||||
class="link-to-prism">src/app/Helpers/helper.service.ts:18</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="../interfaces/Share.html" target="_self" >Share[]</a></code>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from '@angular/core';
|
||||
import { BotService } from '../Services/bot.service';
|
||||
import { Keyword, Share } from '../Views/bot-settings/bot-settings.component';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class HelperService {
|
||||
constructor(private botService: BotService) {}
|
||||
|
||||
/**
|
||||
* @param {number} ms
|
||||
*/
|
||||
delay(ms: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
formatShareData(): Share[] {
|
||||
var shares: Share[] = [];
|
||||
this.botService.getSymbols().subscribe((result) => {
|
||||
var data = JSON.parse(result);
|
||||
for (let i = 0; i < data.data.length; i++) {
|
||||
shares.push({
|
||||
isin: data.data[i].isin,
|
||||
});
|
||||
}
|
||||
});
|
||||
return shares;
|
||||
}
|
||||
|
||||
formatKeywordsData(): Keyword[] {
|
||||
var keywords: Keyword[] = [];
|
||||
this.botService.getKeywords().subscribe((result) => {
|
||||
var data = JSON.parse(result);
|
||||
for (let i = 0; i < data.data.length; i++) {
|
||||
keywords.push({
|
||||
name: data.data[i].keyword,
|
||||
});
|
||||
}
|
||||
});
|
||||
return keywords;
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results">
|
||||
<div class="has-results">
|
||||
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
||||
<ul class="search-results-list"></ul>
|
||||
</div>
|
||||
<div class="no-results">
|
||||
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="dark-mode-switch">
|
||||
<input type="checkbox">
|
||||
<span class="slider">
|
||||
<svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<script>
|
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable';
|
||||
var COMPODOC_CURRENT_PAGE_URL = 'HelperService.html';
|
||||
var MAX_SEARCH_RESULTS = 15;
|
||||
</script>
|
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script>
|
||||
<script src="../js/libs/lit-html.js"></script>
|
||||
|
||||
<script src="../js/menu-wc.js" defer></script>
|
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
||||
|
||||
<script src="../js/libs/bootstrap-native.js"></script>
|
||||
|
||||
<script src="../js/libs/es6-shim.min.js"></script>
|
||||
<script src="../js/libs/EventDispatcher.js"></script>
|
||||
<script src="../js/libs/promise.min.js"></script>
|
||||
<script src="../js/libs/zepto.min.js"></script>
|
||||
|
||||
<script src="../js/compodoc.js"></script>
|
||||
|
||||
<script src="../js/tabs.js"></script>
|
||||
<script src="../js/menu.js"></script>
|
||||
<script src="../js/libs/clipboard.min.js"></script>
|
||||
<script src="../js/libs/prism.js"></script>
|
||||
<script src="../js/sourceCode.js"></script>
|
||||
<script src="../js/search/search.js"></script>
|
||||
<script src="../js/search/lunr.min.js"></script>
|
||||
<script src="../js/search/search-lunr.js"></script>
|
||||
<script src="../js/search/search_index.js"></script>
|
||||
<script src="../js/lazy-load-graphs.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
617
frontend/documentation/injectables/ProfileService.html
Normal file
617
frontend/documentation/injectables/ProfileService.html
Normal file
@@ -0,0 +1,617 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>aktienbot documentation</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<link rel="stylesheet" href="../styles/dark.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs">
|
||||
<a href="../" class="navbar-brand">aktienbot documentation</a>
|
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
||||
</div>
|
||||
|
||||
<div class="xs-menu menu" id="mobile-menu">
|
||||
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid main">
|
||||
<div class="row main">
|
||||
<div class="hidden-xs menu">
|
||||
<compodoc-menu mode="normal"></compodoc-menu>
|
||||
</div>
|
||||
<!-- START CONTENT -->
|
||||
<div class="content injectable">
|
||||
<div class="content-data">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li>Injectables</li>
|
||||
<li >ProfileService</li>
|
||||
</ol>
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="active">
|
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
|
||||
</li>
|
||||
<li >
|
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active in" id="c-info">
|
||||
<p class="comment">
|
||||
<h3>File</h3>
|
||||
</p>
|
||||
<p class="comment">
|
||||
<code>src/app/Services/profile.service.ts</code>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="index">Index</h3>
|
||||
<table class="table table-sm table-bordered index-table">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<h6><b>Methods</b></h6>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<ul class="index-list">
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#addCronString" >addCronString</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#addTelegramId" >addTelegramId</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#getUserData" >getUserData</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#updateProfile" >updateProfile</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="constructor">Constructor</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>constructor(tokenStorage: <a href="../injectables/TokenStorageService.html" target="_self">TokenStorageService</a>, http: <a href="https://angular.io/api/common/http/HttpClient" target="_blank">HttpClient</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="11" class="link-to-prism">src/app/Services/profile.service.ts:11</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div>
|
||||
<b>Parameters :</b>
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>tokenStorage</td>
|
||||
|
||||
<td>
|
||||
<code><a href="../injectables/TokenStorageService.html" target="_self" >TokenStorageService</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>http</td>
|
||||
|
||||
<td>
|
||||
<code><a href="https://angular.io/api/common/http/HttpClient" target="_blank" >HttpClient</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<h3 id="methods">
|
||||
Methods
|
||||
</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="addCronString"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>addCronString</b></span>
|
||||
<a href="#addCronString"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>addCronString(cron: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="74"
|
||||
class="link-to-prism">src/app/Services/profile.service.ts:74</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>cron</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="addTelegramId"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>addTelegramId</b></span>
|
||||
<a href="#addTelegramId"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>addTelegramId(telegram_user_id: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="55"
|
||||
class="link-to-prism">src/app/Services/profile.service.ts:55</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>telegram_user_id</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="getUserData"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>getUserData</b></span>
|
||||
<a href="#getUserData"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>getUserData()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="20"
|
||||
class="link-to-prism">src/app/Services/profile.service.ts:20</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="updateProfile"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>updateProfile</b></span>
|
||||
<a href="#updateProfile"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>updateProfile(username: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>, password: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank">number</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="35"
|
||||
class="link-to-prism">src/app/Services/profile.service.ts:35</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>username</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td>password</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/number" target="_blank" >number</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>Observable<any></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>Observable</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { TokenStorageService } from './token.service';
|
||||
|
||||
const API_URL = 'https://gruppe1.testsites.info/api/';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ProfileService {
|
||||
constructor(
|
||||
private tokenStorage: TokenStorageService,
|
||||
private http: HttpClient
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @returns Observable
|
||||
*/
|
||||
public getUserData(): Observable<any> {
|
||||
return this.http.get(API_URL + 'user', {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
responseType: 'text',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} username
|
||||
* @param {number} password
|
||||
* @returns Observable
|
||||
*/
|
||||
public updateProfile(username: string, password: number): Observable<any> {
|
||||
return this.http.put(
|
||||
API_URL + 'user',
|
||||
{
|
||||
username,
|
||||
password,
|
||||
},
|
||||
{
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} telegramUserID
|
||||
* @returns Observable
|
||||
*/
|
||||
public addTelegramId(telegram_user_id: string): Observable<any> {
|
||||
return this.http.post(
|
||||
API_URL + 'telegram',
|
||||
{
|
||||
telegram_user_id,
|
||||
},
|
||||
{
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} cronString
|
||||
* @returns Observable
|
||||
*/
|
||||
public addCronString(cron: string): Observable<any> {
|
||||
return this.http.put(
|
||||
'https://gruppe1.testsites.info/api/user' + '/setCron',
|
||||
{
|
||||
cron,
|
||||
},
|
||||
{
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: 'Bearer ' + this.tokenStorage.getToken(),
|
||||
}),
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results">
|
||||
<div class="has-results">
|
||||
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
||||
<ul class="search-results-list"></ul>
|
||||
</div>
|
||||
<div class="no-results">
|
||||
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="dark-mode-switch">
|
||||
<input type="checkbox">
|
||||
<span class="slider">
|
||||
<svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<script>
|
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable';
|
||||
var COMPODOC_CURRENT_PAGE_URL = 'ProfileService.html';
|
||||
var MAX_SEARCH_RESULTS = 15;
|
||||
</script>
|
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script>
|
||||
<script src="../js/libs/lit-html.js"></script>
|
||||
|
||||
<script src="../js/menu-wc.js" defer></script>
|
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
||||
|
||||
<script src="../js/libs/bootstrap-native.js"></script>
|
||||
|
||||
<script src="../js/libs/es6-shim.min.js"></script>
|
||||
<script src="../js/libs/EventDispatcher.js"></script>
|
||||
<script src="../js/libs/promise.min.js"></script>
|
||||
<script src="../js/libs/zepto.min.js"></script>
|
||||
|
||||
<script src="../js/compodoc.js"></script>
|
||||
|
||||
<script src="../js/tabs.js"></script>
|
||||
<script src="../js/menu.js"></script>
|
||||
<script src="../js/libs/clipboard.min.js"></script>
|
||||
<script src="../js/libs/prism.js"></script>
|
||||
<script src="../js/sourceCode.js"></script>
|
||||
<script src="../js/search/search.js"></script>
|
||||
<script src="../js/search/lunr.min.js"></script>
|
||||
<script src="../js/search/search-lunr.js"></script>
|
||||
<script src="../js/search/search_index.js"></script>
|
||||
<script src="../js/lazy-load-graphs.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
546
frontend/documentation/injectables/TokenStorageService.html
Normal file
546
frontend/documentation/injectables/TokenStorageService.html
Normal file
@@ -0,0 +1,546 @@
|
||||
<!doctype html>
|
||||
<html class="no-js" lang="">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<title>aktienbot documentation</title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<link rel="icon" type="image/x-icon" href="../images/favicon.ico">
|
||||
<link rel="stylesheet" href="../styles/style.css">
|
||||
<link rel="stylesheet" href="../styles/dark.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-default navbar-fixed-top visible-xs">
|
||||
<a href="../" class="navbar-brand">aktienbot documentation</a>
|
||||
<button type="button" class="btn btn-default btn-menu ion-ios-menu" id="btn-menu"></button>
|
||||
</div>
|
||||
|
||||
<div class="xs-menu menu" id="mobile-menu">
|
||||
<div id="book-search-input" role="search"><input type="text" placeholder="Type to search"></div> <compodoc-menu></compodoc-menu>
|
||||
</div>
|
||||
|
||||
<div class="container-fluid main">
|
||||
<div class="row main">
|
||||
<div class="hidden-xs menu">
|
||||
<compodoc-menu mode="normal"></compodoc-menu>
|
||||
</div>
|
||||
<!-- START CONTENT -->
|
||||
<div class="content injectable">
|
||||
<div class="content-data">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ol class="breadcrumb">
|
||||
<li>Injectables</li>
|
||||
<li >TokenStorageService</li>
|
||||
</ol>
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="active">
|
||||
<a href="#info" role="tab" id="info-tab" data-toggle="tab" data-link="info">Info</a>
|
||||
</li>
|
||||
<li >
|
||||
<a href="#source" role="tab" id="source-tab" data-toggle="tab" data-link="source">Source</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade active in" id="c-info">
|
||||
<p class="comment">
|
||||
<h3>File</h3>
|
||||
</p>
|
||||
<p class="comment">
|
||||
<code>src/app/Services/token.service.ts</code>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<section>
|
||||
<h3 id="index">Index</h3>
|
||||
<table class="table table-sm table-bordered index-table">
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<h6><b>Methods</b></h6>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<ul class="index-list">
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#getToken" >getToken</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#getUser" >getUser</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#saveToken" >saveToken</a>
|
||||
</li>
|
||||
<li>
|
||||
<span class="modifier">Public</span>
|
||||
<a href="#saveUser" >saveUser</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#signOut" >signOut</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<h3 id="constructor">Constructor</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>constructor()</code>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="7" class="link-to-prism">src/app/Services/token.service.ts:7</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
|
||||
<h3 id="methods">
|
||||
Methods
|
||||
</h3>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="getToken"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>getToken</b></span>
|
||||
<a href="#getToken"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>getToken()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="29"
|
||||
class="link-to-prism">src/app/Services/token.service.ts:29</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code>string | null</code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>string</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="getUser"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>getUser</b></span>
|
||||
<a href="#getUser"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>getUser()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="45"
|
||||
class="link-to-prism">src/app/Services/token.service.ts:45</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>any</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="saveToken"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>saveToken</b></span>
|
||||
<a href="#saveToken"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>saveToken(token: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank">string</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="21"
|
||||
class="link-to-prism">src/app/Services/token.service.ts:21</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>token</td>
|
||||
<td>
|
||||
<code><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/string" target="_blank" >string</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>void</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="saveUser"></a>
|
||||
<span class="name">
|
||||
<span class="modifier">Public</span>
|
||||
<span ><b>saveUser</b></span>
|
||||
<a href="#saveUser"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<span class="modifier-icon icon ion-ios-reset"></span>
|
||||
<code>saveUser(user: <a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank">any</a>)</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="37"
|
||||
class="link-to-prism">src/app/Services/token.service.ts:37</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div class="io-description">
|
||||
<b>Parameters :</b>
|
||||
|
||||
<table class="params">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Type</td>
|
||||
<td>Optional</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>user</td>
|
||||
<td>
|
||||
<code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >any</a></code>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
No
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>void</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-sm table-bordered">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<a name="signOut"></a>
|
||||
<span class="name">
|
||||
<span ><b>signOut</b></span>
|
||||
<a href="#signOut"><span class="icon ion-ios-link"></span></a>
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<code>signOut()</code>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
<div class="io-line">Defined in <a href="" data-line="13"
|
||||
class="link-to-prism">src/app/Services/token.service.ts:13</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="col-md-4">
|
||||
|
||||
<div>
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<b>Returns : </b> <code><a href="https://www.typescriptlang.org/docs/handbook/basic-types.html" target="_blank" >void</a></code>
|
||||
|
||||
</div>
|
||||
<div class="io-description">
|
||||
<p>void</p>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade tab-source-code" id="c-source">
|
||||
<pre class="line-numbers compodoc-sourcecode"><code class="language-typescript">import { Injectable } from '@angular/core';
|
||||
const TOKEN_KEY = 'auth-token';
|
||||
const USER_KEY = 'auth-user';
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TokenStorageService {
|
||||
constructor() {}
|
||||
|
||||
/**
|
||||
* @returns void
|
||||
*/
|
||||
signOut(): void {
|
||||
window.sessionStorage.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} token
|
||||
* @returns void
|
||||
*/
|
||||
public saveToken(token: string): void {
|
||||
window.sessionStorage.removeItem(TOKEN_KEY);
|
||||
window.sessionStorage.setItem(TOKEN_KEY, token);
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns string
|
||||
*/
|
||||
public getToken(): string | null {
|
||||
return window.sessionStorage.getItem(TOKEN_KEY);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {any} user
|
||||
* @returns void
|
||||
*/
|
||||
public saveUser(user: any): void {
|
||||
window.sessionStorage.removeItem(USER_KEY);
|
||||
window.sessionStorage.setItem(USER_KEY, JSON.stringify(user));
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns any
|
||||
*/
|
||||
public getUser(): any {
|
||||
const user = window.sessionStorage.getItem(USER_KEY);
|
||||
if (user) {
|
||||
return JSON.parse(user);
|
||||
}
|
||||
return {};
|
||||
}
|
||||
}
|
||||
</code></pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div><div class="search-results">
|
||||
<div class="has-results">
|
||||
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
|
||||
<ul class="search-results-list"></ul>
|
||||
</div>
|
||||
<div class="no-results">
|
||||
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- END CONTENT -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<label class="dark-mode-switch">
|
||||
<input type="checkbox">
|
||||
<span class="slider">
|
||||
<svg class="slider-icon" viewBox="0 0 24 24" fill="none" height="20" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" width="20" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"></path>
|
||||
</svg>
|
||||
</span>
|
||||
</label>
|
||||
|
||||
<script>
|
||||
var COMPODOC_CURRENT_PAGE_DEPTH = 1;
|
||||
var COMPODOC_CURRENT_PAGE_CONTEXT = 'injectable';
|
||||
var COMPODOC_CURRENT_PAGE_URL = 'TokenStorageService.html';
|
||||
var MAX_SEARCH_RESULTS = 15;
|
||||
</script>
|
||||
|
||||
<script src="../js/libs/custom-elements.min.js"></script>
|
||||
<script src="../js/libs/lit-html.js"></script>
|
||||
|
||||
<script src="../js/menu-wc.js" defer></script>
|
||||
<script nomodule src="../js/menu-wc_es5.js" defer></script>
|
||||
|
||||
<script src="../js/libs/bootstrap-native.js"></script>
|
||||
|
||||
<script src="../js/libs/es6-shim.min.js"></script>
|
||||
<script src="../js/libs/EventDispatcher.js"></script>
|
||||
<script src="../js/libs/promise.min.js"></script>
|
||||
<script src="../js/libs/zepto.min.js"></script>
|
||||
|
||||
<script src="../js/compodoc.js"></script>
|
||||
|
||||
<script src="../js/tabs.js"></script>
|
||||
<script src="../js/menu.js"></script>
|
||||
<script src="../js/libs/clipboard.min.js"></script>
|
||||
<script src="../js/libs/prism.js"></script>
|
||||
<script src="../js/sourceCode.js"></script>
|
||||
<script src="../js/search/search.js"></script>
|
||||
<script src="../js/search/lunr.min.js"></script>
|
||||
<script src="../js/search/search-lunr.js"></script>
|
||||
<script src="../js/search/search_index.js"></script>
|
||||
<script src="../js/lazy-load-graphs.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user