YzSceneController.java 1.52 KB
package com.yoho.search.restapi.scene;

import com.yoho.search.common.utils.HttpServletRequestUtils;
import com.yoho.search.models.SearchApiResult;
import com.yoho.search.service.scene.others.YzService;
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;

@RequestMapping(method = RequestMethod.GET, value = "/yz")
@RestController
public class YzSceneController {

    @Autowired
    private YzService yzService;

    @RequestMapping(method = RequestMethod.GET, value = "/msortList")
    public SearchApiResult msortAggregations(HttpServletRequest request) {
        Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
        return yzService.msortList(paramMap);
    }

    @RequestMapping(method = RequestMethod.GET, value = "/productList")
    public SearchApiResult productList(HttpServletRequest request) {
        Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
        return yzService.productList(paramMap);
    }

    @RequestMapping(method = RequestMethod.GET, value = "/similarProductList")
    public SearchApiResult similarProductList(HttpServletRequest request) {
        Map<String, String> paramMap = HttpServletRequestUtils.transParamType(request);
        return yzService.similarProductList(paramMap);
    }

}