Compare commits
10 Commits
165b0e9ea8
...
3bbeea672d
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3bbeea672d | ||
![]() |
8d3c862719 | ||
![]() |
86a287cf8b | ||
![]() |
5399d16135 | ||
![]() |
c1a879f9d4 | ||
![]() |
4a6ea0fd86 | ||
![]() |
4809c57412 | ||
![]() |
4e93cfb624 | ||
![]() |
6af74df222 | ||
![]() |
99b24e35ec |
141
README.md
141
README.md
@ -1,8 +1,143 @@
|
||||
# ZooSystem
|
||||
登录接口
|
||||
#### **登录接口**
|
||||
|
||||
请求:post请求
|
||||
|
||||
```
|
||||
url: http://localhost:8080/zoo/login/login
|
||||
```
|
||||
|
||||
输入参数 username:admin password:123
|
||||
返回类型为:R
|
||||
账户正确返回数据: {"code": 1,"msg": null,"data": {"roleid": 1,"name": "管理员","permissions": 0 },"map": {} }
|
||||
错误使返回数据: {"code": 0,"msg": "账号密码错误","data": null,"map": {} }
|
||||
账户正确返回数据:
|
||||
|
||||
```
|
||||
{"code": 1,"msg": null,"data": {"roleid": 1,"name": "管理员","permissions": 0 },"map": {} }
|
||||
```
|
||||
|
||||
错误使返回数据:
|
||||
|
||||
```
|
||||
{"code": 0,"msg": "账号密码错误","data": null,"map": {} }
|
||||
```
|
||||
|
||||
输入参数 username:admin password:123
|
||||
返回类型为: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**
|
@ -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";
|
||||
String table = "account,admin,animal,keeper,veterinary,breedingplan,health,archive";
|
||||
String mapperLocation = "C:\\Users\\16058\\IdeaProjects\\zooSystem\\src\\main\\resources\\mapper\\";
|
||||
FastAutoGenerator.create(url, username, password)
|
||||
.globalConfig(builder -> {
|
||||
|
@ -13,7 +13,7 @@ public class MyCorsConfig {
|
||||
public CorsFilter corsFilter(){
|
||||
CorsConfiguration corsConfiguration = new CorsConfiguration();
|
||||
//允许跨域的地址
|
||||
corsConfiguration.addAllowedOrigin("http://localhost:8888");
|
||||
corsConfiguration.addAllowedOrigin("http://localhost:5000");
|
||||
//http://localhost:8080
|
||||
//是否发送cookie信息
|
||||
corsConfiguration.setAllowCredentials(true);
|
||||
|
@ -1,6 +1,11 @@
|
||||
package com.zoo.controller;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
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.stereotype.Controller;
|
||||
|
||||
/**
|
||||
@ -11,8 +16,53 @@ import org.springframework.stereotype.Controller;
|
||||
* @author DJ
|
||||
* @since 2024-05-17
|
||||
*/
|
||||
@Controller
|
||||
@RestController
|
||||
@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("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,64 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
}
|
@ -2,15 +2,12 @@ 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>
|
||||
@ -29,15 +26,15 @@ public class AnimalController {
|
||||
public R info(Integer aid){
|
||||
if (aid != null){
|
||||
QueryWrapper<Animal> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("aid",aid);
|
||||
queryWrapper.eq("a_id",aid);
|
||||
Animal one = iAnimalService.getOne(queryWrapper);
|
||||
R.success(one);
|
||||
return R.success(one);
|
||||
}
|
||||
List<Animal> list = iAnimalService.list();
|
||||
return R.success(list);
|
||||
}
|
||||
@PostMapping("/add")
|
||||
public R add(Animal animal){
|
||||
public R add(@RequestBody Animal animal){
|
||||
boolean save = iAnimalService.save(animal);
|
||||
if (save){
|
||||
return R.success("添加成功");
|
||||
@ -46,8 +43,10 @@ public class AnimalController {
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public R update(Animal animal){
|
||||
boolean b = iAnimalService.updateById(animal);
|
||||
public R update(@RequestBody Animal animal){
|
||||
QueryWrapper<Animal> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("a_id",animal.getaId());
|
||||
boolean b = iAnimalService.update(animal,queryWrapper);
|
||||
if (b){
|
||||
return R.success("修改成功");
|
||||
}
|
||||
@ -55,7 +54,9 @@ public class AnimalController {
|
||||
}
|
||||
@GetMapping("/delete")
|
||||
public R delete(Integer aid){
|
||||
boolean b = iAnimalService.removeById(aid);
|
||||
QueryWrapper<Animal> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("a_id",aid);
|
||||
boolean b = iAnimalService.remove(queryWrapper);
|
||||
if (b){
|
||||
return R.success("删除成功");
|
||||
}
|
||||
|
84
src/main/java/com/zoo/controller/ArchiveController.java
Normal file
84
src/main/java/com/zoo/controller/ArchiveController.java
Normal file
@ -0,0 +1,84 @@
|
||||
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));
|
||||
}
|
||||
}
|
@ -2,17 +2,11 @@ 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.entity.Keeper;
|
||||
import com.zoo.service.IAnimalService;
|
||||
import com.zoo.service.IArchiveService;
|
||||
import com.zoo.service.IBreedingplanService;
|
||||
import com.zoo.service.IKeeperService;
|
||||
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.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -21,19 +15,21 @@ 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);
|
||||
R.success(one);
|
||||
return R.success(one);
|
||||
}
|
||||
List<Breedingplan> list = iBreedingplanService.list();
|
||||
return R.success(list);
|
||||
}
|
||||
@PostMapping("/add")
|
||||
public R add(Breedingplan breedingplan){
|
||||
public R add(@RequestBody Breedingplan breedingplan){
|
||||
boolean save = iBreedingplanService.save(breedingplan);
|
||||
if (save){
|
||||
return R.success("添加成功");
|
||||
@ -42,8 +38,10 @@ public class BreedingplanController {
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public R update(Breedingplan breedingplan){
|
||||
boolean b = iBreedingplanService.updateById(breedingplan);
|
||||
public R update(@RequestBody Breedingplan breedingplan){
|
||||
QueryWrapper<Breedingplan> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id",breedingplan.getId());
|
||||
boolean b = iBreedingplanService.update(breedingplan,queryWrapper);
|
||||
if (b){
|
||||
return R.success("修改成功");
|
||||
}
|
||||
@ -51,10 +49,14 @@ public class BreedingplanController {
|
||||
}
|
||||
@GetMapping("/delete")
|
||||
public R delete(Integer id){
|
||||
boolean b = iBreedingplanService.removeById(id);
|
||||
QueryWrapper<Breedingplan> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id",id);
|
||||
boolean b = iBreedingplanService.remove(queryWrapper);
|
||||
if (b){
|
||||
return R.success("删除成功");
|
||||
}
|
||||
return R.error("删除失败");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
73
src/main/java/com/zoo/controller/HealthController.java
Normal file
73
src/main/java/com/zoo/controller/HealthController.java
Normal file
@ -0,0 +1,73 @@
|
||||
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("删除失败");
|
||||
}
|
||||
}
|
@ -1,65 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
}
|
@ -1,19 +1,10 @@
|
||||
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;
|
||||
@ -24,15 +15,8 @@ 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);
|
||||
@ -40,24 +24,35 @@ public class LoginController {
|
||||
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);
|
||||
}
|
||||
return R.success(one);
|
||||
}
|
||||
// @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);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
@ -1,63 +0,0 @@
|
||||
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("删除失败");
|
||||
}
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
package com.zoo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@ -17,13 +20,9 @@ public class Account implements Serializable {
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 角色id
|
||||
*/
|
||||
private Integer roleid;
|
||||
|
||||
/**
|
||||
* 角色账号
|
||||
*/
|
||||
@ -35,7 +34,7 @@ public class Account implements Serializable {
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 权限
|
||||
* 权限 0管理员1饲养员2兽医
|
||||
*/
|
||||
private Integer permissions;
|
||||
|
||||
@ -46,13 +45,6 @@ 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;
|
||||
}
|
||||
@ -79,7 +71,6 @@ public class Account implements Serializable {
|
||||
public String toString() {
|
||||
return "Account{" +
|
||||
"id=" + id +
|
||||
", roleid=" + roleid +
|
||||
", username=" + username +
|
||||
", password=" + password +
|
||||
", permissions=" + permissions +
|
||||
|
@ -1,49 +0,0 @@
|
||||
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 +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -1,5 +1,8 @@
|
||||
package com.zoo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@ -17,6 +20,7 @@ public class Animal implements Serializable {
|
||||
/**
|
||||
* 动物ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer aId;
|
||||
|
||||
/**
|
||||
|
175
src/main/java/com/zoo/entity/Archive.java
Normal file
175
src/main/java/com/zoo/entity/Archive.java
Normal file
@ -0,0 +1,175 @@
|
||||
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+
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
package com.zoo.entity;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@ -18,6 +21,7 @@ public class Breedingplan implements Serializable {
|
||||
/**
|
||||
* 饲养计划id
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
@ -53,7 +57,7 @@ public class Breedingplan implements Serializable {
|
||||
/**
|
||||
* 饲养员计划描述
|
||||
*/
|
||||
private String describe;
|
||||
private String describe1;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
@ -104,12 +108,12 @@ public class Breedingplan implements Serializable {
|
||||
public void setRoleid(Integer roleid) {
|
||||
this.roleid = roleid;
|
||||
}
|
||||
public String getDescribe() {
|
||||
return describe;
|
||||
public String getDescribe1() {
|
||||
return describe1;
|
||||
}
|
||||
|
||||
public void setDescribe(String describe) {
|
||||
this.describe = describe;
|
||||
public void setDescribe1(String describe) {
|
||||
this.describe1 = describe;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -122,7 +126,7 @@ public class Breedingplan implements Serializable {
|
||||
", phase=" + phase +
|
||||
", state=" + state +
|
||||
", roleid=" + roleid +
|
||||
", describe=" + describe +
|
||||
", describe=" + describe1 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
171
src/main/java/com/zoo/entity/Health.java
Normal file
171
src/main/java/com/zoo/entity/Health.java
Normal file
@ -0,0 +1,171 @@
|
||||
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 +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
|
@ -1,75 +0,0 @@
|
||||
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 +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
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 +
|
||||
"}";
|
||||
}
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
package com.zoo.mapper;
|
||||
|
||||
import com.zoo.entity.Admin;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zoo.entity.Archive;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -9,8 +10,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* </p>
|
||||
*
|
||||
* @author DJ
|
||||
* @since 2024-05-17
|
||||
* @since 2024-06-07
|
||||
*/
|
||||
public interface AdminMapper extends BaseMapper<Admin> {
|
||||
public interface ArchiveMapper extends BaseMapper<Archive> {
|
||||
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
package com.zoo.mapper;
|
||||
|
||||
import com.zoo.entity.Keeper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.zoo.entity.Health;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -9,8 +10,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* </p>
|
||||
*
|
||||
* @author DJ
|
||||
* @since 2024-05-17
|
||||
* @since 2024-06-07
|
||||
*/
|
||||
public interface KeeperMapper extends BaseMapper<Keeper> {
|
||||
public interface HealthMapper extends BaseMapper<Health> {
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
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> {
|
||||
|
||||
}
|
@ -1,7 +1,8 @@
|
||||
package com.zoo.service;
|
||||
|
||||
import com.zoo.entity.Admin;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zoo.entity.Archive;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -9,8 +10,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
* </p>
|
||||
*
|
||||
* @author DJ
|
||||
* @since 2024-05-17
|
||||
* @since 2024-06-07
|
||||
*/
|
||||
public interface IAdminService extends IService<Admin> {
|
||||
Admin selectById(int roleId);
|
||||
public interface IArchiveService extends IService<Archive> {
|
||||
|
||||
}
|
17
src/main/java/com/zoo/service/IHealthService.java
Normal file
17
src/main/java/com/zoo/service/IHealthService.java
Normal file
@ -0,0 +1,17 @@
|
||||
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> {
|
||||
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
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);
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
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);
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
23
src/main/java/com/zoo/service/impl/ArchiveServiceImpl.java
Normal file
23
src/main/java/com/zoo/service/impl/ArchiveServiceImpl.java
Normal file
@ -0,0 +1,23 @@
|
||||
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 {
|
||||
|
||||
}
|
22
src/main/java/com/zoo/service/impl/HealthServiceImpl.java
Normal file
22
src/main/java/com/zoo/service/impl/HealthServiceImpl.java
Normal file
@ -0,0 +1,22 @@
|
||||
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 {
|
||||
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
@ -1,3 +1,4 @@
|
||||
|
||||
# 应用服务 WEB 访问端口
|
||||
spring:
|
||||
datasource:
|
||||
@ -5,4 +6,5 @@ spring:
|
||||
url: jdbc:mysql://localhost:3306/zoo
|
||||
username: root
|
||||
password: 83363083a
|
||||
|
||||
server:
|
||||
port: 8888
|
||||
|
5
src/main/resources/mapper/ArchiveMapper.xml
Normal file
5
src/main/resources/mapper/ArchiveMapper.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?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>
|
5
src/main/resources/mapper/HealthMapper.xml
Normal file
5
src/main/resources/mapper/HealthMapper.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?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>
|
@ -1,3 +1,4 @@
|
||||
|
||||
# 应用服务 WEB 访问端口
|
||||
spring:
|
||||
datasource:
|
||||
@ -5,4 +6,5 @@ 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.
BIN
target/classes/com/zoo/controller/ArchiveController.class
Normal file
BIN
target/classes/com/zoo/controller/ArchiveController.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/zoo/controller/HealthController.class
Normal file
BIN
target/classes/com/zoo/controller/HealthController.class
Normal file
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.
BIN
target/classes/com/zoo/entity/Archive.class
Normal file
BIN
target/classes/com/zoo/entity/Archive.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/zoo/entity/Health.class
Normal file
BIN
target/classes/com/zoo/entity/Health.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/zoo/mapper/ArchiveMapper.class
Normal file
BIN
target/classes/com/zoo/mapper/ArchiveMapper.class
Normal file
Binary file not shown.
BIN
target/classes/com/zoo/mapper/BreedingplanMapper.class
Normal file
BIN
target/classes/com/zoo/mapper/BreedingplanMapper.class
Normal file
Binary file not shown.
BIN
target/classes/com/zoo/mapper/HealthMapper.class
Normal file
BIN
target/classes/com/zoo/mapper/HealthMapper.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/zoo/service/IArchiveService.class
Normal file
BIN
target/classes/com/zoo/service/IArchiveService.class
Normal file
Binary file not shown.
BIN
target/classes/com/zoo/service/IBreedingplanService.class
Normal file
BIN
target/classes/com/zoo/service/IBreedingplanService.class
Normal file
Binary file not shown.
BIN
target/classes/com/zoo/service/IHealthService.class
Normal file
BIN
target/classes/com/zoo/service/IHealthService.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/zoo/service/impl/ArchiveServiceImpl.class
Normal file
BIN
target/classes/com/zoo/service/impl/ArchiveServiceImpl.class
Normal file
Binary file not shown.
Binary file not shown.
BIN
target/classes/com/zoo/service/impl/HealthServiceImpl.class
Normal file
BIN
target/classes/com/zoo/service/impl/HealthServiceImpl.class
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
5
target/classes/mapper/ArchiveMapper.xml
Normal file
5
target/classes/mapper/ArchiveMapper.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?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>
|
5
target/classes/mapper/HealthMapper.xml
Normal file
5
target/classes/mapper/HealthMapper.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<?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>
|
Loading…
Reference in New Issue
Block a user