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

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

import javax.validation.Valid;
import java.util.List;


/**
 * (ZccmOrderUserLog)表控制层
 *
 * @author java
 * @since 2020-12-03 09:25:12
 */

@RestController
@RequestMapping("/new/api/back/orderUserLog")
public class BackOrderUserLogController {

    /**
     * 服务对象
     */
    private final ZccmOrderUserLogService orderUserLogService;

    public BackOrderUserLogController(ZccmOrderUserLogService orderUserLogService) {
        this.orderUserLogService = orderUserLogService;
    }

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

    @GetMapping("/order/{orderId}")
    @ApiOperation(value = "依据订单id 获取 ZccmOrderUserLog", response = Result.class)
    public Result selectZccmOrderUserLogByZccmOrderId(@ApiParam(value = "订单id") @PathVariable("orderId") Integer orderId) {
        return Result.success(orderUserLogService.queryListByOrderId(orderId));
    }


}