package cn.pluss.platform.controller.merchant;


import cn.pluss.platform.base.BaseModelController;
import cn.pluss.platform.channel.MakeMoneyService;
import cn.pluss.platform.entity.MakeMoney;
import cn.pluss.platform.util.SxfConfg;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Djh
 * @since 2020-09-10
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/makeMoney")
public class MakeMoneyController extends BaseModelController<MakeMoneyService, MakeMoney> {

    private final MakeMoneyService sxfMakeMoneyService;

    /**
     * 随行付结算接口回调
     */
    @PostMapping("sxfCallback")
    public JSONObject sxfCallback(@RequestBody JSONObject data) {
        log.info("=====随行付结算=====\n{}", data);
        sxfMakeMoneyService.dealCallbackData(data);
        return SxfConfg.ok();
    }
}
