Compare commits

..

No commits in common. "3bbeea672d10c4b4e42649bdb0205771def94e07" and "165b0e9ea86bb7104781f33218eb21bcbd564761" have entirely different histories.

81 changed files with 656 additions and 877 deletions

141
README.md
View File

@ -1,143 +1,8 @@
# ZooSystem
#### **登录接口**
登录接口
请求post请求
```
url: http://localhost:8080/zoo/login/login
```
输入参数 usernameadmin password123
返回类型为R
账户正确返回数据:
```
{"code": 1,"msg": null,"data": {"roleid": 1,"name": "管理员","permissions": 0 },"map": {} }
```
错误使返回数据:
```
{"code": 0,"msg": "账号密码错误","data": null,"map": {} }
```
输入参数 usernameadmin password123
返回类型为R
账户正确返回数据:
```
{"code": 1,"msg": null,"data": {"roleid": 1,"name": "管理员","permissions": 0 },"map": {} }
```
错误使返回数据:
```
{"code": 0,"msg": "账号密码错误","data": null,"map": {} }
```
#### **动物信息管理接口**
###### **查询接口**
```
GET http://localhost:8888/zoo/animal/info
```
当请求头带有查找的aid时就只查出对应id的动物信息
###### 返回如下:
```
{
"code": 1,
"msg": null,
"data": [
{
"aId": 1,
"name": "旺财",
"sex": "1",
"species": "中华田园犬",
"weight": 20,
"height": 90,
"state": 0,
"roleid": 1,
"color": "黄",
"features": "亲人,性格温和",
"phase": "成年期"
},
{
"aId": 2,
"name": "小黑",
"sex": "1",
"species": "蓝猫",
"weight": 10,
"height": 40,
"state": 0,
"roleid": 1,
"color": "蓝黑",
"features": "不爱动",
"phase": "幼年期"
}
],
"map": {}
}
```
#### 添加接口:
```
POST : http://localhost:8888/zoo/animal/add
```
在请求体中输入数据各个属性的值
返回如下:
```
{
"code": 1,
"msg": null,
"data": "添加成功",
"map": {}
}
```
#### 修改接口:
```
POST:http://localhost:8888/zoo/animal/update
```
在请求体中输入数据各个属性的值
返回如下:
```
{
"code": 1,
"msg": null,
"data": "修改成功",
"map": {}
}
```
#### 删除接口:
```
GET:http://localhost:8888/zoo/animal/delete?aid=3
```
返回数据
```
{
"code": 1,
"msg": null,
"data": "删除成功",
"map": {}
}
```
**其他各种接口信息都如以上接口一般实现了基本的增删改查接口当操作成功时返回码code为1失败时为0**
账户正确返回数据: {"code": 1,"msg": null,"data": {"roleid": 1,"name": "管理员","permissions": 0 },"map": {} }
错误使返回数据: {"code": 0,"msg": "账号密码错误","data": null,"map": {} }

View File

