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
2252cc1f
Commit
2252cc1f
authored
May 18, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new
parent
d2b363e8
Pipeline
#36479
passed with stages
in 3 minutes and 50 seconds
Changes
13
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
380 additions
and
43 deletions
+380
-43
angular.json
angular.json
+3
-0
src/app/api/models.ts
src/app/api/models.ts
+5
-3
src/app/api/models/ad-return-message-dto.ts
src/app/api/models/ad-return-message-dto.ts
+5
-0
src/app/api/models/ad.ts
src/app/api/models/ad.ts
+7
-7
src/app/api/models/blacklist-account-blacklist-result-dto.ts
src/app/api/models/blacklist-account-blacklist-result-dto.ts
+20
-0
src/app/api/models/blacklist-account-result-dto-paginated-return-message-dto.ts
...cklist-account-result-dto-paginated-return-message-dto.ts
+8
-3
src/app/api/models/blacklist-account-result-dto.ts
src/app/api/models/blacklist-account-result-dto.ts
+17
-0
src/app/api/models/string-return-message-dto.ts
src/app/api/models/string-return-message-dto.ts
+5
-0
src/app/api/models/whitelist-account-result-dto-paginated-return-message-dto.ts
...telist-account-result-dto-paginated-return-message-dto.ts
+50
-0
src/app/api/models/whitelist-account-result-dto.ts
src/app/api/models/whitelist-account-result-dto.ts
+40
-0
src/app/api/services/api.service.ts
src/app/api/services/api.service.ts
+96
-5
src/app/app.component.html
src/app/app.component.html
+54
-14
src/app/app.component.ts
src/app/app.component.ts
+70
-11
No files found.
angular.json
View file @
2252cc1f
{
{
"$schema"
:
"./node_modules/@angular/cli/lib/config/schema.json"
,
"$schema"
:
"./node_modules/@angular/cli/lib/config/schema.json"
,
"cli"
:
{
"analytics"
:
false
},
"version"
:
1
,
"version"
:
1
,
"newProjectRoot"
:
"projects"
,
"newProjectRoot"
:
"projects"
,
"projects"
:
{
"projects"
:
{
...
...
src/app/api/models.ts
View file @
2252cc1f
export
{
Blacklist
}
from
'
./models/blacklist
'
;
export
{
Blacklist
AccountBlacklistResultDto
}
from
'
./models/blacklist-account-blacklist-result-dto
'
;
export
{
BlacklistAccount
}
from
'
./models/blacklist-account
'
;
export
{
BlacklistAccount
ResultDto
}
from
'
./models/blacklist-account-result-dto
'
;
export
{
BlacklistAccount
PaginatedReturnMessageDto
}
from
'
./models/blacklist-account
-paginated-return-message-dto
'
;
export
{
BlacklistAccount
ResultDtoPaginatedReturnMessageDto
}
from
'
./models/blacklist-account-result-dto
-paginated-return-message-dto
'
;
export
{
Ad
}
from
'
./models/ad
'
;
export
{
Ad
}
from
'
./models/ad
'
;
export
{
AdReturnMessageDto
}
from
'
./models/ad-return-message-dto
'
;
export
{
AdReturnMessageDto
}
from
'
./models/ad-return-message-dto
'
;
export
{
StringReturnMessageDto
}
from
'
./models/string-return-message-dto
'
;
export
{
StringReturnMessageDto
}
from
'
./models/string-return-message-dto
'
;
export
{
WhitelistAccountResultDto
}
from
'
./models/whitelist-account-result-dto
'
;
export
{
WhitelistAccountResultDtoPaginatedReturnMessageDto
}
from
'
./models/whitelist-account-result-dto-paginated-return-message-dto
'
;
src/app/api/models/ad-return-message-dto.ts
View file @
2252cc1f
...
@@ -22,4 +22,9 @@ export interface AdReturnMessageDto {
...
@@ -22,4 +22,9 @@ export interface AdReturnMessageDto {
* Whether success.
* Whether success.
*/
*/
success
:
boolean
;
success
:
boolean
;
/**
* Return timestamp
*/
timestamp
:
string
;
}
}
src/app/api/models/ad.ts
View file @
2252cc1f
...
@@ -5,20 +5,20 @@ export interface Ad {
...
@@ -5,20 +5,20 @@ export interface Ad {
/**
/**
* Ad click count
* Ad click count
*/
*/
clickCount
:
number
;
clickCount
?
:
number
;
/**
/**
* Ad content
* Ad content
*/
*/
content
:
string
;
content
:
string
;
createTime
:
string
;
createTime
?
:
string
;
deleteTime
:
string
;
deleteTime
?
:
string
;
/**
/**
* Ad is enabled
* Ad is enabled
*/
*/
enabled
:
boolean
;
enabled
?
:
boolean
;
id
:
number
;
id
?
:
number
;
/**
/**
* Ad link
* Ad link
...
@@ -34,10 +34,10 @@ export interface Ad {
...
@@ -34,10 +34,10 @@ export interface Ad {
* Records per page.
* Records per page.
*/
*/
recordsPerPage
?:
number
;
recordsPerPage
?:
number
;
updateTime
:
string
;
updateTime
?
:
string
;
/**
/**
* Ad view count
* Ad view count
*/
*/
viewCount
:
number
;
viewCount
?
:
number
;
}
}
src/app/api/models/blacklist.ts
→
src/app/api/models/blacklist
-account-blacklist-result-dto
.ts
View file @
2252cc1f
/* tslint:disable */
/* tslint:disable */
/* eslint-disable */
/* eslint-disable */
import
{
BlacklistAccount
}
from
'
./blacklist-account
'
;
export
interface
BlacklistAccountBlacklistResultDto
{
export
interface
Blacklist
{
accounts
:
Array
<
BlacklistAccount
>
;
/**
/**
* Tweet content
* Tweet content
*/
*/
content
:
string
;
content
:
string
;
createTime
:
string
;
deleteTime
:
string
;
id
:
string
;
id
:
string
;
/**
/**
...
@@ -17,19 +13,8 @@ export interface Blacklist {
...
@@ -17,19 +13,8 @@ export interface Blacklist {
*/
*/
link
:
string
;
link
:
string
;
/**
* The nth page, starting with 1.
*/
pageCount
?:
number
;
/**
* Records per page.
*/
recordsPerPage
?:
number
;
/**
/**
* Tweet time
* Tweet time
*/
*/
time
:
string
;
time
:
string
;
updateTime
:
string
;
}
}
src/app/api/models/blacklist-account-paginated-return-message-dto.ts
→
src/app/api/models/blacklist-account-
result-dto-
paginated-return-message-dto.ts
View file @
2252cc1f
/* tslint:disable */
/* tslint:disable */
/* eslint-disable */
/* eslint-disable */
import
{
BlacklistAccount
}
from
'
./blacklist-account
'
;
import
{
BlacklistAccount
ResultDto
}
from
'
./blacklist-account-result-dto
'
;
export
interface
BlacklistAccountPaginatedReturnMessageDto
{
export
interface
BlacklistAccount
ResultDto
PaginatedReturnMessageDto
{
/**
/**
* Return data.
* Return data.
*/
*/
data
?:
Array
<
BlacklistAccount
>
;
data
?:
Array
<
BlacklistAccount
ResultDto
>
;
/**
/**
* Return message
* Return message
...
@@ -33,6 +33,11 @@ export interface BlacklistAccountPaginatedReturnMessageDto {
...
@@ -33,6 +33,11 @@ export interface BlacklistAccountPaginatedReturnMessageDto {
*/
*/
success
:
boolean
;
success
:
boolean
;
/**
* Return timestamp
*/
timestamp
:
string
;
/**
/**
* Total record count.
* Total record count.
*/
*/
...
...
src/app/api/models/blacklist-account.ts
→
src/app/api/models/blacklist-account
-result-dto
.ts
View file @
2252cc1f
/* tslint:disable */
/* tslint:disable */
/* eslint-disable */
/* eslint-disable */
import
{
Blacklist
}
from
'
./blacklist
'
;
import
{
Blacklist
AccountBlacklistResultDto
}
from
'
./blacklist-account-blacklist-result-dto
'
;
export
interface
BlacklistAccount
{
export
interface
BlacklistAccount
ResultDto
{
/**
/**
* QQ account number.
* QQ account number.
*/
*/
account
:
string
;
account
:
string
;
blacklist
:
Blacklist
;
blacklist
?:
BlacklistAccountBlacklistResultDto
;
/**
/**
* Blacklist ID.
* Blacklist ID.
*/
*/
blacklistId
:
string
;
blacklistId
:
string
;
createTime
:
string
;
id
?:
number
;
deleteTime
:
string
;
id
:
number
;
/**
* The nth page, starting with 1.
*/
pageCount
?:
number
;
/**
* Records per page.
*/
recordsPerPage
?:
number
;
updateTime
:
string
;
}
}
src/app/api/models/string-return-message-dto.ts
View file @
2252cc1f
...
@@ -21,4 +21,9 @@ export interface StringReturnMessageDto {
...
@@ -21,4 +21,9 @@ export interface StringReturnMessageDto {
* Whether success.
* Whether success.
*/
*/
success
:
boolean
;
success
:
boolean
;
/**
* Return timestamp
*/
timestamp
:
string
;
}
}
src/app/api/models/whitelist-account-result-dto-paginated-return-message-dto.ts
0 → 100644
View file @
2252cc1f
/* tslint:disable */
/* eslint-disable */
import
{
WhitelistAccountResultDto
}
from
'
./whitelist-account-result-dto
'
;
export
interface
WhitelistAccountResultDtoPaginatedReturnMessageDto
{
/**
* Return data.
*/
data
?:
Array
<
WhitelistAccountResultDto
>
;
/**
* Return message
*/
message
:
string
;
/**
* Current page.
*/
pageCount
:
number
;
/**
* Records per page.
*/
recordsPerPage
:
number
;
/**
* Return code
*/
statusCode
:
number
;
/**
* Whether success.
*/
success
:
boolean
;
/**
* Return timestamp
*/
timestamp
:
string
;
/**
* Total record count.
*/
total
:
number
;
/**
* Total page count.
*/
totalPages
:
number
;
}
src/app/api/models/whitelist-account-result-dto.ts
0 → 100644
View file @
2252cc1f
/* tslint:disable */
/* eslint-disable */
export
interface
WhitelistAccountResultDto
{
/**
* QQ account number.
*/
account
:
string
;
/**
* false => not active
*/
enabled
?:
boolean
;
/**
* Fee
*/
fee
?:
string
;
/**
* forbidden
*/
forbidden
?:
string
;
id
?:
number
;
/**
* name
*/
name
:
string
;
/**
* Twitter ID
*/
twitter
:
string
;
/**
* type
*/
type
?:
string
;
}
src/app/api/services/api.service.ts
View file @
2252cc1f
...
@@ -10,8 +10,9 @@ import { Observable } from 'rxjs';
...
@@ -10,8 +10,9 @@ import { Observable } from 'rxjs';
import
{
map
,
filter
}
from
'
rxjs/operators
'
;
import
{
map
,
filter
}
from
'
rxjs/operators
'
;
import
{
AdReturnMessageDto
}
from
'
../models/ad-return-message-dto
'
;
import
{
AdReturnMessageDto
}
from
'
../models/ad-return-message-dto
'
;
import
{
BlacklistAccount
PaginatedReturnMessageDto
}
from
'
../models/blacklist-account
-paginated-return-message-dto
'
;
import
{
BlacklistAccount
ResultDtoPaginatedReturnMessageDto
}
from
'
../models/blacklist-account-result-dto
-paginated-return-message-dto
'
;
import
{
StringReturnMessageDto
}
from
'
../models/string-return-message-dto
'
;
import
{
StringReturnMessageDto
}
from
'
../models/string-return-message-dto
'
;
import
{
WhitelistAccountResultDtoPaginatedReturnMessageDto
}
from
'
../models/whitelist-account-result-dto-paginated-return-message-dto
'
;
@
Injectable
({
@
Injectable
({
providedIn
:
'
root
'
,
providedIn
:
'
root
'
,
...
@@ -61,7 +62,7 @@ export class ApiService extends BaseService {
...
@@ -61,7 +62,7 @@ export class ApiService extends BaseService {
* Blacklist ID.
* Blacklist ID.
*/
*/
blacklistId
?:
string
;
blacklistId
?:
string
;
}):
Observable
<
StrictHttpResponse
<
BlacklistAccountPaginatedReturnMessageDto
>>
{
}):
Observable
<
StrictHttpResponse
<
BlacklistAccount
ResultDto
PaginatedReturnMessageDto
>>
{
const
rb
=
new
RequestBuilder
(
this
.
rootUrl
,
ApiService
.
BlacklistAccountControllerFindAllPath
,
'
get
'
);
const
rb
=
new
RequestBuilder
(
this
.
rootUrl
,
ApiService
.
BlacklistAccountControllerFindAllPath
,
'
get
'
);
if
(
params
)
{
if
(
params
)
{
...
@@ -78,7 +79,7 @@ export class ApiService extends BaseService {
...
@@ -78,7 +79,7 @@ export class ApiService extends BaseService {
})).
pipe
(
})).
pipe
(
filter
((
r
:
any
)
=>
r
instanceof
HttpResponse
),
filter
((
r
:
any
)
=>
r
instanceof
HttpResponse
),
map
((
r
:
HttpResponse
<
any
>
)
=>
{
map
((
r
:
HttpResponse
<
any
>
)
=>
{
return
r
as
StrictHttpResponse
<
BlacklistAccountPaginatedReturnMessageDto
>
;
return
r
as
StrictHttpResponse
<
BlacklistAccount
ResultDto
PaginatedReturnMessageDto
>
;
})
})
);
);
}
}
...
@@ -115,10 +116,10 @@ export class ApiService extends BaseService {
...
@@ -115,10 +116,10 @@ export class ApiService extends BaseService {
* Blacklist ID.
* Blacklist ID.
*/
*/
blacklistId
?:
string
;
blacklistId
?:
string
;
}):
Observable
<
BlacklistAccountPaginatedReturnMessageDto
>
{
}):
Observable
<
BlacklistAccount
ResultDto
PaginatedReturnMessageDto
>
{
return
this
.
blacklistAccountControllerFindAll$Response
(
params
).
pipe
(
return
this
.
blacklistAccountControllerFindAll$Response
(
params
).
pipe
(
map
((
r
:
StrictHttpResponse
<
BlacklistAccount
PaginatedReturnMessageDto
>
)
=>
r
.
body
as
BlacklistAccount
PaginatedReturnMessageDto
)
map
((
r
:
StrictHttpResponse
<
BlacklistAccount
ResultDtoPaginatedReturnMessageDto
>
)
=>
r
.
body
as
BlacklistAccountResultDto
PaginatedReturnMessageDto
)
);
);
}
}
...
@@ -230,4 +231,94 @@ export class ApiService extends BaseService {
...
@@ -230,4 +231,94 @@ export class ApiService extends BaseService {
);
);
}
}
/**
* Path part for operation whitelistAccountControllerFindAll
*/
static
readonly
WhitelistAccountControllerFindAllPath
=
'
/api/whitelist-account
'
;
/**
* Find all WhitelistAccount.
*
*
*
* This method provides access to the full `HttpResponse`, allowing access to response headers.
* To access only the response body, use `whitelistAccountControllerFindAll()` instead.
*
* This method doesn't expect any request body.
*/
whitelistAccountControllerFindAll$Response
(
params
?:
{
/**
* The nth page, starting with 1.
*/
pageCount
?:
number
;
/**
* Records per page.
*/
recordsPerPage
?:
number
;
id
?:
number
;
/**
* QQ account number.
*/
account
?:
string
;
random
?:
number
;
}):
Observable
<
StrictHttpResponse
<
WhitelistAccountResultDtoPaginatedReturnMessageDto
>>
{
const
rb
=
new
RequestBuilder
(
this
.
rootUrl
,
ApiService
.
WhitelistAccountControllerFindAllPath
,
'
get
'
);
if
(
params
)
{
rb
.
query
(
'
pageCount
'
,
params
.
pageCount
,
{});
rb
.
query
(
'
recordsPerPage
'
,
params
.
recordsPerPage
,
{});
rb
.
query
(
'
id
'
,
params
.
id
,
{});
rb
.
query
(
'
account
'
,
params
.
account
,
{});
rb
.
query
(
'
random
'
,
params
.
random
,
{});
}
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
<
WhitelistAccountResultDtoPaginatedReturnMessageDto
>
;
})
);
}
/**
* Find all WhitelistAccount.
*
*
*
* This method provides access to only to the response body.
* To access the full response (for headers, for example), `whitelistAccountControllerFindAll$Response()` instead.
*
* This method doesn't expect any request body.
*/
whitelistAccountControllerFindAll
(
params
?:
{
/**
* The nth page, starting with 1.
*/
pageCount
?:
number
;
/**
* Records per page.
*/
recordsPerPage
?:
number
;
id
?:
number
;
/**
* QQ account number.
*/
account
?:
string
;
random
?:
number
;
}):
Observable
<
WhitelistAccountResultDtoPaginatedReturnMessageDto
>
{
return
this
.
whitelistAccountControllerFindAll$Response
(
params
).
pipe
(
map
((
r
:
StrictHttpResponse
<
WhitelistAccountResultDtoPaginatedReturnMessageDto
>
)
=>
r
.
body
as
WhitelistAccountResultDtoPaginatedReturnMessageDto
)
);
}
}
}
src/app/app.component.html
View file @
2252cc1f
<header
class=
"container"
>
<header
class=
"container"
>
<h1
class=
"title"
>
蔷蔷
挂人
查询
</h1>
<h1
class=
"title"
>
蔷蔷查询
</h1>
</header>
</header>
<div
class=
"container"
>
<div
class=
"container"
>
...
@@ -15,16 +15,20 @@
...
@@ -15,16 +15,20 @@
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"col-lg-12"
>
<label>
要查询的 QQ 号
</label>
<label>
搜索
</label>
<input
type=
"text"
class=
"form-control"
[(ngModel)]=
"search"
(keyup.enter)=
"onSearch()"
>
<input
type=
"text"
class=
"form-control"
[(ngModel)]=
"search"
(keyup.enter)=
"on
Blacklist
Search()"
>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"container"
>
<div
class=
"container"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-12"
>
<div
class=
"col-lg-6"
>
<br>
<button
class=
"btn btn-danger"
style=
"width: 100%"
(click)=
"onBlacklistSearch()"
>
黑名单查询
</button>
</div>
<div
class=
"col-lg-6"
>
<br>
<br>
<button
class=
"btn btn-
primary"
style=
"width: 100%"
(click)=
"onSearch()"
>
查询
</button>
<button
class=
"btn btn-
success"
style=
"width: 100%"
(click)=
"onWhitelistSearch()"
>
白名单
查询
</button>
</div>
</div>
</div>
</div>
</div>
</div>
...
@@ -33,13 +37,18 @@
...
@@ -33,13 +37,18 @@
</div>
</div>
</div>
</div>
<div
class=
"container"
*ngIf=
"
r
esult"
>
<div
class=
"container"
*ngIf=
"
blacklistResult || whitelistR
esult"
>
<br>
<br>
<ul
class=
"list-group"
>
<ul
class=
"list-group"
*ngIf=
"blacklistResult"
>
<li
class=
"list-group-item list-group-item-success"
*ngIf=
"!result!.length"
>
用户 {{displayingAccount}} 是安全的。
</li>
<li
class=
"list-group-item list-group-item-success"
*ngIf=
"!blacklistResult.length && whitelistResult?.length"
>
用户 {{displayingAccount}} 处在白名单内,是安全的。
</li>
<li
class=
"list-group-item list-group-item-danger"
*ngIf=
"result!.length"
>
用户 {{displayingAccount}} 存在风险。
</li>
<li
class=
"list-group-item list-group-item-info"
*ngIf=
"!blacklistResult.length && !whitelistResult?.length"
>
用户 {{displayingAccount}} 是安全的。
</li>
<li
class=
"list-group-item list-group-item-danger"
*ngIf=
"blacklistResult.length"
>
用户 {{displayingAccount}} 存在风险。
</li>
</ul>
</ul>
<div
class=
"row grid"
*ngIf=
"result!.length"
>
<ul
class=
"list-group"
*ngIf=
"!blacklistResult && whitelistResult && displayingAccount"
>
<li
class=
"list-group-item list-group-item-warning"
*ngIf=
"!whitelistResult.length"
>
用户 {{displayingAccount}} 不在白名单内。
</li>
<li
class=
"list-group-item list-group-item-success"
*ngIf=
"whitelistResult.length"
>
用户 {{displayingAccount}} 处在白名单内。
</li>
</ul>
<div
class=
"row grid"
*ngIf=
"blacklistResult?.length"
>
<br>
<br>
<div
class=
"col-lg-12"
>
<div
class=
"col-lg-12"
>
<table
class=
"table table-striped"
>
<table
class=
"table table-striped"
>
...
@@ -51,12 +60,43 @@
...
@@ -51,12 +60,43 @@
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
<tr
*ngFor=
"let item of result"
>
<tr
*ngFor=
"let item of blacklistResult"
>
<td>
{{displayDate(item.blacklist.time)}}
</td>
<td>
{{displayDate(item.blacklist!.time!)}}
</td>
<td>
{{item.blacklist.content}}
</td>
<td>
{{item.blacklist!.content}}
</td>
<td>
<a
class=
"btn btn-outline-primary"
[href]=
"item.blacklist!.link"
target=
"_blank"
>
查看
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div
class=
"row grid"
*ngIf=
"whitelistResult?.length"
>
<br>
<div
class=
"col-lg-12"
>
<table
class=
"table table-striped"
>
<thead>
<tr>
<th
width=
"15%"
>
昵称
</th>
<th
width=
"15%"
>
QQ号
</th>
<th
width=
"10%"
>
Twitter帐号
</th>
<th
width=
"15%"
>
费用
</th>
<th
width=
"22.5%"
>
营业类型
</th>
<th
width=
"22.5%"
>
禁忌项
</th>
</tr>
</thead>
<tbody>
<tr
*ngFor=
"let item of whitelistResult"
>
<td>
{{item.name || ''}}
</td>
<td>
{{item.account || ''}}
</td>
<td>
<td>
<a
class=
"btn btn-outline-primary"
[href]=
"item.blacklist.link"
target=
"_blank"
>
查看
</a>
<a
*ngIf=
"item.twitter"
[href]=
"getTwitterLink(item.twitter)"
target=
"_blank"
>
{{ truncateMiddle(item.twitter, 15) }}
</a>
</td>
</td>
<td>
{{item.fee || ''}}
</td>
<td>
{{item.type || ''}}
</td>
<td>
{{item.forbidden || ''}}
</td>
</tr>
</tr>
</tbody>
</tbody>
</table>
</table>
...
...
src/app/app.component.ts
View file @
2252cc1f
import
{
AfterViewInit
,
Component
}
from
'
@angular/core
'
;
import
{
AfterViewInit
,
Component
}
from
'
@angular/core
'
;
import
{
ToastService
}
from
'
./toast.service
'
;
import
{
ToastService
}
from
'
./toast.service
'
;
import
{
BlacklistAccount
}
from
'
./api/models/blacklist-account
'
;
import
{
ApiService
}
from
'
./api/services/api.service
'
;
import
{
ApiService
}
from
'
./api/services/api.service
'
;
import
{
lastValueFrom
}
from
'
rxjs
'
;
import
{
lastValueFrom
}
from
'
rxjs
'
;
import
*
as
moment
from
'
moment
'
;
import
*
as
moment
from
'
moment
'
;
import
{
Ad
}
from
'
./api/models
'
;
import
{
import
{
ActivatedRoute
}
from
'
@angular/router
'
;
Ad
,
BlacklistAccountResultDto
,
WhitelistAccountResultDto
,
}
from
'
./api/models
'
;
@
Component
({
@
Component
({
selector
:
'
app-root
'
,
selector
:
'
app-root
'
,
...
@@ -17,7 +19,8 @@ export class AppComponent implements AfterViewInit {
...
@@ -17,7 +19,8 @@ export class AppComponent implements AfterViewInit {
displayingAccount
=
''
;
displayingAccount
=
''
;
title
=
'
蔷蔷挂人查询
'
;
title
=
'
蔷蔷挂人查询
'
;
ad
:
Ad
|
null
=
null
;
ad
:
Ad
|
null
=
null
;
result
?:
BlacklistAccount
[];
blacklistResult
?:
BlacklistAccountResultDto
[];
whitelistResult
?:
WhitelistAccountResultDto
[];
constructor
(
public
toast
:
ToastService
,
private
api
:
ApiService
)
{}
constructor
(
public
toast
:
ToastService
,
private
api
:
ApiService
)
{}
ngAfterViewInit
()
{
ngAfterViewInit
()
{
...
@@ -52,26 +55,55 @@ export class AppComponent implements AfterViewInit {
...
@@ -52,26 +55,55 @@ export class AppComponent implements AfterViewInit {
async
onAdClick
()
{
async
onAdClick
()
{
const
clickResult
=
await
lastValueFrom
(
const
clickResult
=
await
lastValueFrom
(
this
.
api
.
adControllerClickAd
({
id
:
this
.
ad
!
.
id
})
this
.
api
.
adControllerClickAd
({
id
:
this
.
ad
!
.
id
!
})
);
);
if
(
clickResult
?.
data
)
{
if
(
clickResult
?.
data
)
{
this
.
openInNewTab
(
clickResult
.
data
);
this
.
openInNewTab
(
clickResult
.
data
);
}
}
}
}
async
onSearch
()
{
getTwitterLink
(
twitter
:
string
)
{
this
.
result
=
undefined
;
const
urlObj
=
new
URL
(
'
https://x.com
'
);
urlObj
.
pathname
=
`/
${
twitter
}
`
;
return
urlObj
.
toString
();
}
async
searchWhitelist
(
account
?:
string
)
{
this
.
whitelistResult
=
undefined
;
const
{
data
}
=
await
lastValueFrom
(
this
.
api
.
whitelistAccountControllerFindAll
({
recordsPerPage
:
5
,
account
:
account
||
undefined
,
random
:
account
?
0
:
1
,
})
);
this
.
whitelistResult
=
data
;
}
async
checkSearch
(
allowEmpty
=
false
)
{
const
search
=
this
.
search
.
trim
();
const
search
=
this
.
search
.
trim
();
if
(
!
search
)
{
if
(
!
search
&&
!
allowEmpty
)
{
this
.
toast
.
warn
(
'
不能为空。
'
);
this
.
toast
.
warn
(
'
不能为空。
'
);
return
;
return
false
;
}
else
if
(
!
search
&&
allowEmpty
)
{
return
true
;
}
}
if
(
search
.
length
>
10
)
{
if
(
search
.
length
>
10
)
{
this
.
toast
.
warn
(
'
不能超过 10 个字符。
'
);
this
.
toast
.
warn
(
'
不能超过 10 个字符。
'
);
return
;
return
false
;
}
}
if
(
!
search
.
match
(
/^
\d
+$/
))
{
if
(
!
search
.
match
(
/^
\d
+$/
))
{
this
.
toast
.
warn
(
'
只能输入数字。
'
);
this
.
toast
.
warn
(
'
只能输入数字。
'
);
return
false
;
}
return
true
;
}
async
onBlacklistSearch
()
{
this
.
blacklistResult
=
undefined
;
this
.
whitelistResult
=
undefined
;
const
search
=
this
.
search
.
trim
();
if
(
!
(
await
this
.
checkSearch
()))
{
return
;
return
;
}
}
try
{
try
{
...
@@ -81,10 +113,37 @@ export class AppComponent implements AfterViewInit {
...
@@ -81,10 +113,37 @@ export class AppComponent implements AfterViewInit {
account
:
search
,
account
:
search
,
})
})
);
);
this
.
result
=
data
;
this
.
blacklistResult
=
data
;
if
(
!
data
?.
length
)
{
await
this
.
searchWhitelist
(
search
);
}
this
.
displayingAccount
=
this
.
search
;
}
catch
(
e
)
{
this
.
toast
.
error
(
`查询失败:
${(
e
as
Error
).
toString
()}
`
);
}
}
async
onWhitelistSearch
()
{
this
.
blacklistResult
=
undefined
;
this
.
whitelistResult
=
undefined
;
const
search
=
this
.
search
.
trim
();
if
(
!
(
await
this
.
checkSearch
(
true
)))
{
return
;
}
try
{
await
this
.
searchWhitelist
(
search
);
this
.
displayingAccount
=
this
.
search
;
this
.
displayingAccount
=
this
.
search
;
}
catch
(
e
)
{
}
catch
(
e
)
{
this
.
toast
.
error
(
`查询失败:
${(
e
as
Error
).
toString
()}
`
);
this
.
toast
.
error
(
`查询失败:
${(
e
as
Error
).
toString
()}
`
);
}
}
}
}
truncateMiddle
(
text
:
string
,
maxLength
:
number
):
string
{
if
(
!
text
||
text
.
length
<=
maxLength
)
{
return
text
;
}
const
keep
=
Math
.
floor
((
maxLength
-
3
)
/
2
);
// -3 for '...'
return
text
.
slice
(
0
,
keep
)
+
'
...
'
+
text
.
slice
(
-
keep
);
}
}
}
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