Browse Source

优化目录

tsurumure 7 months ago
parent
commit
452329c461

+ 94 - 95
db/sys_user_role_permission.sql

@@ -36,27 +36,27 @@ INSERT INTO sys_user_role_permission(id, parent_id, permission_name, sort) VALUE
         ('35.1', '35', 'AI模特-运营权限', null),
         ('35.1', '35', 'AI模特-运营权限', null),
 
 
     ('3', -1, '系统用户管理', 900),
     ('3', -1, '系统用户管理', 900),
-        ('3.1', '3', '系统用户-列表 (在线的)', null),
-        ('3.2', '3', '系统用户-列表', null),
+        ('3.1', '3', '系统用户列表 (在线的)', null),
+        ('3.2', '3', '系统用户列表', null),
             ('3.2.1', '3.2', '查询用户信息', null),
             ('3.2.1', '3.2', '查询用户信息', null),
-                ('3.2.1.2', '3.2', '查询他人信息', null),
-            ('3.2.2', '3.2', '创建系统用户', null),
-            ('3.2.3', '3.2', '编辑系统用户', null),
-                ('3.2.3.2', '3.2', '编辑他人系统用户信息', null),
-                ('3.2.3.3', '3.2', '编辑系统用户密码', null),
-                ('3.2.3.4', '3.2', '重置系统用户密码', null),
-            ('3.2.4', '3.2', '删除系统用户', null),
-            ('3.2.5', '3.2', '删除系统用户(批量)', null),
-            ('3.2.6', '3.2', '审核系统用户', null),
-            ('3.2.7', '3.2', '踢出系统用户', null),
-        ('3.3', '3', '系统用户积分', null),
-            ('3.3.8', '3.3', '系统用户-操作积分', null),
-            ('3.3.9', '3.3', '系统用户-查询积分', null),
-            ('3.3.10', '3.3', '系统用户-查询积分操作记录', null),
-        ('3.4', '3', '系统用户权限', null),
+                ('3.2.1.2', '3.2', '查询他人用户信息', null),
+            ('3.2.2', '3.2', '创建用户', null),
+            ('3.2.3', '3.2', '编辑用户', null),
+                ('3.2.3.2', '3.2', '编辑他人用户信息', null),
+                ('3.2.3.3', '3.2', '编辑用户密码', null),
+                ('3.2.3.4', '3.2', '重置用户密码', null),
+            ('3.2.4', '3.2', '删除用户', null),
+            ('3.2.5', '3.2', '删除用户(批量)', null),
+            ('3.2.6', '3.2', '审核用户', null),
+            ('3.2.7', '3.2', '踢出用户', null),
+        ('3.3', '3', '系统用户积分列表', null),
+            ('3.3.8', '3.3', '操作用户积分', null),
+            ('3.3.9', '3.3', '查询用户积分', null),
+            ('3.3.10', '3.3', '查询用户积分操作记录', null),
+        ('3.4', '3', '系统用户权限列表', null),
             ('3.4.1', '3.4', '查询用户权限', null),
             ('3.4.1', '3.4', '查询用户权限', null),
             ('3.4.1.2', '3.4', '查询他人用户权限', null),
             ('3.4.1.2', '3.4', '查询他人用户权限', null),
-        ('3.5', '3', '系统用户菜', null),
+        ('3.5', '3', '系统用户菜列表', null),
             ('3.5.1', '3.5', '查询用户菜单', null),
             ('3.5.1', '3.5', '查询用户菜单', null),
             ('3.5.1.2', '3.5', '查询他人用户菜单', null),
             ('3.5.1.2', '3.5', '查询他人用户菜单', null),
         -- ('3.3', '3', '会员用户-列表'),
         -- ('3.3', '3', '会员用户-列表'),
@@ -69,20 +69,20 @@ INSERT INTO sys_user_role_permission(id, parent_id, permission_name, sort) VALUE
         --     ('3.3.7', '3.3', '会员用户-审核'),
         --     ('3.3.7', '3.3', '会员用户-审核'),
 
 
     ('4', -1, '系统角色管理', 901),
     ('4', -1, '系统角色管理', 901),
