package cn.stylefeng.team.project.modular.filing.controller;

import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import cn.stylefeng.team.project.modular.filing.pojo.businessAiParseLog.del.BusinessAiParseLogBatchDelRequest;
import cn.stylefeng.team.project.modular.filing.pojo.businessAiParseLog.del.BusinessAiParseLogDelRequest;
import cn.stylefeng.team.project.modular.filing.pojo.businessAiParseLog.edit.BusinessAiParseLogEditRequest;
import cn.stylefeng.team.project.modular.filing.pojo.businessAiParseLog.query.BusinessAiParseLogDetailRequest;
import cn.stylefeng.team.project.modular.filing.pojo.businessAiParseLog.query.BusinessAiParseLogListRequest;
import cn.stylefeng.team.project.modular.filing.pojo.businessAiParseLog.query.BusinessAiParseLogPageRequest;
import cn.stylefeng.team.project.modular.filing.pojo.businessAiParseLog.response.BusinessAiParseLogDetailResponse;
import cn.stylefeng.team.project.modular.filing.pojo.businessAiParseLog.response.BusinessAiParseLogListResponse;
import cn.stylefeng.team.project.modular.filing.pojo.businessAiParseLog.response.BusinessAiParseLogPageResponse;
import cn.stylefeng.team.project.modular.filing.service.BusinessAiParseLogService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@ApiResource(name = "AI解析业务日志")
public class AiParseLogController {

    @Resource
    private BusinessAiParseLogService businessAiParseLogService;

    @PostResource(name = "删除AI解析业务日志", path = "/businessAiParseLog/delete")
    public ResponseData<?> delete(@RequestBody @Validated BusinessAiParseLogDelRequest businessAiParseLogDelRequest) {
        businessAiParseLogService.del(businessAiParseLogDelRequest);
        return new SuccessResponseData<>();
    }

    @PostResource(name = "批量删除AI解析业务日志", path = "/businessAiParseLog/batchDelete")
    public ResponseData<?> batchDelete(@RequestBody @Validated BusinessAiParseLogBatchDelRequest businessAiParseLogBatchDelRequest) {
        businessAiParseLogService.batchDelete(businessAiParseLogBatchDelRequest);
        return new SuccessResponseData<>();
    }

    @PostResource(name = "编辑AI解析业务日志", path = "/businessAiParseLog/edit")
    public ResponseData<?> edit(@RequestBody @Validated BusinessAiParseLogEditRequest businessAiParseLogEditRequest) {
        businessAiParseLogService.edit(businessAiParseLogEditRequest);
        return new SuccessResponseData<>();
    }

    @GetResource(name = "查看AI解析业务日志详情", path = "/businessAiParseLog/detail")
    public ResponseData<BusinessAiParseLogDetailResponse> detail(@Validated BusinessAiParseLogDetailRequest businessAiParseLogDetailRequest) {
        return new SuccessResponseData<>(businessAiParseLogService.detail(businessAiParseLogDetailRequest));
    }

    @GetResource(name = "获取AI解析业务日志列表", path = "/businessAiParseLog/list")
    public ResponseData<List<BusinessAiParseLogListResponse>> list(BusinessAiParseLogListRequest businessAiParseLogListRequest) {
        return new SuccessResponseData<>(businessAiParseLogService.findList(businessAiParseLogListRequest));
    }

    @GetResource(name = "获取AI解析业务日志列表（带分页）", path = "/businessAiParseLog/page")
    public ResponseData<PageResult<BusinessAiParseLogPageResponse>> page(BusinessAiParseLogPageRequest businessAiParseLogPageRequest) {
        return new SuccessResponseData<>(businessAiParseLogService.findPage(businessAiParseLogPageRequest));
    }

    @GetResource(name = "自定义查看AI解析业务日志详情", path = "/businessAiParseLog/customDetail")
    public ResponseData<BusinessAiParseLogDetailResponse> customDetail(@Validated BusinessAiParseLogDetailRequest businessAiParseLogDetailRequest) {
        return new SuccessResponseData<>(businessAiParseLogService.customDetail(businessAiParseLogDetailRequest));
    }

    @GetResource(name = "自定义获取AI解析业务日志列表", path = "/businessAiParseLog/customList")
    public ResponseData<List<BusinessAiParseLogListResponse>> customList(BusinessAiParseLogListRequest businessAiParseLogListRequest) {
        return new SuccessResponseData<>(businessAiParseLogService.customList(businessAiParseLogListRequest));
    }

    @GetResource(name = "自定义获取AI解析业务日志列表（带分页）", path = "/businessAiParseLog/customPage")
    public ResponseData<PageResult<BusinessAiParseLogPageResponse>> customPage(BusinessAiParseLogPageRequest businessAiParseLogPageRequest) {
        return new SuccessResponseData<>(businessAiParseLogService.customPage(businessAiParseLogPageRequest));
    }

}