Commit 8701cf7527de08ad5289608d1b7a7bc3ea727cbd
Merge remote-tracking branch 'github/master-jdk17' into HEAD
Showing
4 changed files
with
66 additions
and
4 deletions
sql/tools/convertor.py
| ... | ... | @@ -412,7 +412,7 @@ class PostgreSQLConvertor(Convertor): |
| 412 | 412 | |
| 413 | 413 | type = type.lower() |
| 414 | 414 | |
| 415 | - if type == "varchar": | |
| 415 | + if type in ("varchar", "char"): | |
| 416 | 416 | return f"varchar({size})" |
| 417 | 417 | if type in ("int", "int unsigned", "int unsigned zerofill"): |
| 418 | 418 | return "int4" |
| ... | ... | @@ -426,13 +426,15 @@ class PostgreSQLConvertor(Convertor): |
| 426 | 426 | return "date" |
| 427 | 427 | if type == "json": |
| 428 | 428 | return "jsonb" |
| 429 | + if type == "time": | |
| 430 | + return "time" | |
| 429 | 431 | if type == "double": |
| 430 | 432 | return "double precision" |
| 431 | 433 | if type == "timestamp": |
| 432 | 434 | return f"timestamp({size})" if size else "timestamp" |
| 433 | 435 | if type == "bit": |
| 434 | 436 | return "bool" |
| 435 | - if type in ("text", "longtext"): | |
| 437 | + if type in ("text", "longtext", "mediumtext"): | |
| 436 | 438 | return "text" |
| 437 | 439 | if type in ("blob", "mediumblob", "longblob"): |
| 438 | 440 | return "bytea" | ... | ... |
yudao-module-im/src/main/java/cn/iocoder/yudao/module/im/dal/mysql/message/ImChannelMessageMapper.java
| ... | ... | @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.im.controller.admin.manager.message.vo.channel.Im |
| 8 | 8 | import cn.iocoder.yudao.module.im.dal.dataobject.message.ImChannelMessageDO; |
| 9 | 9 | import org.apache.ibatis.annotations.Mapper; |
| 10 | 10 | |
| 11 | +import java.util.Collections; | |
| 11 | 12 | import java.util.List; |
| 12 | 13 | |
| 13 | 14 | /** |
| ... | ... | @@ -32,7 +33,7 @@ public interface ImChannelMessageMapper extends BaseMapperX<ImChannelMessageDO> |
| 32 | 33 | return selectList(new LambdaQueryWrapperX<ImChannelMessageDO>() |
| 33 | 34 | .gt(ImChannelMessageDO::getId, minId) |
| 34 | 35 | .and(w -> w.isNull(ImChannelMessageDO::getReceiverUserIds) |
| 35 | - .or().eq(ImChannelMessageDO::getReceiverUserIds, "") | |
| 36 | + .or().eq(ImChannelMessageDO::getReceiverUserIds, Collections.emptyList()) | |
| 36 | 37 | .or().apply(MyBatisUtils.findInSet("receiver_user_ids"), userId)) |
| 37 | 38 | .orderByAsc(ImChannelMessageDO::getId) |
| 38 | 39 | .last("LIMIT " + size)); | ... | ... |
yudao-module-im/src/test/java/cn/iocoder/yudao/module/im/dal/mysql/message/ImChannelMessageMapperTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.im.dal.mysql.message; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 4 | +import cn.iocoder.yudao.module.im.dal.dataobject.message.ImChannelMessageDO; | |
| 5 | +import jakarta.annotation.Resource; | |
| 6 | +import org.junit.jupiter.api.Test; | |
| 7 | +import org.springframework.test.context.jdbc.Sql; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +import static org.junit.jupiter.api.Assertions.assertEquals; | |
| 13 | + | |
| 14 | +@Sql(statements = "DELETE FROM im_channel_message", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) | |
| 15 | +public class ImChannelMessageMapperTest extends BaseDbUnitTest { | |
| 16 | + | |
| 17 | + @Resource | |
| 18 | + private ImChannelMessageMapper mapper; | |
| 19 | + | |
| 20 | + @Test | |
| 21 | + public void testSelectListByUserAndMinId_includesBroadcastAndMatchingRecipients() { | |
| 22 | + ImChannelMessageDO nullRecipients = insertMessage(null); | |
| 23 | + ImChannelMessageDO emptyRecipients = insertMessage(List.of()); | |
| 24 | + ImChannelMessageDO matchingRecipients = insertMessage(List.of(1L, 2L)); | |
| 25 | + insertMessage(List.of(2L, 11L)); // 用户 1 不应误命中用户 11 | |
| 26 | + ImChannelMessageDO deleted = insertMessage(List.of(1L)); | |
| 27 | + mapper.deleteById(deleted.getId()); | |
| 28 | + | |
| 29 | + List<ImChannelMessageDO> result = mapper.selectListByUserAndMinId(1L, 0L, 100); | |
| 30 | + | |
| 31 | + assertEquals(List.of(nullRecipients.getId(), emptyRecipients.getId(), matchingRecipients.getId()), | |
| 32 | + result.stream().map(ImChannelMessageDO::getId).toList()); | |
| 33 | + } | |
| 34 | + | |
| 35 | + @Test | |
| 36 | + public void testSelectListByUserAndMinId_respectsCursorAndLimit() { | |
| 37 | + ImChannelMessageDO cursor = insertMessage(null); | |
| 38 | + ImChannelMessageDO next = insertMessage(List.of()); | |
| 39 | + insertMessage(List.of(1L)); | |
| 40 | + | |
| 41 | + List<ImChannelMessageDO> result = mapper.selectListByUserAndMinId(1L, cursor.getId(), 1); | |
| 42 | + | |
| 43 | + assertEquals(List.of(next.getId()), result.stream().map(ImChannelMessageDO::getId).toList()); | |
| 44 | + } | |
| 45 | + | |
| 46 | + private ImChannelMessageDO insertMessage(List<Long> receiverUserIds) { | |
| 47 | + ImChannelMessageDO message = ImChannelMessageDO.builder() | |
| 48 | + .channelId(10L) | |
| 49 | + .materialId(20L) | |
| 50 | + .type(1) | |
| 51 | + .content("{}") | |
| 52 | + .receiverUserIds(receiverUserIds) | |
| 53 | + .sendTime(LocalDateTime.now()) | |
| 54 | + .build(); | |
| 55 | + mapper.insert(message); | |
| 56 | + return message; | |
| 57 | + } | |
| 58 | + | |
| 59 | +} | ... | ... |
yudao-module-mall/yudao-module-product/src/main/java/cn/iocoder/yudao/module/product/controller/admin/property/vo/value/ProductPropertyValuePageReqVO.java
| ... | ... | @@ -13,7 +13,7 @@ import lombok.ToString; |
| 13 | 13 | public class ProductPropertyValuePageReqVO extends PageParam { |
| 14 | 14 | |
| 15 | 15 | @Schema(description = "属性项的编号", example = "1024") |
| 16 | - private String propertyId; | |
| 16 | + private Long propertyId; | |
| 17 | 17 | |
| 18 | 18 | @Schema(description = "名称", example = "红色") |
| 19 | 19 | private String name; | ... | ... |