package cn.com.qmth.stmms.monitor;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.com.qmth.stmms.biz.exam.model.SubjectiveBlock;
import cn.com.qmth.stmms.biz.exam.service.SubjectiveBlockService;

@Controller("subjectiveBlockMonitor")
@RequestMapping("/monitor/subjective-block")
public class SubjectiveBlockController {

    protected static Logger log = LoggerFactory.getLogger(SubjectiveBlockController.class);

    @Autowired
    private SubjectiveBlockService blockService;

    @RequestMapping("/{blockId}")
    @ResponseBody
    public SubjectiveBlock findById(HttpServletRequest request, @PathVariable Integer blockId) {
        SubjectiveBlock result = null;
        if (blockId != null && blockId > 0) {
            result = blockService.findBlockById(blockId, true);
        }
        return result;
    }
}
