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

import com.hc.business.model.ZccmUserRefundHistory;
import com.hc.business.service.ZccmUserRefundHistoryService;
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/app/userRefundHistory")
public class AppUserRefundHistoryController {

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

    public AppUserRefundHistoryController(ZccmUserRefundHistoryService userRefundHistoryService) {
        this.userRefundHistoryService = userRefundHistoryService;
    }

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

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



}