/*
 * Copyright (c) 2018-2999 广州亚米信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 */

package com.yami.shop.multishop.controller;

import com.yami.shop.bean.model.ShopWallet;
import com.yami.shop.security.multishop.util.SecurityUtils;
import com.yami.shop.service.ShopWalletService;
import com.yami.shop.common.annotation.SysLog;

import javax.validation.Valid;

import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import lombok.AllArgsConstructor;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yami.shop.common.util.PageParam;
import com.baomidou.mybatisplus.core.metadata.IPage;


/**
 * 商家钱包信息
 *
 * @author Dwl
 * @date 2019-09-19 14:02:57
 */
@RestController
@AllArgsConstructor
@RequestMapping("/shop/shopWallet" )
public class ShopWalletController {

    private final ShopWalletService shopWalletService;

    /**
     * 通过id查询商家钱包信息
     * @return 单个数据
     */
    @GetMapping("/info" )
    public ResponseEntity<ShopWallet> info() {
        ShopWallet shopWallet = shopWalletService.getShopWalletByShopId(SecurityUtils.getShopUser().getShopId());
        return ResponseEntity.ok(shopWallet);
    }

}
