package cn.iocoder.yudao.module.pay.controller.app.divide;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.pay.controller.app.divide.vo.DrawMoneyVO;
import cn.iocoder.yudao.module.pay.service.divide.DivideService;
import cn.iocoder.yudao.module.pay.service.wxprofitsharing.WxProfitsharingService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 分账单")
@RestController
@RequestMapping("/pay/divide")
@Validated
public class AppDivideController {

    @Resource
    private WxProfitsharingService profitsharingService;

    @PostMapping("/drawMoney")
    @Operation(summary = "提现")
    public CommonResult<Boolean> createDivide(@RequestBody DrawMoneyVO drawMoneyVO) {
        return success(profitsharingService.drawMoney(drawMoneyVO));
    }

}