fucai-claim/src/types/apiService.d.ts

116 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// API服务类型声明
// 接口类型定义
export interface ActivityInfo {
activityName: string
activityStartTime: string
activityEndTime: string
money: number
status: number
}
export interface OcrUploadResponse {
uploadId: string
}
export interface OcrParseResponse {
raw: string
words: string[]
parsed: {
marriageNo: string
husbandName: string
wifeName: string
registerDate: string
}
}
export interface MarriageCodeDTO {
marriageNo?: string
receiveName?: string
receiveMobile?: string
code?: string
smsCode?: string
signImage?: string
salesNo?: string
dataTime?: string
}
export interface MarriageCodeVO {
code: string
status: number
marriageNo: string | null
receiveName: string | null
receiveMobile: string | null
receiveTime: string | null
salesNo?: string
}
export interface MarriageCodeListVO {
codeList: MarriageCodeVO[]
receiveCount: string
receiveAmount: string
}
export interface CommSmsDTO {
mobile: string
type: number // 0=登录1=兑换领取2=OCR识别
}
// API服务接口定义
export interface ApiService {
// 活动介绍页
// 获取当前活动信息
getCurrentActivity(): Promise<any>
// OCR识别相关接口
// 上传OCR图片
uploadOcrImage(formData: FormData): Promise<any>
// 发送短信验证码
sendSms(data: CommSmsDTO): Promise<any>
// OCR识别并返回证件信息
parseOcrInfo(data: {
mobile: string
smsCode: string
uploadId: string
}): Promise<any>
// 领取流程相关接口
// 领取前校验(生成二维码前的校验与预览)
receiveCheck(data: MarriageCodeDTO): Promise<any>
// 确认领取(落库并置为已核销)
receiveCode(data: MarriageCodeDTO): Promise<any>
// 二维码状态相关接口
// 按站点号与月份分页统计列表
getCodeList(data: {
salesNo: string
page: number
size: number
dataTime?: string
}): Promise<any>
// 按核销码查询状态
getCodeStatus(data: { code: string }): Promise<any>
// 兑奖页面相关接口
// 根据核销码获取领取信息(用于自动带出)
getCodeInfo(data: { code: string }): Promise<any>
// 站点登录相关接口
// 登录
login(data: {
mobile: string
password: string
smsCode: string
}): Promise<any>
// 后台活动管理接口(可选,用于管理端)
// 获取活动列表
getActivityList(): Promise<any>
}
export const apiService: ApiService
export default apiService