package com.diagbot.web;


import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.QuestionUsualDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.facade.QuestionUsualFacade;
import com.diagbot.vo.QuestionUsualVO;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 常用标签表 前端控制器
 * </p>
 *
 * @author wangyu
 * @since 2018-11-16
 */
@RestController
@RequestMapping("/questionUsual")
@Api(value = "常用标签检索API", tags = { "常用标签API" })
@SuppressWarnings("unchecked")
public class QuestionUsualController {

    @Autowired
    private QuestionUsualFacade questionUsualFacade;

    @ApiOperation(value = "常用标签——根据科室获取常用标签[by:wangyu]",
            notes = "deptCode：医院编码<br>" +
                    "age：年龄<br>" +
                    "sexType: 性别<br>")
    @PostMapping("/getQuestionUsual")
    @SysLogger("getQuestionUsual")
    public RespDTO<List<QuestionUsualDTO>> getQuestionUsual(@RequestBody @Valid QuestionUsualVO questionUsualVO) {
        List<QuestionUsualDTO> data = questionUsualFacade.getQuestionUsual(questionUsualVO);
        return RespDTO.onSuc(data);
    }
}
