package com.ycwl.basic.service.printer;

import com.ycwl.basic.model.mobile.face.FaceRecognizeResp;
import com.ycwl.basic.model.mobile.order.PriceObj;
import com.ycwl.basic.model.pc.printer.entity.PrintTaskEntity;
import com.ycwl.basic.model.pc.printer.entity.PrinterEntity;
import com.ycwl.basic.model.pc.printer.resp.MemberPrintResp;
import com.ycwl.basic.model.pc.printer.resp.PrinterResp;
import com.ycwl.basic.model.printer.req.FromSourceReq;
import com.ycwl.basic.model.printer.req.PrinterSyncReq;
import com.ycwl.basic.model.printer.resp.PrintTaskResp;
import com.ycwl.basic.model.printer.req.WorkerAuthReqVo;
import com.ycwl.basic.utils.ApiResponse;

import java.util.List;
import java.util.Map;

public interface PrinterService {
    List<PrinterResp> listByScenicId(Long scenicId);

    ApiResponse<List<PrinterEntity>> list(PrinterEntity condition);

    ApiResponse<PrinterEntity> get(Integer id);

    ApiResponse<Integer> add(PrinterEntity entity);

    ApiResponse<Integer> update(PrinterEntity entity);

    ApiResponse<Integer> delete(Integer id);

    List<PrintTaskResp> sync(PrinterSyncReq req);

    void taskSuccess(Integer taskId, WorkerAuthReqVo req);

    void taskFail(Integer taskId, WorkerAuthReqVo req);

    List<MemberPrintResp> getUserPhotoList(Long userId, Long scenicId, Long faceId);

    List<MemberPrintResp> getUserPhotoListByOrderId(Long orderId);

    boolean deleteUserPhoto(Long memberId, Long scenicId, Long relationId);

    Integer addUserPhoto(Long memberId, Long scenicId, String url, Long faceId, Long sourceId);

    MemberPrintResp getUserPhoto(Long memberId, Long scenicId, Long id);

    int setPhotoCropped(Long memberId, Long scenicId, Long id, String url, String crop);

    int setPhotoQuantity(Long memberId, Long scenicId, Long id, Integer quantity);

    PriceObj queryPrice(Long memberId, Long scenicId, Long faceId);

    List<Integer> addUserPhotoFromSource(Long memberId, Long scenicId, FromSourceReq req, Long faceId);

    Map<String, Object> createOrder(Long memberId, Long scenicId, Integer printerId, Long faceId);

    void batchSetUserPhotoListToPrinter(Long memberId, Long scenicId, Integer printerId);

    void setUserIsBuyItem(Long memberId, Long id, Long orderId);

    FaceRecognizeResp useSample(Long userId, Long sampleId);

    void autoAddPhotosToPreferPrint(Long faceId);

    /**
     * 查询待审核的打印任务
     * @param printerId 打印机ID(可选)
     * @return 待审核任务列表
     */
    List<PrintTaskEntity> getPendingReviewTasks(Integer printerId);

    /**
     * 更新待审核任务的URL
     * @param taskId 任务ID
     * @param url 新的打印URL
     * @return 是否成功
     */
    boolean updatePendingReviewTaskUrl(Integer taskId, String url);

    /**
     * 批准待审核任务，下发到打印队列
     * @param taskIds 任务ID列表
     * @return 成功数量
     */
    int approvePrintTasks(List<Integer> taskIds);

    /**
     * 拒绝待审核任务
     * @param taskIds 任务ID列表
     * @return 成功数量
     */
    int rejectPrintTasks(List<Integer> taskIds);
}