首页>代码>eclipse+spring+mybatis+Atomikos+maven实现简易分布式数据库读写分离>/jta-db-1.0.0/src/main/java/com/dcliu/controller/CustomerController.java
package com.dcliu.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import com.dcliu.bean.Customer;
import com.dcliu.service.CustomerService;
@Controller
@RequestMapping("/customer")
public class CustomerController {
private static final Logger logger = LoggerFactory.getLogger(CustomerController.class);
@Autowired
private CustomerService demoService;
@RequestMapping(value="/getCustomerByName/{name}",method = RequestMethod.GET)
@ResponseBody
public Customer getCustomerByName(@PathVariable String name){
logger.info("i am coming.....");
System.out.println("==================================");
Customer customer = demoService.getInfoByName("dcliu0");
System.out.println(customer.getUserName());
System.out.println(customer.getUserPhone());
System.out.println(customer.getUserEmail());
System.out.println("==================================");
return demoService.getInfoByName(name);
}
}
最近下载更多
最近浏览更多
llllllK LV5
2024年5月13日
微信网友_6813145916592128
2024年1月8日
暂无贡献等级
lujinchao1111 LV4
2023年6月25日
admin1234545545 LV3
2022年11月10日
lcbaaa LV6
2022年8月13日
是你爸爸啊100 LV5
2022年8月5日
小星超级爱编程 LV17
2022年1月21日
szf123 LV12
2021年11月13日
wwww1984 LV14
2021年10月31日
赵小胖
2021年6月17日
暂无贡献等级

