赠送勋章增加图片

This commit is contained in:
tianfeng 2025-11-03 19:45:26 +08:00
parent 11996109d2
commit 3343943965

View File

@ -5,7 +5,9 @@ import com.red.circle.external.inner.model.cmd.message.notice.official.NoticeExt
import com.red.circle.external.inner.model.enums.message.OfficialNoticeTypeEnum;
import com.red.circle.framework.dto.ResultResponse;
import com.red.circle.other.app.inner.service.material.props.PropsBackpackClientService;
import com.red.circle.other.infra.database.rds.entity.badge.BadgePictureConfig;
import com.red.circle.other.infra.database.rds.entity.props.PropsSourceRecord;
import com.red.circle.other.infra.database.rds.service.badge.BadgePictureConfigService;
import com.red.circle.other.infra.database.rds.service.props.PropsSourceRecordService;
import com.red.circle.other.infra.utils.I18nUtils;
import com.red.circle.other.domain.gateway.user.UserProfileGateway;
@ -20,10 +22,9 @@ import com.red.circle.other.inner.model.cmd.material.PropsBackpackQry;
import com.red.circle.other.inner.model.cmd.material.ReduceDaysAndUnUseCmd;
import com.red.circle.other.inner.model.dto.material.PropsBackpackDTO;
import com.red.circle.other.inner.model.dto.material.UsePropsDTO;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.*;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
@ -46,6 +47,7 @@ public class PropsBackpackClientEndpoint implements PropsBackpackClientApi {
private final UserProfileGateway userProfileGateway;
private final UserRegionGateway userRegionGateway;
private final PropsSourceRecordService propsSourceRecordService;
private final BadgePictureConfigService badgePictureConfigService;
@Override
public ResultResponse<UsePropsDTO> switchUseProps(Long userId, Long propsId) {
@ -91,6 +93,11 @@ public class PropsBackpackClientEndpoint implements PropsBackpackClientApi {
}
if (!Objects.isNull(user)) {
if (Arrays.asList("ACTIVITY", "ADMINISTRATOR").contains(type)) {
BadgePictureConfig badgePictureConfig = badgePictureConfigService.getByBadgeId(user.getOriginSys(), propsId);
url = badgePictureConfig != null ? badgePictureConfig.getSelectUrl() : "";
}
RegionConfig region = userRegionGateway.getRegionConfigByUserId(userId);
officialNoticeClient.send(
NoticeExtTemplateCustomizeCmd.builder().toAccount(userId)