mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
contactList chat done
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpService } from 'src/app/services/http.service';
|
||||
import { MessageOutPutDTO } from '../../chat/dto/message/messageOutputDTO';
|
||||
import { MessageListInputDTO } from '../../chat/dto/message/messageListInputDTO';
|
||||
import { DataSourceReturn } from '../../type';
|
||||
|
||||
|
||||
export interface UserContacts {
|
||||
wxUserId: number;
|
||||
wxFullName: string;
|
||||
wxeMail: string | null;
|
||||
userPhoto: string | null;
|
||||
}
|
||||
|
||||
export interface UserList {
|
||||
success: boolean;
|
||||
message: string;
|
||||
data: UserContacts[];
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContactsDataSourceService {
|
||||
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL
|
||||
|
||||
constructor(private httpService: HttpService) {}
|
||||
|
||||
|
||||
async getUsers() {
|
||||
return await this.httpService.get<UserList>(`${this.baseUrl}/Users`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ContactsDataSourceService } from '../data-source/contacts-data-source.service';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ContactRepositoryService {
|
||||
|
||||
constructor(
|
||||
private constactsDataSourceService: ContactsDataSourceService,
|
||||
) {}
|
||||
|
||||
async getUsers() {
|
||||
const result = await this.constactsDataSourceService.getUsers();
|
||||
return result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user