package com.cool.store.controller.webc;

import com.cool.store.response.ResponseResult;
import com.cool.store.service.close.CloseStoreAccountService;
import com.cool.store.vo.close.account.CloseStoreAccountVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
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.NotNull;
import java.util.List;

/**
 * <p>
 * 闭店账号关闭 前端控制器
 * </p>
 *
 * @author wangff
 * @since 2025/10/8
 */
@Api(tags = "mini账号关闭")
@RestController
@RequestMapping("/mini/close/account")
@RequiredArgsConstructor
@Validated
public class MiniCloseStoreAccountController {
    private final CloseStoreAccountService closeStoreAccountService;

    @ApiOperation("获取账号列表")
    @GetMapping("/accountList")
    @ApiImplicitParam(name = "closeStoreId", value = "闭店申请id", required = true, dataType = "Long")
    public ResponseResult<List<CloseStoreAccountVO>> accountList(@NotNull(message = "闭店申请id不能为空") Long closeStoreId) {
        return ResponseResult.success(closeStoreAccountService.getAccountList(closeStoreId));
    }
}
