package com.ruoyi.aftersalesservice.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.aftersalesservice.pojo.AfterSalesNearExpiry;
import com.ruoyi.aftersalesservice.service.AfterSalesNearExpiryService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
*
* 临期售后管理控制层
*
*
* @author deslrey
* @version 1.0
* @since 2026/03/02 14:40
*/
@RestController
@Api(tags = "临期售后管理")
@RequestMapping("/afterSalesNearExpiryService")
public class AfterSalesNearExpiryController extends BaseController {
@Autowired
private AfterSalesNearExpiryService afterSalesNearExpiryService;
/**
* 新增临期售后
*/
@PostMapping("/add")
@ApiOperation("新增临期售后")
@Log(title = "新增临期售后", businessType = BusinessType.INSERT)
public AjaxResult add(@RequestBody AfterSalesNearExpiry entity) {
afterSalesNearExpiryService.add(entity);
return AjaxResult.success("添加成功");
}
/**
* 更新临期售后
*/
@PostMapping("/update")
@ApiOperation("更新临期售后")
@Log(title = "更新临期售后", businessType = BusinessType.UPDATE)
public AjaxResult update(@RequestBody AfterSalesNearExpiry entity) {
afterSalesNearExpiryService.update(entity);
return AjaxResult.success("更新成功");
}
/**
* 删除临期售后
*/
@DeleteMapping("/delete")
@ApiOperation("删除临期售后")
@Log(title = "删除临期售后", businessType = BusinessType.DELETE)
public AjaxResult delete(Long[] ids) {
afterSalesNearExpiryService.delete(ids);
return AjaxResult.success("删除成功");
}
/**
* 分页查询临期售后
*/
@GetMapping("/listPage")
@ApiOperation("分页查询临期售后")
@Log(title = "分页查询临期售后", businessType = BusinessType.OTHER)
public AjaxResult listPage(Page page, AfterSalesNearExpiry entity) {
IPage listPage = afterSalesNearExpiryService.listPage(page, entity);
return AjaxResult.success(listPage);
}
}