Files
WrenchBoardIonic2023/src/app/services/wrench.service.ts
T
2023-07-30 12:58:14 -04:00

189 lines
5.3 KiB
TypeScript

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
//import 'rxjs/add/operator/map';
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class WrenchService {
apiKey = '99dfe35fcb7de1ee';
url;
constructor(private http: HttpClient) {
this.url = 'https://apigate.lotus.g1.wrenchboard.com/en/wrench/api/v1';
}
getPostData(reqPath:string, reqData): Observable<any> {
return this.http.post(
`${environment.baseUrl}/${reqPath}`,reqData
);
}
getMyNotifications(usrData) {
return this.getPostData('mynotifications',usrData);
}
loginUser(loginData) {
return this.getPostData('userlogin',loginData);
}
getBlogData(){
const blogReq=[];
return this.getPostData('blogdata',blogReq);
//blogdata
}
getHomeBanners(usrData){
return this.getPostData('homebanners',usrData);
}
getUserWallets(usrData) {
return this.getPostData("getwallets", usrData);
}
getPaymentHx(usrData) {
return this.getPostData("paymenthx", usrData);
}
getJobsData(usrData) {
return this.getPostData("getjobsdata", usrData);
}
getMyActiveJobsData(usrData) {
return this.getPostData("activetaskslist", usrData);
}
/*
registerUser(newUserData) {
// no session needed - will start the session
return this.http.post(this.url + '/createmobileuser', newUserData)
.map(res => res.json());
}
completeRegisterUser(newUserData) {
// no session needed - will start the session
return this.http.post(this.url + '/completemobileuser', newUserData)
.map(res => res.json());
}
startResetPassword(UserData) {
// no session needed - will start the session
return this.http.post(this.url + '/startresetpasword', UserData)
.map(res => res.json());
}
getStartData() {
return this.http.post(this.url + '/startjoblist', { limit: '10', page: '1' })
.map(res => res.json());
}
getJobsData() {
return this.http.post(this.url + '/getjobsdata', { limit: '20', page: '1' })
.map(res => res.json());
}
getPendingJobsData(userData: any) {
return this.http.post(this.url + '/getpendingjobs', userData)
.map(res => res.json());
}
getMessages(UserData) {
console.log("getMessages Called");
return this.http.post(this.url + '/message', UserData)
.map(res => res.json());
}
//JOBS
getActiveJobData(UserData) {
console.log("getActiveJobData Called");
return this.http.post(this.url + '/activejoblist', UserData)
.map(res => res.json());
}
getMyOffersJobData(UserData) {
console.log("getMyOffersJobData Called");
return this.http.post(this.url + '/offerslist', UserData)
.map(res => res.json());
}
//=========================================
getPaymentHx(UserData) {
console.log("getPaymentHx Called");
return this.http.post(this.url + '/paymenthx', UserData)
.map(res => res.json());
}
getOffersJobDataff() {
console.log("getOffersJobData Called");
return this.http.post(this.url + '/offerslist', { limit: '10', page: '1', sessionid: 'ADNGHGHGHGHGHGH', member_id: 1 })
.map(res => res.json());
}
getDashData(memberID, sessionID) {
// session required here
return this.http.post(this.url + '/dashdata', { sessionid: sessionID, member_id: memberID })
.map(res => res.json());
}
getUserAccount(memberID, sessionID) {
// account
return this.http.post(this.url + '/account', { sessionid: sessionID, member_id: memberID })
.map(res => res.json());
}
getProfile(memberID, sessionID) {
//loadprofile
return this.http.post(this.url + '/loadprofile', { sessionid: sessionID, member_id: memberID })
.map(res => res.json());
}
getUserBankList(UserData) {
console.log("getActiveJobData Called");
return this.http.post(this.url + '/mybanklist', UserData)
.map(res => res.json());
}
userSendMoneyt(SendMoneydata) {
console.log("userSendMoneyt Called");
return this.http.post(this.url + '/sendmoney', SendMoneydata)
.map(res => res.json());
}
sendMoneyFee(SendMoneydata) {
console.log("sendMoneyFee Called");
return this.http.post(this.url + '/sendmoneyfee', SendMoneydata)
.map(res => res.json());
}
sendJobInterest(SendJobInterestData) {
console.log("sendJobInterest Called");
return this.http.post(this.url + '/sendinterest', SendJobInterestData)
.map(res => res.json());
}
sendOfferInterest(SendJobInterestData) {
console.log("sendOfferInterest Called");
return this.http.post(this.url + '/sendofferinterest', SendJobInterestData)
.map(res => res.json());
}
sendJobInterestMessage(sendJobInterestMessage) {
console.log("sendJobInterestMessage Called");
return this.http.post(this.url + '/sendinterestmessage', sendJobInterestMessage)
.map(res => res.json());
}
getTaskMessage(taskData: any) {
console.log("getTaskMessage Called");
return this.http.post(this.url + '/taskmessage', taskData)
.map(res => res.json());
}
sendTaskMessage(taskMessage: any) {
console.log("sendTaskMessage Called");
return this.http.post(this.url + '/sendtaskmessage', taskMessage)
.map(res => res.json());
}
*/
}