package com.diagbot.web;

import com.diagbot.annotation.SysLogger;
import com.diagbot.dto.RespDTO;
import com.diagbot.dto.SymptomFeatureDTO;
import com.diagbot.facade.FeatureFacade;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description:
 * @Author:zhaops
 * @time: 2019/2/26 13:25
 */
@RestController
@RequestMapping("/feature")
@Api(value = "特征词提取相关API", tags = { "特征词提取相关API" })
public class FeatureController {

    @Autowired
    FeatureFacade featureFacade;

    @ApiOperation(value = "症状文本解析[by:zhaops]",
            notes = "text： 症状文本描述(必填)<br>")
    @PostMapping("/getSymptomFeature")
    @SysLogger("getSymptomFeature")
    public RespDTO<List<SymptomFeatureDTO>> getSymptomFeature(@RequestParam("text") String text) {
        return RespDTO.onSuc(featureFacade.getSymptomFeature(text));
    }
}
