feat:feature-REQ/2129 增加注解
This commit is contained in:
parent
a8f77f1b3b
commit
078b457256
@ -11,6 +11,7 @@ import lombok.NoArgsConstructor;
|
|||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -20,10 +21,10 @@ import java.util.Set;
|
|||||||
public interface AccountRegisterApi {
|
public interface AccountRegisterApi {
|
||||||
|
|
||||||
@PostMapping("/api/im/account/register/page")
|
@PostMapping("/api/im/account/register/page")
|
||||||
ApiPageResult<AccountRegisterDTO> page(PageAccountRegisterParam param);
|
ApiPageResult<AccountRegisterDTO> page(@RequestBody PageAccountRegisterParam param);
|
||||||
|
|
||||||
@PostMapping("/api/im/account/register/list")
|
@PostMapping("/api/im/account/register/list")
|
||||||
ApiListResult<AccountRegisterDTO> list(ListAccountRegisterParam param);
|
ApiListResult<AccountRegisterDTO> list(@RequestBody ListAccountRegisterParam param);
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import lombok.NoArgsConstructor;
|
|||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -20,10 +21,10 @@ import java.util.Set;
|
|||||||
public interface MessageHistoryApi {
|
public interface MessageHistoryApi {
|
||||||
|
|
||||||
@PostMapping("/api/im/message/history/page")
|
@PostMapping("/api/im/message/history/page")
|
||||||
ApiPageResult<MessageHistoryDTO> page(PageMessageHistoryParam param);
|
ApiPageResult<MessageHistoryDTO> page(@RequestBody PageMessageHistoryParam param);
|
||||||
|
|
||||||
@PostMapping("/api/im/message/history/list")
|
@PostMapping("/api/im/message/history/list")
|
||||||
ApiListResult<MessageHistoryDTO> list(ListMessageHistoryParam param);
|
ApiListResult<MessageHistoryDTO> list(@RequestBody ListMessageHistoryParam param);
|
||||||
|
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@ -83,12 +83,12 @@ public interface MessageHistoryService extends IService<MessageHistory> {
|
|||||||
private OrganizationalUnitVO receiveOrganizationalUnit;
|
private OrganizationalUnitVO receiveOrganizationalUnit;
|
||||||
|
|
||||||
public static MessageHistoryDTO from(MessageHistory messageHistory,
|
public static MessageHistoryDTO from(MessageHistory messageHistory,
|
||||||
Map<Long, PersonProfileDto> personProfiles,
|
Map<String, PersonProfileDto> personProfiles,
|
||||||
Map<Long, OrganizationalUnitVO> organizationals) {
|
Map<Long, OrganizationalUnitVO> organizationals) {
|
||||||
MessageHistoryDTO messageHistoryDTO = MessageHistoryDTO.builder().build();
|
MessageHistoryDTO messageHistoryDTO = MessageHistoryDTO.builder().build();
|
||||||
BeanUtils.copyProperties(messageHistory, messageHistoryDTO);
|
BeanUtils.copyProperties(messageHistory, messageHistoryDTO);
|
||||||
|
|
||||||
messageHistoryDTO.setReceivePersonProfile(personProfiles.get(Long.valueOf(messageHistoryDTO.getReceivePersonId())));
|
messageHistoryDTO.setReceivePersonProfile(personProfiles.get(messageHistoryDTO.getReceivePersonId()));
|
||||||
messageHistoryDTO.setReceiveOrganizationalUnit(organizationals.get(messageHistoryDTO.getReceiveOuId()));
|
messageHistoryDTO.setReceiveOrganizationalUnit(organizationals.get(messageHistoryDTO.getReceiveOuId()));
|
||||||
return messageHistoryDTO;
|
return messageHistoryDTO;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,7 +46,7 @@ public class MessageHistoryServiceImpl extends ServiceImpl<MessageHistoryMapper,
|
|||||||
|
|
||||||
Page<MessageHistory> page = this.page(PageConverter.convertToMybatis(param, MessageHistory.class), wrapper);
|
Page<MessageHistory> page = this.page(PageConverter.convertToMybatis(param, MessageHistory.class), wrapper);
|
||||||
|
|
||||||
Map<Long, PersonProfileDto> personProfiles = listReceiveUserPersonProfile(param, page.getRecords());
|
Map<String, PersonProfileDto> personProfiles = listReceiveUserPersonProfile(param, page.getRecords());
|
||||||
|
|
||||||
Map<Long, OrganizationalUnitVO> organizationals = listReceiveOrganizational(param, page.getRecords());
|
Map<Long, OrganizationalUnitVO> organizationals = listReceiveOrganizational(param, page.getRecords());
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ public class MessageHistoryServiceImpl extends ServiceImpl<MessageHistoryMapper,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<Long, PersonProfileDto> listReceiveUserPersonProfile(PageMessageHistoryParam param,
|
private Map<String, PersonProfileDto> listReceiveUserPersonProfile(PageMessageHistoryParam param,
|
||||||
List<MessageHistory> messageHistories) {
|
List<MessageHistory> messageHistories) {
|
||||||
if (CollectionUtils.isEmpty(messageHistories) || BooleanUtils.isNotTrue(param.isNeedReceiveUserInfo())) {
|
if (CollectionUtils.isEmpty(messageHistories) || BooleanUtils.isNotTrue(param.isNeedReceiveUserInfo())) {
|
||||||
return Collections.emptyMap();
|
return Collections.emptyMap();
|
||||||
@ -84,7 +84,7 @@ public class MessageHistoryServiceImpl extends ServiceImpl<MessageHistoryMapper,
|
|||||||
|
|
||||||
return userProfileServiceApi.postPersonProfiles(personIds).getData()
|
return userProfileServiceApi.postPersonProfiles(personIds).getData()
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(PersonProfileDto::getId, Function.identity()));
|
.collect(Collectors.toMap(e -> e.getId().toString(), Function.identity()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<Long, OrganizationalUnitVO> listReceiveOrganizational(PageMessageHistoryParam param,
|
private Map<Long, OrganizationalUnitVO> listReceiveOrganizational(PageMessageHistoryParam param,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user