diff --git a/package-lock.json b/package-lock.json index d41af87..0dc11e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@funixproductions/angular-core", - "version": "0.4.0", + "version": "0.4.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@funixproductions/angular-core", - "version": "0.4.0", + "version": "0.4.2", "dependencies": { "@angular/animations": "^19.1.7", "@angular/common": "^19.1.7", diff --git a/package.json b/package.json index 7ff1752..8070066 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@funixproductions/angular-core", - "version": "0.4.1", + "version": "0.4.2", "description": "Package used in all FunixProductions Angular projects", "scripts": { "ng": "ng", diff --git a/projects/funixproductions-requests/src/lib/services/pacifista-api/server/players/sync/dtos/PacifistaPlayerDataDTO.ts b/projects/funixproductions-requests/src/lib/services/pacifista-api/server/players/sync/dtos/PacifistaPlayerDataDTO.ts new file mode 100644 index 0000000..c1ca8e6 --- /dev/null +++ b/projects/funixproductions-requests/src/lib/services/pacifista-api/server/players/sync/dtos/PacifistaPlayerDataDTO.ts @@ -0,0 +1,10 @@ +import {ApiDTO} from 'projects/funixproductions-requests/src/public-api'; + +export class PacifistaPlayerDataDTO extends ApiDTO { + public minecraftUuid: string; + + constructor(minecraftUuid: string) { + super(); + this.minecraftUuid = minecraftUuid; + } +} diff --git a/projects/funixproductions-requests/src/lib/services/pacifista-api/server/players/sync/dtos/PacifistaPlayerMoneyDTO.ts b/projects/funixproductions-requests/src/lib/services/pacifista-api/server/players/sync/dtos/PacifistaPlayerMoneyDTO.ts new file mode 100644 index 0000000..7f5d15c --- /dev/null +++ b/projects/funixproductions-requests/src/lib/services/pacifista-api/server/players/sync/dtos/PacifistaPlayerMoneyDTO.ts @@ -0,0 +1,14 @@ +import {PacifistaPlayerDataDTO} from './PacifistaPlayerDataDTO'; + +export class PacifistaPlayerMoneyDTO extends PacifistaPlayerDataDTO { + money: number; + offlineMoney: number; + + constructor(money: number, + offlineMoney: number, + minecraftUuid: string) { + super(minecraftUuid); + this.money = money; + this.offlineMoney = offlineMoney; + } +} diff --git a/projects/funixproductions-requests/src/lib/services/pacifista-api/server/players/sync/service/PacifistaPlayerMoneyService.ts b/projects/funixproductions-requests/src/lib/services/pacifista-api/server/players/sync/service/PacifistaPlayerMoneyService.ts new file mode 100644 index 0000000..4d419f6 --- /dev/null +++ b/projects/funixproductions-requests/src/lib/services/pacifista-api/server/players/sync/service/PacifistaPlayerMoneyService.ts @@ -0,0 +1,15 @@ +import {HttpClient} from "@angular/common/http"; +import {CrudHttpClient} from "projects/funixproductions-requests/src/public-api"; +import {PacifistaPlayerMoneyDTO} from "../dtos/PacifistaPlayerMoneyDTO"; +import {environment} from "projects/funixproductions-requests/src/environments/environment"; +import {environmentDev} from "projects/funixproductions-requests/src/environments/environment-dev"; + +export class PacifistaPlayerMoneyService extends CrudHttpClient { + constructor(protected httpClient: HttpClient, production: boolean) { + super( + httpClient, + production ? environment.pacifistaApiUrl : environmentDev.pacifistaApiUrl, + 'playersync/money' + ); + } +}