Authored by FengRuwei

typectl

  1 +package com.ui.ctrl.type;
  2 +
  3 +import com.ui.contants.HttpUriContants;
  4 +import com.ui.http.HttpRestClient;
  5 +import org.slf4j.Logger;
  6 +import org.slf4j.LoggerFactory;
  7 +import org.springframework.beans.factory.annotation.Autowired;
  8 +import org.springframework.stereotype.Controller;
  9 +import org.springframework.web.bind.annotation.RequestMapping;
  10 +import org.springframework.web.bind.annotation.ResponseBody;
  11 +
  12 +import java.util.HashMap;
  13 +
  14 +/**
  15 + * Created by fruwei on 2016/6/16.
  16 + */
  17 +@Controller
  18 +@RequestMapping("type")
  19 +public class TypeCtrl {
  20 + Logger logger = LoggerFactory.getLogger(TypeCtrl.class);
  21 +
  22 + @Autowired
  23 + private HttpRestClient httpClient;
  24 +
  25 + @RequestMapping("/all")
  26 + @ResponseBody
  27 + public String getAllType(){
  28 + String strType="";
  29 +
  30 + logger.debug("get all type");
  31 +
  32 + strType=httpClient.defaultGet(HttpUriContants.GET_ALL_TYPE, String.class);
  33 +
  34 + logger.info("all type: {}",strType);
  35 +
  36 + return strType;
  37 + }
  38 +
  39 +}