package com.cool.store.controller.webb;

import com.cool.store.response.ResponseResult;
import com.cool.store.service.modify.ModifyRecordService;
import com.cool.store.vo.modify.ModifyRecordVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * 修改记录 前端控制器
 * </p>
 *
 * @author wangff
 * @since 2026/1/27
 */
@Api(tags = "修改记录")
@RestController
@RequestMapping("/pc/modify/record")
@RequiredArgsConstructor
@Validated
public class ModifyRecordController {
    private final ModifyRecordService modifyRecordService;

    @ApiOperation("修改记录")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "module", value = "模块，WALLET_ALLOCATION_CONFIG分账配置 PAYEE_BANK_CONFIG收款银行配置 FEE_STANDARD_CONFIG加盟费用标准收费额配置", required = true),
            @ApiImplicitParam(name = "businessId", value = "业务id", required = true)
    })
    @GetMapping("/list")
    public ResponseResult<List<ModifyRecordVO>> list(@NotBlank(message = "模块不能为空") String module,
                                                     @NotNull(message = "业务id不能为空") Long businessId) {
        return ResponseResult.success(modifyRecordService.getModifyRecorsList(module, businessId));
    }
}
