帮助中心
This commit is contained in:
@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 用户端
|
||||
@@ -25,17 +27,17 @@ public class UserVersionController {
|
||||
@Resource
|
||||
private SysParamsService sysParamsService;
|
||||
|
||||
/**
|
||||
* 获取版本信息
|
||||
*
|
||||
* @param source 渠道
|
||||
* @param type 类型
|
||||
* @return VersionDTO
|
||||
*/
|
||||
@GetMapping("/version/info/{source}/{type}")
|
||||
public CzgResult<VersionDTO> getVersionInfo(@PathVariable("source") String source, @PathVariable("type") String type) {
|
||||
return versionService.getVersionInfo(source, type);
|
||||
}
|
||||
// /**
|
||||
// * 获取版本信息
|
||||
// *
|
||||
// * @param source 渠道
|
||||
// * @param type 类型
|
||||
// * @return VersionDTO
|
||||
// */
|
||||
// @GetMapping("/version/info/{source}/{type}")
|
||||
// public CzgResult<VersionDTO> getVersionInfo(@PathVariable("source") String source, @PathVariable("type") String type) {
|
||||
// return versionService.getVersionInfo(source, type);
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
@@ -44,7 +46,8 @@ public class UserVersionController {
|
||||
* @return VersionDTO
|
||||
*/
|
||||
@GetMapping("/getHelp")
|
||||
public CzgResult<List<SysParamsDTO>> getHelpInfo() {
|
||||
return sysParamsService.getParamsByParamType("system_help");
|
||||
public CzgResult<Map<String, String>> getHelpInfo() {
|
||||
List<SysParamsDTO> systemHelps = sysParamsService.getParamsByParamType("system_help");
|
||||
return CzgResult.success(systemHelps.stream().collect(Collectors.toMap(SysParamsDTO::getParamCode, SysParamsDTO::getParamValue)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,5 +82,5 @@ public interface SysParamsService extends IService<SysParams> {
|
||||
* @param paramType 参数类型
|
||||
* @return 参数列表
|
||||
*/
|
||||
CzgResult<List<SysParamsDTO>> getParamsByParamType(String paramType) throws CzgException;
|
||||
List<SysParamsDTO> getParamsByParamType(String paramType) throws CzgException;
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ public class SysParamsServiceImpl extends ServiceImpl<SysParamsMapper, SysParams
|
||||
|
||||
@Cacheable(cacheNames = "params:paramType", key = "#paramType")
|
||||
@Override
|
||||
public CzgResult<List<SysParamsDTO>> getParamsByParamType(String paramType) throws CzgException {
|
||||
return CzgResult.success(listAs(query().eq(SysParams::getParamType, paramType), SysParamsDTO.class));
|
||||
public List<SysParamsDTO> getParamsByParamType(String paramType) throws CzgException {
|
||||
return listAs(query().eq(SysParams::getParamType, paramType), SysParamsDTO.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user