-        ('4.1', '4', '系统角色-列表', null),
-            ('4.1.1', '4.1', '系统角色-详情', null),
-            ('4.1.2', '4.1', '系统角色-创建', null),
-            ('4.1.3', '4.1', '系统角色-编辑', null),
-            ('4.1.4', '4.1', '系统角色-删除', null),
-            ('4.1.5', '4.1', '系统角色-权限列表', null),
-        ('4.3', '4', '系统菜单-列表', null),
-            ('4.3.1', '4.3', '系统菜单-详情', null),
-            ('4.3.2', '4.3', '系统菜单-创建', null),
-            ('4.3.3', '4.3', '系统菜单-编辑', null),
-            ('4.3.4', '4.3', '系统菜单-删除', null),
+        ('4.1', '4', '系统角色列表', null),
+            ('4.1.1', '4.1', '角色详情', null),
+            ('4.1.2', '4.1', '创建角色', null),
+            ('4.1.3', '4.1', '编辑角色', null),
+            ('4.1.4', '4.1', '删除角色', null),
+            ('4.1.5', '4.1', '角色权限列表', null),
+        ('4.3', '4', '系统菜单列表', null),
+            ('4.3.1', '4.3', '菜单详情', null),
+            ('4.3.2', '4.3', '创建菜单', null),
+            ('4.3.3', '4.3', '编辑菜单', null),
+            ('4.3.4', '4.3', '删除菜单', null),
 
 
     ('5', -1, '系统日志管理', 901),
     ('5', -1, '系统日志管理', 901),
-        ('5.1', '5', '系统日志-列表', null),
+        ('5.1', '5', '系统日志列表', null),
 
 
     ('10', -1, '内容管理', null),
     ('10', -1, '内容管理', null),
         ('10.1', '10', '幻灯片列表', null),
         ('10.1', '10', '幻灯片列表', null),
@@ -102,82 +102,81 @@ INSERT INTO sys_user_role_permission(id, parent_id, permission_name, sort) VALUE
             ('10.3.4', '10.3', '删除资讯', null),
             ('10.3.4', '10.3', '删除资讯', null),
 
 
     -- ('11', -1, '商品管理', null),
     -- ('11', -1, '商品管理', null),
-    --     ('11.1', '11', '商品-列表', null),
-    --         ('11.1.1', '11.1', '商品-详情', null),
-    --         ('11.1.2', '11.1', '商品-创建', null),
-    --         ('11.1.3', '11.1', '商品-编辑', null),
-    --         ('11.1.4', '11.1', '商品-删除', null),
-    --     ('11.2', '11', '商品分类-列表', null),
-    --         ('11.2.1', '11.2', '商品分类-详情', null),
-    --         ('11.2.2', '11.2', '商品分类-创建', null),
-    --         ('11.2.3', '11.2', '商品分类-编辑', null),
-    --         ('11.2.4', '11.2', '商品分类-删除', null),
-    --     ('11.3', '11', '商品品牌-列表', null),
-    --         ('11.3.1', '11.3', '商品品牌-详情', null),
-    --         ('11.3.2', '11.3', '商品品牌-创建', null),
-    --         ('11.3.3', '11.3', '商品品牌-编辑', null),
-    --         ('11.3.4', '11.3', '商品品牌-删除', null),
-    --     ('11.4', '11', '商品单位-列表', null),
-    --         ('11.4.1', '11.4', '商品单位-详情', null),
-    --         ('11.4.2', '11.4', '商品单位-创建', null),
-    --         ('11.4.3', '11.4', '商品单位-编辑', null),
-    --         ('11.4.4', '11.4', '商品单位-删除', null),
-    --     ('11.5', '11', '商品规格-列表', null),
-    --         ('11.5.1', '11.5', '商品规格-详情', null),
-    --         ('11.5.2', '11.5', '商品规格-创建', null),
-    --         ('11.5.3', '11.5', '商品规格-编辑', null),
-    --         ('11.5.4', '11.5', '商品规格-删除', null),
-    --     ('11.6', '11', '商品规格SKU-列表', null),
-    --         ('11.6.1', '11.6', '商品规格SKU-详情', null),
-    --         ('11.6.2', '11.6', '商品规格SKU-创建', null),
-    --         ('11.6.3', '11.6', '商品规格SKU-编辑', null),
-    --         ('11.6.4', '11.6', '商品规格SKU-删除', null),
-    -- ('12', -1, '内容管理', null),
-    --     ('12.1', '12', '内容-列表', null),
-    --     ('12.2', '12', '内容-详情', null),
-    --     ('12.3', '12', '内容-编辑', null),
+    --     ('11.1', '11', '商品列表', null),
+    --         ('11.1.1', '11.1', '商品详情', null),
+    --         ('11.1.2', '11.1', '创建商品', null),
+    --         ('11.1.3', '11.1', '编辑商品', null),
+    --         ('11.1.4', '11.1', '删除商品', null),
+    --     ('11.2', '11', '商品分类列表', null),
+    --         ('11.2.1', '11.2', '商品分类详情', null),
+    --         ('11.2.2', '11.2', '创建商品分类', null),
+    --         ('11.2.3', '11.2', '编辑商品分类', null),
+    --         ('11.2.4', '11.2', '删除商品分类', null),
+    --     ('11.3', '11', '商品品牌列表', null),
+    --         ('11.3.1', '11.3', '商品品牌详情', null),
+    --         ('11.3.2', '11.3', '创建商品品牌', null),
+    --         ('11.3.3', '11.3', '编辑商品品牌', null),
+    --         ('11.3.4', '11.3', '删除商品品牌', null),
+    --     ('11.4', '11', '商品单位列表', null),
+    --         ('11.4.1', '11.4', '商品单位详情', null),
+    --         ('11.4.2', '11.4', '创建商品单位', null),
+    --         ('11.4.3', '11.4', '编辑商品单位', null),
+    --         ('11.4.4', '11.4', '删除商品单位', null),
+    --     ('11.5', '11', '商品规格列表', null),
+    --         ('11.5.1', '11.5', '商品规格详情', null),
+    --         ('11.5.2', '11.5', '创建商品规格', null),
+    --         ('11.5.3', '11.5', '编辑商品规格', null),
+    --         ('11.5.4', '11.5', '删除商品规格', null),
+    --     ('11.6', '11', '商品规格SKU列表', null),
+    --         ('11.6.1', '11.6', '商品规格SKU详情', null),
+    --         ('11.6.2', '11.6', '创建商品规格SKU', null),
+    --         ('11.6.3', '11.6', '编辑商品规格SKU', null),
+    --         ('11.6.4', '11.6', '删除商品规格SKU', null),
+    -- ('12', -1, '单页管理', null),
+    --     ('12.1', '12', '单页列表', null),
+    --     ('12.2', '12', '单页详情', null),
+    --     ('12.3', '12', '编辑单页', null),
 
 
     ('13', -1, '站点管理', null),
     ('13', -1, '站点管理', null),
