|
@@ -1,36 +1,29 @@
|
|
|
package com.ruoyi.framework.recovery.controller;
|
|
|
|
|
|
-import java.util.List;
|
|
|
-import jakarta.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.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
import com.ruoyi.common.enums.BusinessType;
|
|
|
+import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.framework.recovery.domain.WxUserLottery;
|
|
|
import com.ruoyi.framework.recovery.service.IWxUserLotteryService;
|
|
|
-import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
-import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 微信中奖记录Controller
|
|
|
- *
|
|
|
+ *
|
|
|
* @author jin
|
|
|
* @date 2024-12-17
|
|
|
*/
|
|
|
@RestController
|
|
|
@RequestMapping("/recovery/user/lottery")
|
|
|
-public class WxUserLotteryController extends BaseController
|
|
|
-{
|
|
|
+public class WxUserLotteryController extends BaseController {
|
|
|
@Autowired
|
|
|
private IWxUserLotteryService wxUserLotteryService;
|
|
|
|
|
@@ -39,8 +32,7 @@ public class WxUserLotteryController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('recovery:lottery:list')")
|
|
|
@GetMapping("/list")
|
|
|
- public TableDataInfo list(WxUserLottery wxUserLottery)
|
|
|
- {
|
|
|
+ public TableDataInfo list(WxUserLottery wxUserLottery) {
|
|
|
startPage();
|
|
|
List<WxUserLottery> list = wxUserLotteryService.selectWxUserLotteryList(wxUserLottery);
|
|
|
return getDataTable(list);
|
|
@@ -52,8 +44,7 @@ public class WxUserLotteryController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('recovery:lottery:export')")
|
|
|
@Log(title = "微信中奖记录", businessType = BusinessType.EXPORT)
|
|
|
@PostMapping("/export")
|
|
|
- public void export(HttpServletResponse response, WxUserLottery wxUserLottery)
|
|
|
- {
|
|
|
+ public void export(HttpServletResponse response, WxUserLottery wxUserLottery) {
|
|
|
List<WxUserLottery> list = wxUserLotteryService.selectWxUserLotteryList(wxUserLottery);
|
|
|
ExcelUtil<WxUserLottery> util = new ExcelUtil<WxUserLottery>(WxUserLottery.class);
|
|
|
util.exportExcel(response, list, "微信中奖记录数据");
|
|
@@ -64,8 +55,7 @@ public class WxUserLotteryController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('recovery:lottery:query')")
|
|
|
@GetMapping(value = "/{id}")
|
|
|
- public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
|
return success(wxUserLotteryService.selectWxUserLotteryById(id));
|
|
|
}
|
|
|
|
|
@@ -75,8 +65,7 @@ public class WxUserLotteryController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('recovery:lottery:add')")
|
|
|
@Log(title = "微信中奖记录", businessType = BusinessType.INSERT)
|
|
|
@PostMapping
|
|
|
- public AjaxResult add(@RequestBody WxUserLottery wxUserLottery)
|
|
|
- {
|
|
|
+ public AjaxResult add(@RequestBody WxUserLottery wxUserLottery) {
|
|
|
return toAjax(wxUserLotteryService.insertWxUserLottery(wxUserLottery));
|
|
|
}
|
|
|
|
|
@@ -86,8 +75,7 @@ public class WxUserLotteryController extends BaseController
|
|
|
@PreAuthorize("@ss.hasPermi('recovery:lottery:edit')")
|
|
|
@Log(title = "微信中奖记录", businessType = BusinessType.UPDATE)
|
|
|
@PutMapping
|
|
|
- public AjaxResult edit(@RequestBody WxUserLottery wxUserLottery)
|
|
|
- {
|
|
|
+ public AjaxResult edit(@RequestBody WxUserLottery wxUserLottery) {
|
|
|
return toAjax(wxUserLotteryService.updateWxUserLottery(wxUserLottery));
|
|
|
}
|
|
|
|
|
@@ -96,9 +84,8 @@ public class WxUserLotteryController extends BaseController
|
|
|
*/
|
|
|
@PreAuthorize("@ss.hasPermi('recovery:lottery:remove')")
|
|
|
@Log(title = "微信中奖记录", businessType = BusinessType.DELETE)
|
|
|
- @DeleteMapping("/{ids}")
|
|
|
- public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
- {
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids) {
|
|
|
return toAjax(wxUserLotteryService.deleteWxUserLotteryByIds(ids));
|
|
|
}
|
|
|
}
|