fix chat ui details

This commit is contained in:
Peter Maquiran
2024-09-09 10:28:53 +01:00
parent e7887d4e5a
commit 96daa01f94
20 changed files with 236 additions and 108 deletions
+33
View File
@@ -0,0 +1,33 @@
import { z } from "zod";
export const MemberEntitySchema = z.object({
$roomIdUserId: z.string().optional(),
id: z.string().optional(), // useless
roomId: z.string(),
wxUserId: z.number(),
wxFullName: z.string(),
wxeMail: z.string(),
userPhoto: z.string().nullable(),
joinAt: z.string(),
status: z.string().optional(), // useless
isAdmin: z.boolean()
})
export type IMember = z.infer<typeof MemberEntitySchema>
export class MemberEntity implements IMember {
id: typeof MemberEntitySchema._type.id
roomId: typeof MemberEntitySchema._type.roomId
wxUserId: typeof MemberEntitySchema._type.wxUserId
wxFullName: typeof MemberEntitySchema._type.wxFullName
wxeMail: typeof MemberEntitySchema._type.wxeMail
userPhoto: typeof MemberEntitySchema._type.userPhoto
joinAt: typeof MemberEntitySchema._type.joinAt
status: typeof MemberEntitySchema._type.status
isAdmin: typeof MemberEntitySchema._type.isAdmin
hasPhoto() {
return typeof this.userPhoto == 'string'
}
}
@@ -0,0 +1,13 @@
import { HttpResult, IHttPReturn } from "src/app/infra/http/type"
import { UserPhotoGetByIdInputSchema } from "src/app/module/chat/domain/use-case/user-photo/user-photo-get-by-id-use-case.service"
import { z } from "zod"
export const IGetUserPhotoByAttachmentIdInputSchema = z.object({
attachmentId: z.string(),
})
export type IGetUserPhotoByAttachmentId = z.infer<typeof IGetUserPhotoByAttachmentIdInputSchema>
export abstract class IUserPhotoRemoteRepository {
abstract getUserPhotoByAttachmentId(input: IGetUserPhotoByAttachmentId): IHttPReturn<string>
}