-        ('13.1', '13', '站点-编辑', null),
+        ('13.1', '13', '编辑站点信息', null),
 
 
     ('14', -1, '导航菜单', null),
     ('14', -1, '导航菜单', null),
-        ('14.3', '14', '导航-列表', null),
-            ('14.3.1', '14.3', '导航-详情', null),
-            ('14.3.2', '14.3', '导航创建', null),
-            ('14.3.3', '14.3', '导航-编辑', null),
-            ('14.3.4', '14.3', '导航-删除', null),
+        ('14.3', '14', '导航列表', null),
+            ('14.3.1', '14.3', '导航详情', null),
+            ('14.3.2', '14.3', '创建导航', null),
+            ('14.3.3', '14.3', '编辑导航', null),
+            ('14.3.4', '14.3', '删除导航', null),
 
 
     ('20', -1, '素材管理', null),
     ('20', -1, '素材管理', null),
         ('20.1', '20', '素材列表', null),
         ('20.1', '20', '素材列表', null),
             ('20.1.1', '20.1', '素材中心', null),
             ('20.1.1', '20.1', '素材中心', null),
-            ('20.1.2', '20.1', '素材列表-详情', null),
-            ('20.1.3', '20.1', '素材列表-创建', null),
-            ('20.1.4', '20.1', '素材列表-编辑', null),
-            ('20.1.5', '20.1', '素材列表-审核', null),
-            ('20.1.6', '20.1', '素材列表-删除', null),
-        ('20.2', '20', '素材分类', null),
-            ('20.2.1', '20.2', '素材分类-详情', null),
-            ('20.2.2', '20.2', '素材分类-创建', null),
-            ('20.2.3', '20.2', '素材分类-编辑', null),
-            ('20.2.4', '20.2', '素材分类-删除', null),
-        ('20.3', '20', '素材中心', null),
+            ('20.1.2', '20.1', '素材列表详情', null),
+            ('20.1.3', '20.1', '创建素材', null),
+            ('20.1.4', '20.1', '编辑素材', null),
+            ('20.1.5', '20.1', '审核素材', null),
+            ('20.1.6', '20.1', '删除素材', null),
+        ('20.2', '20', '素材分类列表', null),
+            ('20.2.1', '20.2', '素材分类详情', null),
+            ('20.2.2', '20.2', '创建素材分类', null),
+            ('20.2.3', '20.2', '编辑素材分类', null),
+            ('20.2.4', '20.2', '删除素材分类', null),
 
 
     ('21', -1, '个人中心', null),
     ('21', -1, '个人中心', null),
         ('21.1', '21', '我的素材', null),
         ('21.1', '21', '我的素材', null),
