package cn.com.qmth.stmms.ms.marking.api;

import cn.com.qmth.stmms.ms.core.domain.Level;
import cn.com.qmth.stmms.ms.core.repository.LevelRepo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by yuanpan on 2017/11/23.
 */
@RestController
@RequestMapping("/api/level")
public class LevelApi {

    @Autowired
    private LevelRepo levelRepo;

    @GetMapping
    public List<Level> list(@RequestParam("workId") Long workId) {

        return levelRepo.findByWorkId(workId);
    }
}
