package com.sqx.modules.bl.order.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.bl.order.entity.UserPackageOrder;
import com.sqx.modules.bl.order.service.UserPackageOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/user/package/order")
@Api(value = "用户服务包订单管理", tags = {"用户服务包订单"})
public class UserPackageOrderController {

    @Autowired
    private UserPackageOrderService service;

    @GetMapping("/findPage")
    @ApiOperation("查询服务包订单（分页）")
    public Result findPage(UserPackageOrder userPackageOrder){
        return service.findPage(userPackageOrder);
    }


    @GetMapping("/findCoupon")
    @ApiOperation("查询代金券")
    public Result findCoupon(UserPackageOrder userPackageOrder){
        return service.findCoupon(userPackageOrder);
    }

    @PostMapping("/refund")
    @ApiOperation("退款")
    public Result refund(UserPackageOrder userPackageOrder){
        service.refund(userPackageOrder);
        return Result.success();
    }

}
