新增 车辆绑定优惠券记录表、实体类、Service、controller

This commit is contained in:
Lemon
2024-10-14 15:52:00 +08:00
parent 1acb03f56e
commit 1776075ac2
11 changed files with 544 additions and 2 deletions

View File

@@ -0,0 +1,98 @@
package com.jsowell.web.controller.pile;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.jsowell.common.annotation.Log;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.enums.BusinessType;
import com.jsowell.pile.domain.CarCouponRecord;
import com.jsowell.pile.service.CarCouponRecordService;
import com.jsowell.common.util.poi.ExcelUtil;
import com.jsowell.common.core.page.TableDataInfo;
/**
* 车辆绑定优惠券记录Controller
*
* @author jsowell
* @date 2024-10-14
*/
@RestController
@RequestMapping("/pile/couponRecord")
public class CarCouponRecordController extends BaseController {
@Autowired
private CarCouponRecordService carCouponRecordService;
/**
* 查询车辆绑定优惠券记录列表
*/
@PreAuthorize("@ss.hasPermi('pile:couponRecord:list')")
@GetMapping("/list")
public TableDataInfo list(CarCouponRecord carCouponRecord) {
startPage();
List<CarCouponRecord> list = carCouponRecordService.selectCarCouponRecordList(carCouponRecord);
return getDataTable(list);
}
/**
* 导出车辆绑定优惠券记录列表
*/
@PreAuthorize("@ss.hasPermi('pile:couponRecord:export')")
@Log(title = "车辆绑定优惠券记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, CarCouponRecord carCouponRecord) {
List<CarCouponRecord> list = carCouponRecordService.selectCarCouponRecordList(carCouponRecord);
ExcelUtil<CarCouponRecord> util = new ExcelUtil<CarCouponRecord>(CarCouponRecord.class);
util.exportExcel(response, list, "车辆绑定优惠券记录数据");
}
/**
* 获取车辆绑定优惠券记录详细信息
*/
@PreAuthorize("@ss.hasPermi('pile:couponRecord:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(carCouponRecordService.selectCarCouponRecordById(id));
}
/**
* 新增车辆绑定优惠券记录
*/
@PreAuthorize("@ss.hasPermi('pile:couponRecord:add')")
@Log(title = "车辆绑定优惠券记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody CarCouponRecord carCouponRecord) {
return toAjax(carCouponRecordService.insertCarCouponRecord(carCouponRecord));
}
/**
* 修改车辆绑定优惠券记录
*/
@PreAuthorize("@ss.hasPermi('pile:couponRecord:edit')")
@Log(title = "车辆绑定优惠券记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody CarCouponRecord carCouponRecord) {
return toAjax(carCouponRecordService.updateCarCouponRecord(carCouponRecord));
}
/**
* 删除车辆绑定优惠券记录
*/
@PreAuthorize("@ss.hasPermi('pile:couponRecord:remove')")
@Log(title = "车辆绑定优惠券记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(carCouponRecordService.deleteCarCouponRecordByIds(ids));
}
}