帮助中心
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package com.czg.controller.user;
|
||||
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.system.dto.SysParamsDTO;
|
||||
import com.czg.system.dto.VersionDTO;
|
||||
import com.czg.system.service.SysParamsService;
|
||||
import com.czg.system.service.VersionService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -9,23 +11,40 @@ import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户端
|
||||
* @author GYJoker
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user/version")
|
||||
@RequestMapping("/user")
|
||||
public class UserVersionController {
|
||||
@Resource
|
||||
private VersionService versionService;
|
||||
@Resource
|
||||
private SysParamsService sysParamsService;
|
||||
|
||||
/**
|
||||
* 获取版本信息
|
||||
*
|
||||
* @param source 渠道
|
||||
* @param type 类型
|
||||
* @param type 类型
|
||||
* @return VersionDTO
|
||||
*/
|
||||
@GetMapping("/info/{source}/{type}")
|
||||
@GetMapping("/version/info/{source}/{type}")
|
||||
public CzgResult<VersionDTO> getVersionInfo(@PathVariable("source") String source, @PathVariable("type") String type) {
|
||||
return versionService.getVersionInfo(source, type);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 帮助中心
|
||||
*
|
||||
* @return VersionDTO
|
||||
*/
|
||||
@GetMapping("/getHelp")
|
||||
public CzgResult<List<SysParamsDTO>> getHelpInfo() {
|
||||
return sysParamsService.getParamsByParamType("system_help");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,4 +75,12 @@ public interface SysParamsService extends IService<SysParams> {
|
||||
* @param keyList 内容为 {@link com.czg.constants.ParamCodeCst}的Set集合
|
||||
*/
|
||||
Map<String, String> getParamsByMap(String type, Set<String> keyList) throws CzgException;
|
||||
|
||||
/**
|
||||
* 根据参数类型获取参数
|
||||
*
|
||||
* @param paramType 参数类型
|
||||
* @return 参数列表
|
||||
*/
|
||||
CzgResult<List<SysParamsDTO>> getParamsByParamType(String paramType) throws CzgException;
|
||||
}
|
||||
|
||||
@@ -151,4 +151,10 @@ public class SysParamsServiceImpl extends ServiceImpl<SysParamsMapper, SysParams
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user