package com.fjhx.victoriatourist.controller.after;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.victoriatourist.entity.after.vo.AfterSaleRecordVo;
import com.fjhx.victoriatourist.entity.after.dto.AfterSaleRecordSelectDto;
import com.fjhx.victoriatourist.entity.after.dto.AfterSaleRecordDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.victoriatourist.service.after.AfterSaleRecordService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 售后管理 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-19
 */
@RestController
@RequestMapping("/afterSaleRecord")
public class AfterSaleRecordController {

    @Autowired
    private AfterSaleRecordService afterSaleRecordService;

    /**
     * 售后管理分页
     */
    @PostMapping("/page")
    public Page<AfterSaleRecordVo> page(@RequestBody AfterSaleRecordSelectDto dto) {
        return afterSaleRecordService.getPage(dto);
    }

    /**
     * 售后管理明细
     */
    @PostMapping("/detail")
    public AfterSaleRecordVo detail(@RequestBody BaseSelectDto dto) {
        return afterSaleRecordService.detail(dto.getId());
    }

    /**
     * 售后管理新增
     */
    @PostMapping("/add")
    public void add(@RequestBody AfterSaleRecordDto afterSaleRecordDto) {
        afterSaleRecordService.add(afterSaleRecordDto);
    }

    /**
     * 售后管理编辑
     */
    @PostMapping("/edit")
    public void edit(@RequestBody AfterSaleRecordDto afterSaleRecordDto) {
        afterSaleRecordService.edit(afterSaleRecordDto);
    }

    /**
     * 售后管理删除
     */
    @PostMapping("/delete")
    public void delete(@RequestBody BaseSelectDto dto) {
        afterSaleRecordService.delete(dto.getId());
    }

}
