Преглед изворни кода

小程序会员标签管理

xgb пре 1 месец
родитељ
комит
ef51f5d4b5

+ 95 - 0
fs-admin/src/main/java/com/fs/his/controller/CompanyTagController.java

@@ -0,0 +1,95 @@
+package com.fs.his.controller;
+
+import java.util.List;
+
+import com.fs.company.domain.CompanyTag;
+import com.fs.company.service.ICompanyTagService;
+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.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 小程序会员标签Controller
+ *
+ * @author fs
+ * @date 2025-10-09
+ */
+@RestController
+@RequestMapping("/his/userTag")
+public class CompanyTagController extends BaseController
+{
+    @Autowired
+    private ICompanyTagService companyTagService;
+
+    /**
+     * 查询小程序会员标签列表
+     */
+    @PreAuthorize("@ss.hasPermi('tag:tag:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyTag companyTag)
+    {
+        startPage();
+        List<CompanyTag> list = companyTagService.selectCompanyTagList(companyTag);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取小程序会员标签详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('tag:tag:query')")
+    @GetMapping(value = "/{tagId}")
+    public AjaxResult getInfo(@PathVariable("tagId") Long tagId)
+    {
+        return AjaxResult.success(companyTagService.selectCompanyTagById(tagId));
+    }
+
+
+    /**
+     * 新增小程序会员标签
+     */
+    @PreAuthorize("@ss.hasPermi('tag:tag:add')")
+    @Log(title = "小程序会员标签", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CompanyTag companyTag)
+    {
+        return toAjax(companyTagService.insertCompanyTag(companyTag));
+    }
+
+    /**
+     * 修改小程序会员标签
+     */
+    @PreAuthorize("@ss.hasPermi('tag:tag:edit')")
+    @Log(title = "小程序会员标签", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CompanyTag companyTag)
+    {
+        return toAjax(companyTagService.updateCompanyTag(companyTag));
+    }
+
+    /**
+     * 删除小程序会员标签
+     */
+    @PreAuthorize("@ss.hasPermi('tag:tag:remove')")
+    @Log(title = "小程序会员标签", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{tagIds}")
+    public AjaxResult remove(@PathVariable Long[] tagIds)
+    {
+        if(companyTagService.deleteCompanyTagByIds(tagIds)<=0){
+            throw new RuntimeException("删除失败");
+        }
+        return AjaxResult.success();
+    }
+}

+ 88 - 0
fs-company/src/main/java/com/fs/company/controller/company/CompanyTagController.java

@@ -0,0 +1,88 @@
+package com.fs.company.controller.company;
+
+import com.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.core.page.TableDataInfo;
+import com.fs.common.enums.BusinessType;
+import com.fs.company.domain.CompanyTag;
+import com.fs.company.service.ICompanyTagService;
+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 fs
+ * @date 2025-10-09
+ */
+@RestController
+@RequestMapping("/his/userTag")
+public class CompanyTagController extends BaseController
+{
+    @Autowired
+    private ICompanyTagService companyTagService;
+
+    /**
+     * 查询小程序会员标签列表
+     */
+    @PreAuthorize("@ss.hasPermi('tag:tag:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CompanyTag companyTag)
+    {
+        startPage();
+        List<CompanyTag> list = companyTagService.selectCompanyTagList(companyTag);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取小程序会员标签详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('tag:tag:query')")
+    @GetMapping(value = "/{tagId}")
+    public AjaxResult getInfo(@PathVariable("tagId") Long tagId)
+    {
+        return AjaxResult.success(companyTagService.selectCompanyTagById(tagId));
+    }
+
+
+    /**
+     * 新增小程序会员标签
+     */
+    @PreAuthorize("@ss.hasPermi('tag:tag:add')")
+    @Log(title = "小程序会员标签", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CompanyTag companyTag)
+    {
+        return toAjax(companyTagService.insertCompanyTag(companyTag));
+    }
+
+    /**
+     * 修改小程序会员标签
+     */
+    @PreAuthorize("@ss.hasPermi('tag:tag:edit')")
+    @Log(title = "小程序会员标签", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CompanyTag companyTag)
+    {
+        return toAjax(companyTagService.updateCompanyTag(companyTag));
+    }
+
+    /**
+     * 删除小程序会员标签
+     */
+    @PreAuthorize("@ss.hasPermi('tag:tag:remove')")
+    @Log(title = "小程序会员标签", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{tagIds}")
+    public AjaxResult remove(@PathVariable Long[] tagIds)
+    {
+        if(companyTagService.deleteCompanyTagByIds(tagIds)<=0){
+            throw new RuntimeException("删除失败");
+        }
+        return AjaxResult.success();
+    }
+}