package com.neusoft.smart.pos.payment.controller;


import com.neusoft.smart.pos.constants.DictionaryConstant;
import com.neusoft.smart.pos.dto.payment.request.PostMchInfoRequest;
import com.neusoft.smart.pos.dto.payment.response.PostMchInfoResponse;
import com.neusoft.smart.pos.framework.dto.ResponseData;
import com.neusoft.smart.pos.payment.service.MchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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;

@Api(value = "商户管理使用rest接口", description = "商户管理使用rest接口")
@RestController
@RequestMapping(path = "/mch")
public class MchController {

	@Autowired
	private MchService mchService;

    @ApiOperation(value = "商户号申请内部接口", notes = "商户号申请内部接口")
    @PostMapping("/applyMchByPrivate")
    public ResponseData<PostMchInfoResponse> applyMchByPrivate(@RequestBody PostMchInfoRequest mchInfoRequest) {
        return new ResponseData<>(mchService.createMchInfo(mchInfoRequest.getMchName(), DictionaryConstant.PAYMENT_APPLY_TYPE_NB.getCode()));
    }

}
	