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

import com.sqx.common.utils.Result;
import com.sqx.modules.artificer.entity.Period;
import com.sqx.modules.artificer.service.OrdersService;
import com.sqx.modules.utils.PeriodUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/app/dividedIntoDetails")
@Api(value = "技师端-分成明细", tags = {"技师端-分成明细查询"})
public class DividedIntoDetailsController {
    @Autowired
    private OrdersService ordersService;
    //@Login
    @ApiOperation("分成明细-总收益查询")
    @PostMapping(value = "selectDividedIntoDetail")
    public Result selectDividedIntoDetail(Period period){
        period = PeriodUtil.calculationPeriod(period);
        Result result  = ordersService.selectDividedIntoDetail(period);
        return result;
    }
    //@Login
    @ApiOperation("分成明细-收益列表")
    @PostMapping(value = "selectDividedIntoDetails")
    public Result selectDividedIntoDetails(Integer page, Integer limit,Period period)  {
        period = PeriodUtil.calculationPeriod(period);
        Result result = ordersService.selectDividedIntoDetails(page,limit, period);
        return result;
    }
    //@Login
    @ApiOperation("分成明细-列表详情")
    @PostMapping(value = "splitDetails")
    public Result splitDetails(Period period){
        Result result = ordersService.splitDetails(period);
        return result;
    }
}
