首页>代码>spring boot+mybatis+ehcache(缓存)整合的简单实例>/springboot-mybatis/src/main/java/com/singhand/controller/UserController.java
                
                package com.singhand.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
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.RestController;
import com.singhand.entity.UserEntity;
import com.singhand.service.UserService;
/**
 * 控制类
 * @author mjy
 *
 */
@RestController
public class UserController {
	@Autowired
	private UserService userService;
	@RequestMapping(value="/getUser/{userId}", method=RequestMethod.GET)
	public UserEntity getUser(@PathVariable String userId) {
		UserEntity users = userService.getUser(userId);
		return users;
	}
	@RequestMapping(value="/addUser", method=RequestMethod.PUT)
	public String addUser(@RequestBody UserEntity user) {
		userService.addUser(user);
		return "成功";
	}
	
	@RequestMapping(value="/updateUser", method=RequestMethod.POST)
	public String updateUser(@RequestBody UserEntity user){
		userService.updateUserById(user);
		return "成功";
	}
	
	@RequestMapping(value="/deleteUserById{id}", method=RequestMethod.DELETE)
	public String deleteUserById(@PathVariable String id){
		userService.deleteUserById(id);;
		return "成功";
	}
}
 最近下载更多
最近下载更多
                
                WXX1083402844     LV1
                2021年12月3日
            
            
        
                mudingc木钉     LV30
                2021年6月16日
            
            
        
                1798672867     LV21
                2021年5月22日
            
            
        
                912299793     LV21
                2021年4月22日
            
            
        
                欠踹de背影     LV25
                2020年12月25日
            
            
        
                wcy071213     LV27
                2020年11月17日
            
            
        
                sangyy     LV10
                2020年8月21日
            
            
        
                zaizai21312     LV10
                2020年6月12日
            
            
        
                youwuzuichen     LV11
                2020年4月30日
            
            
        
                海问香     LV6
                2020年1月20日
            
            
         最近浏览更多
最近浏览更多
                
                woldxy     LV12
                2023年9月14日
            
            
        
                hbsoft2008     LV16
                2023年3月23日
            
            
        
                xiaoyuer2     LV8
                2022年11月20日
            
            
        
                love8309287     LV4
                2022年10月9日
            
            
        
                wang512237140     LV20
                2021年12月14日
            
            
        
                WXX1083402844     LV1
                2021年12月3日
            
            
        
                尹恒yingying     LV18
                2021年10月28日
            
            
        
                mudingc木钉     LV30
                2021年6月16日
            
            
        
                912299793     LV21
                2021年4月22日
            
            
        
                caojianlong1     LV6
                2021年2月3日
            
            
        
 
     
                 
                