首页 > 其他 > 详细

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

时间:2020-11-14 22:40:38      阅读:37      评论:0      收藏:0      [点我收藏+]

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界面

原文:https://www.cnblogs.com/daizuo/p/13974314.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!