-            ('21.1.1', '21.1', '我的素材-详情', null),
-            ('21.1.2', '21.1', '我的素材-加入 (从素材中心)', null),
-            ('21.1.3', '21.1', '我的素材-分享 (到素材列表)', null),
-            ('21.1.4', '21.1', '我的素材-创建', null),
-            ('21.1.5', '21.1', '我的素材-编辑', null),
-            ('21.1.6', '21.1', '我的素材-删除', null),
+            ('21.1.1', '21.1', '我的素材详情', null),
+            ('21.1.2', '21.1', '加入我的素材 (从素材中心)', null),
+            ('21.1.3', '21.1', '分享我的素材 (到素材列表)', null),
+            ('21.1.4', '21.1', '创建我的素材', null),
+            ('21.1.5', '21.1', '编辑我的素材', null),
+            ('21.1.6', '21.1', '删除我的素材', null),
         ('21.2', '21', '我的作品', null),
         ('21.2', '21', '我的作品', null),
-            ('21.2.1', '21.2', '我的作品-详情', null),
-            ('21.2.2', '21.2', '我的作品-创建', null),
-            ('21.2.3', '21.2', '我的作品-编辑', null),
-            ('21.2.4', '21.2', '我的作品-删除', null),
+            ('21.2.1', '21.2', '我的作品详情', null),
+            ('21.2.2', '21.2', '创建我的作品', null),
+            ('21.2.3', '21.2', '编辑我的作品', null),
+            ('21.2.4', '21.2', '删除我的作品', null),
         ('21.3', '21', '我的草稿', null),
         ('21.3', '21', '我的草稿', null),
-            ('21.3.1', '21.3', '我的草稿-详情', null),
-            ('21.3.2', '21.3', '我的草稿-创建', null),
-            ('21.3.3', '21.3', '我的草稿-编辑', null),
-            ('21.3.4', '21.3', '我的草稿-删除', null)
+            ('21.3.1', '21.3', '我的草稿详情', null),
+            ('21.3.2', '21.3', '创建我的草稿', null),
+            ('21.3.3', '21.3', '编辑我的草稿', null),
+            ('21.3.4', '21.3', '删除我的草稿', null)
 ;
 ;

+ 0 - 1
db/sys_user_role_permission_relation.sql

@@ -78,7 +78,6 @@ INSERT INTO sys_user_role_permission_relation(role_id, permission_id) VALUES
             (1, '20.1.1'), (1, '20.1.2'), (1, '20.1.3'), (1, '20.1.4'), (1, '20.1.5'), (1, '20.1.6'),
             (1, '20.1.1'), (1, '20.1.2'), (1, '20.1.3'), (1, '20.1.4'), (1, '20.1.5'), (1, '20.1.6'),
         (1, '20.2'),
         (1, '20.2'),
             (1, '20.2.1'), (1, '20.2.2'), (1, '20.2.3'), (1, '20.2.4'),
             (1, '20.2.1'), (1, '20.2.2'), (1, '20.2.3'), (1, '20.2.4'),
-        (1, '20.3'),
 
 
     (1, '21'),
     (1, '21'),
         (1, '21.1'),
         (1, '21.1'),

+ 65 - 65
src/main/java/com/backendsys/controller/Systems/SysAgreementController.java

