| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- package com.launch.api.mysql.controller;
- import com.launch.api.elasticSearch.entity.Index1;
- import com.launch.api.elasticSearch.entity.Index2;
- import com.launch.api.elasticSearch.service.TweeTEsService;
- import com.launch.api.mysql.entity.test.Tweet;
- import com.launch.api.mysql.service.test.TweetService;
- import jakarta.annotation.Resource;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import reactor.core.publisher.Flux;
- import reactor.core.publisher.Mono;
- @RestController
- @RequestMapping("tweet")
- public class TweetController {
- @Resource
- private TweeTEsService repository;
- @Resource
- private TweetService tweetService;
- @GetMapping("getAll")
- public Flux<Tweet> getAll(){
- return tweetService.getAll();
- }
- @GetMapping("saveEs")
- public Mono<Index1> saveEs(){
- Index1 index1 = new Index1(1l,"xiao");
- return repository.mySave(index1);
- }
- @GetMapping("getEs")
- public Mono<Index2> getEs(){
- return repository.get();
- }
- }
|