【优化】添加多语言支持
This commit is contained in:
parent
d1df308dda
commit
e914cd27a8
|
|
@ -1,6 +1,7 @@
|
||||||
package com.nflg.mobilebroken.cfs.controller;
|
package com.nflg.mobilebroken.cfs.controller;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||||
import com.nflg.mobilebroken.common.pojo.vo.LanguageVO;
|
import com.nflg.mobilebroken.common.pojo.vo.LanguageVO;
|
||||||
import com.nflg.mobilebroken.repository.entity.Language;
|
import com.nflg.mobilebroken.repository.entity.Language;
|
||||||
|
|
@ -36,15 +37,6 @@ public class SystemController extends ControllerBase {
|
||||||
if (CollectionUtil.isEmpty(languages)) {
|
if (CollectionUtil.isEmpty(languages)) {
|
||||||
return ApiResult.success(Collections.emptyList());
|
return ApiResult.success(Collections.emptyList());
|
||||||
}
|
}
|
||||||
List<LanguageVO> vos=languages.stream()
|
return ApiResult.success(Convert.toList(LanguageVO.class, languages));
|
||||||
.map(l->new LanguageVO()
|
|
||||||
.setCode(l.getCode())
|
|
||||||
.setName(l.getName())
|
|
||||||
.setValue(l.getValue())
|
|
||||||
.setIco(l.getIco())
|
|
||||||
.setSort(l.getSort())
|
|
||||||
.setEnable(l.getEnable()))
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
return ApiResult.success(vos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue