feat(aihr): complete company message R1-R3
This commit is contained in:
@@ -42,6 +42,17 @@ export type BroadcastAdminMessage = {
|
||||
unmatchedTargetCount: number;
|
||||
};
|
||||
|
||||
export type BroadcastAttachment = {
|
||||
id: number;
|
||||
fileName: string;
|
||||
fileSize: number;
|
||||
contentType: string;
|
||||
status: 'QUEUED' | 'PROCESSING' | 'READY' | 'FAILED';
|
||||
summary?: string;
|
||||
errorMessage?: string;
|
||||
downloadUrl?: string;
|
||||
};
|
||||
|
||||
export type BroadcastAdminPage = {
|
||||
/** Effective request tenant, including an administrator's dynamic-tenant selection. */
|
||||
tenantId: string;
|
||||
@@ -58,6 +69,7 @@ export type PublishBroadcastRequest = {
|
||||
expectedTenantId: string;
|
||||
requiredRead: boolean;
|
||||
targets: BroadcastTargetRequest;
|
||||
attachmentId?: number;
|
||||
};
|
||||
|
||||
export type WithdrawBroadcastRequest = {
|
||||
@@ -84,6 +96,26 @@ export function loadBroadcastTargetOptions(): Promise<ApiResult<BroadcastTargetO
|
||||
});
|
||||
}
|
||||
|
||||
export function uploadBroadcastAttachment(file: File, expectedTenantId: string): Promise<ApiResult<BroadcastAttachment>> {
|
||||
const data = new FormData();
|
||||
data.append('file', file);
|
||||
return request({
|
||||
url: '/api/aihr/broadcast/admin/attachments',
|
||||
method: 'post',
|
||||
params: { expectedTenantId },
|
||||
data,
|
||||
timeout: 120000,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
}
|
||||
|
||||
export function getBroadcastAttachment(id: number): Promise<ApiResult<BroadcastAttachment>> {
|
||||
return request({
|
||||
url: `/api/aihr/broadcast/admin/attachments/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
export function publishBroadcast(data: PublishBroadcastRequest): Promise<ApiResult<{
|
||||
id: number;
|
||||
version: number;
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
type ApiResult<T> = { code: number; msg: string; data: T };
|
||||
|
||||
export type DirectFeedbackStatus = 'SUBMITTED' | 'REPLIED';
|
||||
export type DirectChannelCode = 'PRESIDENT' | 'FINANCE' | 'HR' | 'AUDIT' | 'OPERATIONS';
|
||||
|
||||
export type DirectAdminFeedback = {
|
||||
id: number;
|
||||
channelCode: DirectChannelCode;
|
||||
channelName: string;
|
||||
senderDisplayName: string;
|
||||
anonymous: boolean;
|
||||
content: string;
|
||||
status: DirectFeedbackStatus;
|
||||
replyContent?: string;
|
||||
repliedAt?: string;
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
export type DirectAdminPage = {
|
||||
tenantId: string;
|
||||
total: number;
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
rows: DirectAdminFeedback[];
|
||||
};
|
||||
|
||||
export const listDirectAdminFeedback = (params: {
|
||||
pageNum: number;
|
||||
pageSize: number;
|
||||
status?: DirectFeedbackStatus;
|
||||
channelCode?: DirectChannelCode;
|
||||
}): Promise<ApiResult<DirectAdminPage>> =>
|
||||
request({
|
||||
url: '/api/aihr/direct/admin/feedback',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
|
||||
export const replyDirectFeedback = (
|
||||
id: number,
|
||||
data: { content: string; expectedTenantId: string }
|
||||
): Promise<ApiResult<DirectAdminFeedback>> =>
|
||||
request({
|
||||
url: `/api/aihr/direct/admin/feedback/${id}/reply`,
|
||||
method: 'post',
|
||||
data,
|
||||
headers: { repeatSubmit: false }
|
||||
});
|
||||
Reference in New Issue
Block a user