勋章查询接口更改
This commit is contained in:
parent
6fdf9c5f09
commit
b60178b596
@ -42,7 +42,12 @@ public enum BadgeConfigTypeEnum {
|
||||
/**
|
||||
* 家族徽章.
|
||||
*/
|
||||
FAMILY;
|
||||
FAMILY,
|
||||
|
||||
/**
|
||||
* 活动 成就 管理员
|
||||
*/
|
||||
ALL;
|
||||
|
||||
public boolean eq(String name) {
|
||||
return Objects.equals(this.name(), name);
|
||||
|
||||
@ -45,8 +45,7 @@ public class UserBadgeTableQryExe {
|
||||
|
||||
public List<BadgeGroupTableCO> execute(UserBadgeQueryCmd cmd) {
|
||||
List<BadgeConfig> badgeConfigs = badgeConfigService
|
||||
.listBadgeConfig(Objects.isNull(cmd.getType())
|
||||
? BadgeConfigTypeEnum.ACHIEVEMENT : cmd.getType());
|
||||
.listBadgeConfig(cmd.getType());
|
||||
|
||||
if (CollectionUtils.isEmpty(badgeConfigs)) {
|
||||
return Lists.newArrayList();
|
||||
|
||||
@ -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.tool.core.collection.CollectionUtils;
|
||||
import com.red.circle.tool.core.text.StringUtils;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -97,6 +94,15 @@ public class BadgeConfigServiceImpl extends BaseServiceImpl<BadgeConfigDAO, Badg
|
||||
|
||||
@Override
|
||||
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)
|
||||
.eq(BadgeConfig::getDel, Boolean.FALSE)
|
||||
.orderByAsc(BadgeConfig::getBadgeLevel)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user