zhentao 2 weeks ago
parent
commit
7f97ae9a5a

+ 0 - 3
src/main/java/com/zhentao/groups/service/GroupsService.java

@@ -21,7 +21,4 @@ public interface GroupsService extends IService<Groupss> {
 //        添加人数
     Result AddGroupMembers(AddGroupMembers addGroupMembers);
 
-//    删除人数
-    Result DelGroupMembers(DelGroupMembers delGroupMembers);
-
 }

+ 5 - 18
src/main/java/com/zhentao/groups/service/impl/GroupsServiceImpl.java

@@ -4,16 +4,17 @@ import cn.hutool.core.util.IdUtil;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zhentao.groups.dto.AddGroupMembers;
 import com.zhentao.groups.dto.AddGroupsDto;
-import com.zhentao.groups.dto.DelGroupMembers;
 import com.zhentao.groups.mapper.GroupMembersMapper;
 import com.zhentao.groups.pojo.GroupMembers;
 import com.zhentao.groups.pojo.Groupss;
 import com.zhentao.groups.service.GroupMembersService;
 import com.zhentao.groups.service.GroupsService;
 import com.zhentao.groups.mapper.GroupsMapper;
-import com.zhentao.user.domain.UserShouye;
-import com.zhentao.user.mapper.UserShouyeMapper;
-import com.zhentao.user.service.UserShouyeService;
+import com.zhentao.shouye.domain.UserShouye;
+import com.zhentao.shouye.mapper.UserShouyeMapper;
+import com.zhentao.shouye.service.UserShouyeService;
+
+
 import com.zhentao.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -130,20 +131,6 @@ public class GroupsServiceImpl extends ServiceImpl<GroupsMapper, Groupss>
 
 
 
-//     删除人数
-    @Override
-    @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class, timeout = 30)
-    public Result DelGroupMembers(DelGroupMembers delGroupMembers) {
-
-
-
-
-
-        return null;
-    }
-
-
-
 
 
 

+ 0 - 6
src/main/java/com/zhentao/intercepoter/Userinterceptor.java

