UfoSuggestController.java
965 Bytes
package com.yoho.search.restapi.ufo;
import com.yoho.search.common.utils.HttpServletRequestUtils;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.ufo.UfoSuggestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
@RestController
public class UfoSuggestController {
@Autowired
private UfoSuggestService ufoSuggestService;
// UFO - 搜索建议词接口
@RequestMapping(method = RequestMethod.GET, value = "/ufo/suggest")
public SearchApiResult suggest(HttpServletRequest request) {
Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
return ufoSuggestService.suggest(paramMap);
}
}