Authored by peuei

Merge branch 'dev_lineShops_screen_qrcode' into test6.8.5

package com.yohoufo.product.controller;
import com.yoho.core.common.utils.URIBuilder;
import com.yoho.tools.docs.ApiOperation;
import com.yohoufo.common.ApiResponse;
import com.yohoufo.common.annotation.IgnoreSession;
import com.yohoufo.common.annotation.IgnoreSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.HashMap;
/***
* @author peuei
* @date 2019/1/8 13:49
* @description 门店商品吊牌打印
*/
@RestController
public class InfoPrintController {
private final Logger logger = LoggerFactory.getLogger(InfoPrintController.class);
@Resource
RestTemplate restTemplate;
@Value("${ufo.platform.url}")
String platformUrl;
@ApiOperation(name = "ufo.product.shopScreen.printCode", desc = "门店商品吊牌打印")
@IgnoreSignature
@IgnoreSession
@RequestMapping(params = "method=ufo.product.shopScreen.printCode")
public ApiResponse shopScreenPrintCode(@RequestParam(value = "storeIds") String storeIds) {
if (storeIds == null) {
logger.info("in method=ufo.product.shopScreen.printCode storeIds is null");
return new ApiResponse(400, "storeIds can not be null", null);
}
logger.info("in method=ufo.product.shopScreen.printCode storeIds={}", storeIds);
URIBuilder uriBuilder = new URIBuilder(platformUrl);
uriBuilder.addPath("/infoPrint/getPrintContent.do");
uriBuilder.addParameter("storeIds", storeIds);
ApiResponse response = restTemplate.getForObject(uriBuilder.build(), ApiResponse.class);
return new ApiResponse.ApiResponseBuilder().data(response.getData()).code(200).message("print code content").build();
}
}