package com.mcwl.web.controller.platformData;


import com.mcwl.common.core.domain.R;
import com.mcwl.pay.domain.vo.IncomeVo;
import com.mcwl.pay.domain.vo.TrendVo;
import com.mcwl.pay.service.OrderTradeService;
import com.mcwl.system.domain.vo.UserDataVo;
import com.mcwl.system.service.ISysUserService;
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("platformData")
@RequiredArgsConstructor
public class PlatformData {

    private final OrderTradeService orderTradeService;

    private final ISysUserService sysUserService;

    /**
     * 平台收益
     */
    @ApiOperation(value = "平台收益")
    @GetMapping("getIncome")
    public R<IncomeVo> getIncome() {

        return R.ok(orderTradeService.getIncome());
    }

    /**
     * 收益趋势
     */
    @ApiOperation(value = "收益趋势")
    @GetMapping("getTrend")
    public R<TrendVo> getTrend() {

        return R.ok(orderTradeService.getTrend());
    }

    /**
     * 用户数据
     */
    @ApiOperation(value = "用户数据")
    @GetMapping("getUserData")
    public R<UserDataVo> getUserData() {

        return R.ok(sysUserService.getUserData());
    }






}
