package com.Baike.Controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.Baike.Entity.User;
import com.Baike.Service.UserService;
@RequestMapping("/user")
@RestController
public class UserController {
@Autowired
private UserService userservice;
@PostMapping
public void save(@RequestBody User user) {
userservice.save(user);
// TODO Auto-generated method stub
}
@PutMapping
public void update(@RequestBody Integer id) {
userservice.update(id);
// TODO Auto-generated method stub
}
@DeleteMapping("/{id}")
public void delete(@PathVariable Integer id) {
userservice.delete(id);
// TODO Auto-generated method stub
}
@GetMapping("/{id}")
public User getById(@PathVariable Integer id) {
System.out.println("1");
return userservice.getById(id);
// TODO Auto-generated method stub
}
@GetMapping
public List<User> getAll() {
return userservice.getAll();
// TODO Auto-generated method stub
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
SSM框架项目(普通版本)
共48个文件
java:13个
class:12个
xml:4个
需积分: 5 0 下载量 34 浏览量
2024-01-30
23:57:32
上传
评论
收藏 255KB RAR 举报
温馨提示
无
资源推荐
资源详情
资源评论
收起资源包目录
SSM.rar (48个子文件)
test
.classpath 2KB
.settings
org.eclipse.wst.jsdt.ui.superType.name 6B
org.eclipse.jdt.core.prefs 616B
.jsdtscope 639B
org.eclipse.wst.validation.prefs 50B
org.eclipse.wst.common.component 668B
org.eclipse.wst.common.project.facet.core.xml 292B
org.eclipse.wst.jsdt.ui.superType.container 49B
org.eclipse.m2e.core.prefs 90B
pom.xml 3KB
src
test
resources
java
com
Baike
Service
UserserviceTest.java 816B
main
resources
jdbc.properties 140B
java
com
Baike
Dao
UserDao.java 727B
Service
UserService.java 578B
ServiceImpl
UserServiceImpl.java 990B
Config
ServletConfig.java 665B
JdbcConfig.java 1KB
SpringMvcSupport.java 521B
SpringMvcConfig.java 985B
MybatisConfig.java 782B
SpringConfig.java 565B
CorsConfig.java 571B
Controller
UserController.java 2KB
Entity
User.java 311B
webapp
WEB-INF
web.xml 632B
dist
js
chunk-vendors.5a7efb5c.js.map 699KB
app.9cb23368.js 2KB
app.9cb23368.js.map 11KB
chunk-vendors.5a7efb5c.js 125KB
favicon.ico 4KB
index.html 570B
target
classes
jdbc.properties 140B
com
Baike
Dao
UserDao.class 859B
Service
ServiceImpl
UserServiceImpl.class 1KB
UserService.class 494B
Config
SpringMvcSupport.class 1KB
JdbcConfig.class 2KB
SpringMvcConfig.class 2KB
SpringConfig.class 798B
MybatisConfig.class 1KB
ServletConfig.class 866B
Controller
UserController.class 2KB
Entity
User.class 768B
m2e-wtp
web-resources
META-INF
MANIFEST.MF 88B
maven
com.test
test
pom.properties 216B
pom.xml 3KB
test-classes
com
Baike
Service
UserserviceTest.class 1KB
.project 1KB
共 48 条
- 1
资源评论
软件开发技术局
- 粉丝: 122
- 资源: 26
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功