package com.fjhx.victoriatourist.controller.jd;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.victoriatourist.entity.jd.vo.JdBackQualityDetailsVo;
import com.fjhx.victoriatourist.entity.jd.dto.JdBackQualityDetailsSelectDto;
import com.fjhx.victoriatourist.entity.jd.dto.JdBackQualityDetailsDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.victoriatourist.service.jd.JdBackQualityDetailsService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;


/**
 * <p>
 * 京东退货质检明细 前端控制器
 * </p>
 *
 * @author 
 * @since 2023-04-19
 */
@RestController
@RequestMapping("/jdBackQualityDetails")
public class JdBackQualityDetailsController {

    @Autowired
    private JdBackQualityDetailsService jdBackQualityDetailsService;

    /**
     * 京东退货质检明细分页
     */
    @PostMapping("/page")
    public Page<JdBackQualityDetailsVo> page(@RequestBody JdBackQualityDetailsSelectDto dto) {
        return jdBackQualityDetailsService.getPage(dto);
    }

    /**
     * 京东退货质检明细明细
     */
    @PostMapping("/detail")
    public List<JdBackQualityDetailsVo> detail(@RequestBody JdBackQualityDetailsSelectDto dto) {
        return jdBackQualityDetailsService.detail(dto.getCode());
    }

    /**
     * 京东退货质检明细新增
     */
    @PostMapping("/add")
    public void add(@RequestBody List<JdBackQualityDetailsDto> jdBackQualityDetailsDtoList) {
        jdBackQualityDetailsService.add(jdBackQualityDetailsDtoList);
    }

    /**
     * 京东退货质检明细编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody JdBackQualityDetailsDto jdBackQualityDetailsDto) {
        jdBackQualityDetailsService.edit(jdBackQualityDetailsDto);
    }

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

}
