• 大小: 3.7MB
    文件类型: .gz
    金币: 1
    下载: 0 次
    发布日期: 2023-10-27
  • 语言: Java
  • 标签: javaweb  

资源简介

java + mysq + jspl 的自行车租赁管理系统 实现租赁管理的功能

资源截图

代码片段和文件信息

package com.bike.controller;

import com.bike.model.Bike;
import com.bike.model.Person;
import com.bike.service.BikeService;
import com.bike.service.PersonService;
import com.bike.util.BikeConstants;
import com.bike.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.portlet.ModelAndView;

import javax.servlet.http.HttpSession;

/**
 * 处理用户请求控制器
 * */
@Controller
@RequestMapping(“/bike“)
public class BikeController {
@Autowired
@Qualifier(“bikeService“)
private BikeService bikeService;

@RequestMapping(value = “/borrowBike“method = RequestMethod.GET)
public JsonResult borrowBike(int id){
Bike bike=bikeService.getBikeById(id);
bikeService.updateBikeStatus(id0);//0:状态为借
return JsonResult.ok();
}

@RequestMapping(value = “/returnBike“method = RequestMethod.GET)
public JsonResult returnBike(int id){
Bike bike=bikeService.getBikeById(id);
bikeService.updateBikeStatus(id1);////0:状态为还
return JsonResult.ok();
}

@RequestMapping(value = “/updateBike“method = RequestMethod.GET)
public JsonResult updateBike(int id){
Bike bike=bikeService.getBikeById(id);
bikeService.updateBike(bike);
return JsonResult.ok();
}

@RequestMapping(value = “/deleteBike“method = RequestMethod.GET)
public JsonResult deleteBike(int id){
bikeService.deleteBike(id);
return JsonResult.ok();
}
}

评论

共有 条评论