mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
fix chat ui details
This commit is contained in:
@@ -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>
|
||||
}
|
||||
Reference in New Issue
Block a user