package com.fjhx.victoriatourist.controller.jd;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.victoriatourist.entity.jd.dto.JdSalesReturnsDetailDto;
import com.fjhx.victoriatourist.entity.jd.dto.JdSalesReturnsDetailSelectDto;
import com.fjhx.victoriatourist.entity.jd.vo.JdSalesReturnsDetailVo;
import com.fjhx.victoriatourist.service.jd.JdSalesReturnsDetailService;
import com.ruoyi.common.core.domain.BaseSelectDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 京东售后退货明细 前端控制器
 * </p>
 *
 * @author hj
 * @since 2023-12-12
 */
@RestController
@RequestMapping("/jdSalesReturnsDetail")
public class JdSalesReturnsDetailController {

    @Autowired
    private JdSalesReturnsDetailService jdSalesReturnsDetailService;

    /**
     * 京东售后退货明细列表
     */
    @PostMapping("/list")
    public List<JdSalesReturnsDetailVo> list(@RequestBody JdSalesReturnsDetailSelectDto dto) {
        return jdSalesReturnsDetailService.getList(dto);
    }

    /**
     * 京东售后退货明细分页
     */
    @PostMapping("/page")
    public Page<JdSalesReturnsDetailVo> page(@RequestBody JdSalesReturnsDetailSelectDto dto) {
        return jdSalesReturnsDetailService.getPage(dto);
    }

    /**
     * 京东售后退货明细明细
     */
    @PostMapping("/detail")
    public JdSalesReturnsDetailVo detail(@RequestBody BaseSelectDto dto) {
        return jdSalesReturnsDetailService.detail(dto.getId());
    }

    /**
     * 京东售后退货明细新增
     */
    @PostMapping("/add")
    public void add(@RequestBody JdSalesReturnsDetailDto jdSalesReturnsDetailDto) {
        jdSalesReturnsDetailService.add(jdSalesReturnsDetailDto);
    }

    /**
     * 京东售后退货明细编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody JdSalesReturnsDetailDto jdSalesReturnsDetailDto) {
        jdSalesReturnsDetailService.edit(jdSalesReturnsDetailDto);
    }

    /**
     * 京东售后退货明细删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        jdSalesReturnsDetailService.delete(dto.getId());
    }

}
