package com.cftech.mp.reply.web;

import com.alibaba.fastjson.JSONObject;
import com.cftech.core.util.StringUtils;
import com.cftech.mp.reply.model.MobileLog;
import com.cftech.mp.reply.service.AsyncService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Created by kingdee-001 on 2018/6/20.
 */
@RestController
@RequestMapping("/mobile/testAsync")
@Slf4j
public class MobileTestAsyncController {
    @Autowired
    private AsyncService asyncService;

    @RequestMapping("/doLOg")
    public void oauth(MobileLog mobileLog,HttpServletRequest request) {
        String ip = StringUtils.getRemoteAddr(request);
        mobileLog.setIp(ip);
        asyncService.deductInventory(mobileLog,request);
    }
}
