package org.springblade.gateway.point_gateway.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.*;
import lombok.AllArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.payment.cmcc.request.CmccRequest;
import org.springblade.payment.cmcc.response.CmccResponse;
import org.springblade.payment.cmcc.util.CmccUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Silent
 * @Description
 * @Date: Created in 11:08 2021/11/12
 * @Modified By:
 */
@RestController
@AllArgsConstructor
@RequestMapping("app/cmcc")
@Api(value = "助力商场", tags = "助力商场接口")
@Slf4j
public class CmccController {

	/**
	 * 兑换道具
	 */
	@PostMapping("/queryCmccPoint")
	@ApiOperationSupport(order = 1)
	@ApiOperation(value = "查询移动积分", notes = "传入mobile")
	@SneakyThrows
	public R<CmccResponse> queryCmccPoint(@ApiParam(value = "用户手机号码",required = true) @RequestParam String mobile){
		return R.data(CmccUtil.queryCmccBalance(CmccRequest
			.builder()
			.mobile(mobile)
			.build()));
	}
}
