package com.fjhx.jxst.controller.after;

import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.jxst.entity.after.vo.AfterSalesRecordVo;
import com.fjhx.jxst.entity.after.dto.AfterSalesRecordSelectDto;
import com.fjhx.jxst.entity.after.dto.AfterSalesRecordDto;
import com.ruoyi.common.core.domain.BaseSelectDto;
import com.fjhx.jxst.service.after.AfterSalesRecordService;
import org.springframework.beans.factory.annotation.Autowired;


/**
 * <p>
 * 售后记录 前端控制器
 * </p>
 *
 * @author
 * @since 2023-05-25
 */
@RestController
@RequestMapping("/afterSalesRecord")
public class AfterSalesRecordController {

    @Autowired
    private AfterSalesRecordService afterSalesRecordService;

    /**
     * 售后记录分页
     */
    @PostMapping("/page")
    public Page<AfterSalesRecordVo> page(@RequestBody AfterSalesRecordSelectDto dto) {
        return afterSalesRecordService.getPage(dto);
    }

    /**
     * 售后记录明细
     */
    @PostMapping("/detail")
    public AfterSalesRecordVo detail(@RequestBody BaseSelectDto dto) {
        return afterSalesRecordService.detail(dto.getId());
    }

    /**
     * 售后记录新增
     */
    @PostMapping("/add")
    public void add(@RequestBody AfterSalesRecordDto afterSalesRecordDto) {
        afterSalesRecordService.add(afterSalesRecordDto);
    }

    /**
     * 售后记录提交
     */
    @PostMapping("/afterSales")
    public void afterSales(@RequestBody AfterSalesRecordDto afterSalesRecordDto) {
        afterSalesRecordService.afterSales(afterSalesRecordDto);
    }


}
