package com.cweb.controller;

import com.hfkj.common.utils.ResponseMsgUtil;
import com.hfkj.model.ResponseData;
import com.hfkj.service.BsMerPlatformNoService;
import com.hfkj.sysenum.PlatformTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * @className: BsMerPlatformNo
 * @author: HuRui
 * @date: 2023/5/23
 **/
@Controller
@Api(value = "设备管理")
@RequestMapping(value = "/merPlatformNo")
public class BsMerPlatformNoController {

    private static Logger log = LoggerFactory.getLogger(BsMerLedgerController.class);

    @Resource
    private BsMerPlatformNoService merPlatformNoService;

    @RequestMapping(value="/getMerPlatformNo",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "查询商户分账功能")
    public ResponseData getMerPlatformNo(@RequestParam(name = "merId", required = true) Long merId,
                                         @RequestParam(name = "platformType", required = true) Integer platformType) {
        try {

            return ResponseMsgUtil.success(merPlatformNoService.getPlatformNo(merId, PlatformTypeEnum.getDataByNumber(platformType)));

        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return ResponseMsgUtil.exception(e);
        }
    }

}
