package cn.superdesk.uniorder.openapi.api.order;

import cn.superdesk.uniorder.dto.openapi.order.UnifiedOrderDto;
import cn.superdesk.uniorder.openapi.api.base.O;
import cn.superdesk.uniorder.openapi.api.order.request.MergeOrderReceiveParam;
import cn.superdesk.uniorder.openapi.api.order.request.RefundOrderReceiveParam;
import cn.superdesk.uniorder.openapi.api.order.request.SelectUniOrderByThirdOrderSnCriteria;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.github.xiaoymin.knife4j.annotations.ApiSort;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@Api(value = "订单API接口", tags = {"订单API接口"})
@ApiSort(value = 200000)
@Slf4j
@RestController
@RequestMapping("/v0/biz/order")
public class OrderController {


	@ApiOperation(value = "订单")
	@ApiOperationSupport(order = 10)
	@RequestMapping(value = "merge", method = RequestMethod.POST)
	@ResponseBody
	public O<String> merge(@RequestBody UnifiedOrderDto mergeOrderReceiveParam) {

		String result = new String();

		return new O<String>()
				.setResult(result)
				.setResultCode(200)
				.setResultMessage("成功")
				.setSuccess(true);
	}

	@ApiOperation(value = "退单")
	@ApiOperationSupport(order = 20)
	@RequestMapping(value = "refund", method = RequestMethod.POST)
	@ResponseBody
	public O<String> refund(@RequestBody UnifiedOrderDto refundOrderReceiveParam) {

		String result = new String();

		return new O<String>()
				.setResult(result)
				.setResultCode(200)
				.setResultMessage("成功")
				.setSuccess(true);
	}

	@ApiOperation(value = "反查")
	@ApiOperationSupport(order = 30)
	@RequestMapping(value = "selectUniOrderByThirdOrderSn", method = RequestMethod.POST)
	@ResponseBody
	public O<String> selectUniOrderByThirdOrderSn(@RequestBody SelectUniOrderByThirdOrderSnCriteria criteria) {

		String result = new String();

		return new O<String>()
				.setResult(result)
				.setResultCode(200)
				.setResultMessage("成功")
				.setSuccess(true);
	}

}
