package cn.com.ty.lift.ud.payment.controller;

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;

import com.baomidou.mybatisplus.extension.service.IService;

import cn.com.ty.lift.ud.common.BaseController;
import cn.com.ty.lift.ud.payment.controller.query.UserRechargeDetailQuery;
import cn.com.ty.lift.ud.payment.mapper.entity.UserRechargeDetailEntity;
import cn.com.ty.lift.ud.payment.service.IUserRechargeDetailService;
import cn.com.xwy.boot.web.dto.RestResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

/**
 * 用户充值记录表API
 * 
 * @author Xson
 * @date 2020-06-05
 */
@Slf4j
@Api(tags = "用户充值记录表API - sKing")
@RestController
@RequestMapping("/api/userRechargeDetails")
public class UserRechargeDetailController extends BaseController<UserRechargeDetailEntity, UserRechargeDetailQuery> {

    private @Autowired IUserRechargeDetailService userRechargeDetailService;

    @Override
    protected IService<UserRechargeDetailEntity> getService() {
        return userRechargeDetailService;
    }

    @PostMapping("/createRecharge")
    @ApiOperation(value = "创建充值订单")
    public RestResponse createRecharge(@RequestBody UserRechargeDetailEntity request) {
        return userRechargeDetailService.createRecharge(request);
    }
}