Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
W
wenyuanwall
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
3rdeye
wenyuanwall
Commits
8c172da7
Commit
8c172da7
authored
Nov 17, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add ad
parent
780e4a9e
Pipeline
#17952
passed with stages
in 2 minutes and 6 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
2 deletions
+99
-2
src/app/api/models.ts
src/app/api/models.ts
+1
-0
src/app/api/models/string-return-message-dto.ts
src/app/api/models/string-return-message-dto.ts
+24
-0
src/app/api/services/api.service.ts
src/app/api/services/api.service.ts
+52
-0
src/app/app.component.html
src/app/app.component.html
+6
-0
src/app/app.component.ts
src/app/app.component.ts
+16
-2
No files found.
src/app/api/models.ts
View file @
8c172da7
export
{
Blacklist
}
from
'
./models/blacklist
'
;
export
{
BlacklistAccount
}
from
'
./models/blacklist-account
'
;
export
{
BlacklistAccountPaginatedReturnMessageDto
}
from
'
./models/blacklist-account-paginated-return-message-dto
'
;
export
{
StringReturnMessageDto
}
from
'
./models/string-return-message-dto
'
;
src/app/api/models/string-return-message-dto.ts
0 → 100644
View file @
8c172da7
/* tslint:disable */
/* eslint-disable */
export
interface
StringReturnMessageDto
{
/**
* Return data.
*/
data
?:
string
;
/**
* Return message
*/
message
:
string
;
/**
* Return code
*/
statusCode
:
number
;
/**
* Whether success.
*/
success
:
boolean
;
}
src/app/api/services/api.service.ts
View file @
8c172da7
...
...
@@ -10,6 +10,7 @@ import { Observable } from 'rxjs';
import
{
map
,
filter
}
from
'
rxjs/operators
'
;
import
{
BlacklistAccountPaginatedReturnMessageDto
}
from
'
../models/blacklist-account-paginated-return-message-dto
'
;
import
{
StringReturnMessageDto
}
from
'
../models/string-return-message-dto
'
;
@
Injectable
({
providedIn
:
'
root
'
,
...
...
@@ -120,4 +121,55 @@ export class ApiService extends BaseService {
);
}
/**
* Path part for operation adControllerGetAd
*/
static
readonly
AdControllerGetAdPath
=
'
/api/ad
'
;
/**
* Get ad.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `adControllerGetAd()` instead.
*
* This method doesn't expect any request body.
*/
adControllerGetAd$Response
(
params
?:
{
}):
Observable
<
StrictHttpResponse
<
StringReturnMessageDto
>>
{
const
rb
=
new
RequestBuilder
(
this
.
rootUrl
,
ApiService
.
AdControllerGetAdPath
,
'
get
'
);
if
(
params
)
{
}
return
this
.
http
.
request
(
rb
.
build
({
responseType
:
'
json
'
,
accept
:
'
application/json
'
})).
pipe
(
filter
((
r
:
any
)
=>
r
instanceof
HttpResponse
),
map
((
r
:
HttpResponse
<
any
>
)
=>
{
return
r
as
StrictHttpResponse
<
StringReturnMessageDto
>
;
})
);
}
/**
* Get ad.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `adControllerGetAd$Response()` instead.
*
* This method doesn't expect any request body.
*/
adControllerGetAd
(
params
?:
{
}):
Observable
<
StringReturnMessageDto
>
{
return
this
.
adControllerGetAd$Response
(
params
).
pipe
(
map
((
r
:
StrictHttpResponse
<
StringReturnMessageDto
>
)
=>
r
.
body
as
StringReturnMessageDto
)
);
}
}
src/app/app.component.html
View file @
8c172da7
...
...
@@ -3,6 +3,12 @@
</header>
<div
class=
"container"
>
<div
class=
"row"
*ngIf=
"ad"
>
<ul
class=
"list-group"
>
<li
class=
"list-group-item list-group-item-info"
[innerHTML]=
"ad"
></li>
</ul>
</div>
<br
*ngIf=
"ad"
>
<div
class=
"row"
>
<div
class=
"col-lg-3"
></div>
<div
class=
"col-lg-6"
>
...
...
src/app/app.component.ts
View file @
8c172da7
import
{
Component
}
from
'
@angular/core
'
;
import
{
AfterViewInit
,
Component
}
from
'
@angular/core
'
;
import
{
ToastService
}
from
'
./toast.service
'
;
import
{
BlacklistAccount
}
from
'
./api/models/blacklist-account
'
;
import
{
ApiService
}
from
'
./api/services/api.service
'
;
...
...
@@ -10,17 +10,31 @@ import * as moment from 'moment';
templateUrl
:
'
./app.component.html
'
,
styleUrls
:
[
'
./app.component.css
'
],
})
export
class
AppComponent
{
export
class
AppComponent
implements
AfterViewInit
{
search
=
''
;
displayingAccount
=
''
;
title
=
'
蔷蔷挂人查询
'
;
ad
=
''
;
result
?:
BlacklistAccount
[];
constructor
(
public
toast
:
ToastService
,
private
api
:
ApiService
)
{}
ngAfterViewInit
()
{
this
.
initAd
();
}
displayDate
(
date
:
string
)
{
return
moment
(
date
).
format
(
'
YYYY-MM-DD HH:mm:ss
'
);
}
async
initAd
()
{
try
{
const
ad
=
await
lastValueFrom
(
this
.
api
.
adControllerGetAd
());
this
.
ad
=
ad
.
data
!
;
}
catch
(
e
)
{
console
.
log
(
`Failed to load ad:
${(
e
as
Error
).
toString
()}
`
);
}
}
async
onSearch
()
{
this
.
result
=
undefined
;
const
search
=
this
.
search
.
trim
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment