BochaController.java 845 B

12345678910111213141516171819202122
  1. package com.backendsys.modules.sdk.bocha.controller;
  2. import com.backendsys.modules.common.utils.Result;
  3. import com.backendsys.modules.sdk.bocha.entity.BochaParam;
  4. import com.backendsys.modules.sdk.bocha.service.BochaService;
  5. import org.springframework.beans.factory.annotation.Autowired;
  6. import org.springframework.validation.annotation.Validated;
  7. import org.springframework.web.bind.annotation.PostMapping;
  8. import org.springframework.web.bind.annotation.RequestBody;
  9. import org.springframework.web.bind.annotation.RestController;
  10. @RestController
  11. public class BochaController {
  12. @Autowired
  13. private BochaService bochaService;
  14. @PostMapping("/api/bochat/web-search")
  15. public Result webSearch(@Validated @RequestBody BochaParam bochaParam) {
  16. return Result.success().put("data", bochaService.WebSearch(bochaParam));
  17. }
  18. }