@@ -1,65 +1,65 @@
-package com.backendsys.controller.Systems;
-
-import cn.hutool.core.util.StrUtil;
-import com.backendsys.entity.PageDTO;
-import com.backendsys.entity.System.SysAgreementDTO;
-import com.backendsys.service.System.SysAgreementService;
-import com.backendsys.utils.response.Result;
-import jakarta.servlet.http.HttpServletResponse;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.Map;
-
-@Validated
-@RestController
-public class SysAgreementController {
-
-    @Autowired
-    private SysAgreementService sysAgreementService;
-
-
-    @GetMapping("/api/public/system/getAgreementView")
-    public String getAgreementView(HttpServletResponse response, @RequestParam(name = "tag", required = false) String tag) {
-
-        // 校验
-        if (StrUtil.isEmpty(tag)) return "tag 参数不能为空";
-        Map<String, Object> detail = sysAgreementService.querySysAgreementByTag(tag);
-        if (detail == null) return "找不到内容";
-
-        String title = (String) detail.get("title");
-        String content = (String) detail.get("content");
-
-        // 设置响应的类型为 text/html,这样浏览器就知道接收到的是 HTML 内容
-        response.setContentType("text/html;charset=UTF-8");
-
-        // 直接返回 HTML 字符串
-        return "<html>" +
-                "<head><title>" + title + "</title></head>" +
-                "<body>" +
-                content +
-                "</body>" +
-                "</html>";
-
-    }
-
-    /**
-     * 获得协议
-     */
-    @GetMapping("/api/public/system/getAgreement")
-    public Result getUser(@Validated PageDTO pageDTO, @Validated(SysAgreementDTO.List.class) SysAgreementDTO sysAgreementDTO) {
-        return Result.success(sysAgreementService.querySysAgreement(pageDTO.getPage_num(), pageDTO.getPage_size(), sysAgreementDTO));
-    }
-
-    /**
-     * 获得协议详情
-     */
-    @GetMapping("/api/public/system/getAgreementByTag")
-    public Result getUser(@Validated(SysAgreementDTO.Detail.class) SysAgreementDTO sysAgreementDTO) {
-        return Result.success(sysAgreementService.querySysAgreementByTag(sysAgreementDTO.getTag()));
-    }
-
-}
+//package com.backendsys.controller.Systems;
+//
+//import cn.hutool.core.util.StrUtil;
+//import com.backendsys.entity.PageDTO;
+//import com.backendsys.entity.System.SysAgreementDTO;
+//import com.backendsys.service.System.SysAgreementService;
+//import com.backendsys.utils.response.Result;
+//import jakarta.servlet.http.HttpServletResponse;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.validation.annotation.Validated;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RequestParam;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.util.Map;
+//
+//@Validated
+//@RestController
+//public class SysAgreementController {
+//
+//    @Autowired
+//    private SysAgreementService sysAgreementService;
+//
+//
+//    @GetMapping("/api/public/system/getAgreementView")
+//    public String getAgreementView(HttpServletResponse response, @RequestParam(name = "tag", required = false) String tag) {
+//
+//        // 校验
+//        if (StrUtil.isEmpty(tag)) return "tag 参数不能为空";
+//        Map<String, Object> detail = sysAgreementService.querySysAgreementByTag(tag);
+//        if (detail == null) return "找不到内容";
+//
+//        String title = (String) detail.get("title");
+//        String content = (String) detail.get("content");
+//
+//        // 设置响应的类型为 text/html,这样浏览器就知道接收到的是 HTML 内容
+//        response.setContentType("text/html;charset=UTF-8");
+//
+//        // 直接返回 HTML 字符串
+//        return "<html>" +
+//                "<head><title>" + title + "</title></head>" +
+//                "<body>" +
+//                content +
+//                "</body>" +
+//                "</html>";
+//
+//    }
+//
+//    /**
+//     * 获得协议
+//     */
+//    @GetMapping("/api/public/system/getAgreement")
+//    public Result getUser(@Validated PageDTO pageDTO, @Validated(SysAgreementDTO.List.class) SysAgreementDTO sysAgreementDTO) {
+//        return Result.success(sysAgreementService.querySysAgreement(pageDTO.getPage_num(), pageDTO.getPage_size(), sysAgreementDTO));
+//    }
+//
+//    /**
+//     * 获得协议详情
+//     */
+//    @GetMapping("/api/public/system/getAgreementByTag")
+//    public Result getUser(@Validated(SysAgreementDTO.Detail.class) SysAgreementDTO sysAgreementDTO) {
+//        return Result.success(sysAgreementService.querySysAgreementByTag(sysAgreementDTO.getTag()));
+//    }
+//
+//}

+ 0 - 21
src/main/java/com/backendsys/controller/TestAuthController.java

@@ -1,21 +0,0 @@
-package com.backendsys.controller;
-
-import com.backendsys.modules.common.config.security.utils.TokenUtil;
-import io.jsonwebtoken.Claims;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-@RequestMapping("/api/testAuth")
-public class TestAuthController {
-    @Autowired
-    private TokenUtil tokenUtil;
-
-    @GetMapping("testGetLoginUser")
-    public Claims testGetSystemUser() {
-        System.out.println("testGetSystemUser:");
-        return tokenUtil.getRedisTokenInfo();
-    }
-}

+ 59 - 59
src/main/java/com/backendsys/controller/WebsocketController.java

