package cn.iocoder.yudao.module.member.controller.admin.orderdetail;

import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "管理后台 - 订单明细")
@RestController
@RequestMapping("/member/order-detail")
@Validated
public class OrderDetailController {

    //@Resource
    //private OrderDetailService orderDetailService;
    //
    //@PostMapping("/create")
    //@Operation(summary = "创建订单明细")
    //@PreAuthorize("@ss.hasPermission('member:order-detail:create')")
    //public CommonResult<Long> createOrderDetail(@Valid @RequestBody OrderDetailSaveReqVO createReqVO) {
    //    return success(orderDetailService.createOrderDetail(createReqVO));
    //}
    //
    //@PutMapping("/update")
    //@Operation(summary = "更新订单明细")
    //@PreAuthorize("@ss.hasPermission('member:order-detail:update')")
    //public CommonResult<Boolean> updateOrderDetail(@Valid @RequestBody OrderDetailSaveReqVO updateReqVO) {
    //    orderDetailService.updateOrderDetail(updateReqVO);
    //    return success(true);
    //}
    //
    //@DeleteMapping("/delete")
    //@Operation(summary = "删除订单明细")
    //@Parameter(name = "id", description = "编号", required = true)
    //@PreAuthorize("@ss.hasPermission('member:order-detail:delete')")
    //public CommonResult<Boolean> deleteOrderDetail(@RequestParam("id") Long id) {
    //    orderDetailService.deleteOrderDetail(id);
    //    return success(true);
    //}
    //
    //@GetMapping("/get")
    //@Operation(summary = "获得订单明细")
    //@Parameter(name = "id", description = "编号", required = true, example = "1024")
    //@PreAuthorize("@ss.hasPermission('member:order-detail:query')")
    //public CommonResult<OrderDetailRespVO> getOrderDetail(@RequestParam("id") Long id) {
    //    OrderDetailDO orderDetail = orderDetailService.getOrderDetail(id);
    //    return success(BeanUtils.toBean(orderDetail, OrderDetailRespVO.class));
    //}
    //
    //@GetMapping("/page")
    //@Operation(summary = "获得订单明细分页")
    //@PreAuthorize("@ss.hasPermission('member:order-detail:query')")
    //public CommonResult<PageResult<OrderDetailRespVO>> getOrderDetailPage(@Valid OrderDetailPageReqVO pageReqVO) {
    //    PageResult<OrderDetailDO> pageResult = orderDetailService.getOrderDetailPage(pageReqVO);
    //    return success(BeanUtils.toBean(pageResult, OrderDetailRespVO.class));
    //}
    //
    //@GetMapping("/export-excel")
    //@Operation(summary = "导出订单明细 Excel")
    //@PreAuthorize("@ss.hasPermission('member:order-detail:export')")
    //@OperateLog(type = EXPORT)
    //public void exportOrderDetailExcel(@Valid OrderDetailPageReqVO pageReqVO,
    //          HttpServletResponse response) throws IOException {
    //    pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
    //    List<OrderDetailDO> list = orderDetailService.getOrderDetailPage(pageReqVO).getList();
    //    // 导出 Excel
    //    ExcelUtils.write(response, "订单明细.xls", "数据", OrderDetailRespVO.class,
    //                    BeanUtils.toBean(list, OrderDetailRespVO.class));
    //}

}