package com.fjhx.victoriatourist.controller.after;

import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fjhx.victoriatourist.entity.after.vo.AfterSaleHandleVo;
import com.fjhx.victoriatourist.entity.after.dto.AfterSaleHandleSelectDto;
import com.fjhx.victoriatourist.entity.after.dto.AfterSaleHandleDto;
import com.fjhx.victoriatourist.service.after.AfterSaleHandleService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.validation.Valid;


/**
 * <p>
 * 售后管理-跟进记录 前端控制器
 * </p>
 *
 * @author
 * @since 2023-04-19
 */
@RestController
@RequestMapping("/afterSaleHandle")
public class AfterSaleHandleController {

    @Autowired
    private AfterSaleHandleService afterSaleHandleService;

    /**
     * 售后管理-跟进记录分页
     */
    @PostMapping("/page")
    public Page<AfterSaleHandleVo> page(@RequestBody AfterSaleHandleSelectDto dto) {
        return afterSaleHandleService.getPage(dto);
    }

    /**
     * 售后管理-跟进记录新增
     */
    @PostMapping("/add")
    public void add(@Validated @RequestBody AfterSaleHandleDto afterSaleHandleDto) {
        afterSaleHandleService.add(afterSaleHandleDto);
    }

}
