勋章查询接口更改

This commit is contained in:
tianfeng 2026-05-12 10:36:22 +08:00
parent 6fdf9c5f09
commit b60178b596
3 changed files with 18 additions and 8 deletions

View File

@ -42,7 +42,12 @@ public enum BadgeConfigTypeEnum {
/** /**
* 家族徽章. * 家族徽章.
*/ */
FAMILY; FAMILY,
/**
* 活动 成就 管理员
*/
ALL;
public boolean eq(String name) { public boolean eq(String name) {
return Objects.equals(this.name(), name); return Objects.equals(this.name(), name);

View File

@ -45,8 +45,7 @@ public class UserBadgeTableQryExe {
public List<BadgeGroupTableCO> execute(UserBadgeQueryCmd cmd) { public List<BadgeGroupTableCO> execute(UserBadgeQueryCmd cmd) {
List<BadgeConfig> badgeConfigs = badgeConfigService List<BadgeConfig> badgeConfigs = badgeConfigService
.listBadgeConfig(Objects.isNull(cmd.getType()) .listBadgeConfig(cmd.getType());
? BadgeConfigTypeEnum.ACHIEVEMENT : cmd.getType());
if (CollectionUtils.isEmpty(badgeConfigs)) { if (CollectionUtils.isEmpty(badgeConfigs)) {
return Lists.newArrayList(); return Lists.newArrayList();

View File

@ -14,11 +14,8 @@ import com.red.circle.other.inner.model.cmd.sys.GiveBadgeConfigQryCmd;
import com.red.circle.other.inner.model.cmd.sys.SysBadgeConfigQryCmd; import com.red.circle.other.inner.model.cmd.sys.SysBadgeConfigQryCmd;
import com.red.circle.tool.core.collection.CollectionUtils; import com.red.circle.tool.core.collection.CollectionUtils;
import com.red.circle.tool.core.text.StringUtils; import com.red.circle.tool.core.text.StringUtils;
import java.util.List;
import java.util.Map; import java.util.*;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -97,6 +94,15 @@ public class BadgeConfigServiceImpl extends BaseServiceImpl<BadgeConfigDAO, Badg
@Override @Override
public List<BadgeConfig> listBadgeConfig(BadgeConfigTypeEnum type) { public List<BadgeConfig> listBadgeConfig(BadgeConfigTypeEnum type) {
if (type == BadgeConfigTypeEnum.ALL) {
return query()
.in(BadgeConfig::getType, Arrays.asList(BadgeConfigTypeEnum.ACTIVITY, BadgeConfigTypeEnum.ACHIEVEMENT, BadgeConfigTypeEnum.ADMINISTRATOR))
.eq(BadgeConfig::getDel, Boolean.FALSE)
.orderByAsc(BadgeConfig::getBadgeLevel)
.last(PageConstant.formatLimit(300))
.list();
}
return query().eq(BadgeConfig::getType, type) return query().eq(BadgeConfig::getType, type)
.eq(BadgeConfig::getDel, Boolean.FALSE) .eq(BadgeConfig::getDel, Boolean.FALSE)
.orderByAsc(BadgeConfig::getBadgeLevel) .orderByAsc(BadgeConfig::getBadgeLevel)