mirror of
https://github.com/didi/KnowStreaming.git
synced 2025-12-24 20:22:12 +08:00
Merge branch 'master' into v2.2.1_ldap
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package com.xiaojukeji.kafka.manager.web.api.versionone;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.common.constant.Constant;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.Result;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ResultStatus;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ao.account.Account;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.dto.normal.LoginDTO;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.vo.common.AccountVO;
|
||||
@@ -11,8 +9,6 @@ import com.xiaojukeji.kafka.manager.account.LoginService;
|
||||
import com.xiaojukeji.kafka.manager.common.constant.ApiPrefix;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -28,26 +24,22 @@ import javax.servlet.http.HttpServletResponse;
|
||||
@RestController
|
||||
@RequestMapping(ApiPrefix.API_V1_SSO_PREFIX)
|
||||
public class LoginController {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(LoginController.class);
|
||||
|
||||
@Autowired
|
||||
private LoginService loginService;
|
||||
|
||||
@ApiOperation(value = "登陆", notes = "")
|
||||
@RequestMapping(value = "login", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<AccountVO> login(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@RequestBody LoginDTO dto){
|
||||
Account account = loginService.login(request, response, dto);
|
||||
if (ValidateUtils.isNull(account)) {
|
||||
return Result.buildFrom(ResultStatus.LOGIN_FAILED);
|
||||
public Result<AccountVO> login(HttpServletRequest request, HttpServletResponse response, @RequestBody LoginDTO dto){
|
||||
Result<Account> accountResult = loginService.login(request, response, dto);
|
||||
if (ValidateUtils.isNull(accountResult) || accountResult.failed()) {
|
||||
return new Result<>(accountResult.getCode(), accountResult.getMessage());
|
||||
}
|
||||
AccountVO vo = new AccountVO();
|
||||
vo.setUsername(account.getUsername());
|
||||
vo.setChineseName(account.getChineseName());
|
||||
vo.setDepartment(account.getDepartment());
|
||||
vo.setRole(account.getAccountRoleEnum().getRole());
|
||||
vo.setUsername(accountResult.getData().getUsername());
|
||||
vo.setChineseName(accountResult.getData().getChineseName());
|
||||
vo.setDepartment(accountResult.getData().getDepartment());
|
||||
vo.setRole(accountResult.getData().getAccountRoleEnum().getRole());
|
||||
return new Result<>(vo);
|
||||
}
|
||||
|
||||
@@ -58,28 +50,4 @@ public class LoginController {
|
||||
loginService.logout(request, response, true);
|
||||
return new Result();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiOperation(value = "登录检查", notes = "检查SSO返回的Code")
|
||||
@RequestMapping(value = "xiaojukeji/login-check", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result<AccountVO> checkCodeAndGetStaffInfo(HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@RequestBody LoginDTO dto) {
|
||||
Result<AccountVO> ra = login(request, response, dto);
|
||||
if (!Constant.SUCCESS.equals(ra.getCode())) {
|
||||
LOGGER.info("user login failed, req:{} result:{}.", dto, ra);
|
||||
} else {
|
||||
LOGGER.info("user login success, req:{} result:{}.", dto, ra);
|
||||
}
|
||||
return ra;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ApiOperation(value = "登出", notes = "")
|
||||
@RequestMapping(value = "xiaojukeji/logout", method = RequestMethod.DELETE)
|
||||
@ResponseBody
|
||||
public Result logout(HttpServletRequest request, HttpServletResponse response) {
|
||||
return logoff(request, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ public class GatewayHeartbeatController {
|
||||
doList = JsonUtils.parseTopicConnections(clusterId, jsonObject, System.currentTimeMillis());
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("class=GatewayHeartbeatController||method=receiveTopicConnections||clusterId={}||brokerId={}||msg=parse data failed||exception={}", clusterId, brokerId, e.getMessage());
|
||||
return Result.buildFailure("fail");
|
||||
return Result.buildGatewayFailure("fail");
|
||||
}
|
||||
|
||||
topicConnectionService.batchAdd(doList);
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping(ApiPrefix.GATEWAY_API_V1_PREFIX)
|
||||
public class GatewayServiceDiscoveryController {
|
||||
|
||||
private final static Logger LOGGER = LoggerFactory.getLogger(GatewayHeartbeatController.class);
|
||||
|
||||
@Autowired
|
||||
@@ -65,7 +64,7 @@ public class GatewayServiceDiscoveryController {
|
||||
KafkaBootstrapServerConfig config =
|
||||
gatewayConfigService.getKafkaBootstrapServersConfig(Long.MIN_VALUE);
|
||||
if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getClusterIdBootstrapServersMap())) {
|
||||
return Result.buildFailure("call init kafka bootstrap servers failed");
|
||||
return Result.buildGatewayFailure("call init kafka bootstrap servers failed");
|
||||
}
|
||||
if (ValidateUtils.isEmptyMap(config.getClusterIdBootstrapServersMap())) {
|
||||
return Result.buildSuc();
|
||||
@@ -81,7 +80,7 @@ public class GatewayServiceDiscoveryController {
|
||||
KafkaBootstrapServerConfig config =
|
||||
gatewayConfigService.getKafkaBootstrapServersConfig(versionNumber);
|
||||
if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getClusterIdBootstrapServersMap())) {
|
||||
return Result.buildFailure("call update kafka bootstrap servers failed");
|
||||
return Result.buildGatewayFailure("call update kafka bootstrap servers failed");
|
||||
}
|
||||
if (ValidateUtils.isEmptyMap(config.getClusterIdBootstrapServersMap())) {
|
||||
return Result.buildSuc();
|
||||
@@ -99,7 +98,7 @@ public class GatewayServiceDiscoveryController {
|
||||
public Result<String> getMaxRequestNum(@RequestParam("versionNumber") long versionNumber) {
|
||||
RequestQueueConfig config = gatewayConfigService.getRequestQueueConfig(versionNumber);
|
||||
if (ValidateUtils.isNull(config)) {
|
||||
return Result.buildFailure("call get request queue size config failed");
|
||||
return Result.buildGatewayFailure("call get request queue size config failed");
|
||||
}
|
||||
if (ValidateUtils.isNull(config.getMaxRequestQueueSize())) {
|
||||
return Result.buildSuc();
|
||||
@@ -119,7 +118,7 @@ public class GatewayServiceDiscoveryController {
|
||||
public Result<String> getAppIdRate(@RequestParam("versionNumber") long versionNumber) {
|
||||
AppRateConfig config = gatewayConfigService.getAppRateConfig(versionNumber);
|
||||
if (ValidateUtils.isNull(config)) {
|
||||
return Result.buildFailure("call get app rate config failed");
|
||||
return Result.buildGatewayFailure("call get app rate config failed");
|
||||
}
|
||||
if (ValidateUtils.isNull(config.getAppRateLimit())) {
|
||||
return Result.buildSuc();
|
||||
@@ -139,7 +138,7 @@ public class GatewayServiceDiscoveryController {
|
||||
public Result getIpRate(@RequestParam("versionNumber") long versionNumber) {
|
||||
IpRateConfig config = gatewayConfigService.getIpRateConfig(versionNumber);
|
||||
if (ValidateUtils.isNull(config)) {
|
||||
return Result.buildFailure("call get ip rate config failed");
|
||||
return Result.buildGatewayFailure("call get ip rate config failed");
|
||||
}
|
||||
if (ValidateUtils.isNull(config.getIpRateLimit())) {
|
||||
return Result.buildSuc();
|
||||
@@ -160,7 +159,7 @@ public class GatewayServiceDiscoveryController {
|
||||
SpRateConfig config =
|
||||
gatewayConfigService.getSpRateConfig(versionNumber);
|
||||
if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getSpRateMap())) {
|
||||
return Result.buildFailure("call update kafka bootstrap servers failed");
|
||||
return Result.buildGatewayFailure("call update kafka bootstrap servers failed");
|
||||
}
|
||||
if (ValidateUtils.isEmptyMap(config.getSpRateMap())) {
|
||||
return Result.buildSuc();
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.xiaojukeji.kafka.manager.web.api.versionone.op;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.common.entity.Result;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ResultStatus;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.dto.op.ControllerPreferredCandidateDTO;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.dto.rd.ClusterDTO;
|
||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||
import com.xiaojukeji.kafka.manager.service.service.ClusterService;
|
||||
@@ -13,6 +14,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* @author zengqiao
|
||||
* @date 20/4/23
|
||||
@@ -25,48 +27,56 @@ public class OpClusterController {
|
||||
private ClusterService clusterService;
|
||||
|
||||
@ApiOperation(value = "接入集群")
|
||||
@RequestMapping(value = "clusters", method = RequestMethod.POST)
|
||||
@PostMapping(value = "clusters")
|
||||
@ResponseBody
|
||||
public Result addNew(@RequestBody ClusterDTO dto) {
|
||||
if (ValidateUtils.isNull(dto) || !dto.legal()) {
|
||||
return Result.buildFrom(ResultStatus.PARAM_ILLEGAL);
|
||||
}
|
||||
return Result.buildFrom(
|
||||
clusterService.addNew(
|
||||
ClusterModelConverter.convert2ClusterDO(dto),
|
||||
SpringTool.getUserName()
|
||||
)
|
||||
clusterService.addNew(ClusterModelConverter.convert2ClusterDO(dto), SpringTool.getUserName())
|
||||
);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除集群")
|
||||
@RequestMapping(value = "clusters", method = RequestMethod.DELETE)
|
||||
@DeleteMapping(value = "clusters")
|
||||
@ResponseBody
|
||||
public Result delete(@RequestParam(value = "clusterId") Long clusterId) {
|
||||
return Result.buildFrom(clusterService.deleteById(clusterId));
|
||||
return Result.buildFrom(clusterService.deleteById(clusterId, SpringTool.getUserName()));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改集群信息")
|
||||
@RequestMapping(value = "clusters", method = RequestMethod.PUT)
|
||||
@PutMapping(value = "clusters")
|
||||
@ResponseBody
|
||||
public Result modify(@RequestBody ClusterDTO reqObj) {
|
||||
if (ValidateUtils.isNull(reqObj) || !reqObj.legal() || ValidateUtils.isNull(reqObj.getClusterId())) {
|
||||
return Result.buildFrom(ResultStatus.PARAM_ILLEGAL);
|
||||
}
|
||||
ResultStatus rs = clusterService.updateById(
|
||||
ClusterModelConverter.convert2ClusterDO(reqObj),
|
||||
SpringTool.getUserName()
|
||||
return Result.buildFrom(
|
||||
clusterService.updateById(ClusterModelConverter.convert2ClusterDO(reqObj), SpringTool.getUserName())
|
||||
);
|
||||
return Result.buildFrom(rs);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "开启|关闭集群监控")
|
||||
@RequestMapping(value = "clusters/{clusterId}/monitor", method = RequestMethod.PUT)
|
||||
@PutMapping(value = "clusters/{clusterId}/monitor")
|
||||
@ResponseBody
|
||||
public Result modifyStatus(@PathVariable Long clusterId,
|
||||
@RequestParam("status") Integer status) {
|
||||
public Result modifyStatus(@PathVariable Long clusterId, @RequestParam("status") Integer status) {
|
||||
return Result.buildFrom(
|
||||
clusterService.modifyStatus(clusterId, status, SpringTool.getUserName())
|
||||
);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "增加Controller优先候选的Broker", notes = "滴滴内部引擎特性")
|
||||
@PostMapping(value = "cluster-controller/preferred-candidates")
|
||||
@ResponseBody
|
||||
public Result addControllerPreferredCandidates(@RequestBody ControllerPreferredCandidateDTO dto) {
|
||||
return clusterService.addControllerPreferredCandidates(dto.getClusterId(), dto.getBrokerIdList());
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除Controller优先候选的Broker", notes = "滴滴内部引擎特性")
|
||||
@DeleteMapping(value = "cluster-controller/preferred-candidates")
|
||||
@ResponseBody
|
||||
public Result deleteControllerPreferredCandidates(@RequestBody ControllerPreferredCandidateDTO dto) {
|
||||
return clusterService.deleteControllerPreferredCandidates(dto.getClusterId(), dto.getBrokerIdList());
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,11 @@ package com.xiaojukeji.kafka.manager.web.api.versionone.op;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.entry.apply.gateway.OrderExtensionAddGatewayConfigDTO;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.entry.apply.gateway.OrderExtensionDeleteGatewayConfigDTO;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.entry.apply.gateway.OrderExtensionModifyGatewayConfigDTO;
|
||||
import com.xiaojukeji.kafka.manager.common.bizenum.gateway.GatewayConfigKeyEnum;
|
||||
import com.xiaojukeji.kafka.manager.common.constant.ApiPrefix;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.Result;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ResultStatus;
|
||||
import com.xiaojukeji.kafka.manager.common.utils.JsonUtils;
|
||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||
import com.xiaojukeji.kafka.manager.service.service.gateway.GatewayConfigService;
|
||||
import com.xiaojukeji.kafka.manager.web.converters.GatewayModelConverter;
|
||||
@@ -16,12 +19,20 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Api(tags = "OP-Gateway配置相关接口(REST)")
|
||||
@RestController
|
||||
@RequestMapping(ApiPrefix.API_V1_OP_PREFIX)
|
||||
public class OpGatewayConfigController {
|
||||
@Autowired
|
||||
private GatewayConfigService gatewayConfigService;
|
||||
|
||||
@ApiOperation(value = "Gateway配置类型", notes = "")
|
||||
@GetMapping(value = "gateway-configs/type-enums")
|
||||
@ResponseBody
|
||||
public Result getClusterModesEnum() {
|
||||
return new Result<>(JsonUtils.toJson(GatewayConfigKeyEnum.class));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "创建Gateway配置", notes = "")
|
||||
@RequestMapping(value = "gateway-configs", method = RequestMethod.POST)
|
||||
@PostMapping(value = "gateway-configs")
|
||||
@ResponseBody
|
||||
public Result createGatewayConfig(@RequestBody OrderExtensionAddGatewayConfigDTO dto) {
|
||||
if (ValidateUtils.isNull(dto) || !dto.legal()) {
|
||||
@@ -31,7 +42,7 @@ public class OpGatewayConfigController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改Gateway配置", notes = "")
|
||||
@RequestMapping(value = "gateway-configs", method = RequestMethod.PUT)
|
||||
@PutMapping(value = "gateway-configs")
|
||||
@ResponseBody
|
||||
public Result modifyGatewayConfig(@RequestBody OrderExtensionModifyGatewayConfigDTO dto) {
|
||||
if (ValidateUtils.isNull(dto) || !dto.legal()) {
|
||||
@@ -41,7 +52,7 @@ public class OpGatewayConfigController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "删除Gateway配置", notes = "")
|
||||
@RequestMapping(value = "gateway-configs", method = RequestMethod.DELETE)
|
||||
@DeleteMapping(value = "gateway-configs")
|
||||
@ResponseBody
|
||||
public Result deleteGatewayConfig(@RequestBody OrderExtensionDeleteGatewayConfigDTO dto) {
|
||||
if (ValidateUtils.isNull(dto) || !dto.legal()) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.xiaojukeji.kafka.manager.web.api.versionone.rd;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ResultStatus;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.vo.common.AccountVO;
|
||||
import com.xiaojukeji.kafka.manager.common.utils.SpringTool;
|
||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||
import com.xiaojukeji.kafka.manager.common.constant.ApiPrefix;
|
||||
import com.xiaojukeji.kafka.manager.web.converters.AccountConverter;
|
||||
@@ -35,7 +36,7 @@ public class RdAccountController {
|
||||
@RequestMapping(value = "accounts", method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Result addAccount(@RequestBody AccountDTO dto) {
|
||||
if (!dto.legal() || ValidateUtils.isNull(dto.getPassword())) {
|
||||
if (!dto.legal() || ValidateUtils.isBlank(dto.getPassword())) {
|
||||
return Result.buildFrom(ResultStatus.PARAM_ILLEGAL);
|
||||
}
|
||||
ResultStatus rs = accountService.createAccount(AccountConverter.convert2AccountDO(dto));
|
||||
@@ -46,7 +47,7 @@ public class RdAccountController {
|
||||
@RequestMapping(value = "accounts", method = RequestMethod.DELETE)
|
||||
@ResponseBody
|
||||
public Result deleteAccount(@RequestParam("username") String username) {
|
||||
ResultStatus rs = accountService.deleteByName(username);
|
||||
ResultStatus rs = accountService.deleteByName(username, SpringTool.getUserName());
|
||||
return Result.buildFrom(rs);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.xiaojukeji.kafka.manager.web.api.versionone.rd;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.common.constant.ApiPrefix;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.Result;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.pojo.gateway.GatewayConfigDO;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.vo.rd.GatewayConfigVO;
|
||||
@@ -15,12 +16,13 @@ import java.util.List;
|
||||
|
||||
@Api(tags = "RD-Gateway配置相关接口(REST)")
|
||||
@RestController
|
||||
@RequestMapping(ApiPrefix.API_V1_RD_PREFIX)
|
||||
public class RdGatewayConfigController {
|
||||
@Autowired
|
||||
private GatewayConfigService gatewayConfigService;
|
||||
|
||||
@ApiOperation(value = "Gateway相关配置信息", notes = "")
|
||||
@RequestMapping(value = "gateway-configs", method = RequestMethod.GET)
|
||||
@GetMapping(value = "gateway-configs")
|
||||
@ResponseBody
|
||||
public Result<List<GatewayConfigVO>> getGatewayConfigs() {
|
||||
List<GatewayConfigDO> doList = gatewayConfigService.list();
|
||||
|
||||
@@ -15,9 +15,16 @@ import com.xiaojukeji.kafka.manager.common.constant.ApiPrefix;
|
||||
import com.xiaojukeji.kafka.manager.web.converters.KafkaFileConverter;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.tomcat.util.http.fileupload.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -30,6 +37,8 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping(ApiPrefix.API_V1_RD_PREFIX)
|
||||
public class RdKafkaFileController {
|
||||
private final static Logger LOGGER = LoggerFactory.getLogger(RdKafkaFileController.class);
|
||||
|
||||
@Autowired
|
||||
private ClusterService clusterService;
|
||||
|
||||
@@ -71,9 +80,33 @@ public class RdKafkaFileController {
|
||||
return new Result<>(KafkaFileConverter.convertKafkaFileVOList(kafkaFileDOList, clusterService));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "文件预览", notes = "")
|
||||
@Deprecated
|
||||
@ApiOperation(value = "文件下载", notes = "")
|
||||
@RequestMapping(value = "kafka-files/{fileId}/config-files", method = RequestMethod.GET)
|
||||
public Result<String> previewKafkaFile(@PathVariable("fileId") Long fileId) {
|
||||
return kafkaFileService.downloadKafkaConfigFile(fileId);
|
||||
public Result downloadKafkaFile(@PathVariable("fileId") Long fileId, HttpServletResponse response) {
|
||||
Result<MultipartFile> multipartFileResult = kafkaFileService.downloadKafkaFile(fileId);
|
||||
|
||||
if (multipartFileResult.failed() || ValidateUtils.isNull(multipartFileResult.getData())) {
|
||||
return multipartFileResult;
|
||||
}
|
||||
|
||||
InputStream is = null;
|
||||
try {
|
||||
response.setContentType(multipartFileResult.getData().getContentType());
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(multipartFileResult.getData().getOriginalFilename(), "UTF-8"));
|
||||
is = multipartFileResult.getData().getInputStream();
|
||||
IOUtils.copy(is, response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("class=RdKafkaFileController||method=downloadKafkaFile||fileId={}||errMsg={}||msg=modify response failed", fileId, e.getMessage());
|
||||
} finally {
|
||||
try {
|
||||
if (is != null) {
|
||||
is.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
return Result.buildSuc();
|
||||
}
|
||||
}
|
||||
@@ -24,14 +24,13 @@ import java.util.List;
|
||||
@RestController
|
||||
@RequestMapping(ApiPrefix.API_V1_RD_PREFIX)
|
||||
public class RdOperateRecordController {
|
||||
|
||||
private static final int MAX_RECORD_COUNT = 200;
|
||||
|
||||
@Autowired
|
||||
private OperateRecordService operateRecordService;
|
||||
|
||||
@ApiOperation(value = "查询操作记录", notes = "")
|
||||
@RequestMapping(value = "operate-record", method = RequestMethod.POST)
|
||||
@PostMapping(value = "operate-record")
|
||||
@ResponseBody
|
||||
public Result<List<OperateRecordVO>> geOperateRecords(@RequestBody OperateRecordDTO dto) {
|
||||
if (ValidateUtils.isNull(dto) || !dto.legal()) {
|
||||
|
||||
@@ -39,10 +39,10 @@ public class SwaggerConfig implements WebMvcConfigurer {
|
||||
|
||||
private ApiInfo apiInfo() {
|
||||
return new ApiInfoBuilder()
|
||||
.title("Kafka云平台-接口文档")
|
||||
.description("欢迎使用滴滴出行开源kafka-manager")
|
||||
.title("Logi-KafkaManager 接口文档")
|
||||
.description("欢迎使用滴滴Logi-KafkaManager")
|
||||
.contact("huangyiminghappy@163.com")
|
||||
.version("2.0")
|
||||
.version("2.2.0")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@ public class GatewayModelConverter {
|
||||
vo.setName(configDO.getName());
|
||||
vo.setValue(configDO.getValue());
|
||||
vo.setVersion(configDO.getVersion());
|
||||
vo.setDescription(configDO.getDescription());
|
||||
vo.setCreateTime(configDO.getCreateTime());
|
||||
vo.setModifyTime(configDO.getModifyTime());
|
||||
voList.add(vo);
|
||||
@@ -76,18 +77,20 @@ public class GatewayModelConverter {
|
||||
|
||||
public static GatewayConfigDO convert2GatewayConfigDO(OrderExtensionAddGatewayConfigDTO configDTO) {
|
||||
GatewayConfigDO configDO = new GatewayConfigDO();
|
||||
configDO.setType(configDO.getType());
|
||||
configDO.setName(configDO.getName());
|
||||
configDO.setValue(configDO.getValue());
|
||||
configDO.setType(configDTO.getType());
|
||||
configDO.setName(configDTO.getName());
|
||||
configDO.setValue(configDTO.getValue());
|
||||
configDO.setDescription(ValidateUtils.isNull(configDTO.getDescription())? "": configDTO.getDescription());
|
||||
return configDO;
|
||||
}
|
||||
|
||||
public static GatewayConfigDO convert2GatewayConfigDO(OrderExtensionModifyGatewayConfigDTO configDTO) {
|
||||
GatewayConfigDO configDO = new GatewayConfigDO();
|
||||
configDO.setId(configDO.getId());
|
||||
configDO.setType(configDO.getType());
|
||||
configDO.setName(configDO.getName());
|
||||
configDO.setValue(configDO.getValue());
|
||||
configDO.setId(configDTO.getId());
|
||||
configDO.setType(configDTO.getType());
|
||||
configDO.setName(configDTO.getName());
|
||||
configDO.setValue(configDTO.getValue());
|
||||
configDO.setDescription(ValidateUtils.isNull(configDTO.getDescription())? "": configDTO.getDescription());
|
||||
return configDO;
|
||||
}
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public class WebMetricsInterceptor {
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
String uri = attributes.getRequest().getRequestURI();
|
||||
if (uri.contains(ApiPrefix.GATEWAY_API_V1_PREFIX)) {
|
||||
return Result.buildFailure("api limited");
|
||||
return Result.buildGatewayFailure("api limited");
|
||||
}
|
||||
return new Result<>(ResultStatus.OPERATION_FORBIDDEN);
|
||||
}
|
||||
|
||||
@@ -11,9 +11,10 @@ spring:
|
||||
name: kafkamanager
|
||||
datasource:
|
||||
kafka-manager:
|
||||
jdbc-url: jdbc:mysql://127.0.0.1:3306/logi_kafka_manager?characterEncoding=UTF-8&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: root
|
||||
|
||||
jdbc-url: jdbc:mysql://127.0.0.1:3306/logi_kafka_manager?characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
|
||||
username: admin
|
||||
password: admin
|
||||
driver-class-name: com.mysql.jdbc.Driver
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
@@ -31,7 +32,7 @@ logging:
|
||||
custom:
|
||||
idc: cn
|
||||
jmx:
|
||||
max-conn: 10
|
||||
max-conn: 10 # 2.3版本配置不在这个地方生效
|
||||
store-metrics-task:
|
||||
community:
|
||||
broker-metrics-enabled: true
|
||||
@@ -52,8 +53,11 @@ account:
|
||||
|
||||
kcm:
|
||||
enabled: false
|
||||
storage:
|
||||
base-url: http://127.0.0.1
|
||||
s3:
|
||||
endpoint: s3.didiyunapi.com
|
||||
access-key: 1234567890
|
||||
secret-key: 0987654321
|
||||
bucket: logi-kafka
|
||||
n9e:
|
||||
base-url: http://127.0.0.1:8004
|
||||
user-token: 12345678
|
||||
|
||||
Reference in New Issue
Block a user