package com.uas.finance.controller;

import com.uas.finance.service.MFCustInfoService;
import com.uas.finance.model.MFCustInfo;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 买方客户信息
 * created by shicr on 2017/12/22
 **/
@Controller
@RequestMapping("/mfcustinfo")
public class MFCustInfoController {

    private final static Logger logger = LoggerFactory.getLogger(MFCustInfoController.class);

    @Autowired
    private MFCustInfoService mfCustInfoService;

    /**
     * 买方客户信息保存
     *
     * @param mfCustInfo
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public MFCustInfo save(@RequestBody MFCustInfo mfCustInfo) {

        logger.info("买方客户信息保存", "success");
        return mfCustInfoService.save(mfCustInfo);
    }

    /**
     * 查找某一具体的买方客户信息
     *
     * @param id
     * @return
     */
    @ResponseBody
    @RequestMapping(value = "/findOne", method = RequestMethod.GET)
    public MFCustInfo findOne(@RequestBody Long id) {

        logger.info("查找某一具体的买方客户信息", "success");
        return mfCustInfoService.findOne(id);
    }
}
