-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Stefan Werfling
committed
Sep 21, 2023
1 parent
f0d22bc
commit 40fc7ec
Showing
17 changed files
with
198 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 3 additions & 8 deletions
11
...b/MariaDb/Entity/IpBlacklistMaintainer.ts → ...b/MariaDb/Entity/IpBlacklistMaintainer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 3 additions & 8 deletions
11
...inc/Db/MariaDb/Entity/IpListMaintainer.ts → ...inc/Db/MariaDb/Entity/IpListMaintainer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 3 additions & 8 deletions
11
...d/src/inc/Db/MariaDb/Entity/IpLocation.ts → core/src/inc/Db/MariaDb/Entity/IpLocation.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import {DBService} from './DBService.js'; | ||
import {IpBlacklistMaintainer} from './Entity/IpBlacklistMaintainer.js'; | ||
|
||
/** | ||
* Ip blacklist maintainer service object. | ||
*/ | ||
export class IpBlacklistMaintainerService extends DBService<IpBlacklistMaintainer> { | ||
|
||
/** | ||
* register name | ||
*/ | ||
public static REGISTER_NAME = 'ip_blacklist_maintainer'; | ||
|
||
/** | ||
* Return an intance from ip blacklist maintainer service. | ||
* @returns {IpBlacklistMaintainerService} | ||
*/ | ||
public static getInstance(): IpBlacklistMaintainerService { | ||
return DBService.getSingleInstance( | ||
IpBlacklistMaintainerService, | ||
IpBlacklistMaintainer, | ||
IpBlacklistMaintainerService.REGISTER_NAME | ||
); | ||
} | ||
|
||
/** | ||
* Find a blacklist maintainer by ip id and ip maintainer id. | ||
* @param {number} ipId | ||
* @param {number} ipMaintainerId | ||
* @returns {IpBlacklistMaintainer|null} | ||
*/ | ||
public async findByIp(ipId: number, ipMaintainerId: number): Promise<IpBlacklistMaintainer|null> { | ||
return this._repository.findOne({ | ||
where: { | ||
ip_id: ipId, | ||
ip_maintainer_id: ipMaintainerId | ||
} | ||
}); | ||
} | ||
|
||
/** | ||
* Find all blacklist maintainers by ip id. | ||
* @param {number} ipId | ||
* @returns {IpBlacklistMaintainer[]} | ||
*/ | ||
public async findAllByIp(ipId: number): Promise<IpBlacklistMaintainer[]> { | ||
return this._repository.find({ | ||
where: { | ||
ip_id: ipId | ||
} | ||
}); | ||
} | ||
|
||
} |
Oops, something went wrong.