mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix chage duplicate message
This commit is contained in:
@@ -132,15 +132,14 @@ registerLocaleData(localePt, 'pt');
|
||||
})
|
||||
|
||||
openTelemetryLogging.send({
|
||||
type: 'graylog',
|
||||
level: 'info',
|
||||
message: event.exception.values[0].value,
|
||||
payload: {
|
||||
message: event.exception.values[0].value,
|
||||
object: {
|
||||
sentry: true,
|
||||
error: event
|
||||
}
|
||||
},
|
||||
spanContext: null
|
||||
})
|
||||
}
|
||||
// Return event to send it to Sentry
|
||||
|
||||
@@ -27,7 +27,7 @@ const MemberSchema = z.object({
|
||||
export const RoomEntitySchema = z.object({
|
||||
$id: z.string(),
|
||||
id: z.string().uuid().optional(),
|
||||
roomName: z.string(),
|
||||
roomName: z.string().nullable(),
|
||||
createdBy: z.object({
|
||||
wxUserId: z.number(),
|
||||
wxFullName: z.string(),
|
||||
|
||||
@@ -49,7 +49,7 @@ export const MessageEntitySchema = z.object({
|
||||
wxUserId: z.number(),
|
||||
wxFullName: z.string(),
|
||||
wxeMail: z.string(),
|
||||
userPhoto: z.string().nullable(),
|
||||
userPhoto: z.string().nullable().optional(),
|
||||
}).nullable(),
|
||||
reactions: z.object({
|
||||
id: z.string(),
|
||||
@@ -67,7 +67,8 @@ export const MessageEntitySchema = z.object({
|
||||
origin: z.enum(['history', 'local', 'incoming']).optional(),
|
||||
requestId: z.string().nullable().optional(),
|
||||
sendAttemp: z.number().optional(),
|
||||
hasAttachment: z.boolean().optional()
|
||||
hasAttachment: z.boolean().optional(),
|
||||
deviceId: z.string().nullable().optional()
|
||||
})
|
||||
|
||||
export type IMessage = z.infer<typeof MessageEntitySchema>;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { MessageEntity, IMessage } from "../entity/message";
|
||||
import { MessageOutPutDataDTO } from "src/app/core/chat/repository/dto/messageOutputDTO";
|
||||
import { MessageInputDTO } from "../usecase/message/message-create-use-case.service";
|
||||
import { getInstanceId } from "src/app/module/chat/domain/chat-service.service";
|
||||
|
||||
export class MessageMapper {
|
||||
static toDomain(DTO: MessageOutPutDataDTO) : MessageEntity {
|
||||
@@ -27,8 +28,8 @@ export class MessageMapper {
|
||||
docId: Number(e.docId) || 0,
|
||||
mimeType: e.mimeType,
|
||||
description: e.description
|
||||
}))[0] || {}
|
||||
|
||||
})) || [],
|
||||
deviceId: getInstanceId()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,8 @@ export const MessageOutPutDataDTOSchema = z.object({
|
||||
applicationId: z.number().optional(),
|
||||
docId: z.number().optional(),
|
||||
id: z.string().optional()
|
||||
}))
|
||||
})),
|
||||
deviceId: z.string().nullable().optional()
|
||||
});
|
||||
|
||||
export type MessageOutPutDataDTO = z.infer<typeof MessageOutPutDataDTOSchema>
|
||||
|
||||
@@ -8,7 +8,7 @@ import { z } from "zod";
|
||||
|
||||
const SocketRoomUpdateOutPutSchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
roomName: z.string().min(1),
|
||||
roomName: z.string().nullable(),
|
||||
createdBy: z.string().nullable(), // Allowing null for createdBy
|
||||
createdAt: z.string().datetime(),
|
||||
expirationDate: z.string().nullable().optional(), // Allowing null and making it optional
|
||||
|
||||
@@ -3,7 +3,7 @@ import { filter, map } from 'rxjs/operators';
|
||||
import { z } from 'zod';
|
||||
import { IMessageSocketRepository } from 'src/app/core/chat/repository/message/message-socket-repository';
|
||||
import { MessageEntity } from '../../entity/message';
|
||||
import { InstanceId } from 'src/app/module/chat/domain/chat-service.service';
|
||||
import { getInstanceId } from 'src/app/module/chat/domain/chat-service.service';
|
||||
|
||||
|
||||
export const ListenMessageByRoomIdNewInputDTOSchema = z.object({
|
||||
@@ -25,8 +25,10 @@ export class ListenMessageByRoomIdNewUseCase {
|
||||
|
||||
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||
map(message => message.data),
|
||||
filter((message) => !message?.requestId?.startsWith(InstanceId) && message?.roomId == data.roomId),
|
||||
map(message => Object.assign(new MessageEntity(), message))
|
||||
filter((message) => message.deviceId != getInstanceId()),
|
||||
map(message => {
|
||||
return Object.assign(new MessageEntity(), message)
|
||||
})
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MessageSocketRepositoryService } from 'src/app/module/chat/data/repository/message/message-live-signalr-data-source.service'
|
||||
import { InstanceId } from '../../../../module/chat/domain/chat-service.service';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { z } from 'zod';
|
||||
import { IMessageSocketRepository } from '../../repository/message/message-socket-repository';
|
||||
import { getInstanceId } from 'src/app/module/chat/domain/chat-service.service';
|
||||
|
||||
export const ListenSendMessageInputDTOSchema = z.object({
|
||||
roomId: z.string(),
|
||||
@@ -25,10 +25,7 @@ export class ListenSendMessageUseCase {
|
||||
|
||||
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||
map(message => message.data),
|
||||
filter((message) => {
|
||||
|
||||
return message?.requestId?.startsWith(InstanceId) && message?.roomId == roomId
|
||||
}),
|
||||
filter((message) => message.deviceId != getInstanceId()),
|
||||
map(message => message)
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
|
||||
import { IMessage, MessageAttachmentSource, MessageEntity, MessageEntitySchema, } from '../../entity/message';
|
||||
import { z } from 'zod';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { InstanceId } from '../../../../module/chat/domain/chat-service.service';
|
||||
import { createBlobFromBase64, createDataURL } from 'src/app/utils/ToBase64';
|
||||
import { zodSafeValidation } from 'src/app/utils/zodValidation';
|
||||
import { Logger } from 'src/app/services/logger/main/service';
|
||||
@@ -105,7 +104,7 @@ export class MessageCreateUseCaseService {
|
||||
if(validation.isOk()) {
|
||||
message.sendAttemp++;
|
||||
|
||||
message.requestId = InstanceId +'@'+ uuidv4();
|
||||
message.requestId = uuidv4();
|
||||
message.sending = true;
|
||||
|
||||
const createMessageLocally = this.messageLocalDataSourceService.insert(message)
|
||||
|
||||
@@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
|
||||
import { IMessage, MessageAttachmentSource, MessageEntity, MessageEntitySchema, } from '../../entity/message';
|
||||
import { z } from 'zod';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { InstanceId } from '../../../../module/chat/domain/chat-service.service';
|
||||
import { createBlobFromBase64, createDataURL } from 'src/app/utils/ToBase64';
|
||||
import { zodSafeValidation } from 'src/app/utils/zodValidation';
|
||||
import { Logger } from 'src/app/services/logger/main/service';
|
||||
@@ -38,7 +37,8 @@ export const MessageInputDTOSchema = z.object({
|
||||
docId: z.number().optional(),
|
||||
mimeType: z.string().nullable().optional(),
|
||||
description: z.string().optional()
|
||||
}).optional()
|
||||
}).array(),
|
||||
deviceId: z.string().optional()
|
||||
});
|
||||
export type MessageInputDTO = z.infer<typeof MessageInputDTOSchema>
|
||||
|
||||
@@ -105,14 +105,11 @@ export class MessageCreateUseCaseService {
|
||||
if(validation.isOk()) {
|
||||
message.sendAttemp++;
|
||||
|
||||
message.requestId = InstanceId +'@'+ uuidv4();
|
||||
|
||||
const createMessageLocally = this.messageLocalDataSourceService.insert(message)
|
||||
|
||||
createMessageLocally.then((value) => {
|
||||
if(value.isOk()) {
|
||||
|
||||
console.log("set image")
|
||||
message.$id = value.value
|
||||
|
||||
if(message.hasAttachment) {
|
||||
|
||||
+2
-1
@@ -5,6 +5,7 @@ import { MessageSocketRepositoryService } from 'src/app/module/chat/data/reposit
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { IMessageLocalRepository } from '../../repository/message/message-local-repository';
|
||||
import { IMessageSocketRepository } from '../../repository/message/message-socket-repository';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
const MessageMarkAllMessageAsReadByRoomIdInputSchema = z.object({
|
||||
roomId: z.string(),
|
||||
@@ -36,7 +37,7 @@ export class MessageMarkAllMessageAsReadByRoomIdService {
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
roomId: input.roomId,
|
||||
requestId: 'uuid'
|
||||
requestId: uuidv4()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { MessageLocalDataSourceService } from '../../../../module/chat/data/repository/message/message-local-data-source.service';
|
||||
import { MessageSocketRepositoryService } from '../../../../module/chat/data/repository/message/message-live-signalr-data-source.service';
|
||||
import { InstanceId } from '../../../../module/chat/domain/chat-service.service';
|
||||
import { MessageMapper } from '../../mapper/messageMapper';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { AttachmentLocalDataSource } from '../../../../module/chat/data/repository/attachment/attachment-local-repository.service';
|
||||
@@ -65,8 +64,6 @@ export class SendLocalMessagesUseCaseService {
|
||||
description: e.description,
|
||||
file: e.base64.split(',')[1]
|
||||
}))
|
||||
console.log('to upload', messages)
|
||||
const requestId = InstanceId +'@'+ uuidv4();
|
||||
|
||||
await this.messageLocalDataSourceService.update(message.$id, { sending: true })
|
||||
|
||||
|
||||
@@ -4,11 +4,11 @@ import { IMessageSocketRepository } from 'src/app/core/chat/repository/message/m
|
||||
import { MessageEntity } from 'src/app/core/chat/entity/message';
|
||||
import { IBoldLocalRepository } from 'src/app/core/chat/repository/bold/bold-local-repository';
|
||||
import { IMessageLocalRepository } from 'src/app/core/chat/repository/message/message-local-repository';
|
||||
import { InstanceId } from '../../../../module/chat/domain/chat-service.service';
|
||||
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
||||
import { TracingType, XTracerAsync } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { IRoomLocalRepository } from 'src/app/core/chat/repository/room/room-local-repository';
|
||||
import { IMessageGetAllByRoomIdOutPut } from 'src/app/core/chat/usecase/message/message-get-all-by-room-Id';
|
||||
import { getInstanceId } from 'src/app/module/chat/domain/chat-service.service';
|
||||
|
||||
|
||||
@Injectable({
|
||||
@@ -37,7 +37,7 @@ export class RoomBoldSyncUseCaseService {
|
||||
private listenToIncomingMessage() {
|
||||
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||
map(message => message.data),
|
||||
filter((message) => !message?.requestId?.startsWith(InstanceId)),
|
||||
filter((message) => message.deviceId != getInstanceId()),
|
||||
map(message => Object.assign(new MessageEntity(), message)),
|
||||
filter((message) => !message.meSender())
|
||||
).subscribe(async (message) => {
|
||||
@@ -59,7 +59,7 @@ export class RoomBoldSyncUseCaseService {
|
||||
*/
|
||||
private listenToUpdateMessages() {
|
||||
return this.MessageSocketRepositoryService.listenToUpdateMessages().pipe(
|
||||
filter((message) => !message?.requestId?.startsWith(InstanceId)),
|
||||
filter((message) => message.deviceId != getInstanceId()),
|
||||
map(message => Object.assign(new MessageEntity(), message))
|
||||
).subscribe(async (message) => {
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export const RoomOutPutDTOSchema = z.object({
|
||||
message: z.string(),
|
||||
data: z.object({
|
||||
id: z.string(),
|
||||
roomName: z.string(),
|
||||
roomName: z.string().nullable(),
|
||||
createdBy: z.any().nullable(),
|
||||
createdAt: z.string(),
|
||||
expirationDate: z.string().nullable(),
|
||||
|
||||
@@ -30,7 +30,7 @@ export const RoomByIdOutputDTOSchema = z.object({
|
||||
message: z.string(),
|
||||
data: z.object({
|
||||
id: z.string(),
|
||||
roomName: z.string(),
|
||||
roomName: z.string().nullable(),
|
||||
createdBy: UserSchema,
|
||||
createdAt: z.string(),
|
||||
expirationDate: z.string().nullable(),
|
||||
|
||||
@@ -21,7 +21,7 @@ const CreatedBySchema = z.object({
|
||||
|
||||
const roomListItemSchema = z.object({
|
||||
id: z.string(),
|
||||
roomName: z.string(),
|
||||
roomName: z.string().nullable(),
|
||||
createdBy: CreatedBySchema,
|
||||
createdAt: z.string(),
|
||||
expirationDate: z.string().nullable(), // api check
|
||||
|
||||
@@ -31,7 +31,7 @@ export const RoomUpdateOutputDTOSchema = z.object({
|
||||
message: z.string(),
|
||||
data: z.object({
|
||||
id: z.string(),
|
||||
roomName: z.string(),
|
||||
roomName: z.string().nullable(),
|
||||
createdBy: UserSchema,
|
||||
createdAt: z.string(),
|
||||
expirationDate: z.string().nullable(),
|
||||
|
||||
@@ -8,7 +8,7 @@ export const MemberTableSchema = z.object({
|
||||
wxUserId: z.number(),
|
||||
wxFullName: z.string(),
|
||||
wxeMail: z.string(),
|
||||
userPhoto: z.string().nullable(),
|
||||
userPhoto: z.string().nullable().optional(),
|
||||
joinAt: z.string(),
|
||||
status: z.string().optional(), // useless
|
||||
isAdmin: z.boolean()
|
||||
|
||||
@@ -7,7 +7,7 @@ import { IDBoolean } from "../../../type";
|
||||
export const RoomTableSchema = z.object({
|
||||
$id: z.string().optional(),
|
||||
id: z.string().optional(),
|
||||
roomName: z.string(),
|
||||
roomName: z.string().nullable(),
|
||||
createdBy: z.object({
|
||||
wxUserId: z.number(),
|
||||
wxFullName: z.string(),
|
||||
|
||||
@@ -26,7 +26,7 @@ export class TokenInterceptor implements HttpInterceptor {
|
||||
null
|
||||
);
|
||||
|
||||
private excludedDomains = [ 'Login', environment.apiChatUrl, 'http://localhost:8019']; // Add the domains you want to exclude
|
||||
private excludedDomains = [ 'Login', 'http://localhost:8019']; // Add the domains you want to exclude
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
@@ -58,7 +58,7 @@ export class TokenInterceptor implements HttpInterceptor {
|
||||
}
|
||||
else if (error instanceof HttpErrorResponse && error.status === 401) {
|
||||
return this.handle401Error(request, next);
|
||||
} else if (error.url.includes('https://gdapi-dev.dyndns.info/stage/api/v2') && error.status === 0){
|
||||
} else if (error.url.includes(`${environment.apiURL.slice(0, -1)}`) && error.status === 0){
|
||||
return this.handle401Error(request, next);
|
||||
} else {
|
||||
return throwError(error);
|
||||
@@ -119,7 +119,7 @@ export class TokenInterceptor implements HttpInterceptor {
|
||||
}
|
||||
|
||||
return this.http
|
||||
.post<UserLoginOutputResponse>('https://gdapi-dev.dyndns.info/stage/api/v2/Users/RefreshToken', {
|
||||
.post<UserLoginOutputResponse>(`${environment.apiURL}Users/RefreshToken`, {
|
||||
authorization: SessionStore.user.Authorization,
|
||||
refreshToken: SessionStore.user.RefreshToken,
|
||||
channelId
|
||||
|
||||
@@ -7,6 +7,7 @@ import { switchMap } from 'rxjs/operators';
|
||||
import { err, Result } from 'neverthrow';
|
||||
import { HubConnection } from '@microsoft/signalr';
|
||||
import { ISignalRInput, ISignalROutput } from '../type';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
const { App } = Plugins;
|
||||
|
||||
@@ -53,7 +54,7 @@ export class SignalRService {
|
||||
async establishConnection(): Promise<Result<HubConnection, false>> {
|
||||
|
||||
// const connection = new SignalRConnection({url:'https://41e3-41-63-166-54.ngrok-free.app/api/v2/chathub'})
|
||||
const connection = new SignalRConnection({url:'https://gdapi-dev.dyndns.info/stage/api/v2/chathub'})
|
||||
const connection = new SignalRConnection({url:`${environment.apiURLStage}chathub`})
|
||||
const attempConnection = await connection.establishConnection()
|
||||
|
||||
if(attempConnection.isOk()) {
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="profile-title d-flex justify-space-between align-center width-100">
|
||||
<!-- <div class="profile-title d-flex justify-space-between align-center width-100">
|
||||
<div class="d-flex align-center">
|
||||
<div>Tema</div>
|
||||
</div>
|
||||
@@ -146,7 +146,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
export interface Environment {
|
||||
id: string;
|
||||
apiURL: string;
|
||||
apiChatUrl: string;
|
||||
apiWsChatUrl: string;
|
||||
apiURLStage: String
|
||||
apiPCURL: string;
|
||||
logoLabel: string;
|
||||
production: boolean;
|
||||
|
||||
@@ -11,13 +11,14 @@ import { HttpService } from 'src/app/services/http.service';
|
||||
import { TracingType } from 'src/app/services/monitoring/opentelemetry/tracer';
|
||||
import { IGetDraftListByProcessIdOutput, IGetDraftListByProcessIdSchema } from '../../domain/usecase/getDraft-list-by-process-id.service';
|
||||
import { IDraftSaveByIdInput } from '../../domain/usecase/draft-save-by-id-use-case.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
|
||||
export class AgendaDataService {
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL
|
||||
private baseUrl = `${environment.apiURLStage.slice(0, -1)}`; // Your base URL
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
|
||||
+2
-1
@@ -3,11 +3,12 @@ import { IAttachmentRemoteRepository } from 'src/app/core/chat/repository/attach
|
||||
import { HttpService } from 'src/app/services/http.service';
|
||||
import { DataSourceReturn } from 'src/app/services/Repositorys/type';
|
||||
import { HttpAdapter } from 'src/app/infra/http/adapter'
|
||||
import { environment } from 'src/environments/environment';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AttachmentRemoteDataSourceService implements IAttachmentRemoteRepository {
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2/Chat'; // Your base URL
|
||||
private baseUrl = `${environment.apiURLStage.slice(0, -1)}`; // Your base URL
|
||||
|
||||
constructor(
|
||||
private httpService: HttpService,
|
||||
|
||||
@@ -7,12 +7,13 @@ import { IMemberRemoteRepository } from 'src/app/core/chat/repository/member/mem
|
||||
import { UserRemoveListInputDTOSchema, UserRemoveListInputDTO } from '../../../../../core/chat/usecase/room/room-leave-by-id-use-case.service';
|
||||
import { AddMemberToRoomInputDTOSchema, AddMemberToRoomInputDTO } from 'src/app/core/chat/usecase/member/member-add-use-case.service';
|
||||
import { MemberSetAdminDTO } from 'src/app/core/chat/usecase/member/member-admin-use-case.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class MemberListRemoteRepository implements IMemberRemoteRepository {
|
||||
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2/Chat'; // Your base URL
|
||||
private baseUrl = `${environment.apiURLStage.slice(0, -1)}/Chat`; // Your base URL
|
||||
|
||||
constructor(private httpService: HttpService) { }
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { SignalRService } from 'src/app/infra/socket/signalR/signal-r.service';
|
||||
import { IMemberSocketRepository } from 'src/app/core/chat/repository/member/member-socket-repository';
|
||||
import { InstanceId } from '../../../domain/chat-service.service';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { filter, map, tap } from 'rxjs/operators';
|
||||
import { SocketMessage } from 'src/app/infra/socket/signalR/signalR';
|
||||
@@ -19,11 +18,12 @@ export class MemberSocketRepositoryService implements IMemberSocketRepository {
|
||||
}
|
||||
async removeMember(data: RemoveRoomMemberInput) {
|
||||
|
||||
const id = uuidv4();
|
||||
const result = await this.socket.sendData<any>({
|
||||
method: 'RemoveRoomMember',
|
||||
data: {
|
||||
...data,
|
||||
requestId: InstanceId +'@'+ uuidv4()
|
||||
requestId: id
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
+10
-6
@@ -1,6 +1,5 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { InstanceId } from '../../../domain/chat-service.service';
|
||||
import { MessageUpdateInput } from '../../../../../core/chat/usecase/message/message-update-by-id-use-case.service';
|
||||
import { MessageReactionInput } from '../../../../../core/chat/usecase/message/message-reaction-by-id-use-case.service';
|
||||
import { SignalRService } from 'src/app/infra/socket/signalR/signal-r.service';
|
||||
@@ -43,7 +42,8 @@ export class MessageSocketRepositoryService implements IMessageSocketRepository
|
||||
async sendGroupMessage(data: MessageInputDTO) {
|
||||
|
||||
if(!data.requestId) {
|
||||
data.requestId = InstanceId +'@'+ uuidv4();
|
||||
//data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||
data['requestId'] = uuidv4();
|
||||
}
|
||||
|
||||
const result = await this.socket.sendData<MessageCreateOutPutDataDTO>({
|
||||
@@ -62,7 +62,8 @@ export class MessageSocketRepositoryService implements IMessageSocketRepository
|
||||
async sendDirectMessage(data: MessageInputDTO) {
|
||||
|
||||
if(!data.requestId) {
|
||||
data.requestId = InstanceId +'@'+ uuidv4();
|
||||
//data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||
data['requestId'] = uuidv4();
|
||||
}
|
||||
const result = await this.socket.sendData<MessageOutPutDataDTO>({
|
||||
method: 'SendDirectMessage',
|
||||
@@ -140,7 +141,8 @@ export class MessageSocketRepositoryService implements IMessageSocketRepository
|
||||
|
||||
|
||||
reactToMessageSocket(data: MessageReactionInput) {
|
||||
data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||
//data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||
data['requestId'] = uuidv4();
|
||||
|
||||
return this.socket.sendData({
|
||||
method: 'ReactMessage',
|
||||
@@ -149,7 +151,8 @@ export class MessageSocketRepositoryService implements IMessageSocketRepository
|
||||
}
|
||||
|
||||
updateMessage(input: MessageUpdateInput) {
|
||||
input['requestId'] = InstanceId +'@'+ uuidv4();
|
||||
//data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||
input['requestId'] = uuidv4();
|
||||
|
||||
this.socket.sendData({
|
||||
method: 'EditMessage',
|
||||
@@ -160,7 +163,8 @@ export class MessageSocketRepositoryService implements IMessageSocketRepository
|
||||
|
||||
sendMessageDelete(data: MessageDeleteInputDTO) {
|
||||
|
||||
data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||
//data['requestId'] = InstanceId +'@'+ uuidv4();
|
||||
data['requestId'] = uuidv4();
|
||||
|
||||
const result = this.socket.sendData<any>({
|
||||
method: 'DeleteMessage',
|
||||
|
||||
@@ -8,13 +8,14 @@ import { IGetMessagesFromRoomParams, IMessageRemoteRepository } from 'src/app/co
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Result } from 'neverthrow';
|
||||
import { HttpResult } from 'src/app/infra/http/type';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class MessageRemoteDataSourceService implements IMessageRemoteRepository {
|
||||
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2/Chat'; // Your base URL
|
||||
private baseUrl = `${environment.apiURLStage}Chat`; // Your base URL
|
||||
|
||||
constructor(
|
||||
private httpService: HttpService,
|
||||
|
||||
@@ -13,6 +13,7 @@ import { RoomListItemOutPutDTO, RoomListItemSchema, RoomListOutPutDTO } from '..
|
||||
import { z } from 'zod';
|
||||
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
||||
import { AddMemberToRoomInputDTO } from 'src/app/core/chat/usecase/member/member-add-use-case.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
const RoomByIdInputDTOSchema = z.string()
|
||||
type RoomByIdInputDTO = z.infer<typeof RoomByIdInputDTOSchema>
|
||||
@@ -23,7 +24,7 @@ type RoomByIdInputDTO = z.infer<typeof RoomByIdInputDTOSchema>
|
||||
})
|
||||
export class RoomRemoteDataSourceService implements IRoomRemoteRepository {
|
||||
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2/Chat'; // Your base URL
|
||||
private baseUrl = `${environment.apiURLStage}chat`; // Your base URL
|
||||
|
||||
constructor(
|
||||
private httpService: HttpService,
|
||||
|
||||
@@ -5,7 +5,6 @@ import { filter, map } from 'rxjs/operators';
|
||||
import { SocketMessage } from 'src/app/infra/socket/signalR/signalR';
|
||||
import { ITypingRemoteRepository } from 'src/app/core/chat/repository/typing/typing-remote-repository';
|
||||
import { z } from "zod"
|
||||
import { InstanceId } from '../../../domain/chat-service.service';
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
export const UserTypingDTOSchema = z.object({
|
||||
@@ -28,13 +27,14 @@ export class UserTypingRemoteRepositoryService implements ITypingRemoteRepositor
|
||||
) { }
|
||||
|
||||
sendTyping(roomId: string) {
|
||||
const id = uuidv4();
|
||||
return this.socket.sendData({
|
||||
method: 'Typing',
|
||||
data: {
|
||||
roomId,
|
||||
UserName:SessionStore.user.FullName,
|
||||
userId:SessionStore.user.UserId,
|
||||
requestId: InstanceId +'@'+ uuidv4(),
|
||||
requestId: id,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ import { IMessageLocalGetByIdServiceInput, MessageLocalGetByIdService } from 'sr
|
||||
import { ContactListService } from 'src/app/core/chat/usecase/contact/contact-list.service';
|
||||
import { IRoomGetLocalByIdServiceInput, RoomGetLocalByIdService } from '../../../core/chat/usecase/room/room-getlocal-by-id.service';
|
||||
|
||||
|
||||
export const getInstanceId = (): string => {
|
||||
const storageKey = 'instanceId'; // Key for localStorage
|
||||
let instanceId = localStorage.getItem(storageKey);
|
||||
@@ -66,8 +65,6 @@ export const getInstanceId = (): string => {
|
||||
return instanceId;
|
||||
};
|
||||
|
||||
export const InstanceId = getInstanceId();
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -129,9 +126,7 @@ export class ChatServiceService {
|
||||
})
|
||||
|
||||
this.MessageSocketRepositoryService.listenToUpdateMessages().pipe(
|
||||
filter((message) => {
|
||||
return !message?.requestId?.startsWith(InstanceId)
|
||||
})
|
||||
filter((message) => message.deviceId != getInstanceId())
|
||||
).subscribe(async (message) => {
|
||||
if(message?.id) {
|
||||
this.SocketMessageUpdateUseCaseService.execute(message)
|
||||
@@ -140,12 +135,7 @@ export class ChatServiceService {
|
||||
|
||||
this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||
map(message => message.data),
|
||||
filter((message) => {
|
||||
if(!message?.requestId?.startsWith(InstanceId) == false) {
|
||||
// console.log('exclude my message---')
|
||||
}
|
||||
return !message?.requestId?.startsWith(InstanceId)
|
||||
})
|
||||
filter((message) => message.deviceId != getInstanceId())
|
||||
).subscribe(async (message) => {
|
||||
if(message?.id) {
|
||||
this.SocketMessageCreateUseCaseService.execute(message)
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { filter, map } from 'rxjs/operators';
|
||||
import { MessageEntity } from 'src/app/core/chat/entity/message';
|
||||
import { IMessageSocketRepository } from 'src/app/core/chat/repository/message/message-socket-repository';
|
||||
import { InstanceId } from '../chat-service.service';
|
||||
import { getInstanceId } from '../chat-service.service';
|
||||
import { IRoomLocalRepository } from 'src/app/core/chat/repository/room/room-local-repository';
|
||||
|
||||
@Injectable({
|
||||
@@ -20,7 +20,7 @@ export class RoomLastMessageService {
|
||||
listenToIncomingMessage() {
|
||||
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||
map(message => message.data),
|
||||
filter((message) => !message?.requestId?.startsWith(InstanceId)),
|
||||
filter((message) => message.deviceId != getInstanceId()),
|
||||
map(message => Object.assign(new MessageEntity(), message))
|
||||
).subscribe(async (message) => {
|
||||
this.roomLocalRepository.update(message.roomId, {
|
||||
|
||||
@@ -3,13 +3,14 @@ import { HttpService } from 'src/app/services/http.service';
|
||||
import { NotificationInputDTO } from '../dto/NotificationInputDTO';
|
||||
import { NotificationOutputDTO, NotificationOutputDTOSchema } from '../dto/NotificationOutputDTO';
|
||||
import { APIReturn } from 'src/app/services/decorator/api-validate-schema.decorator';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class RemoteNotificationService {
|
||||
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2';
|
||||
private baseUrl = `${environment.apiURLStage.slice(0, -1)}`;
|
||||
|
||||
constructor(
|
||||
private httpService: HttpService
|
||||
|
||||
@@ -13,8 +13,8 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
})
|
||||
export class UserRemoteRepositoryService {
|
||||
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL
|
||||
|
||||
private baseUrl = `${environment.apiURLStage.slice(0, -1)}`; // Your base URL
|
||||
|
||||
constructor(
|
||||
private httpService: HttpService,
|
||||
private http: HttpAdapter,
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
|
||||
import { APIReturn } from 'src/app/services/decorator/api-validate-schema.decorator';
|
||||
import { HttpService } from 'src/app/services/http.service';
|
||||
import { ContactCombinedOutputDTO, EventListDataOutputDTOSchema } from '../DTO/contactsCombined';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
export interface UserContacts {
|
||||
wxUserId: number;
|
||||
@@ -26,7 +27,7 @@ export interface UserList {
|
||||
})
|
||||
export class ContactsDataSourceService {
|
||||
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL
|
||||
private baseUrl = `${environment.apiURLStage.slice(0, -1)}`; // Your base URL
|
||||
|
||||
constructor(private httpService: HttpService) {}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import CryptoJS from 'crypto-js';
|
||||
import { Logger } from './logger/main/service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
||||
@@ -39,23 +39,20 @@ export class Logger {
|
||||
);
|
||||
|
||||
|
||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
openTelemetryLogging.send({
|
||||
type: 'graylog',
|
||||
spanContext: null,
|
||||
level: 'info',
|
||||
message,
|
||||
payload: {
|
||||
message: message,
|
||||
object: {
|
||||
...obj,
|
||||
spanId: null,
|
||||
name,
|
||||
user: SessionStore?.user?.FullName,
|
||||
device_name: device?.name || device?.model,
|
||||
commit_date: environment.version.lastCommitTime,
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
static debug(message: string, obj = {}): void {
|
||||
@@ -65,23 +62,20 @@ export class Logger {
|
||||
Object.assign(obj, {createdAt: getCurrentTime(), message })
|
||||
);
|
||||
|
||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
openTelemetryLogging.send({
|
||||
type: 'graylog',
|
||||
spanContext: null,
|
||||
level: 'debug',
|
||||
message,
|
||||
payload: {
|
||||
message: message,
|
||||
object: {
|
||||
...obj,
|
||||
spanId: null,
|
||||
name,
|
||||
user: SessionStore?.user?.FullName,
|
||||
device_name: device?.name || device?.model,
|
||||
commit_date: environment.version.lastCommitTime,
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
static info(message: string, obj = {}): void {
|
||||
@@ -94,23 +88,20 @@ export class Logger {
|
||||
'\n',
|
||||
);
|
||||
|
||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
openTelemetryLogging.send({
|
||||
type: 'graylog',
|
||||
spanContext: null,
|
||||
level: 'info',
|
||||
message,
|
||||
payload: {
|
||||
message: message,
|
||||
object: {
|
||||
...obj,
|
||||
spanId: null,
|
||||
name,
|
||||
user: SessionStore?.user?.FullName,
|
||||
device_name: device?.name || device?.model,
|
||||
commit_date: environment.version.lastCommitTime,
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
static warn(message: string, obj = {}): void {
|
||||
@@ -123,23 +114,20 @@ export class Logger {
|
||||
'\n',
|
||||
);
|
||||
|
||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
openTelemetryLogging.send({
|
||||
type: 'graylog',
|
||||
spanContext: null,
|
||||
level: 'warn',
|
||||
message,
|
||||
payload: {
|
||||
message: message,
|
||||
object: {
|
||||
...obj,
|
||||
spanId: null,
|
||||
name,
|
||||
user: SessionStore?.user?.FullName,
|
||||
device_name: device?.name || device?.model,
|
||||
commit_date: environment.version.lastCommitTime,
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
static error(message?: string, obj = {}): void {
|
||||
@@ -153,23 +141,20 @@ export class Logger {
|
||||
'\n',
|
||||
);
|
||||
|
||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
openTelemetryLogging.send({
|
||||
type: 'graylog',
|
||||
spanContext: null,
|
||||
level: 'error',
|
||||
message,
|
||||
payload: {
|
||||
message: message,
|
||||
object: {
|
||||
...obj,
|
||||
spanId: null,
|
||||
name,
|
||||
user: SessionStore?.user?.FullName,
|
||||
device_name: device?.name || device?.model,
|
||||
commit_date: environment.version.lastCommitTime,
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
fatal(error?: any, message?: string, context?: string): void {}
|
||||
|
||||
@@ -3,6 +3,7 @@ import { v4 as uuidv4 } from 'uuid';
|
||||
import { WebSocketGraylogService } from "../socket/socket";
|
||||
import { Span } from "@opentelemetry/sdk-trace-web";
|
||||
import { environment } from "src/environments/environment";
|
||||
import { getInstanceId } from "src/app/module/chat/domain/chat-service.service";
|
||||
|
||||
|
||||
export class OpenTelemetryLogging {
|
||||
@@ -17,13 +18,53 @@ export class OpenTelemetryLogging {
|
||||
|
||||
}
|
||||
|
||||
send(data: Object & { type: string; payload: any, spanContext:any }): void {
|
||||
// this.socket.send({
|
||||
// type: data.type,
|
||||
// payload: data.payload,
|
||||
// requestId: uuidv4(),
|
||||
// spanContext: data.spanContext
|
||||
// });
|
||||
async send({
|
||||
level,
|
||||
message,
|
||||
payload
|
||||
}: {
|
||||
level: string,
|
||||
message: string,
|
||||
payload: Record<string, any>,
|
||||
}): Promise<void> {
|
||||
const nanoTimestamp = (Date.now() * 1_000_000).toString();
|
||||
|
||||
const logMessage = {
|
||||
message,
|
||||
details: { ...payload },
|
||||
};
|
||||
|
||||
const logData = {
|
||||
streams: [
|
||||
{
|
||||
stream: {
|
||||
level,
|
||||
k2: "true",
|
||||
app: "angular-app",
|
||||
instanceId: getInstanceId(),
|
||||
},
|
||||
values: [[nanoTimestamp, JSON.stringify(logMessage)]], // ✅ FIXED
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await fetch("https://logs.petermaquiran.xyz/loki/api/v1/push", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(logData),
|
||||
});
|
||||
|
||||
if (response.status !== 204) {
|
||||
// Optional: handle failed log delivery
|
||||
console.warn(`Failed to send log: ${response.status}`);
|
||||
}
|
||||
} catch (error) {
|
||||
// Optional: handle fetch error
|
||||
console.error("Log sending error:", error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,21 +16,25 @@ function createProvider(serviceName) {
|
||||
});
|
||||
|
||||
// provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter()));
|
||||
// provider.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({
|
||||
// //url: 'https://5-180-182-151.cloud-xip.com:85/zipkin-endpoint/api/v2/spans',
|
||||
// url: 'https://185-229-224-75.cloud-xip.com:85/zipkin-endpoint/api/v2/spans',
|
||||
// serviceName: serviceName,
|
||||
// getExportRequestHeaders: () => {
|
||||
// return {
|
||||
// 'Authorization': 'Basic ' + btoa('tabteste@006:tabteste@006'),
|
||||
// };
|
||||
// }
|
||||
// })));
|
||||
|
||||
provider.addSpanProcessor(new SimpleSpanProcessor(new OTLPTraceExporter({
|
||||
url: 'https://185-229-224-75.cloud-xip.com:85/collector2/v1/traces',
|
||||
provider.addSpanProcessor(new SimpleSpanProcessor(new ZipkinExporter({
|
||||
//url: 'https://5-180-182-151.cloud-xip.com:85/zipkin-endpoint/api/v2/spans',
|
||||
//url: 'https://dev-obs01.doneit.co.ao/api/v2/spans',
|
||||
url: 'https://tracing.petermaquiran.xyz/api/v2/spans',
|
||||
serviceName: serviceName,
|
||||
getExportRequestHeaders: () => {
|
||||
return {
|
||||
'Authorization': `Basic ${btoa('doneit:Tabteste@006')}`,
|
||||
};
|
||||
},
|
||||
headers: {
|
||||
'Authorization': `Basic ${btoa('doneit:Tabteste@006')}`,
|
||||
}
|
||||
})));
|
||||
|
||||
// provider.addSpanProcessor(new SimpleSpanProcessor(new OTLPTraceExporter({
|
||||
// url: 'https://ip-2-56-212-253-123420.vps.hosted-by-mvps.net:85/collector/v1/traces',
|
||||
// })));
|
||||
|
||||
provider.register();
|
||||
return provider;
|
||||
}
|
||||
|
||||
@@ -111,25 +111,18 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish, waitNThrow =
|
||||
const _tracer = OpentelemetryLogging.getTracer('logging')
|
||||
const spanContext = _tracer.startSpan(name)
|
||||
|
||||
dataObject = convertAttributesToString(dataObject)
|
||||
|
||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
//if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
openTelemetryLogging.send({
|
||||
type: 'graylog',
|
||||
spanContext,
|
||||
level: 'info',
|
||||
message,
|
||||
payload: {
|
||||
message: message,
|
||||
object: {
|
||||
...dataObject,
|
||||
spanId,
|
||||
name,
|
||||
user: SessionStore?.user?.FullName,
|
||||
device_name: device?.name || device?.model,
|
||||
commit_date: environment.version.lastCommitTime,
|
||||
}
|
||||
// user: SessionStore?.user?.FullName,
|
||||
// device_name: device?.name || device?.model,
|
||||
// commit_date: environment.version.lastCommitTime,
|
||||
}
|
||||
})
|
||||
}
|
||||
//}
|
||||
|
||||
data.logs.push(dataObject)
|
||||
|
||||
@@ -146,7 +139,7 @@ const createTracingInstance = ({bugPrint, name, module, autoFinish, waitNThrow =
|
||||
|
||||
if(environment.apiURL != 'https://gdqas-api.oapr.gov.ao/api/') {
|
||||
span.setAttribute('error.list', data.errors.join(','))
|
||||
// span.end();
|
||||
span.end();
|
||||
UseCaseCounter.add(1, {user: SessionStore?.user?.FullName, outcome:data.tags['outcome'] || data.status?.code , usecase: name})
|
||||
}
|
||||
|
||||
|
||||
@@ -65,6 +65,11 @@ export class EditGroupPage implements OnInit {
|
||||
|
||||
async changeGroupName() {
|
||||
|
||||
if(this.groupName == "" || this.groupName == null) {
|
||||
this.toastService._badRequest("O nome do grupo não pode estar vazio.");
|
||||
return;
|
||||
}
|
||||
|
||||
this.showLoader = true
|
||||
const result = await this.chatServiceService.updateRoomById({
|
||||
roomId: this.roomId,
|
||||
|
||||
@@ -49,6 +49,8 @@ import { whatsappDate } from 'src/app/ui/shared/utils/whatappdate';
|
||||
import { IDBoolean } from 'src/app/infra/database/dexie/type';
|
||||
import { Result } from 'neverthrow';
|
||||
import { MessageOutPutDataDTO } from 'src/app/core/chat/repository/dto/messageOutputDTO';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
@Component({
|
||||
selector: 'app-messages',
|
||||
templateUrl: './messages.page.html',
|
||||
@@ -450,7 +452,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: '',
|
||||
requestId: uuidv4(),
|
||||
roomId: this.room.id
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -47,6 +47,12 @@ export class EditGroupPage implements OnInit {
|
||||
}
|
||||
|
||||
async changeGroupName() {
|
||||
|
||||
if(this.groupName == "" || this.groupName == null) {
|
||||
this.toastService._badRequest("O nome do grupo não pode estar vazio.");
|
||||
return;
|
||||
}
|
||||
|
||||
this.showLoader = true
|
||||
const result = await this.chatServiceService.updateRoomById({
|
||||
roomId: this.roomId,
|
||||
|
||||
@@ -20,7 +20,7 @@ import { UserTypingLocalRepository } from 'src/app/module/chat/data/repository/t
|
||||
import { Result } from 'neverthrow';
|
||||
import { MessageOutPutDataDTO } from 'src/app/core/chat/repository/dto/messageOutputDTO';
|
||||
import { UserTypingRemoteRepositoryService } from 'src/app/module/chat/data/repository/typing/user-typing-live-data-source.service';
|
||||
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
@@ -227,7 +227,7 @@ export class RoomStore {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: '',
|
||||
requestId: uuidv4(),
|
||||
roomId: this.room.id
|
||||
})
|
||||
|
||||
@@ -351,7 +351,7 @@ export class RoomStore {
|
||||
this.chatServiceService.sendReadAt({
|
||||
memberId: SessionStore.user.UserId,
|
||||
messageId: message.id,
|
||||
requestId: '',
|
||||
requestId: uuidv4(),
|
||||
roomId: this.room.id
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -241,6 +241,9 @@
|
||||
class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
|
||||
</div>
|
||||
|
||||
<ion-icon
|
||||
class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
|
||||
|
||||
|
||||
<div *ngIf="(profilePictureSubject | async) as calendarData" class="profile-image">
|
||||
<img class="profile-image font-45-em image-prety" src={{calendarData.base64}}>
|
||||
|
||||
@@ -85,6 +85,9 @@ export class HeaderPage implements OnInit {
|
||||
this.profilePictureSubject = this.UserRepositoryService.getProfilePictureLive() as any
|
||||
this.notificationCount$ = this.notificationRepositoryService.getNotificationLiveCount()
|
||||
|
||||
this.UserRepositoryService.getProfilePictureLive().subscribe((e) => {
|
||||
console.log(`nice job ${e}`);
|
||||
});
|
||||
this.loggeduser = SessionStore.user;
|
||||
router.events.subscribe((val) => {
|
||||
this.hideSearch();
|
||||
@@ -134,7 +137,7 @@ export class HeaderPage implements OnInit {
|
||||
async getProfilpicture(tracing?: TracingType) {
|
||||
|
||||
if (this.SessionStore.user.UserPhoto) {
|
||||
|
||||
|
||||
const base = await this.UserRepositoryService.getUserProfilePhoto(this.SessionStore.user.UserPhoto, tracing)
|
||||
|
||||
if(base.isOk()) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Environment } from './../app/models/envarioment'
|
||||
import { environment as oaprProd } from './suport/oapr'
|
||||
// import { environment as doneITProd } from './suport/doneIt'
|
||||
import { DevDev } from './suport/dev'
|
||||
|
||||
|
||||
export const environment: Environment = DevDev;
|
||||
export const environment: Environment = oaprProd;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Environment } from './../app/models/envarioment'
|
||||
import { environment as oaprDev } from './suport/oapr'
|
||||
import { doneITDev } from './suport/doneIt'
|
||||
import { DevDev } from './suport/dev'
|
||||
|
||||
|
||||
|
||||
@@ -1,58 +1,11 @@
|
||||
import { versionData } from '../../../version/git-version'
|
||||
import { Environment } from './../../app/models/envarioment'
|
||||
|
||||
// export const environment: Environment = {
|
||||
// id:'3',
|
||||
// apiURL: 'http://gpr-dev-01:83/jwt/api/',
|
||||
// /* apiURL: 'https://gdapi-dev-0.dyndns.info/jwt/api/', */
|
||||
// apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
// apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
// apiPCURL: 'http://gpr-dev-01:86/api/',
|
||||
// /* apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/', */
|
||||
// logoLabel: 'Presidente da República',
|
||||
// despachoLabel: 'Presidenciais',
|
||||
// despachoLabel2: 'Despachos Presidênciais',
|
||||
// production: false,
|
||||
// domain: 'gabinetedigital.local',
|
||||
// defaultuser: 'paulo.pinto@gabinetedigital.local',
|
||||
// defaultuserpwd: 'tabteste@006',
|
||||
// chatOffline: true,
|
||||
// presidential: true,
|
||||
// version: versionData,
|
||||
// agendaPR: 'Agenda do PR',
|
||||
// agendaVP: 'Agenda do MD',
|
||||
// PR: 'PR',
|
||||
// VP: '',
|
||||
// dispatchPR: 'Despachos Presidênciais',
|
||||
// sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
||||
// storageProduction: true,
|
||||
// rejectUnauthorized: "true",
|
||||
// fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub'
|
||||
// /* production: true,
|
||||
// domain: 'gabinetedigital.local',
|
||||
// defaultuser: '',
|
||||
// defaultuserpwd: '',
|
||||
// chatOffline: true,
|
||||
// presidential: false,
|
||||
// version: versionData,
|
||||
// sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
||||
// logoLabel: 'doneIT',
|
||||
// despachoLabel: 'do Titular',
|
||||
// despachoLabel2: 'Despachos do Titular',
|
||||
// agendaPR: 'Agenda do Titular',
|
||||
// agendaVP: 'Agenda do (MD)',
|
||||
// PR: 'Titular',
|
||||
// VP: '',
|
||||
// dispatchPR: 'Despachos Titular',
|
||||
// storageProduction: true */
|
||||
// };
|
||||
|
||||
|
||||
export const DevDev: Environment = {
|
||||
id:'3',
|
||||
apiURLStage: 'https://gdapi-dev.dyndns.info/stage/api/v2/',
|
||||
apiURL: 'https://gdapi-dev.dyndns.info/jwt/api/',
|
||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/',
|
||||
logoLabel: 'Presidente da República',
|
||||
despachoLabel: 'Presidenciais',
|
||||
@@ -71,23 +24,6 @@ export const DevDev: Environment = {
|
||||
dispatchPR: 'Despachos Presidênciais',
|
||||
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
||||
storageProduction: false,
|
||||
rejectUnauthorized: "true"
|
||||
/* production: true,
|
||||
domain: 'gabinetedigital.local',
|
||||
defaultuser: 'paulo.pinto@gabinetedigital.local',
|
||||
defaultuserpwd: 'tabteste@006',
|
||||
chatOffline: true,
|
||||
presidential: false,
|
||||
version: versionData,
|
||||
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
||||
logoLabel: 'doneIT',
|
||||
despachoLabel: 'do Titular',
|
||||
despachoLabel2: 'Despachos do Titular',
|
||||
agendaPR: 'Agenda do Titular',
|
||||
agendaVP: 'Agenda do (MD)',
|
||||
PR: 'Titular',
|
||||
VP: '',
|
||||
dispatchPR: 'Despachos Titular',
|
||||
storageProduction: false, */,
|
||||
rejectUnauthorized: "true",
|
||||
fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub'
|
||||
};
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
import { versionData } from '../../../version/git-version';
|
||||
import { Environment } from './../../app/models/envarioment';
|
||||
|
||||
export const environment: Environment = {
|
||||
id:'1',
|
||||
apiURL: 'http://gpr-dev-01:83/jwt/api/',
|
||||
/* apiURL: 'https://gdapi-dev-0.dyndns.info/jwt/api/', */
|
||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
apiPCURL: 'http://gpr-dev-01:86/api/',
|
||||
/* apiPCURL: 'https://gdcmapi-dev.dyndns.info/api/', */
|
||||
/* apiURL: 'https://API.DONEIT.CO.AO/api/',
|
||||
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
|
||||
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
|
||||
apiPCURL: 'http://192.168.0.21:9099/api/', */
|
||||
production: true,
|
||||
domain: 'gabinetedigital.local',
|
||||
defaultuser: '',
|
||||
defaultuserpwd: '',
|
||||
chatOffline: true,
|
||||
presidential: false,
|
||||
version: versionData,
|
||||
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
||||
logoLabel: 'doneIT',
|
||||
despachoLabel: 'do Titular',
|
||||
despachoLabel2: 'Despachos do Titular',
|
||||
agendaPR: 'Agenda do Titular',
|
||||
agendaVP: 'Agenda do (MD)',
|
||||
PR: 'Titular',
|
||||
VP: '',
|
||||
dispatchPR: 'Despachos Titular',
|
||||
storageProduction: true,
|
||||
rejectUnauthorized: "true",
|
||||
fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub'
|
||||
};
|
||||
|
||||
export const doneITDev: Environment = {
|
||||
id:'1',
|
||||
apiURL: 'http://gpr-dev-01:83/jwt/api/',
|
||||
/* apiURL: 'https://gdapi-dev-0.dyndns.info/jwt/api/', */
|
||||
apiChatUrl: 'https://gdchat-dev.dyndns.info/api/v1/',
|
||||
apiWsChatUrl: 'wss://gdchat-dev.dyndns.info/websocket',
|
||||
apiPCURL: 'http://gpr-dev-01:86/api/',
|
||||
/* apiURL: 'https://API.DONEIT.CO.AO/api/',
|
||||
apiChatUrl: 'https://CHAT.DONEIT.CO.AO/api/v1/',
|
||||
apiWsChatUrl: 'wss://CHAT.DONEIT.CO.AO/websocket',
|
||||
apiPCURL: 'http://192.168.0.21:9099/api/', */
|
||||
production: true,
|
||||
domain: 'gabinetedigital.local',
|
||||
defaultuser: '',
|
||||
defaultuserpwd: '',
|
||||
chatOffline: true,
|
||||
presidential: false,
|
||||
version: versionData,
|
||||
sentryUrl: 'https://9920cc36f1d740b987426ee8d80cf588@o4504340905525248.ingest.sentry.io/4504340946419712',
|
||||
logoLabel: 'doneIT',
|
||||
despachoLabel: 'do Titular',
|
||||
despachoLabel2: 'Despachos do Titular',
|
||||
agendaPR: 'Agenda do Titular',
|
||||
agendaVP: 'Agenda do (MD)',
|
||||
PR: 'Titular',
|
||||
VP: '',
|
||||
dispatchPR: 'Despachos Titular',
|
||||
storageProduction: false,
|
||||
rejectUnauthorized: "true",
|
||||
fileHub: 'https://gdcmapi-dev.dyndns.info/FileHub'
|
||||
};
|
||||
@@ -4,12 +4,8 @@ import { Environment } from './../../app/models/envarioment'
|
||||
|
||||
export const environment: Environment = {
|
||||
id: '0',
|
||||
/* apiURL: 'http://gpr-dev-01:83/jwt/api/', */
|
||||
apiURLStage: 'https://gdqas-api.oapr.gov.ao/stage/api/v2/',
|
||||
apiURL: 'https://gdqas-api.oapr.gov.ao/api/',
|
||||
/* apiChatUrl: 'http://192.168.0.29:3000/api/v1/', */
|
||||
apiChatUrl: 'https://gdqas-chat.oapr.gov.ao/api/v1/',
|
||||
apiWsChatUrl: 'wss://gdqas-chat.oapr.gov.ao/websocket',
|
||||
/* apiPCURL: 'http://gpr-dev-01:86/api/', */
|
||||
apiPCURL: 'https://gdqas-cmapi.oapr.gov.ao/api/',
|
||||
logoLabel: 'Presidente da República',
|
||||
despachoLabel: 'Presidenciais',
|
||||
@@ -34,12 +30,8 @@ export const environment: Environment = {
|
||||
|
||||
export const oaprDev: Environment = {
|
||||
id: '0',
|
||||
/* apiURL: 'http://gpr-dev-01:83/jwt/api/', */
|
||||
apiURLStage: 'https://gdqas-api.oapr.gov.ao/stage/api/v2/',
|
||||
apiURL: 'https://gdqas-api.oapr.gov.ao/api/',
|
||||
/* apiChatUrl: 'http://192.168.0.29:3000/api/v1/', */
|
||||
apiChatUrl: 'https://gdqas-chat.oapr.gov.ao/api/v1/',
|
||||
apiWsChatUrl: 'wss://gdqas-chat.oapr.gov.ao/websocket',
|
||||
/* apiPCURL: 'http://gpr-dev-01:86/api/', */
|
||||
apiPCURL: 'https://gdqas-cmapi.oapr.gov.ao/api/',
|
||||
logoLabel: 'Presidente da República',
|
||||
despachoLabel: 'Presidencial',
|
||||
|
||||
Reference in New Issue
Block a user