package com.fjhx.sale.controller.after;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.sale.entity.after.dto.AfterSalesRecordSelectDto;
import com.fjhx.sale.entity.after.dto.AfterSalesRecordsDto;
import com.fjhx.sale.entity.after.vo.AfterSalesRecordsVo;
import com.fjhx.sale.service.after.AfterSalesRecordsService;
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;


/**
 * <p>
 * 售后跟进记录 前端控制器
 * </p>
 *
 * @author
 * @since 2023-07-20
 */
@RestController
@RequestMapping("/afterSalesRecords")
public class AfterSalesRecordsController {

    @Autowired
    private AfterSalesRecordsService afterSalesRecordsService;

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

    /**
     * 售后跟进记录新增
     */
    @PostMapping("/add")
    public void add(@RequestBody AfterSalesRecordsDto afterSalesRecordDto) {
        afterSalesRecordsService.add(afterSalesRecordDto);
    }

}