@@ -1,59 +1,59 @@
-package com.backendsys.controller;
-
-import lombok.RequiredArgsConstructor;
-import org.springframework.messaging.handler.annotation.DestinationVariable;
-import org.springframework.messaging.handler.annotation.MessageMapping;
-import org.springframework.messaging.handler.annotation.SendTo;
-import org.springframework.messaging.simp.SimpMessagingTemplate;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.security.Principal;
-import java.util.LinkedHashMap;
-
-@RestController
-@RequestMapping("/websocket")
-@RequiredArgsConstructor
-public class WebsocketController {
-
-    private final SimpMessagingTemplate messagingTemplate;
-
-    /**
-     * 广播发送消息
-     *
-     * @param message 消息内容
-     */
-    @MessageMapping("/sendToAll")
-    @SendTo("/topic/notice")
-    public String sendToAll(String message) {
-        return "(后端) 服务端通知: " + message;
-    }
-
-    /**
-     * 点对点发送消息
-     * <p>
-     * 模拟 张三 给 李四 发送消息场景
-     *
-     * @param principal 当前用户
-     * @param username  接收消息的用户
-     * @param message   消息内容
-     */
-    @MessageMapping("/sendToUser/{username}")
-    public void sendToUser(Principal principal, @DestinationVariable String username, String message) {
-
-        String sender = principal.getName(); // 发送人
-        String receiver = username; // 接收人
-
-        System.out.println("(后端) 发送人: " + sender);
-        System.out.println("(后端) 接收人: " + receiver);
-
-//        log.info("发送人:{}; 接收人:{}", sender, receiver);
-        // 发送消息给指定用户 /user/{username}/queue/greeting
-
-        LinkedHashMap<String, Object> messages = new LinkedHashMap<>(); // new ChatMessage(sender, message)
-        messages.put("sender", sender);
-        messages.put("message", message);
-        messagingTemplate.convertAndSendToUser(receiver, "/queue/greeting", messages);
-
-    }
-}
+//package com.backendsys.controller;
+//
+//import lombok.RequiredArgsConstructor;
+//import org.springframework.messaging.handler.annotation.DestinationVariable;
+//import org.springframework.messaging.handler.annotation.MessageMapping;
+//import org.springframework.messaging.handler.annotation.SendTo;
+//import org.springframework.messaging.simp.SimpMessagingTemplate;
+//import org.springframework.web.bind.annotation.RequestMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.security.Principal;
+//import java.util.LinkedHashMap;
+//
+//@RestController
+//@RequestMapping("/websocket")
+//@RequiredArgsConstructor
+//public class WebsocketController {
+//
+//    private final SimpMessagingTemplate messagingTemplate;
+//
+//    /**
+//     * 广播发送消息
+//     *
+//     * @param message 消息内容
+//     */
+//    @MessageMapping("/sendToAll")
+//    @SendTo("/topic/notice")
+//    public String sendToAll(String message) {
+//        return "(后端) 服务端通知: " + message;
+//    }
+//
+//    /**
+//     * 点对点发送消息
+//     * <p>
+//     * 模拟 张三 给 李四 发送消息场景
+//     *
+//     * @param principal 当前用户
+//     * @param username  接收消息的用户
+//     * @param message   消息内容
+//     */
+//    @MessageMapping("/sendToUser/{username}")
+//    public void sendToUser(Principal principal, @DestinationVariable String username, String message) {
+//
+//        String sender = principal.getName(); // 发送人
+//        String receiver = username; // 接收人
+//
+//        System.out.println("(后端) 发送人: " + sender);
+//        System.out.println("(后端) 接收人: " + receiver);
+//
+////        log.info("发送人:{}; 接收人:{}", sender, receiver);
+//        // 发送消息给指定用户 /user/{username}/queue/greeting
+//
+//        LinkedHashMap<String, Object> messages = new LinkedHashMap<>(); // new ChatMessage(sender, message)
+//        messages.put("sender", sender);
+//        messages.put("message", message);
+//        messagingTemplate.convertAndSendToUser(receiver, "/queue/greeting", messages);
+//
+//    }
+//}

+ 12 - 12
src/main/java/com/backendsys/mapper/System/SysMobileAreaCodeMapper.java

