Skip to content

Commit

Permalink
refactor(spring): 移除 MyBatis Plus 相关注解
Browse files Browse the repository at this point in the history
- 注释掉 ChatRoomMapper、FriendMapper 和 SystemConfigMapper 中的 @Mapper 注解
- 注释掉 ChatRoomServiceImpl、FriendServiceImpl 和 SystemConfigServiceImpl 中的 @service 注解
- 注释掉 MybatisPlusConfig 中的 @MapperScan 注解
- 在 SystemConfigMapper 中添加 @repository 注解(已注释)
  • Loading branch information
alex-oos committed Feb 21, 2025
1 parent f93b31a commit 4212c14
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/wechat/bot/config/MybatisPlusConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

@Configuration
@MapperScan("com.wechat.bot.mapper")
//@MapperScan("com.wechat.bot.mapper")
public class MybatisPlusConfig {

/**
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/wechat/bot/mapper/ChatRoomMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wechat.bot.entity.dto.ChatRoomsDto;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

/**
* @author Alex
* @since 2025/1/27 22:18
* <p></p>
*/
@Mapper
public interface ChatRoomMapper extends BaseMapper<ChatRoomsDto> {
//@Mapper
public interface ChatRoomMapper extends BaseMapper<ChatRoomsDto> {

}
2 changes: 1 addition & 1 deletion src/main/java/com/wechat/bot/mapper/FriendMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @since 2025/1/27 22:24
* <p></p>
*/
@Mapper
//@Mapper
public interface FriendMapper extends BaseMapper<FriendDto> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @since 2021/1/21 13:46
*
*/
@Mapper
//@Mapper
//@Repository // 也可以使用@Component,效果都是一样的,只是为了声明为bean
public interface SystemConfigMapper extends BaseMapper<SystemConfigDto> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 2025/1/27 22:19
* <p></p>
*/
@Service
//@Service
public class ChatRoomServiceImpl extends ServiceImpl<ChatRoomMapper, ChatRoomsDto> implements ChatRoomService {

}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @since 2025/1/27 22:25
* <p></p>
*/
@Service
//@Service
public class FriendServiceImpl extends ServiceImpl<FriendMapper, FriendDto> implements FriendService {

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @since 2021/5/31 下午 9:56
*
*/
@Service
//@Service
public class SystemConfigServiceImpl extends ServiceImpl<SystemConfigMapper, SystemConfigDto> implements SystemConfigService {

}

0 comments on commit 4212c14

Please sign in to comment.