作者主页:源码空间codegym
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文中获取源码
项目介绍
本线上旅行信息管理系统,主要实现了用户功能模块和管理员功能模块两大部分
用户可查看旅行相关信息,注册登录后还可实现酒店客房预订和景点购票等
同时管理员可进入系统后台对系统进行全面管理操作。
环境要求
1.运行环境:最好是java jdk1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.tomcat环境:Tomcat7.x,8.X,9.x版本均可
4.硬件环境:windows7/8/10 4G内存以上;或者Mac OS;
5.是否Maven项目:是;查看源码目录中是否包含pom.xml;若包含,则为maven项目,否则为非maven.项目
6.数据库:MySql5.7/8.0等版本均可;
技术栈
运行环境:jdk8 + tomcat9 + mysql5.7 + windows10
服务端技术:Java、Spring、SpringMVC、Mybatis,SSM
使用说明
1.使用Navicati或者其它工具,在mysql中创建对应sq文件名称的数据库,并导入项目的sql文件;
2.使用IDEA/Eclipse/MyEclipse导入项目,修改配置,运行项目;
3.将项目中config-propertiesi配置文件中的数据库配置改为自己的配置,然后运行;
运行指导
idea导入源码空间站顶目教程说明(Vindows版)-ssm篇:
http://mtw.so/5MHvZq
源码地址:http://codegym.top
运行截图
文档截图
项目截图
代码
package com.yx.controller;import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.pagehelper.PageInfo;
import com.yx.model.Parking;
import com.yx.service.IParkingService;
import com.yx.util.JsonObject;
import com.yx.util.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;/*** <p>* 前端控制器* </p>** @author kappy* @since 2020-10-28*/
@Api(tags = {""})
@RestController
@RequestMapping("/parking")
public class ParkingController {private Logger log = LoggerFactory.getLogger(getClass());@Resourceprivate IParkingService parkingService;@RequestMapping("/queryParkAll")public JsonObject queryParkAll(@RequestParam(defaultValue = "1") Integer page,@RequestParam(defaultValue = "15") Integer limit,String numbers){PageInfo<Parking> pageInfo= parkingService.findParkAll(page,limit,numbers);return new JsonObject(0,"ok",pageInfo.getTotal(),pageInfo.getList());}@ApiOperation(value = "新增")@RequestMapping("/add")public R add(@RequestBody Parking parking){if(parking.getOwnerId()!=null){//关联到了户主parking.setStatus(1);}else{parking.setStatus(0);}int num= parkingService.add(parking);if(num>0){return R.ok();}else{return R.fail("添加失败");}}@ApiOperation(value = "删除")@RequestMapping("/deleteByIds")public R delete(String ids){List<String> list= Arrays.asList(ids.split(","));//遍历遍历进行删除for(String id:list){parkingService.delete(Long.parseLong(id));}return R.ok();}@ApiOperation(value = "更新")@RequestMapping("/update")public R update(@RequestBody Parking parking){Parking park=new Parking();if(parking.getOwnerId()!=null){//关联到了户主park.setStatus(1);}else{park.setStatus(0);}park.setId(parking.getId());park.setNumbers(parking.getNumbers());park.setRemarks(parking.getRemarks());park.setOwnerId(parking.getOwnerId());int num= parkingService.updateData(park);if(num>0){return R.ok();}else{return R.fail("修改失败");}}@ApiOperation(value = "查询分页数据")@ApiImplicitParams({@ApiImplicitParam(name = "page", value = "页码"),@ApiImplicitParam(name = "pageCount", value = "每页条数")})@GetMapping()public IPage<Parking> findListByPage(@RequestParam Integer page,@RequestParam Integer pageCount){return parkingService.findListByPage(page, pageCount);}@ApiOperation(value = "id查询")@GetMapping("{id}")public Parking findById(@PathVariable Long id){return parkingService.findById(id);}}