package com.diagbot.web;


import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.ConceptDTO;
import com.diagbot.dto.RespDTO;
import com.diagbot.dto.TermDTO;
import com.diagbot.facade.ConceptFacade;
import com.diagbot.vo.TermVo;
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.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Weixuan Huang
 * @since 2019-01-30
 */
@RestController
@RequestMapping("/concept")
@Api(value = "医学标准术语API", tags = { "医学标准术语API" })

public class ConceptController {
    @Autowired
    private ConceptFacade conceptFacade;

    @ApiOperation(value = "术语信息查询",
            notes = "Term：术语名称，必填<br>Type：术语类型, 必填<br>")
    @PostMapping("/getConceptInfo")
    @SysLogger("getConceptInfo")
    public RespDTO<TermDTO> getConceptInfo(@Valid @RequestBody TermVo termvo) {
        ConceptDTO data = conceptFacade.getConceptInfo(termvo);

        return RespDTO.onSuc(data);
    }

}
