首页>代码>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);
	}
}
最近下载更多
stephysun  LV2 2019年8月17日
morningstar123  LV1 2019年6月11日
杨杨杨杨杨杨123  LV1 2019年6月4日
suiy2010  LV15 2018年7月23日
yangctz  LV25 2018年5月6日
tiancaisq  LV1 2018年4月27日
jic499  LV27 2018年4月17日
huhua11  LV8 2018年4月10日
ldc199375  LV10 2018年3月29日
苗毅6666  LV32 2018年3月27日
最近浏览更多
llllllK  LV5 2024年5月13日
暂无贡献等级
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日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友