首页 > 分享 > Java项目:226基于SpringBoot+vue实现的宠物平台设计与实现(含数据库设计文档)

Java项目:226基于SpringBoot+vue实现的宠物平台设计与实现(含数据库设计文档)

作者主页:夜未央5788

 简介:Java领域优质创作者、Java项目、学习资料、技术互助

文末获取源码

项目介绍

基于Spring+Boot的宠物平台设计与实现

本系统分为前后台,包含管理员、用户两个角色。

管理员角色主要功能为:
登录、个人中心、用户管理、宠物分类管理、宠物科普管理、宠物信息管理、领养申请管理、爱心捐赠管理、捐赠信息管理、宠物救助管理、宠物论坛、社区留言板、系统管理等功能;

用户:登录、注册、个人中心管理、美食鉴赏管理、好友管理、收藏管理、个人信息管理、美食鉴赏发布与管理

使用人群:
正在做毕设的学生,或者需要项目实战练习的Java学习者

由于本程序规模不大,可供课程设计,毕业设计学习演示之用

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 
4.数据库:MySql 5.7/8.0版本均可;

5.是否Maven项目:是;

技术栈

后端:SpringBoot+Mybaits-Plus

前端:Vue + elementui

使用说明

项目运行:
1. 使用Navicat或者其它工具,在mysql中创建对应sql文件名称的数据库,并导入项目的sql文件;
2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令;
3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
4. 运行项目,在浏览器中输入地址:
前台地址:
http://localhost:8080/springboot3148x/front/dist/index.html
用户: 用户账号1  密码 123456

后台地址
http://localhost:8080/springboot3148x/admin/dist/index.html#/login
管理员:admin 密码:admin
用户: 用户账号1  密码:123456

注意项目文件路径中不能含有中文、空格、特殊字符等,否则图片会上传不成功。

运行截图

前台界面

后台界面

相关代码

ChongwufenleiController

package com.controller;

import java.math.BigDecimal;

import java.text.SimpleDateFormat;

import java.text.ParseException;

import java.util.ArrayList;

import java.util.Arrays;

import java.util.Calendar;

import java.util.Map;

import java.util.HashMap;

import java.util.Iterator;

import java.util.Date;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;

import org.apache.commons.lang3.StringUtils;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.transaction.annotation.Transactional;

import org.springframework.format.annotation.DateTimeFormat;

import org.springframework.web.bind.annotation.PathVariable;

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 com.baomidou.mybatisplus.mapper.EntityWrapper;

import com.baomidou.mybatisplus.mapper.Wrapper;

import com.annotation.IgnoreAuth;

import com.entity.ChongwufenleiEntity;

import com.entity.view.ChongwufenleiView;

import com.service.ChongwufenleiService;

import com.service.TokenService;

import com.utils.PageUtils;

import com.utils.R;

import com.utils.MD5Util;

import com.utils.MPUtil;

import com.utils.CommonUtil;

import java.io.IOException;

@RestController

@RequestMapping("/chongwufenlei")

public class ChongwufenleiController {

@Autowired

private ChongwufenleiService chongwufenleiService;

@RequestMapping("/page")

public R page(@RequestParam Map<String, Object> params,ChongwufenleiEntity chongwufenlei,

HttpServletRequest request){

EntityWrapper<ChongwufenleiEntity> ew = new EntityWrapper<ChongwufenleiEntity>();

PageUtils page = chongwufenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chongwufenlei), params), params));

return R.ok().put("data", page);

}

@IgnoreAuth

@RequestMapping("/list")

public R list(@RequestParam Map<String, Object> params,ChongwufenleiEntity chongwufenlei,

HttpServletRequest request){

EntityWrapper<ChongwufenleiEntity> ew = new EntityWrapper<ChongwufenleiEntity>();

PageUtils page = chongwufenleiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chongwufenlei), params), params));

return R.ok().put("data", page);

}

@RequestMapping("/lists")

public R list( ChongwufenleiEntity chongwufenlei){

EntityWrapper<ChongwufenleiEntity> ew = new EntityWrapper<ChongwufenleiEntity>();

ew.allEq(MPUtil.allEQMapPre( chongwufenlei, "chongwufenlei"));

return R.ok().put("data", chongwufenleiService.selectListView(ew));

}

@RequestMapping("/query")

public R query(ChongwufenleiEntity chongwufenlei){

EntityWrapper< ChongwufenleiEntity> ew = new EntityWrapper< ChongwufenleiEntity>();

ew.allEq(MPUtil.allEQMapPre( chongwufenlei, "chongwufenlei"));

ChongwufenleiView chongwufenleiView = chongwufenleiService.selectView(ew);

return R.ok("查询宠物分类成功").put("data", chongwufenleiView);

}

