package org.jeecg.modules.api.teambuyController;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.apiBean.PageBean;
import org.jeecg.modules.apiService.AmountService;
import org.jeecg.modules.apiService.LeaderService;
import org.jeecg.modules.teambuyBalanceLog.entity.TeambuyBalanceLog;
import org.jeecg.modules.teambuyCash.entity.TeambuyCash;
import org.jeecg.modules.teambuyTeamLeader.entity.TeambuyTeamLeader;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@Api(tags="我的-钱包相关接口")
@RestController
@RequestMapping("/teambuy/amount")
@Slf4j
public class AmountController {
    /******************************************************************************************************************/
    //团长
    @Resource
    private AmountService amountService;
    /******************************************************************************************************************/
//    //提现
//    @ApiOperation(value="钱包-提现", notes="钱包-提现")
//    @RequestMapping(value = "/addLeader", method = {RequestMethod.POST})
//    public Result<?> addLeader(@RequestHeader("X-Access-Token") String token, TeambuyTeamLeader teamLeader){
//        return leaderService.addLeader(token, teamLeader);
//    }

    //充值
    @ApiOperation(value="钱包-充值", notes="钱包-充值")
    @RequestMapping(value = "/cashIn", method = {RequestMethod.POST})
    public Result<?> cashIn(@RequestHeader("X-Access-Token") String token, TeambuyCash teambuyCash){
        return amountService.cashIn(token, teambuyCash);
    }

    //收入明细
    @ApiOperation(value="钱包-收支明细", notes="钱包-收支明细")
    @RequestMapping(value = "/queryAmountLog", method = {RequestMethod.POST})
    public Result<?> queryAmountLog(@RequestHeader("X-Access-Token") String token, TeambuyBalanceLog balanceLog, PageBean pageBean){
        return amountService.queryAmountLog(token, balanceLog, pageBean);
    }

    //充值回调
    @PostMapping("/CashNotify")
    public Object CashNotify(@RequestBody String requestBody){
        return amountService.CashNotify(requestBody);
    }

}
