package com.cool.store.controller.webc;

import com.cool.store.request.AdjustmentOrderPageRequest;
import com.cool.store.request.wallet.ConfirmRechargeRequest;
import com.cool.store.response.AdjustmentOrderResponse;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.AdjustmentOrderService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 费用调整单
 * @Auther zx_szh
 * @Date 2026/4/12 16:03
 * @Version 1.0
 */
@RequestMapping("/mini/adjustmentOrder")
@RestController
@Api(tags = "Mini费用调整单管理")
@Slf4j
public class MiniAdjustmentOrderController {

    @Resource
    private AdjustmentOrderService adjustmentOrderService;

    @GetMapping("/getById")
    @ApiOperation("根据ID查询费用调整单详情")
    public ResponseResult<AdjustmentOrderResponse> getById(@ApiParam("调整单ID") @RequestParam Long id) {
        return ResponseResult.success(adjustmentOrderService.getById(id));
    }


    @PostMapping("/confirmRecharge")
    @ApiOperation("确认已充值")
    public ResponseResult<Boolean> confirmRecharge(@RequestBody ConfirmRechargeRequest request) {
        return ResponseResult.success(adjustmentOrderService.confirmRecharge(request));
    }

    @PostMapping("/page")
    @ApiOperation("分页查询费用调整单")
    public ResponseResult<PageInfo<AdjustmentOrderResponse>> page(@RequestBody AdjustmentOrderPageRequest request) {
        return ResponseResult.success(adjustmentOrderService.page(request));
    }


}
