package com.sqx.modules.shop.controller.app;

import com.sqx.common.utils.Result;
import com.sqx.modules.shop.entity.ShopBankCardInfo;
import com.sqx.modules.shop.service.ShopBankCardInfoService;
import com.sqx.modules.sys.controller.AbstractController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags={"商户管理-商户银行卡"})
@RestController
@RequestMapping("admin/shop/bank")
@RequiredArgsConstructor
public class ShopBankCardInfoController extends AbstractController {

    private final ShopBankCardInfoService shopBankCardInfoService;

    @ApiOperation("获取当前商户银行卡信息")
    @GetMapping("get-by-user")
    public Result getByUserId() {
        Long adminUserId = getUserId();
        ShopBankCardInfo cardInfo = shopBankCardInfoService.getByUserId(adminUserId);

        return Result.success().put("data", cardInfo);
    }
}
