package com.hc.web.controller.browser.front;

import com.hc.business.model.UserRefundHistory;
import com.hc.business.service.UserRefundHistoryService;
import com.hc.core.utils.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


/**
 * 用户退款记录表(UserRefundHistory)表控制层
 *
 * @author java
 * @since 2020-12-10 11:31:45
 */

@RestController
@RequestMapping("/new/api/front/userRefundHistory")
public class FrontUserRefundHistoryController {

    /**
     * 服务对象
     */
    private final UserRefundHistoryService userRefundHistoryService;

    public FrontUserRefundHistoryController(UserRefundHistoryService userRefundHistoryService) {
        this.userRefundHistoryService = userRefundHistoryService;
    }

    @GetMapping("/{id}")
    @ApiOperation(value = "依据主键获取 UserRefundHistory", response = Result.class)
    public Result selectFrontUserRefundHistory(@PathVariable("id") Integer id) {
        return Result.success(this.userRefundHistoryService.queryById(id));
    }

    @PostMapping("/insert")
    @ApiOperation(value = "新增 UserRefundHistory", response = Result.class)
    public Result addFrontUserRefundHistory(@Valid @RequestBody UserRefundHistory userRefundHistory) {
        return Result.success(userRefundHistoryService.insert(userRefundHistory));
    }



}