package com.ruoyi.mall.controller; import java.util.List; 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.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.mall.domain.MallMemberIntegral; import com.ruoyi.mall.service.IMallMemberIntegralService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; import javax.annotation.Resource; /** * 用户积分记录Controller * * @author ruoyi * @date 2024-06-21 */ @RestController @RequestMapping("/mall/mallMemberIntegral") public class MallMemberIntegralController extends BaseController { @Resource private IMallMemberIntegralService mallMemberIntegralService; /** * 查询用户积分记录列表 */ @PreAuthorize("@ss.hasPermi('mall:mallMemberIntegral:list')") @GetMapping("/list") public TableDataInfo list(MallMemberIntegral mallMemberIntegral) { startPage(); mallMemberIntegral.setDelFlag(0); List list = mallMemberIntegralService.selectMallMemberIntegralList(mallMemberIntegral); return getDataTable(list); } /** * 导出用户积分记录列表 */ @PreAuthorize("@ss.hasPermi('mall:mallMemberIntegral:export')") @Log(title = "用户积分记录", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(MallMemberIntegral mallMemberIntegral) { List list = mallMemberIntegralService.selectMallMemberIntegralList(mallMemberIntegral); ExcelUtil util = new ExcelUtil(MallMemberIntegral.class); return util.exportExcel(list, "用户积分记录数据"); } /** * 获取用户积分记录详细信息 */ @PreAuthorize("@ss.hasPermi('mall:mallMemberIntegral:query')") @GetMapping(value = "/{integralId}") public AjaxResult getInfo(@PathVariable("integralId") Long integralId) { return AjaxResult.success(mallMemberIntegralService.selectMallMemberIntegralByIntegralId(integralId)); } /** * 新增用户积分记录 */ @PreAuthorize("@ss.hasPermi('mall:mallMemberIntegral:add')") @Log(title = "用户积分记录", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody MallMemberIntegral mallMemberIntegral) { return toAjax(mallMemberIntegralService.insertMallMemberIntegral(mallMemberIntegral)); } /** * 修改用户积分记录 */ @PreAuthorize("@ss.hasPermi('mall:mallMemberIntegral:edit')") @Log(title = "用户积分记录", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody MallMemberIntegral mallMemberIntegral) { return toAjax(mallMemberIntegralService.updateMallMemberIntegral(mallMemberIntegral)); } /** * 删除用户积分记录 */ @PreAuthorize("@ss.hasPermi('mall:mallMemberIntegral:remove')") @Log(title = "用户积分记录", businessType = BusinessType.DELETE) @DeleteMapping("/{integralIds}") public AjaxResult remove(@PathVariable Long[] integralIds) { return toAjax(mallMemberIntegralService.deleteMallMemberIntegralByIntegralIds(integralIds)); } }