@RequestMapping("/info/{id}")

public R info(@PathVariable("id") Long id){

ChongwufenleiEntity chongwufenlei = chongwufenleiService.selectById(id);

return R.ok().put("data", chongwufenlei);

}

@IgnoreAuth

@RequestMapping("/detail/{id}")

public R detail(@PathVariable("id") Long id){

ChongwufenleiEntity chongwufenlei = chongwufenleiService.selectById(id);

return R.ok().put("data", chongwufenlei);

}

@RequestMapping("/save")

public R save(@RequestBody ChongwufenleiEntity chongwufenlei, HttpServletRequest request){

chongwufenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());

chongwufenleiService.insert(chongwufenlei);

return R.ok();

}

@RequestMapping("/add")

public R add(@RequestBody ChongwufenleiEntity chongwufenlei, HttpServletRequest request){

chongwufenlei.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());

chongwufenleiService.insert(chongwufenlei);

return R.ok();

}

@RequestMapping("/update")

@Transactional

public R update(@RequestBody ChongwufenleiEntity chongwufenlei, HttpServletRequest request){

chongwufenleiService.updateById(chongwufenlei);

return R.ok();

}

@RequestMapping("/delete")

public R delete(@RequestBody Long[] ids){

chongwufenleiService.deleteBatchIds(Arrays.asList(ids));

return R.ok();

}

@RequestMapping("/remind/{columnName}/{type}")

public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,

@PathVariable("type") String type,@RequestParam Map<String, Object> map) {

map.put("column", columnName);

map.put("type", type);

if(type.equals("2")) {

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

Calendar c = Calendar.getInstance();

Date remindStartDate = null;

Date remindEndDate = null;

if(map.get("remindstart")!=null) {

Integer remindStart = Integer.parseInt(map.get("remindstart").toString());

c.setTime(new Date());

c.add(Calendar.DAY_OF_MONTH,remindStart);

remindStartDate = c.getTime();

map.put("remindstart", sdf.format(remindStartDate));

}

if(map.get("remindend")!=null) {

Integer remindEnd = Integer.parseInt(map.get("remindend").toString());

c.setTime(new Date());

c.add(Calendar.DAY_OF_MONTH,remindEnd);

remindEndDate = c.getTime();

map.put("remindend", sdf.format(remindEndDate));

}

}

Wrapper<ChongwufenleiEntity> wrapper = new EntityWrapper<ChongwufenleiEntity>();

if(map.get("remindstart")!=null) {

wrapper.ge(columnName, map.get("remindstart"));

}

if(map.get("remindend")!=null) {

wrapper.le(columnName, map.get("remindend"));

}

int count = chongwufenleiService.selectCount(wrapper);

return R.ok().put("count", count);

}

}

ChongwuxinxiController

package com.controller;

import java.math.BigDecimal;

import java.text.SimpleDateFormat;

import java.text.ParseException;

import java.util.ArrayList;

import java.util.Arrays;

import java.util.Calendar;

import java.util.Map;

import java.util.HashMap;

import java.util.Iterator;

import java.util.Date;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.utils.ValidatorUtils;

import org.apache.commons.lang3.StringUtils;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.transaction.annotation.Transactional;

import org.springframework.format.annotation.DateTimeFormat;

import org.springframework.web.bind.annotation.PathVariable;

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 com.baomidou.mybatisplus.mapper.EntityWrapper;

import com.baomidou.mybatisplus.mapper.Wrapper;

import com.annotation.IgnoreAuth;

import com.entity.ChongwuxinxiEntity;

import com.entity.view.ChongwuxinxiView;

import com.service.ChongwuxinxiService;

import com.service.TokenService;

import com.utils.PageUtils;

import com.utils.R;

import com.utils.MD5Util;

import com.utils.MPUtil;

import com.utils.CommonUtil;

import java.io.IOException;

@RestController

@RequestMapping("/chongwuxinxi")

public class ChongwuxinxiController {

@Autowired

private ChongwuxinxiService chongwuxinxiService;

@RequestMapping("/page")

public R page(@RequestParam Map<String, Object> params,ChongwuxinxiEntity chongwuxinxi,

HttpServletRequest request){

EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();

PageUtils page = chongwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chongwuxinxi), params), params));

return R.ok().put("data", page);

}

@IgnoreAuth

@RequestMapping("/list")

public R list(@RequestParam Map<String, Object> params,ChongwuxinxiEntity chongwuxinxi,

HttpServletRequest request){

EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();

PageUtils page = chongwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chongwuxinxi), params), params));