@ -13,7 +13,7 @@ public class CodeGenerator {
String username = "root";
String password = "83363083a";
String moduleName = "com/zoo";
String table = "account,admin,animal,keeper,veterinary,breedingplan,health,archive";
String table = "account,admin,animal,keeper,veterinary,breedingplan";
String mapperLocation = "C:\\Users\\16058\\IdeaProjects\\zooSystem\\src\\main\\resources\\mapper\\";
FastAutoGenerator.create(url, username, password)
.globalConfig(builder -> {

View File

@ -13,7 +13,7 @@ public class MyCorsConfig {
public CorsFilter corsFilter(){
CorsConfiguration corsConfiguration = new CorsConfiguration();
//允许跨域的地址
corsConfiguration.addAllowedOrigin("http://localhost:5000");
corsConfiguration.addAllowedOrigin("http://localhost:8888");
//http://localhost:8080
//是否发送cookie信息
corsConfiguration.setAllowCredentials(true);

View File

@ -1,11 +1,6 @@
package com.zoo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.common.R;
import com.zoo.entity.Account;
import com.zoo.service.IAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
/**
@ -16,53 +11,8 @@ import org.springframework.stereotype.Controller;
* @author DJ
* @since 2024-05-17
*/
@RestController
@Controller
@RequestMapping("/zoo/account")
public class AccountController {
@Autowired
IAccountService iAccountService;
@GetMapping("/info")
public R info(String username) {
if (username!=null){
QueryWrapper<Account> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("username",username);
return R.success(iAccountService.getOne(queryWrapper));
}
return R.success(iAccountService.list());
}
@PostMapping("/save")
public R save(@RequestBody Account account){
boolean save = iAccountService.save(account);
if (save){
return R.success("添加成功");
}
return R.error("添加失败");
}
@PostMapping("/update")
public R update(@RequestBody Account account){
QueryWrapper<Account> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",account.getId());
boolean b = iAccountService.update(account,queryWrapper);
if (b){
return R.success("修改成功");
}
return R.error("修改失败");
}
@GetMapping("/delete")
public R delete(Integer id){
QueryWrapper<Account> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",id);
boolean b = iAccountService.remove(queryWrapper);
if (b){
return R.success("删除成功");
}
return R.error("删除失败");
}
}

View File

@ -0,0 +1,64 @@
package com.zoo.controller;
import com.zoo.common.R;
import com.zoo.entity.Admin;
import com.zoo.entity.Keeper;
import com.zoo.entity.Veterinary;
import com.zoo.service.IAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author DJ
* @since 2024-05-17
*/
@RestController
@RequestMapping("/zoo/admin")
public class AdminController {
@Autowired
IAdminService iAdminService;
@GetMapping("/info")
public R info(Integer id){
if (id!=null){
Admin admin = iAdminService.selectById(id);
return R.success(admin);
}
List<Admin> list = iAdminService.list();
return R.success(list);
}
@PostMapping("/add")
public R add(Admin admin){
boolean save = iAdminService.save(admin);
if (save){
return R.success("添加成功");
}
return R.error("添加失败");
}
@PostMapping("/update")
public R update(Admin admin){
boolean b = iAdminService.updateById(admin);
if (b){
return R.success("修改成功");
}
return R.error("修改失败");
}
@GetMapping("/delete")
public R delete(Integer id){
boolean b = iAdminService.removeById(id);
if (b){
return R.success("删除成功");
}
return R.error("删除失败");
}
}

View File

@ -2,12 +2,15 @@ package com.zoo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.common.R;
import com.zoo.entity.Admin;
import com.zoo.entity.Animal;
import com.zoo.service.IAnimalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import java.util.List;
import java.util.Map;
/**
* <p>
@ -26,15 +29,15 @@ public class AnimalController {
public R info(Integer aid){
if (aid != null){
QueryWrapper<Animal> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("a_id",aid);
queryWrapper.eq("aid",aid);
Animal one = iAnimalService.getOne(queryWrapper);
return R.success(one);
R.success(one);
}
List<Animal> list = iAnimalService.list();
return R.success(list);
}
@PostMapping("/add")
public R add(@RequestBody Animal animal){
public R add(Animal animal){
boolean save = iAnimalService.save(animal);
if (save){
return R.success("添加成功");
@ -43,10 +46,8 @@ public class AnimalController {
}
@PostMapping("/update")
public R update(@RequestBody Animal animal){
QueryWrapper<Animal> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("a_id",animal.getaId());
boolean b = iAnimalService.update(animal,queryWrapper);
public R update(Animal animal){
boolean b = iAnimalService.updateById(animal);
if (b){
return R.success("修改成功");
}
@ -54,9 +55,7 @@ public class AnimalController {
}
@GetMapping("/delete")
public R delete(Integer aid){
QueryWrapper<Animal> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("a_id",aid);
boolean b = iAnimalService.remove(queryWrapper);
boolean b = iAnimalService.removeById(aid);
if (b){
return R.success("删除成功");
}

View File

@ -1,84 +0,0 @@
package com.zoo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.common.R;
import com.zoo.entity.Archive;
import com.zoo.entity.Breedingplan;
import com.zoo.service.IArchiveService;
import com.zoo.service.IBreedingplanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author DJ
* @since 2024-06-07
*/
@RestController
@RequestMapping("/zoo/archive")
public class ArchiveController {
@Autowired
IArchiveService iArchiveService;
@Autowired
IBreedingplanService iBreedingplanService;
@GetMapping("info")
public R info(Integer id,Integer animallId){
QueryWrapper<Archive> queryWrapper = new QueryWrapper<>();
if (id!=null){
queryWrapper.eq("id",id);
Archive one = iArchiveService.getOne(queryWrapper);
return R.success(one);
}
if (animallId!=null){
queryWrapper.eq("animall_id",animallId);
List<Archive> list = iArchiveService.list(queryWrapper);
return R.success(list);
}
return R.success(iArchiveService.list());
}
@PostMapping("/add")
public R add(@RequestBody Archive archive){
boolean save = iArchiveService.save(archive);
if (save){
return R.success("添加成功");
}
return R.error("添加失败");
}
@PostMapping("/update")
public R update(@RequestBody Archive archive){
QueryWrapper<Archive> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",archive.getId());
boolean update = iArchiveService.update(archive,queryWrapper);
if (update){
return R.success("修改成功");
}
return R.error("修改失败");
}
@GetMapping("/delete")
public R delete(Integer id){
QueryWrapper<Archive> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",id);
boolean remove = iArchiveService.remove(queryWrapper);
if (remove){
return R.success("删除成功");
}
return R.error("删除失败");
}
@GetMapping("/selectByBreedingId")
public R selectByBreedingId(Integer breedingId){
QueryWrapper<Archive> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("breeding_id",breedingId);
return R.success(iArchiveService.list(queryWrapper));
}
}

View File

@ -2,11 +2,17 @@ package com.zoo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.common.R;
import com.zoo.entity.Animal;
import com.zoo.entity.Breedingplan;
import com.zoo.service.IArchiveService;
import com.zoo.entity.Keeper;
import com.zoo.service.IAnimalService;
import com.zoo.service.IBreedingplanService;
import com.zoo.service.IKeeperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@ -15,21 +21,19 @@ import java.util.List;
public class BreedingplanController {
@Autowired
IBreedingplanService iBreedingplanService;
@GetMapping("/info")
public R info(Integer id){
if (id != null){
QueryWrapper<Breedingplan> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",id);
Breedingplan one = iBreedingplanService.getOne(queryWrapper);
return R.success(one);
R.success(one);
}
List<Breedingplan> list = iBreedingplanService.list();
return R.success(list);
}
@PostMapping("/add")
public R add(@RequestBody Breedingplan breedingplan){
public R add(Breedingplan breedingplan){
boolean save = iBreedingplanService.save(breedingplan);
if (save){
return R.success("添加成功");
@ -38,10 +42,8 @@ public class BreedingplanController {
}
@PostMapping("/update")
public R update(@RequestBody Breedingplan breedingplan){
QueryWrapper<Breedingplan> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",breedingplan.getId());
boolean b = iBreedingplanService.update(breedingplan,queryWrapper);
public R update(Breedingplan breedingplan){
boolean b = iBreedingplanService.updateById(breedingplan);
if (b){
return R.success("修改成功");
}
@ -49,14 +51,10 @@ public class BreedingplanController {
}
@GetMapping("/delete")
public R delete(Integer id){
QueryWrapper<Breedingplan> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",id);
boolean b = iBreedingplanService.remove(queryWrapper);
boolean b = iBreedingplanService.removeById(id);
if (b){
return R.success("删除成功");
}
return R.error("删除失败");
}
}

View File

@ -1,73 +0,0 @@
package com.zoo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.common.R;
import com.zoo.entity.Breedingplan;
import com.zoo.entity.Health;
import com.zoo.service.IHealthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.stereotype.Controller;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author DJ
* @since 2024-06-07
*/
@RestController
@RequestMapping("/zoo/health")
public class HealthController {
@Autowired
IHealthService iHealthService;
@GetMapping("info")
public R info(Integer id, Integer animalId){
QueryWrapper<Health> queryWrapper = new QueryWrapper<>();
if (id!=null){
queryWrapper.eq("id",id);
Health one = iHealthService.getOne(queryWrapper);
return R.success(one);
}
if (animalId!=null){
queryWrapper.eq("animal_id",animalId);
List<Health> list = iHealthService.list(queryWrapper);
return R.success(list);
}
return R.success(iHealthService.list());
}
@PostMapping("/add")
public R add(@RequestBody Health health){
boolean save = iHealthService.save(health);
if (save){
return R.success("添加成功");
}
return R.error("添加失败");
}
@PostMapping("/update")
public R update(@RequestBody Health health){
QueryWrapper<Health> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",health.getId());
boolean b = iHealthService.update(health,queryWrapper);
if (b){
return R.success("修改成功");
}
return R.error("修改失败");
}
@GetMapping("/delete")
public R delete(Integer id){
QueryWrapper<Health> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",id);
boolean remove = iHealthService.remove(queryWrapper);
if (remove){
return R.success("删除成功");
}
return R.error("删除失败");
}
}

View File

@ -0,0 +1,65 @@
package com.zoo.controller;
import com.zoo.common.R;
import com.zoo.entity.Animal;
import com.zoo.entity.Keeper;
import com.zoo.entity.Veterinary;
import com.zoo.service.IKeeperService;
import com.zoo.service.IVeterinaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author DJ
* @since 2024-05-17
*/
@RestController
@RequestMapping("/zoo/keeper")
public class KeeperController {
@Autowired
IKeeperService iKeeperService;
@GetMapping("info")
public R info(Integer roleid){
if (roleid!=null){
Keeper keeper = iKeeperService.selectById(roleid);
return R.success(keeper);
}
List<Keeper> list = iKeeperService.list();
return R.success(list);
}
@PostMapping("/add")
public R add(Keeper keeper){
boolean save = iKeeperService.save(keeper);
if (save){
return R.success("添加成功");
}
return R.error("添加失败");
}
@PostMapping("/update")
public R update(Keeper keeper){
boolean b = iKeeperService.updateById(keeper);
if (b){
return R.success("修改成功");
}
return R.error("修改失败");
}
@GetMapping("/delete")
public R delete(Integer roleid){
boolean b = iKeeperService.removeById(roleid);
if (b){
return R.success("删除成功");
}
return R.error("删除失败");
}
}

View File

@ -1,10 +1,19 @@
package com.zoo.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.common.R;
import com.zoo.dto.AdminDto;
import com.zoo.dto.KeeperDto;
import com.zoo.dto.VeterinaryDto;
import com.zoo.entity.Account;
import com.zoo.entity.Admin;
import com.zoo.entity.Keeper;
import com.zoo.entity.Veterinary;
import com.zoo.service.IAccountService;
import com.zoo.service.IAdminService;
import com.zoo.service.IKeeperService;
import com.zoo.service.IVeterinaryService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
@ -15,8 +24,15 @@ import org.springframework.web.bind.annotation.RestController;
public class LoginController {
@Autowired
IAccountService iAccountService;
@Autowired
IAdminService iAdminService;
@Autowired
IKeeperService iKeeperService;
@Autowired
IVeterinaryService iVeterinaryService;
@PostMapping("/login")
public R login(String username, String password) {
public R login(String username,String password){
QueryWrapper<Account> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("username",username);
queryWrapper.eq("password",password);
@ -24,35 +40,24 @@ public class LoginController {
if (one == null){
return R.error("账号密码错误");
}
return R.success(one);
if (one.getPermissions()==0){
Admin admin = iAdminService.selectById(one.getRoleid());
AdminDto adminDto = new AdminDto();
BeanUtils.copyProperties(admin,adminDto);
adminDto.setPermissions(0);
return R.success(adminDto);
}else if (one.getPermissions()==1){
Keeper keeper = iKeeperService.selectById(one.getRoleid());
KeeperDto keeperDto = new KeeperDto();
BeanUtils.copyProperties(keeper,keeperDto);
keeperDto.setPermissions(1);
return R.success(keeperDto);
}else {
Veterinary veterinary = iVeterinaryService.selectById(one.getRoleid());
VeterinaryDto veterinaryDto = new VeterinaryDto();
BeanUtils.copyProperties(veterinary,veterinaryDto);
veterinaryDto.setPermissions(2);
return R.success(veterinaryDto);
}
}
// @PostMapping("/login")
// public R login(String username,String password){
// QueryWrapper<Account> queryWrapper = new QueryWrapper<>();
// queryWrapper.eq("username",username);
// queryWrapper.eq("password",password);
// Account one = iAccountService.getOne(queryWrapper);
// if (one == null){
// return R.error("账号密码错误");
// }
// if (one.getPermissions()==0){
// Admin admin = iAdminService.selectById(one.getRoleid());
// AdminDto adminDto = new AdminDto();
// BeanUtils.copyProperties(admin,adminDto);
// adminDto.setPermissions(0);
// return R.success(adminDto);
// }else if (one.getPermissions()==1){
// Keeper keeper = iKeeperService.selectById(one.getRoleid());
// KeeperDto keeperDto = new KeeperDto();
// BeanUtils.copyProperties(keeper,keeperDto);
// keeperDto.setPermissions(1);
// return R.success(keeperDto);
// }else {
// Veterinary veterinary = iVeterinaryService.selectById(one.getRoleid());
// VeterinaryDto veterinaryDto = new VeterinaryDto();
// BeanUtils.copyProperties(veterinary,veterinaryDto);
// veterinaryDto.setPermissions(2);
// return R.success(veterinaryDto);
// }
// }
}

View File

@ -0,0 +1,63 @@
package com.zoo.controller;
import com.zoo.common.R;
import com.zoo.entity.Keeper;
import com.zoo.entity.Veterinary;
import com.zoo.service.IVeterinaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author DJ
* @since 2024-05-17
*/
@RestController
@RequestMapping("/zoo/veterinary")
public class VeterinaryController {
@Autowired
IVeterinaryService iVeterinaryService;
@GetMapping("info")
public R info(Integer roleid){
if (roleid!=null){
Veterinary veterinary = iVeterinaryService.selectById(roleid);
return R.success(veterinary);
}
List<Veterinary> list = iVeterinaryService.list();
return R.success(list);
}
@PostMapping("/add")
public R add(Veterinary veterinary){
boolean save = iVeterinaryService.save(veterinary);
if (save){
return R.success("添加成功");
}
return R.error("添加失败");
}
@PostMapping("/update")
public R update(Veterinary veterinary){
boolean b = iVeterinaryService.updateById(veterinary);
if (b){
return R.success("修改成功");
}
return R.error("修改失败");
}
@GetMapping("/delete")
public R delete(Integer roleid){
boolean b = iVeterinaryService.removeById(roleid);
if (b){
return R.success("删除成功");
}
return R.error("删除失败");
}
}

View File

@ -0,0 +1,16 @@
package com.zoo.dto;
import com.zoo.entity.Admin;
public class AdminDto extends Admin {
private Integer permissions;
public Integer getPermissions() {
return permissions;
}
public void setPermissions(Integer permissions) {
this.permissions = permissions;
}
}

View File

@ -0,0 +1,15 @@
package com.zoo.dto;
import com.zoo.entity.Keeper;
public class KeeperDto extends Keeper {
private Integer permissions;
public Integer getPermissions() {
return permissions;
}
public void setPermissions(Integer permissions) {
this.permissions = permissions;
}
}

View File

@ -0,0 +1,15 @@
package com.zoo.dto;
import com.zoo.entity.Veterinary;
public class VeterinaryDto extends Veterinary {
private Integer permissions;
public Integer getPermissions() {
return permissions;
}
public void setPermissions(Integer permissions) {
this.permissions = permissions;
}
}

View File

@ -1,8 +1,5 @@
package com.zoo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
/**
@ -20,9 +17,13 @@ public class Account implements Serializable {
/**
* 编号
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 角色id
*/
private Integer roleid;
/**
* 角色账号
*/
@ -34,7 +35,7 @@ public class Account implements Serializable {
private String password;
/**
* 权限 0管理员1饲养员2兽医
* 权限
*/
private Integer permissions;
@ -45,6 +46,13 @@ public class Account implements Serializable {
public void setId(Integer id) {
this.id = id;
}
public Integer getRoleid() {
return roleid;
}
public void setRoleid(Integer roleid) {
this.roleid = roleid;
}
public String getUsername() {
return username;
}
@ -70,10 +78,11 @@ public class Account implements Serializable {
@Override
public String toString() {
return "Account{" +
"id=" + id +
", username=" + username +
", password=" + password +
", permissions=" + permissions +
"}";
"id=" + id +
", roleid=" + roleid +
", username=" + username +
", password=" + password +
", permissions=" + permissions +
"}";
}
}

View File

@ -0,0 +1,49 @@
package com.zoo.entity;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author DJ
* @since 2024-05-17
*/
public class Admin implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 角色id
*/
private Integer roleid;
/**
* 管理员名称
*/
private String name;
public Integer getRoleid() {
return roleid;
}
public void setRoleid(Integer roleid) {
this.roleid = roleid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "Admin{" +
"roleid=" + roleid +
", name=" + name +
"}";
}
}

View File

@ -1,8 +1,5 @@
package com.zoo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
/**
@ -20,7 +17,6 @@ public class Animal implements Serializable {
/**
* 动物ID
*/
@TableId(type = IdType.AUTO)
private Integer aId;
/**

View File

@ -1,175 +0,0 @@
package com.zoo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author DJ
* @since 2024-06-07
*/
public class Archive implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 档案号
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 动物id
*/
private Integer animallId;
/**
* 动物名称
*/
private String animalName;
/**
* 生命阶段
*/
private String phase;
/**
* 状态 0 正常 1不正常
*/
private Integer state;
/**
* 档案类型
*/
private String type;
/**
* 记录日期
*/
private String date;
/**
* 记录时间
*/
private String time;
/**
* 录入人id
*/
private Integer roleId;
/**
* 描述
*/
private String description;
/**
* 关联的饲养计划id
* @return
*/
private Integer breedingId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getAnimallId() {
return animallId;
}
public Integer getBreedingId() {
return breedingId;
}
public void setBreedingId(Integer breedingId) {
this.breedingId = breedingId;
}
public void setAnimallId(Integer animallId) {
this.animallId = animallId;
}
public String getAnimalName() {
return animalName;
}
public void setAnimalName(String animalName) {
this.animalName = animalName;
}
public String getPhase() {
return phase;
}
public void setPhase(String phase) {
this.phase = phase;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public Integer getRoleId() {
return roleId;
}
public void setRoleId(Integer roleId) {
this.roleId = roleId;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
return "Archive{" +
"id=" + id +
", animallId=" + animallId +
", animalName=" + animalName +
", phase=" + phase +
", state=" + state +
", type=" + type +
", date=" + date +
", time=" + time +
", roleId=" + roleId +
", description=" + description +
",breedingId="+breedingId+
"}";
}
}

View File

@ -1,9 +1,6 @@
package com.zoo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
/**
@ -21,7 +18,6 @@ public class Breedingplan implements Serializable {
/**
* 饲养计划id
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
@ -57,7 +53,7 @@ public class Breedingplan implements Serializable {
/**
* 饲养员计划描述
*/
private String describe1;
private String describe;
public Integer getId() {
return id;
@ -108,12 +104,12 @@ public class Breedingplan implements Serializable {
public void setRoleid(Integer roleid) {
this.roleid = roleid;
}
public String getDescribe1() {
return describe1;
public String getDescribe() {
return describe;
}
public void setDescribe1(String describe) {
this.describe1 = describe;
public void setDescribe(String describe) {
this.describe = describe;
}
@Override
@ -126,7 +122,7 @@ public class Breedingplan implements Serializable {
", phase=" + phase +
", state=" + state +
", roleid=" + roleid +
", describe=" + describe1 +
", describe=" + describe +
"}";
}
}

View File

@ -1,171 +0,0 @@
package com.zoo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author DJ
* @since 2024-06-07
*/
public class Health implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 健康数据编号
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 动物id
*/
private Integer animalId;
/**
* 动物名称
*/
private String animalName;
/**
* 状态 0正常 1不正常
*/
private Integer state;
/**
* 体温
*/
private Double temperature;
/**
* 呼吸频率
*/
private Integer breathRete;
/**
* 心跳频率
*/
private Integer heartRete;
/**
* 血压
*/
private Integer bloodPressure;
/**
* 记录日期
*/
private String date;
/**
* 记录时间
*/
private String time;
/**
* 描述
*/
private String description;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getAnimalId() {
return animalId;
}
public void setAnimalId(Integer animalId) {
this.animalId = animalId;
}
public String getAnimalName() {
return animalName;
}
public void setAnimalName(String animalName) {
this.animalName = animalName;
}
public Integer getState() {
return state;
}
public void setState(Integer state) {
this.state = state;
}
public Double getTemperature() {
return temperature;
}
public void setTemperature(Double temperature) {
this.temperature = temperature;
}
public Integer getBreathRete() {
return breathRete;
}
public void setBreathRete(Integer breathRete) {
this.breathRete = breathRete;
}
public Integer getHeartRete() {
return heartRete;
}
public void setHeartRete(Integer heartRete) {
this.heartRete = heartRete;
}
public Integer getBloodPressure() {
return bloodPressure;
}
public void setBloodPressure(Integer bloodPressure) {
this.bloodPressure = bloodPressure;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
@Override
public String toString() {
return "Health{" +
"id=" + id +
", animalId=" + animalId +
", animalName=" + animalName +
", state=" + state +
", temperature=" + temperature +
", breathRete=" + breathRete +
", heartRete=" + heartRete +
", bloodPressure=" + bloodPressure +
", date=" + date +
", time=" + time +
", description=" + description +
"}";
}
}

View File

@ -0,0 +1,75 @@
package com.zoo.entity;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author DJ
* @since 2024-05-17
*/
public class Keeper implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 角色id
*/
private Integer roleid;
/**
* 性别
*/
private String sex;
/**
* 饲养员名称
*/
private String name;
/**
* 手机号码
*/
private String phone;
public Integer getRoleid() {
return roleid;
}
public void setRoleid(Integer roleid) {
this.roleid = roleid;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
@Override
public String toString() {
return "Keeper{" +
"roleid=" + roleid +
", sex=" + sex +
", name=" + name +
", phone=" + phone +
"}";
}
}

View File

@ -0,0 +1,62 @@
package com.zoo.entity;
import java.io.Serializable;
/**
* <p>
*
* </p>
*
* @author DJ
* @since 2024-05-17
*/
public class Veterinary implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 兽医角色id
*/
private Integer roleid;
/**
* 名称
*/
private String name;
/**
* 治疗记录
*/
private String record;
public Integer getRoleid() {
return roleid;
}
public void setRoleid(Integer roleid) {
this.roleid = roleid;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getRecord() {
return record;
}
public void setRecord(String record) {
this.record = record;
}
@Override
public String toString() {
return "Veterinary{" +
"roleid=" + roleid +
", name=" + name +
", record=" + record +
"}";
}
}

View File

@ -1,8 +1,7 @@
package com.zoo.mapper;
import com.zoo.entity.Admin;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zoo.entity.Health;
/**
* <p>
@ -10,8 +9,8 @@ import com.zoo.entity.Health;
* </p>
*
* @author DJ
* @since 2024-06-07
* @since 2024-05-17
*/
public interface HealthMapper extends BaseMapper<Health> {
public interface AdminMapper extends BaseMapper<Admin> {
}

View File

@ -1,8 +1,7 @@
package com.zoo.mapper;
import com.zoo.entity.Keeper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zoo.entity.Archive;
/**
* <p>
@ -10,8 +9,8 @@ import com.zoo.entity.Archive;
* </p>
*
* @author DJ
* @since 2024-06-07
* @since 2024-05-17
*/
public interface ArchiveMapper extends BaseMapper<Archive> {
public interface KeeperMapper extends BaseMapper<Keeper> {
}

View File

@ -0,0 +1,16 @@
package com.zoo.mapper;
import com.zoo.entity.Veterinary;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author DJ
* @since 2024-05-17
*/
public interface VeterinaryMapper extends BaseMapper<Veterinary> {
}

View File

@ -1,8 +1,7 @@
package com.zoo.service;
import com.zoo.entity.Admin;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zoo.entity.Archive;
/**
* <p>
@ -10,8 +9,8 @@ import com.zoo.entity.Archive;
* </p>
*
* @author DJ
* @since 2024-06-07
* @since 2024-05-17
*/
public interface IArchiveService extends IService<Archive> {
public interface IAdminService extends IService<Admin> {
Admin selectById(int roleId);
}

View File

@ -1,17 +0,0 @@
package com.zoo.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zoo.entity.Health;
/**
* <p>
* 服务类
* </p>
*
* @author DJ
* @since 2024-06-07
*/
public interface IHealthService extends IService<Health> {
}

View File

@ -0,0 +1,16 @@
package com.zoo.service;
import com.zoo.entity.Keeper;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author DJ
* @since 2024-05-17
*/
public interface IKeeperService extends IService<Keeper> {
Keeper selectById(int roleId);
}

View File

@ -0,0 +1,16 @@
package com.zoo.service;
import com.zoo.entity.Veterinary;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author DJ
* @since 2024-05-17
*/
public interface IVeterinaryService extends IService<Veterinary> {
Veterinary selectById(int roleId);
}

View File

@ -0,0 +1,27 @@
package com.zoo.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.entity.Admin;
import com.zoo.mapper.AdminMapper;
import com.zoo.service.IAdminService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author DJ
* @since 2024-05-17
*/
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements IAdminService {
@Override
public Admin selectById(int roleId) {
QueryWrapper<Admin> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("roleId",roleId);
return this.getOne(queryWrapper);
}
}

View File

@ -1,23 +0,0 @@
package com.zoo.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zoo.entity.Archive;
import com.zoo.mapper.ArchiveMapper;
import com.zoo.service.IArchiveService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author DJ
* @since 2024-06-07
*/
@Service
public class ArchiveServiceImpl extends ServiceImpl<ArchiveMapper, Archive> implements IArchiveService {
}

View File

@ -1,22 +0,0 @@
package com.zoo.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zoo.entity.Health;
import com.zoo.mapper.HealthMapper;
import com.zoo.service.IHealthService;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author DJ
* @since 2024-06-07
*/
@Service
public class HealthServiceImpl extends ServiceImpl<HealthMapper, Health> implements IHealthService {
}

View File

@ -0,0 +1,27 @@
package com.zoo.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.entity.Keeper;
import com.zoo.mapper.KeeperMapper;
import com.zoo.service.IKeeperService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author DJ
* @since 2024-05-17
*/
@Service
public class KeeperServiceImpl extends ServiceImpl<KeeperMapper, Keeper> implements IKeeperService {
@Override
public Keeper selectById(int roleId) {
QueryWrapper<Keeper> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("roleId",roleId);
return this.getOne(queryWrapper);
}
}

View File

@ -0,0 +1,27 @@
package com.zoo.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zoo.entity.Veterinary;
import com.zoo.mapper.VeterinaryMapper;
import com.zoo.service.IVeterinaryService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author DJ
* @since 2024-05-17
*/
@Service
public class VeterinaryServiceImpl extends ServiceImpl<VeterinaryMapper, Veterinary> implements IVeterinaryService {
@Override
public Veterinary selectById(int roleId) {
QueryWrapper<Veterinary> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("roleId",roleId);
return this.getOne(queryWrapper);
}
}

View File

@ -1,4 +1,3 @@
# 应用服务 WEB 访问端口
spring:
datasource:
@ -6,5 +5,4 @@ spring:
url: jdbc:mysql://localhost:3306/zoo
username: root
password: 83363083a
server:
port: 8888

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.com/zoo.mapper.ArchiveMapper">
</mapper>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.com/zoo.mapper.HealthMapper">
</mapper>

View File

@ -1,4 +1,3 @@
# 应用服务 WEB 访问端口
spring:
datasource:
@ -6,5 +5,4 @@ spring:
url: jdbc:mysql://localhost:3306/zoo
username: root
password: 83363083a
server:
port: 8888

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.com/zoo.mapper.ArchiveMapper">
</mapper>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.com/zoo.mapper.HealthMapper">
</mapper>