@@ -17,13 +17,7 @@ public class Userinterceptor implements HandlerInterceptor {
     private RedisTemplate<String,String> redisTemplate;
     @Override
     public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
-        String requestURI = request.getRequestURI();
-        if (requestURI.startsWith("/user/login")||requestURI.startsWith("/user/register")){
-            return true;
-        }
         String token = request.getHeader("token");
-        String userIdFromToken1 = TokenUtils.getUserIdFromToken(token);
-        redisTemplate.opsForValue().set("uid",userIdFromToken1);
         HandlerMethod handlerMethod = (HandlerMethod) handler;
         NullLogin annotation = handlerMethod.getMethod().getAnnotation(NullLogin.class);
         System.err.println("自定义注解"+annotation);

+ 2 - 2
src/main/java/com/zhentao/shouye/domain/UserShouye.java

@@ -1,11 +1,11 @@
 package com.zhentao.shouye.domain;
 
-import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import java.io.Serializable;
 
+import com.zhentao.groups.pojo.Groupss;
 import com.zhentao.user.domain.UserLogin;
 import lombok.Data;
 
@@ -49,7 +49,7 @@ public class UserShouye implements Serializable {
     @TableField(exist = false)
     private UserLogin userLogin;
     @TableField(exist = false)
-    private Groups groupss;
+    private Groupss groupss;
     @TableField(exist = false)
     private static final long serialVersionUID = 1L;
 }

+ 0 - 18
src/main/java/com/zhentao/shouye/mapper/GroupsMapper.java

@@ -1,18 +0,0 @@
-package com.zhentao.shouye.mapper;
-
-import com.zhentao.shouye.domain.Groups;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-
-/**
-* @author 86183
-* @description 针对表【groups(群组表)】的数据库操作Mapper
-* @createDate 2025-06-04 19:51:26
-* @Entity com.zhentao.shouye.domain.Groups
-*/
-public interface GroupsMapper extends BaseMapper<Groups> {
-
-}
-
-
-
-

+ 0 - 13
src/main/java/com/zhentao/shouye/service/GroupsService.java

@@ -1,13 +0,0 @@
-package com.zhentao.shouye.service;
-
-import com.zhentao.shouye.domain.Groups;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
-* @author 86183
-* @description 针对表【groups(群组表)】的数据库操作Service
-* @createDate 2025-06-04 19:51:26
-*/
-public interface GroupsService extends IService<Groups> {
-
-}

+ 0 - 22
src/main/java/com/zhentao/shouye/service/impl/GroupsServiceImpl.java

@@ -1,22 +0,0 @@
-package com.zhentao.shouye.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zhentao.shouye.domain.Groups;
-import com.zhentao.shouye.service.GroupsService;
-import com.zhentao.shouye.mapper.GroupsMapper;
-import org.springframework.stereotype.Service;
-
-/**
-* @author 86183
-* @description 针对表【groups(群组表)】的数据库操作Service实现
-* @createDate 2025-06-04 19:51:26
-*/
-@Service
-public class GroupsServiceImpl extends ServiceImpl<GroupsMapper, Groups>
-    implements GroupsService{
-
-}
-
-
-
-

+ 6 - 6
src/main/java/com/zhentao/shouye/service/impl/UserShouyeServiceImpl.java

@@ -2,10 +2,11 @@ package com.zhentao.shouye.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zhentao.shouye.domain.Groups;
+import com.zhentao.groups.mapper.GroupsMapper;
+import com.zhentao.groups.pojo.Groupss;
+import com.zhentao.groups.service.GroupsService;
 import com.zhentao.shouye.domain.UserShouye;
 import com.zhentao.shouye.dto.UserShouyeDto;
-import com.zhentao.shouye.service.GroupsService;
 import com.zhentao.shouye.service.UserShouyeService;
 import com.zhentao.shouye.mapper.UserShouyeMapper;
 import com.zhentao.user.domain.UserLogin;
@@ -14,7 +15,6 @@ import com.zhentao.vo.Result;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import javax.xml.ws.Action;
 import java.util.List;
 
 /**
@@ -28,7 +28,7 @@ public class UserShouyeServiceImpl extends ServiceImpl<UserShouyeMapper, UserSho
     @Autowired
     private UserLoginService userLoginService;
     @Autowired
-    private GroupsService groupsService;
+    private GroupsMapper groupsService;
     public static boolean isLongNotNull(long value) {
         // 如果值为0L,认为是“空”,返回false
         return value != 0;
@@ -45,7 +45,7 @@ public class UserShouyeServiceImpl extends ServiceImpl<UserShouyeMapper, UserSho
 //        关联用户  群关联
 //        查出所有的用户信息
         List<UserLogin> list1 = userLoginService.list();
-        List<Groups> list2 = groupsService.list();
+        List<Groupss> list2 = groupsService.selectList(null);
 //        进行关联
         for (UserShouye u:list) {
             for (UserLogin l: list1) {
@@ -56,7 +56,7 @@ public class UserShouyeServiceImpl extends ServiceImpl<UserShouyeMapper, UserSho
         }
         System.err.println(list);
         for (UserShouye u:list) {
-            for (Groups g: list2) {
+            for (Groupss g: list2) {
                 if (u.getGid().equals(g.getGroupId()) && isLongNotNull(u.getGid())){
                     u.setGroupss(g);
                 }

+ 0 - 106
src/main/java/com/zhentao/user/domain/UserShouye.java

@@ -1,106 +0,0 @@
-package com.zhentao.user.domain;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import java.io.Serializable;
-
-import com.fasterxml.jackson.annotation.JsonFormat;
-import lombok.Data;
-
-/**
- * 用户首页表
- * @TableName user_shouye
- */
-@TableName(value ="user_shouye")
-@Data
-public class UserShouye implements Serializable {
-    /**
-     * 主键
-     */
-    @TableId
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long id;
-
-    /**
-     * 用户1
-     */
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long uid1;
-
-    /**
-     * 用户2
-     */
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long uid2;
-
-    /**
-     * 群id
-     */
-    @JsonFormat(shape = JsonFormat.Shape.STRING)
-    private Long gid;
-
-    /**
-     * 状态0 1
-     */
-    private Integer status;
-
-    /**
-     * 排序
-     */
-    private Integer sort;
-
-    @TableField(exist = false)
-    private static final long serialVersionUID = 1L;
-
-    @Override
-    public boolean equals(Object that) {
-        if (this == that) {
-            return true;
-        }
-        if (that == null) {
-            return false;
-        }
-        if (getClass() != that.getClass()) {
-            return false;
-        }
-        UserShouye other = (UserShouye) that;
-        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
-            && (this.getUid1() == null ? other.getUid1() == null : this.getUid1().equals(other.getUid1()))
-            && (this.getUid2() == null ? other.getUid2() == null : this.getUid2().equals(other.getUid2()))
-            && (this.getGid() == null ? other.getGid() == null : this.getGid().equals(other.getGid()))
-            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
-            && (this.getSort() == null ? other.getSort() == null : this.getSort().equals(other.getSort()));
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
-        result = prime * result + ((getUid1() == null) ? 0 : getUid1().hashCode());
-        result = prime * result + ((getUid2() == null) ? 0 : getUid2().hashCode());
-        result = prime * result + ((getGid() == null) ? 0 : getGid().hashCode());
-        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
-        result = prime * result + ((getSort() == null) ? 0 : getSort().hashCode());
-        return result;
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append(getClass().getSimpleName());
-        sb.append(" [");
-        sb.append("Hash = ").append(hashCode());
-        sb.append(", id=").append(id);
-        sb.append(", uid1=").append(uid1);
-        sb.append(", uid2=").append(uid2);
-        sb.append(", gid=").append(gid);
-        sb.append(", status=").append(status);
-        sb.append(", sort=").append(sort);
-        sb.append(", serialVersionUID=").append(serialVersionUID);
-        sb.append("]");
-        return sb.toString();
-    }
-}

+ 0 - 20
src/main/java/com/zhentao/user/mapper/UserShouyeMapper.java

@@ -1,20 +0,0 @@
-package com.zhentao.user.mapper;
-
-import com.zhentao.user.domain.UserShouye;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import org.apache.ibatis.annotations.Mapper;
-
-/**
-* @author lzy
-* @description 针对表【user_shouye(用户首页表)】的数据库操作Mapper
-* @createDate 2025-06-05 19:11:47
-* @Entity com.zhentao.user.domain.UserShouye
-*/
-@Mapper
-public interface UserShouyeMapper extends BaseMapper<UserShouye> {
-
-}
-
-
-
-

+ 0 - 13
src/main/java/com/zhentao/user/service/UserShouyeService.java

@@ -1,13 +0,0 @@
-package com.zhentao.user.service;
-
-import com.zhentao.user.domain.UserShouye;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
-* @author lzy
-* @description 针对表【user_shouye(用户首页表)】的数据库操作Service
-* @createDate 2025-06-05 19:11:47
-*/
-public interface UserShouyeService extends IService<UserShouye> {
-
-}

+ 5 - 5
src/main/java/com/zhentao/user/service/impl/UserLoginServiceImpl.java

@@ -22,13 +22,13 @@ import java.util.UUID;
 import java.util.concurrent.TimeUnit;
 
 /**
-* @author 86183
-* @description 针对表【user_login(用户)】的数据库操作Service实现
-* @createDate 2025-06-03 18:38:51
-*/
+ * @author 86183
+ * @description 针对表【user_login(用户)】的数据库操作Service实现
+ * @createDate 2025-06-03 18:38:51
+ */
 @Service
 public class UserLoginServiceImpl extends ServiceImpl<UserLoginMapper, UserLogin>
-    implements UserLoginService{
+        implements UserLoginService{
     @Autowired
     private UserLoginMapper userLoginMapper;
     @Autowired

+ 0 - 22
src/main/java/com/zhentao/user/service/impl/UserShouyeServiceImpl.java

@@ -1,22 +0,0 @@
-package com.zhentao.user.service.impl;
-
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.zhentao.user.domain.UserShouye;
-import com.zhentao.user.service.UserShouyeService;
-import com.zhentao.user.mapper.UserShouyeMapper;
-import org.springframework.stereotype.Service;
-
-/**
-* @author lzy
-* @description 针对表【user_shouye(用户首页表)】的数据库操作Service实现
-* @createDate 2025-06-05 19:11:47
-*/
-@Service
-public class UserShouyeServiceImpl extends ServiceImpl<UserShouyeMapper, UserShouye>
-    implements UserShouyeService{
-
-}
-
-
-
-

+ 2 - 2
src/main/resources/mapper/GroupsMapper.xml

@@ -2,9 +2,9 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.zhentao.shouye.mapper.GroupsMapper">
+<mapper namespace="com.zhentao.groups.mapper.GroupsMapper">
 
-    <resultMap id="BaseResultMap" type="com.zhentao.shouye.domain.Groups">
+    <resultMap id="BaseResultMap" type="com.zhentao.groups.pojo.Groupss">
             <id property="groupId" column="group_id" jdbcType="BIGINT"/>
             <result property="name" column="name" jdbcType="VARCHAR"/>
             <result property="creatorId" column="creator_id" jdbcType="BIGINT"/>