return R.ok().put("data", page);

}

@RequestMapping("/lists")

public R list( ChongwuxinxiEntity chongwuxinxi){

EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();

ew.allEq(MPUtil.allEQMapPre( chongwuxinxi, "chongwuxinxi"));

return R.ok().put("data", chongwuxinxiService.selectListView(ew));

}

@RequestMapping("/query")

public R query(ChongwuxinxiEntity chongwuxinxi){

EntityWrapper< ChongwuxinxiEntity> ew = new EntityWrapper< ChongwuxinxiEntity>();

ew.allEq(MPUtil.allEQMapPre( chongwuxinxi, "chongwuxinxi"));

ChongwuxinxiView chongwuxinxiView = chongwuxinxiService.selectView(ew);

return R.ok("查询宠物信息成功").put("data", chongwuxinxiView);

}

@RequestMapping("/info/{id}")

public R info(@PathVariable("id") Long id){

ChongwuxinxiEntity chongwuxinxi = chongwuxinxiService.selectById(id);

return R.ok().put("data", chongwuxinxi);

}

@IgnoreAuth

@RequestMapping("/detail/{id}")

public R detail(@PathVariable("id") Long id){

ChongwuxinxiEntity chongwuxinxi = chongwuxinxiService.selectById(id);

return R.ok().put("data", chongwuxinxi);

}

@RequestMapping("/save")

public R save(@RequestBody ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){

chongwuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());

chongwuxinxiService.insert(chongwuxinxi);

return R.ok();

}

@RequestMapping("/add")

public R add(@RequestBody ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){

chongwuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());

chongwuxinxiService.insert(chongwuxinxi);

return R.ok();

}

@RequestMapping("/update")

@Transactional

public R update(@RequestBody ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){

chongwuxinxiService.updateById(chongwuxinxi);

return R.ok();

}

@RequestMapping("/delete")

public R delete(@RequestBody Long[] ids){

chongwuxinxiService.deleteBatchIds(Arrays.asList(ids));

return R.ok();

}

@RequestMapping("/remind/{columnName}/{type}")

public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,

@PathVariable("type") String type,@RequestParam Map<String, Object> map) {

map.put("column", columnName);

map.put("type", type);

if(type.equals("2")) {

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");

Calendar c = Calendar.getInstance();

Date remindStartDate = null;

Date remindEndDate = null;

if(map.get("remindstart")!=null) {

Integer remindStart = Integer.parseInt(map.get("remindstart").toString());

c.setTime(new Date());

c.add(Calendar.DAY_OF_MONTH,remindStart);

remindStartDate = c.getTime();

map.put("remindstart", sdf.format(remindStartDate));

}

if(map.get("remindend")!=null) {

Integer remindEnd = Integer.parseInt(map.get("remindend").toString());

c.setTime(new Date());

c.add(Calendar.DAY_OF_MONTH,remindEnd);

remindEndDate = c.getTime();

map.put("remindend", sdf.format(remindEndDate));

}

}

Wrapper<ChongwuxinxiEntity> wrapper = new EntityWrapper<ChongwuxinxiEntity>();

if(map.get("remindstart")!=null) {

wrapper.ge(columnName, map.get("remindstart"));

}

if(map.get("remindend")!=null) {

wrapper.le(columnName, map.get("remindend"));

}

int count = chongwuxinxiService.selectCount(wrapper);

return R.ok().put("count", count);

}

}

如果也想学习本系统,下面领取。关注并回复:226sb

相关知识

Java项目:226基于SpringBoot+vue实现的宠物平台设计与实现(含数据库设计文档)
【含开题报告+文档+PPT+源码】基于Java的宠物医院管理系统的设计与实现
基于SpringBoot+Vue的宠物社交平台设计和实现(源码+LW+部署讲解)
开题报告+文档+源码】基于Java的宠物医院管理系统的设计与实现
可可/基于SpringBoot+Vue的宠物领养系统设计与实现
基于Springboot+Vue框架的宠物领养管理系统设计与实现 毕业设计开题报告
毕设项目:宠物网站的设计与实现(JSP+java+springmvc+mysql+MyBatis)
基于JAVA的宠物网站的设计与实现
springboot+vue基于Vue的宠物饲养管理系统设计与实现【开题+程序+论文】
毕业设计:基于java的宠物管理系统设计与实现

网址: Java项目:226基于SpringBoot+vue实现的宠物平台设计与实现(含数据库设计文档) https://m.mcbbbk.com/newsview449911.html

所属分类:萌宠日常
上一篇: 数字赋能萌宠赛道竞争,天元宠物×
下一篇: 桌面宠物项目下载安装