@@ -1,12 +1,12 @@
-package com.backendsys.mapper.System;
-
-import com.backendsys.entity.System.SysMobileAreaCodeDTO;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface SysMobileAreaCodeMapper {
-    List<Map<String, Object>> queryMobileAreaCodeList(SysMobileAreaCodeDTO sysMobileAreaCodeDTO);
-}
+//package com.backendsys.mapper.System;
+//
+//import com.backendsys.entity.System.SysMobileAreaCodeDTO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Mapper
+//public interface SysMobileAreaCodeMapper {
+//    List<Map<String, Object>> queryMobileAreaCodeList(SysMobileAreaCodeDTO sysMobileAreaCodeDTO);
+//}

+ 32 - 32
src/main/java/com/backendsys/mapper/System/SysMobileAreaCodeMapper.xml

@@ -1,34 +1,34 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.backendsys.mapper.System.SysMobileAreaCodeMapper">
+<!--<?xml version="1.0" encoding="utf-8" ?>-->
+<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >-->
+<!--<mapper namespace="com.backendsys.mapper.System.SysMobileAreaCodeMapper">-->
 
 
-    <sql id="includeMobileAreaCode">
-        id,
-        area_name,
-        COALESCE(area_name_abbr, '') area_name_abbr,
-        area_code
-    </sql>
-    <resultMap id="resultMapMobileAreaCode" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT" />
-        <result property="area_name" column="area_name" />
-        <result property="area_name_abbr" column="area_name_abbr" />
-        <result property="area_code" column="area_code" javaType="java.lang.Integer" />
-    </resultMap>
-    <!-- 查询 列表 -->
-    <select id="queryMobileAreaCodeList" resultMap="resultMapMobileAreaCode">
-        SELECT <include refid="includeMobileAreaCode" />
-        FROM sys_mobile_area_code
-        <where>
-            <if test="area_name != null and area_name != ''">
-                AND area_name = #{area_name}
-            </if>
-            <if test="area_name_abbr != null and area_name_abbr != ''">
-                AND area_name_abbr = #{area_name_abbr}
-            </if>
-            <if test="area_code != null and area_code != ''">
-                AND area_code = #{area_code}
-            </if>
-        </where>
-    </select>
+<!--    <sql id="includeMobileAreaCode">-->
+<!--        id,-->
+<!--        area_name,-->
+<!--        COALESCE(area_name_abbr, '') area_name_abbr,-->
+<!--        area_code-->
+<!--    </sql>-->
+<!--    <resultMap id="resultMapMobileAreaCode" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT" />-->
+<!--        <result property="area_name" column="area_name" />-->
+<!--        <result property="area_name_abbr" column="area_name_abbr" />-->
+<!--        <result property="area_code" column="area_code" javaType="java.lang.Integer" />-->
+<!--    </resultMap>-->
+<!--    &lt;!&ndash; 查询 列表 &ndash;&gt;-->
+<!--    <select id="queryMobileAreaCodeList" resultMap="resultMapMobileAreaCode">-->
+<!--        SELECT <include refid="includeMobileAreaCode" />-->
+<!--        FROM sys_mobile_area_code-->
+<!--        <where>-->
+<!--            <if test="area_name != null and area_name != ''">-->
+<!--                AND area_name = #{area_name}-->
+<!--            </if>-->
+<!--            <if test="area_name_abbr != null and area_name_abbr != ''">-->
+<!--                AND area_name_abbr = #{area_name_abbr}-->
+<!--            </if>-->
+<!--            <if test="area_code != null and area_code != ''">-->
+<!--                AND area_code = #{area_code}-->
+<!--            </if>-->
+<!--        </where>-->
+<!--    </select>-->
 
 
-</mapper>
+<!--</mapper>-->

+ 1 - 1
src/main/java/com/backendsys/controller/TestController.java → src/main/java/com/backendsys/modules/TestController.java

@@ -1,4 +1,4 @@
-package com.backendsys.controller;
+package com.backendsys.modules;
 
 
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.core.util.IdUtil;
 import cn.hutool.json.JSONArray;
 import cn.hutool.json.JSONArray;

+ 1 - 1
src/main/java/com/backendsys/modules/common/config/security/filter/JwtAuthenticationFilter.java

@@ -110,7 +110,7 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
         // [Header][拦截] 从请求头中获取认证信息
         // [Header][拦截] 从请求头中获取认证信息
         final String authHeader = request.getHeader("Authorization");
         final String authHeader = request.getHeader("Authorization");
         if(authHeader == null || !authHeader.startsWith("Bearer ")) {
         if(authHeader == null || !authHeader.startsWith("Bearer ")) {
-            // [TOKEN_EMPTY_ERROR: 请先登录获取有效的Token]
+            // [TOKEN_EMPTY_ERROR: 请先登录获取有效的Token]
             handleError(response, ResultEnum.TOKEN_EMPTY_ERROR);
             handleError(response, ResultEnum.TOKEN_EMPTY_ERROR);
             return;
             return;
         }
         }

