// 模板信息
export interface ItemplateRes {
    id: number
    image: string
    name: string
}

export interface Lora extends ItemplateRes {
    prompt: string
}

// 获取任务信息
export interface ItaskIdParams {
    task_id: string
}

// 申请加入
export interface IjoinInParams {
    phoneNumber: string
    code: string
    isFresh: boolean
    activeCode?: string
}

// 申请加入（邮箱）
export interface IjoinInEmailParams {
    email: string
    code: string
    activeCode?: string
}

// 三方登录
export interface IloginThirdParam {
    third: string
    code: string
    inviterId?: string
}

// 验证码检验
export interface IcheckSmsCodeParams {
    phoneNumber: string
    code: string
    noLogin?: boolean
}

// 老用户注册
export interface IsmsLoginParams {
    key: string
}

//新用户注册
export interface IsmsSignupParams {
    key: string
    isUserAgreementChecked: boolean
    invitaionId?: string
}

//新老用户检测
export interface IFreshParams {
    phoneNumber: string
}

// 肤色
export interface ImodelRes {
    id: number
    image: string
}

export interface IgetTaskParams {
    needCount?: boolean
    page?: number
    agentName: string | null
    token?: string
    noShowToast?: boolean
}

export interface IgetTaskRes {
    taskId: string
    name: string
    image: string
    status: string
    canSuspend: boolean
}
export interface IsaveTaskParams {
    agentName?: string | null
    image?: string // 用户上传原图
    showImage?: string // 1024处理过的展示图
    taskId?: string | null // 任务id
    paramType?: ParamType // 编辑类型
    posPrompt?: string //
    negPrompt?: string
    mask?: string
    locationId?: number
    tagIds?: number[]
    fashionModelId?: string
    denoiseType?: number
    replicateFromTaskNo?: number
    replicateFromExecuteSeq?: number
    replicateFromUnitId?: string
    replicateFromImage?: string
    replicateFromTaskAgentName?: string
    sdCheckpoint?: string // 底模
    sdLora?: { id: string; weight: number }[] // lora
    sdSamplingMethod?: string // 采样方法
    sdWidthAndHeight?: { width: number; height: number } // 尺寸
    sdRestoreFaces?: boolean // 面部修复
    sdCfgScale?: number // 提示词引导系数
    batchTask: boolean
    agentVersion?: string
}

export interface ILora {
    id: string
    name: string
    image: string
    weight: number
    commercialDescription?: string
}
export interface IrenameTaskParams {
    taskId?: string | null
    name?: string
}

// 执行记录结果
export interface InferResultRes {
    status: string
    paramType: ParamType
    locationName: string
    executionTime: string
    tagNames: string[]
    image: string
    showImage: string
    taskName: string
    fashionModelImage: string
    result: InferResultItem[]
    posPrompt: string
    waitingCnt: number
    executionId: string
    negPrompt: string
    textDescription: string
    executeSeq: number
    taskNumber: number
    replicateFromTaskNo?: number
    replicateFromExecuteSeq?: number
    replicateFromImage?: string
    id?: string
    isSubmitted?: boolean
    sdCheckpoint?: string
    sdSamplingMethod?: string
    agentVersion: string
}

// 执行记录结果result单个item
export interface InferResultItem {
    id: string
    blocked?: boolean
    status: string
    finalImage: string
    progress?: string
    previewImage?: string
    isStar?: boolean
    pageNumber?: number
    seed?: string
}

export interface IrunTaskParams {
    taskId: string | null
    executionId?: string
    page?: number
    noShowToast?: boolean
    requestTaskExecutions?: boolean
    agentName?: string | null
    agentVersion?: string | null
}

export interface IstartImageParams {
    id: string
    finalImage: string
    isStar: boolean
}

export interface IreplicableExecutionsParams {
    taskNo?: number
    noShowToast?: boolean
    replicateList?: boolean
}

export interface IexecutionFaceDetectParams {
    unitId?: string
}

// tags
export interface ItagsRes {
    id: number
    name: string
}

//发送验证码
export interface IsendVerificationCodeParams {
    phoneNumber: string
}

//发送验证码邮箱
export interface IsendEmailVerificationCodeParams {
    email: string
}

export type ParamType = 'template' | 'prompt' | 'textDescription' | 'replicate'

export type AgentType =
    | 'mannequin'
    | 'model'
    | 'product'
    | 'accessory'
    | 'toy'
    | 'children'
    | 'image2image'
    | 'text2image'

export interface ItaskDetail {
    taskId?: string
    name?: string
    number?: number
    locationId?: number
    image?: string
    showImage?: string
    mask?: string
    posPrompt?: string
    negPrompt?: string
    paramType?: ParamType
    tag?: string
    updateTime?: string
    createTime?: string
    denoiseType?: number
    fashionModelId?: number
    agentName?: string
    tagIds?: number[]
    textDescription?: string
    replicateFromTaskNo?: number
    replicateFromExecuteSeq?: number
    replicateFromUnitId?: string
    replicateFromImage?: string
    replicateFromTaskAgentName?: string
    sdLora?: ILora[]
    sdCheckpoint?: string
    segmentBodyStatus?: string
    segmentStatus?: string
    batchTask?: boolean
    scheduleStrategy?: string
    agentVersion?: string
}

//登录后的用户信息
export interface IuserInfosParams {
    phoneNumber?: string | undefined
    uid?: string | undefined
    uname?: string | undefined
    planName?: string | undefined
    specialMerchant?: boolean
    isEmployee?: boolean
    accessoryAccess?: boolean
    isAgency?: boolean
    isPlanPaidUser?: boolean
    isBindShopify?: boolean
    apiAccess?: boolean
    apiPlanDuration?: string
    apiPlanExipreDate?: string
    agent15?: boolean
    agentVersion?: string
}

export interface ItabsRes {
    key: number
    value: string
}

export interface IgetMaskDataParams {
    url: string
    version: string
}

export interface IgetSegementParams {
    image: string | null
    taskId: string | null
    noShowToast?: boolean
}

export interface IgetBodySegmentParams {
    image: string | null
    taskId: string | null
    noShowToast?: boolean
}

export interface IgetImage2KParams {
    id: string
    image: string
}

export interface InoLoginParams {
    noLogin?: boolean
}

//联想词
// export interface IgetPromptSuggestionParams {
//     prompt: string
// }

//钱包信息
export interface IgetWalletInfosParams {
    balance: number
    totalAmount: number
    isWithdrawalEnabled: boolean
}

// 邀请码列表
export interface IgetinvitationCodeParams {
    page: number
}

// 邀请记录列表
export interface IgetinvitationRecordParams {
    page: number
}

// 推广用户明细
export interface IgetinvitationUsersParams {
    page: number
}

export interface IReplicableExecution {
    taskId: string
    executionId: string
    executeSeq: number
    results: IReplicableExecutionImage[]
}

export interface IReplicableExecutionImage {
    unitId: string
    image: string
}
// showCase详细信息
export interface IshowCaseDeatil {
    finalImage?: string
    image?: string
    maskBase64?: string
    posPrompt?: string
    negPrompt?: string
    locationName?: string
    fashionModelImage?: string
    tagNames?: string[]
    paramType?: ParamType
    textDescription?: string
    isSubmitted: boolean
}

// 算力明细
export interface IpowerDetail {
    checkPointCnt?: number
    sdSamplingMethodCnt?: number
    posPromptCnt?: number
    perExecutePowerConsume?: number
    totalExecuteCnt?: number
    totalExecutePowerConsume?: number
}
