基于javaweb的SpringBoot宠物领养寄养商城系统(java+springboot+html+thymeleaf+bootstrap+mysql+maven)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

520023152402

530023152402

540023152402

550023152402

570023152402

580023152402

032124103108

基于javaweb的SpringBoot宠物领养寄养商城系统(java+springboot+html+thymeleaf+bootstrap+mysql+maven)

项目介绍

管理员角色: 用户管理、角色管理、菜单管理、宠物信息、视频管理、在线留言、宠物用品管理、 常见问题管理、购物车、商城订单、领养订单、寄养订单

用户角色: 领养宠物、寄养宠物、视频秀、买家秀、在线留言、加入购物车、 购买、商城订单、领养订单、寄养订单

环境需要

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

技术栈

  1. 后端:SpringBoot+Mybatis

  2. 前端:HTML+CSS+Bootstrap+jQuery

使用说明
运行项目,登录地址:http://localhost:8089/login
管理员: admin/admin123
普通账户: liming/123456

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 * 新增保存用户
*/
@RequiresPermissions("system:user:add")
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@Validated User user)
{
if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName())))
{
return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");
}
else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
{
return error("新增用户'" + user.getLoginName() + "'失败,手机号码已存在");
}
else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
{
return error("新增用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
}
return toAjax(userService.insertUser(user));
}

/**
* 修改用户
*/
@GetMapping("/edit/{userId}")
public String edit(@PathVariable("userId") Long userId, ModelMap mmap)
{
mmap.put("user", userService.selectUserById(userId));
mmap.put("roles", roleService.selectRolesByUserId(userId));
mmap.put("posts", postService.selectPostsByUserId(userId));
return prefix + "/edit";
}

/**
* 修改保存用户
*/
@RequiresPermissions("system:user:edit")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@Validated User user)
{
userService.checkUserAllowed(user);
if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
{
return error("修改用户'" + user.getLoginName() + "'失败,手机号码已存在");
}
else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
{
return error("修改用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

/**
* 保存角色分配数据权限
*/
@RequiresPermissions("system:role:edit")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PostMapping("/authDataScope")
@ResponseBody
public AjaxResult authDataScopeSave(Role role)
{
roleService.checkRoleAllowed(role);
if (roleService.authDataScope(role) > 0)
{
setSysUser(userService.selectUserById(getSysUser().getUserId()));
return success();
}
return error();
}

@RequiresPermissions("system:role:remove")
@Log(title = "角色管理", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
try
{
return toAjax(roleService.deleteRoleByIds(ids));
}
catch (Exception e)
{
return error(e.getMessage());
}
}

/**
* 校验角色名称
*/
@PostMapping("/checkRoleNameUnique")
@ResponseBody
public String checkRoleNameUnique(Role role)
{
return roleService.checkRoleNameUnique(role);
}

/**
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
    }
catch (Exception e)
{
return error(e.getMessage());
}
}

/**
* 校验角色名称
*/
@PostMapping("/checkRoleNameUnique")
@ResponseBody
public String checkRoleNameUnique(Role role)
{
return roleService.checkRoleNameUnique(role);
}

/**
* 校验角色权限
*/
@PostMapping("/checkRoleKeyUnique")
@ResponseBody
public String checkRoleKeyUnique(Role role)
{
return roleService.checkRoleKeyUnique(role);
}

/**
* 选择菜单树
*/
@GetMapping("/selectMenuTree")
public String selectMenuTree()
{
return prefix + "/tree";
}

/**
* 角色状态修改
*/
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@RequiresPermissions("system:role:edit")
@PostMapping("/changeStatus")
@ResponseBody
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
long l;
int i;
switch (elements.length)
{
case 1:
l = Long.parseLong(elements[0]);
if ((l < 0L) || (l > 4294967295L))
return null;
bytes[0] = (byte) (int) (l >> 24 & 0xFF);
bytes[1] = (byte) (int) ((l & 0xFFFFFF) >> 16 & 0xFF);
bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
break;
case 2:
l = Integer.parseInt(elements[0]);
if ((l < 0L) || (l > 255L))
return null;
bytes[0] = (byte) (int) (l & 0xFF);
l = Integer.parseInt(elements[1]);
if ((l < 0L) || (l > 16777215L))
return null;
bytes[1] = (byte) (int) (l >> 16 & 0xFF);
bytes[2] = (byte) (int) ((l & 0xFFFF) >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
break;
case 3:
for (i = 0; i < 2; ++i)
{
l = Integer.parseInt(elements[i]);
if ((l < 0L) || (l > 255L))
return null;
bytes[i] = (byte) (int) (l & 0xFF);
}
l = Integer.parseInt(elements[2]);
if ((l < 0L) || (l > 65535L))
return null;
bytes[2] = (byte) (int) (l >> 8 & 0xFF);
bytes[3] = (byte) (int) (l & 0xFF);
break;
case 4:
for (i = 0; i < 4; ++i)
{
l = Integer.parseInt(elements[i]);
if ((l < 0L) || (l > 255L))
return null;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
{
return error("新增角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
{
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
return toAjax(roleService.insertRole(role));

}

/**
* 修改角色
*/
@GetMapping("/edit/{roleId}")
public String edit(@PathVariable("roleId") Long roleId, ModelMap mmap)
{
mmap.put("role", roleService.selectRoleById(roleId));
return prefix + "/edit";
}

/**
* 修改保存角色
*/
@RequiresPermissions("system:role:edit")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@Validated Role role)
{
roleService.checkRoleAllowed(role);
if (UserConstants.ROLE_NAME_NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role)))
{
return error("修改角色'" + role.getRoleName() + "'失败,角色名称已存在");
}
else if (UserConstants.ROLE_KEY_NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role)))
{
return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
}
return toAjax(roleService.updateRole(role));
}

/**
* 角色分配数据权限
*/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
            return error("修改岗位'" + post.getPostName() + "'失败,岗位编码已存在");
}
return toAjax(postService.updatePost(post));
}

/**
* 校验岗位名称
*/
@PostMapping("/checkPostNameUnique")
@ResponseBody
public String checkPostNameUnique(Post post)
{
return postService.checkPostNameUnique(post);
}

/**
* 校验岗位编码
*/
@PostMapping("/checkPostCodeUnique")
@ResponseBody
public String checkPostCodeUnique(Post post)
{
return postService.checkPostCodeUnique(post);
}
}
package com.ruoyi.project.system.message.controller;




项目链接:
https://javayms.github.io?id=332322092805200mk
https://javayms.pages.dev?id=332322092805200mk