package com.qiwu.miao.chat.controller; import com.qiwu.miao.chat.bo.QiwuInterfaceBO; import com.qiwu.miao.chat.bo.RequestParams; import com.qiwu.miao.chat.bo.ServerResponse; import com.qiwu.miao.chat.service.ChatService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; /** * @author 苗权威 * @dateTime 19-6-22 上午10:40 */ @RestController public class ChatController { private static final Logger logger = LoggerFactory.getLogger(ChatController.class); @Autowired private ChatService chatService; @RequestMapping("/chat") public @ResponseBody ServerResponse chat(@RequestBody RequestParams requestParams) { logger.info("REQUEST INFO: "+ requestParams); return chatService.getResponse(requestParams); } @RequestMapping("/hello") public @ResponseBody String hello() { return "Hello MQW"; } }