package com.seer.teach.pay.admin.withdrawal.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.stp.StpUtil;
import com.seer.teach.common.PageListBean;
import com.seer.teach.common.ResultBean;
import com.seer.teach.pay.admin.withdrawal.controller.request.PayWithdrawalOperationLogPageReq;
import com.seer.teach.pay.admin.withdrawal.controller.response.PayWithdrawalOperationLogResp;
import com.seer.teach.pay.admin.withdrawal.service.AdminPayWithdrawalOperationLogService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.validation.Valid;

/**
 * 商户端提现操作日志控制器
 *
 * @author ZS
 * @since 2025-09-17
 */
@RestController
@RequestMapping("/pay/merchant/withdrawal/log")
@Tag(name = "商户端 - 提现操作日志管理")
@RequiredArgsConstructor
public class MerchantPayWithdrawalOperationLogController {

    private final AdminPayWithdrawalOperationLogService payWithdrawalOperationLogService;

    @PostMapping("/paged")
    @Operation(summary = "分页查询提现操作日志")
    @SaCheckPermission("merchant:pay:withdrawal:operation-log:page")
    public ResultBean<PageListBean<PayWithdrawalOperationLogResp>> pageList(@Parameter(description = "分页查询参数") @Valid @RequestBody PayWithdrawalOperationLogPageReq queryParam) {
        queryParam.setOperatorId(StpUtil.getLoginIdAsLong());
        return ResultBean.success(payWithdrawalOperationLogService.pageList(queryParam));
    }
}