Commit b8432cbe by 王军业

【顾客接口】

1 parent d074a0aa
package com.vion.financial.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.vion.financial.service.CustomerService;
@RestController
public class CustomerController extends BaseController {
@Autowired
CustomerService customerService;
@GetMapping(value="/customers")
@ResponseBody
public Object queryCustomers() {
return customerService.queryCustomer();
}
}
package com.vion.financial.service.imp;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.vion.financial.entity.Customer;
import com.vion.financial.mapper.CustomerMapper;
import com.vion.financial.mapper.DeliverGoodsMapper;
import com.vion.financial.service.AppendixService;
import com.vion.financial.service.ContractService;
import com.vion.financial.service.CustomerService;
import com.vion.financial.vo.FailCode;
import com.vion.financial.vo.SuccessCode;
@Service
public class CustomerServiceImpl implements CustomerService {
Logger logger = LoggerFactory.getLogger(DeliverGoodsServiceImpl.class);
@Autowired
SuccessCode successCode;
@Autowired
FailCode failCode;
@Autowired
CustomerMapper customerMapper;
@Override
public Object addCustomer(Customer customer) {
// TODO Auto-generated method stub
return null;
}
@Override
public Object queryCustomer() {
// TODO Auto-generated method stub
logger.info("=====================查询顾客信息========================");
try {
return customerMapper.queryCustomer();
} catch (Exception e) {
// TODO: handle exception
logger.error("查询顾客信息出错"+e.getLocalizedMessage(),e);
failCode.setEcode("500");
failCode.setEnote("Fail");
return failCode;
}
}
@Override
public Object updateCustomer(Customer customer) {
// TODO Auto-generated method stub
return null;
}
@Override
public Object deleteCustomer(int n) {
// TODO Auto-generated method stub
return null;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!