package cn.ey.biz.module.system.controller.admin.rate;

import cn.ey.biz.common.pojo.R;
import cn.ey.biz.module.system.api.rate.dto.RateResDTO;
import cn.ey.biz.module.system.service.rate.FinanceGenerateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

import static cn.ey.biz.common.pojo.R.success;

@Api(tags = "管理后台 - 跑数据")
@RestController
@RequestMapping("/system/rate")
@Validated
public class RateController {

    @Resource
    private FinanceGenerateService financeGenerateService;

    @GetMapping("/generate")
    @ApiOperation("生成rate数据")
    public R<List<RateResDTO>> generateRate() {
        return success(financeGenerateService.generateRate());
    }

}