+ 1 - 1
src/main/java/com/backendsys/modules/common/utils/ResultEnum.java

@@ -17,7 +17,7 @@ public enum ResultEnum {
      * 用户权限枚举
      * 用户权限枚举
      */
      */
 
 
-    TOKEN_EMPTY_ERROR(401, "请先登录获取有效的Token"),
+    TOKEN_EMPTY_ERROR(401, "请先登录获取有效的Token"),
     INVALID_CREDENTIALS(402, "用户名或密码错误"),
     INVALID_CREDENTIALS(402, "用户名或密码错误"),
     LOCK_CREDENTIALS(4024, "错误次数过多,为账号安全,请等待1分钟后重新尝试"),
     LOCK_CREDENTIALS(4024, "错误次数过多,为账号安全,请等待1分钟后重新尝试"),
 
 

+ 67 - 0
src/main/java/com/backendsys/modules/system/controller/SysAgreementController.java

@@ -0,0 +1,67 @@
+//package com.backendsys.modules.system.controller;
+//
+//import cn.hutool.core.util.StrUtil;
+//import com.backendsys.entity.PageDTO;
+//import com.backendsys.entity.System.SysAgreementDTO;
+//import com.backendsys.modules.common.config.security.annotations.Anonymous;
+//import com.backendsys.service.System.SysAgreementService;
+//import com.backendsys.utils.response.Result;
+//import jakarta.servlet.http.HttpServletResponse;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.validation.annotation.Validated;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RequestParam;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.util.Map;
+//
+//@Validated
+//@RestController
+//public class SysAgreementController {
+//
+//    @Autowired
+//    private SysAgreementService sysAgreementService;
+//
+//
+//    @Anonymous
+//    @GetMapping("/api/system/getAgreementHtml")
+//    public String getAgreementView(HttpServletResponse response, @RequestParam(name = "tag", required = false) String tag) {
+//
+//        // 校验
+//        if (StrUtil.isEmpty(tag)) return "tag 参数不能为空";
+//        Map<String, Object> detail = sysAgreementService.querySysAgreementByTag(tag);
+//        if (detail == null) return "找不到内容";
+//
+//        String title = (String) detail.get("title");
+//        String content = (String) detail.get("content");
+//
+//        // 设置响应的类型为 text/html,这样浏览器就知道接收到的是 HTML 内容
+//        response.setContentType("text/html;charset=UTF-8");
+//
+//        // 直接返回 HTML 字符串
+//        return "<html>" +
+//                "<head><title>" + title + "</title></head>" +
+//                "<body>" +
+//                content +
+//                "</body>" +
+//                "</html>";
+//
+//    }
+//
+//    /**
+//     * 获得协议
+//     */
+//    @GetMapping("/api/public/system/getAgreement")
+//    public Result getUser(@Validated PageDTO pageDTO, @Validated(SysAgreementDTO.List.class) SysAgreementDTO sysAgreementDTO) {
+//        return Result.success(sysAgreementService.querySysAgreement(pageDTO.getPage_num(), pageDTO.getPage_size(), sysAgreementDTO));
+//    }
+//
+//    /**
+//     * 获得协议详情
+//     */
+//    @GetMapping("/api/public/system/getAgreementByTag")
+//    public Result getUser(@Validated(SysAgreementDTO.Detail.class) SysAgreementDTO sysAgreementDTO) {
+//        return Result.success(sysAgreementService.querySysAgreementByTag(sysAgreementDTO.getTag()));
+//    }
+//
+//}

+ 1 - 1
src/main/java/com/backendsys/utils/response/ResultEnum.java

@@ -16,7 +16,7 @@ public enum ResultEnum {
     /**
     /**
      * 用户权限枚举
      * 用户权限枚举
      */
      */
-    TOKEN_EMPTY_ERROR(401, "请先登录获取有效的Token"),
+    TOKEN_EMPTY_ERROR(401, "请先登录获取有效的Token"),
     INVALID_CREDENTIALS(402, "用户名或密码错误"),
     INVALID_CREDENTIALS(402, "用户名或密码错误"),
     LOCK_CREDENTIALS(4024, "错误次数过多,为账号安全,请等待1分钟后重新尝试"),
     LOCK_CREDENTIALS(4024, "错误次数过多,为账号安全,请等待1分钟后重新尝试"),