package com.xue.controller;
import com.xue.entity.Employee;
import com.xue.service.EmployeeService;
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 java.util.List;
@RestController
@RequestMapping("/emp")
public class EmployeeController {
@Autowired
private EmployeeService es;
@RequestMapping("/list")
public List<Employee> EmployeeList(){
return es.EmployeeList();
}
@PostMapping("/insert")
public int insert(Employee employee){
return es.insert(employee);
}
@PostMapping("/delete")
public int deleteId(int id){
return es.deleteId(id);
}
@GetMapping("/getemployee")
public Employee getEmployee(int id){
return es.getEmployee(id);
}
@PostMapping("/update")
public int update(Employee employee){
return es.update(employee);
}
// insert?id=1&name=mc&age=23&sex=女
// localhost:8888/kude/s/update?id=1&name=mc&age=23&sex=女
// @PostMapping(value = "/person")
// public Person personAdd(@RequestParam("name") String name,
// @RequestParam("age") Integer age) {
// Person person = new Person();
// person.setName(name);
// person.setAge(age);
//
// return personRepository.save(person);
// }
//————————————————
// 版权声明:本文为CSDN博主「伍有晓俐」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
// 原文链接:https://blog.csdn.net/Peng_Hong_fu/article/details/53691705
}
java springboot加mybaits 简单增删改查案例,源码。
需积分: 49 170 浏览量
2022-04-11
13:56:55
上传
评论
收藏 17KB RAR 举报
m0_60059827
- 粉丝: 2
- 资源: 2
最新资源
- 基于STM8S103F3P6+STM8S207C8T6+STM32F103 单片机三合一最小系统开发板硬件(原理图+PCB)工程
- 基于C语言实现的打印杨辉三角
- 基于ASIO的插件式服务器,支持TCP,UDP,串口,Http,Websocket统一化的数据接口,隔离开发人员和IO之间的操作
- stm32 usb接口通信
- Chessmate是一款完全免费的国际象棋学习软件,支持引擎分析,学开局、残局、棋书解读、大数据分析等功能
- 总结整理的Android面试Java基础知识点面试资料精编汇总文档资料合集.zip
- .android_lq
- FDN5632N-VB一款SOT23封装N-Channel场效应MOS管
- 毛老板-2404250902.amr
- Java类加载流程(双亲委派)流程图.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
评论0