微服务调用demo,两个服务,echarts界面

package cn.kgc.flight.service;

import cn.kgc.flight.dao.FlightDao;
import cn.kgc.flight.pojo.City;
import cn.kgc.flight.pojo.Flight;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@Transactional(readOnly = true)
public class FlightService {

@Resource
private FlightDao flightDao;

@RequestMapping("/showCity")
public List<City> showAllCity() {
    return flightDao.queryAllCity();
}

@RequestMapping("/showFlight")
public List<Flight> showFlight(@RequestParam(value = "departureCity") Integer departureCity, @RequestParam(value = "arrivalCity") Integer arrivalCity) {
    return flightDao.queryFlight(departureCity, arrivalCity);
}

@RequestMapping("/count")
public Boolean queryCountByFlightNo(@RequestParam(value = "flightNo") String flightNo) {
    return flightDao.queryCountByFlightNo(flightNo) == 1;
}

@RequestMapping("/add")
@Transactional
public Boolean addFlight(@RequestBody Flight flight) {
    return flightDao.insertFlight(flight) == 1;
}

}

微服务调用demo,两个服务,echarts界面

上一篇:监听值变化并及时更新


下一篇:爬取携程7天内的全国所有城市航班