Authored by peuei

Merge branch 'dev_lineShops_screen_qrcode' into test6.8.5

  1 +package com.yohoufo.product.controller;
  2 +
  3 +import com.yoho.core.common.utils.URIBuilder;
  4 +import com.yoho.tools.docs.ApiOperation;
  5 +import com.yohoufo.common.ApiResponse;
  6 +import com.yohoufo.common.annotation.IgnoreSession;
  7 +import com.yohoufo.common.annotation.IgnoreSignature;
  8 +import org.slf4j.Logger;
  9 +import org.slf4j.LoggerFactory;
  10 +import org.springframework.beans.factory.annotation.Value;
  11 +import org.springframework.web.bind.annotation.RequestMapping;
  12 +import org.springframework.web.bind.annotation.RequestParam;
  13 +import org.springframework.web.bind.annotation.RestController;
  14 +import org.springframework.web.client.RestTemplate;
  15 +
  16 +import javax.annotation.Resource;
  17 +import java.util.HashMap;
  18 +
  19 +/***
  20 + * @author peuei
  21 + * @date 2019/1/8 13:49
  22 + * @description 门店商品吊牌打印
  23 + */
  24 +@RestController
  25 +public class InfoPrintController {
  26 +
  27 + private final Logger logger = LoggerFactory.getLogger(InfoPrintController.class);
  28 +
  29 + @Resource
  30 + RestTemplate restTemplate;
  31 +
  32 + @Value("${ufo.platform.url}")
  33 + String platformUrl;
  34 +
  35 + @ApiOperation(name = "ufo.product.shopScreen.printCode", desc = "门店商品吊牌打印")
  36 + @IgnoreSignature
  37 + @IgnoreSession
  38 + @RequestMapping(params = "method=ufo.product.shopScreen.printCode")
  39 + public ApiResponse shopScreenPrintCode(@RequestParam(value = "storeIds") String storeIds) {
  40 + if (storeIds == null) {
  41 + logger.info("in method=ufo.product.shopScreen.printCode storeIds is null");
  42 + return new ApiResponse(400, "storeIds can not be null", null);
  43 + }
  44 + logger.info("in method=ufo.product.shopScreen.printCode storeIds={}", storeIds);
  45 + URIBuilder uriBuilder = new URIBuilder(platformUrl);
  46 + uriBuilder.addPath("/infoPrint/getPrintContent.do");
  47 + uriBuilder.addParameter("storeIds", storeIds);
  48 + ApiResponse response = restTemplate.getForObject(uriBuilder.build(), ApiResponse.class);
  49 + return new ApiResponse.ApiResponseBuilder().data(response.getData()).code(200).message("print code content").build();
  50 + }
  51 +}
@@ -118,3 +118,5 @@ rabbit_password=yoho @@ -118,3 +118,5 @@ rabbit_password=yoho
118 118
119 119
120 yoho.gateway.url=http://api-test3.dev.yohocorp.com 120 yoho.gateway.url=http://api-test3.dev.yohocorp.com
  121 +
  122 +ufo.platform.url=http://java-ufo-platform.test3.ingress.dev.yohocorp.com/ufoPlatform