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