package com.bw.qanda.controller; import javax.annotation.Resource; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import com.bw.qanda.service.QandaService; /** * @author jian.mao * @date 2023年11月8日 * @description */ @Controller @RequestMapping("/qanda") @Slf4j public class QandaController { @Resource private QandaService qandaService; @PostMapping("/putQuestion") @ResponseBody public String putQuestion(@RequestBody String dataJson){ String response = qandaService.putQuestion(dataJson); return response; } /** * 本地模型调用 * @param dataJson * @return */ @PostMapping("/putLocalQuestion") @ResponseBody public String putLocalQuestion(@RequestBody String dataJson){ String response = qandaService.putLocalQuestion(dataJson); return response; } @RequestMapping(value = "/hello", method = RequestMethod.GET) @ResponseBody public String hello(String param, String token) { return "123"; } }