package cn.lihongjie.coal.coal;

import cn.lihongjie.coal.annotation.Anonymous;
import cn.lihongjie.coal.base.controller.BaseController;
import cn.lihongjie.coal.coalBlend.dto.CoalBlendRequest;
import cn.lihongjie.coal.coalBlend.dto.CoalBlendResult;

import org.springframework.beans.factory.annotation.Autowired;
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 java.util.List;

@RestController
@RequestMapping("/coal")
@Anonymous
public class CoalController extends BaseController {

    @Autowired CoalService coalService;

    @PostMapping("/blend")
    public CoalBlendResult blend(@RequestBody CoalBlendRequest request) {

        return coalService.blend(request);
    }

    @PostMapping("/params")
    public List<CoalParameterDef> params() {

        return coalService.paramDefs();
    }
}
