|
|
@@ -0,0 +1,63 @@
|
|
|
+package com.fs.qw.controller;
|
|
|
+
|
|
|
+import com.fs.common.core.controller.BaseController;
|
|
|
+import com.fs.common.core.domain.AjaxResult;
|
|
|
+import com.fs.common.core.page.TableDataInfo;
|
|
|
+import com.fs.course.domain.LuckyBag;
|
|
|
+import com.fs.qw.service.ILuckyBagService;
|
|
|
+import com.fs.tenant.mapper.TenantInfoMapper;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 福袋管理
|
|
|
+ *
|
|
|
+ * @author fs
|
|
|
+ * @date 2025-12-02
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/qw/luckyBag")
|
|
|
+public class LuckyBagController extends BaseController
|
|
|
+{
|
|
|
+ @Autowired
|
|
|
+ private ILuckyBagService luckyBagService;
|
|
|
+ @Autowired
|
|
|
+ private TenantInfoMapper tenantInfoMapper;
|
|
|
+
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo list(LuckyBag reward, @RequestParam(required = false) Long companyId)
|
|
|
+ {
|
|
|
+ if (companyId != null) {
|
|
|
+ reward.setCompanyId(String.valueOf(companyId));
|
|
|
+ }
|
|
|
+ startPage();
|
|
|
+ List<LuckyBag> list = luckyBagService.selectLuckyBagList(reward);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/add")
|
|
|
+ public AjaxResult add(@RequestBody LuckyBag reward) {
|
|
|
+ return toAjax(luckyBagService.add(reward));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ public AjaxResult getInfo(@PathVariable("id") Long id)
|
|
|
+ {
|
|
|
+ LuckyBag reward = new LuckyBag();
|
|
|
+ reward.setId(id);
|
|
|
+ return AjaxResult.success(luckyBagService.selectLuckyBagList(reward));
|
|
|
+ }
|
|
|
+
|
|
|
+ @PutMapping
|
|
|
+ public AjaxResult edit(@RequestBody LuckyBag reward) {
|
|
|
+ return toAjax(luckyBagService.updateLuckyBag(reward));
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
+ {
|
|
|
+ return toAjax(luckyBagService.deleteLuckyBagByIds(ids));
|
|
|
+ }
|
|
|
+}
|