فهرست منبع

红娘审核管理端

caojp 1 ماه پیش
والد
کامیت
9a6f308c78

+ 3 - 0
marriageAdmin-vue/src/config/api.js

@@ -37,6 +37,9 @@ export const API_ENDPOINTS = {
   MATCHMAKER_UPDATE: '/api/matchmaker/update',
   MATCHMAKER_DELETE: '/api/matchmaker/delete',
   MATCHMAKER_STATS: '/api/matchmaker/stats',
+  MATCHMAKER_AUDIT_LIST: '/admin/marr-apply/list',
+  MATCHMAKER_AUDIT_APPROVE: '/admin/marr-apply/approve',
+  MATCHMAKER_AUDIT_DELETE: '/admin/marr-apply/delete',
   
   // 课程管理
   COURSE_LIST: '/api/course/list',

+ 1 - 0
marriageAdmin-vue/src/layouts/MainLayout.vue

@@ -49,6 +49,7 @@
             <span>红娘管理</span>
           </template>
           <el-menu-item index="/matchmaker/list">红娘列表</el-menu-item>
+          <el-menu-item index="/matchmaker/audit">红娘审核</el-menu-item>
           <el-menu-item index="/matchmaker/create">添加红娘</el-menu-item>
         </el-sub-menu>
         

+ 6 - 0
marriageAdmin-vue/src/router/index.js

@@ -85,6 +85,12 @@ const router = createRouter({
               component: () => import('@/views/matchmaker/MatchmakerList.vue'),
               meta: { title: '红娘列表' }
             },
+            {
+              path: 'audit',
+              name: 'MatchmakerAudit',
+              component: () => import('@/views/matchmaker/MatchmakerAudit.vue'),
+              meta: { title: '红娘审核' }
+            },
             {
               path: 'create',
               name: 'MatchmakerCreate',

+ 81 - 0
service/admin/src/main/java/com/zhentao/controller/MarrApplyControllor.java

@@ -0,0 +1,81 @@
+package com.zhentao.controller;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.zhentao.common.Result;
+import com.zhentao.entity.MarrApply;
+import com.zhentao.service.MarrApplyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 红娘申请审核
+ */
+@RestController
+@RequestMapping("/admin/marr-apply")
+@CrossOrigin(origins = "*")
+public class MarrApplyControllor {
+
+    @Autowired
+    private MarrApplyService marrApplyService;
+
+    /**
+     * 红娘申请列表(可按姓名/手机号模糊查询,按创建时间倒序)
+     */
+    @GetMapping("/list")
+    public Result<Map<String, Object>> list(@RequestParam(defaultValue = "1") Integer page,
+                                            @RequestParam(defaultValue = "10") Integer pageSize,
+                                            @RequestParam(required = false) String name,
+                                            @RequestParam(required = false) String phone) {
+        try {
+            Page<MarrApply> pageData = marrApplyService.pageQuery(page, pageSize, name, phone);
+            Map<String, Object> data = new HashMap<>();
+            data.put("list", pageData.getRecords());
+            data.put("total", pageData.getTotal());
+            data.put("page", page);
+            data.put("pageSize", pageSize);
+            return Result.success(data);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("查询红娘申请失败:" + e.getMessage());
+        }
+    }
+
+    /**
+     * 审核通过:更新用户isMatchmaker为1
+     */
+    @PostMapping("/approve/{applyId}")
+    public Result<String> approve(@PathVariable Long applyId, @RequestParam Integer userId) {
+        try {
+            boolean success = marrApplyService.approve(applyId, userId);
+            if (success) {
+                return Result.success("审核通过成功");
+            } else {
+                return Result.error("审核通过失败");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("审核通过失败:" + e.getMessage());
+        }
+    }
+
+    /**
+     * 删除申请
+     */
+    @DeleteMapping("/delete/{applyId}")
+    public Result<String> delete(@PathVariable Long applyId) {
+        try {
+            boolean success = marrApplyService.delete(applyId);
+            if (success) {
+                return Result.success("删除成功");
+            } else {
+                return Result.error("删除失败");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return Result.error("删除失败:" + e.getMessage());
+        }
+    }
+}

+ 6 - 0
service/admin/src/main/java/com/zhentao/entity/Users.java

@@ -58,6 +58,12 @@ public class Users implements Serializable {
     @TableField("has_wechat_login")
     private Integer hasWechatLogin;
     
+    /**
+     * 是否为红娘 0-否 1-是
+     */
+    @TableField("is_matchmaker")
+    private Integer isMatchmaker;
+    
     // 计算年龄(从生日计算)
     @TableField(exist = false)
     private Integer age;