mirror of
https://github.com/didi/KnowStreaming.git
synced 2026-01-09 16:32:07 +08:00
增加Topic同步任务&Bug修复
This commit is contained in:
@@ -7,30 +7,80 @@ import com.xiaojukeji.kafka.manager.common.entity.ao.account.Account;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.pojo.AccountDO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author huangyiminghappy@163.com
|
||||
* @date 2019-04-26
|
||||
*/
|
||||
public interface AccountService {
|
||||
/**
|
||||
* 增加账号
|
||||
* @param accountDO 账号信息
|
||||
* @return
|
||||
*/
|
||||
ResultStatus createAccount(AccountDO accountDO);
|
||||
|
||||
/**
|
||||
* 查询账号信息
|
||||
* @param username 用户名
|
||||
* @return
|
||||
*/
|
||||
AccountDO getAccountDO(String username);
|
||||
|
||||
/**
|
||||
* 删除用户
|
||||
* @param username 用户名
|
||||
* @return
|
||||
*/
|
||||
ResultStatus deleteByName(String username);
|
||||
|
||||
/**
|
||||
* 更新账号
|
||||
* @param accountDO 账号信息
|
||||
* @return
|
||||
*/
|
||||
ResultStatus updateAccount(AccountDO accountDO);
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
* @return
|
||||
*/
|
||||
List<AccountDO> list();
|
||||
|
||||
/**
|
||||
* 依据前缀获取查询用户信息
|
||||
* @param prefix
|
||||
* @return
|
||||
*/
|
||||
List<EnterpriseStaff> searchAccountByPrefix(String prefix);
|
||||
|
||||
/**
|
||||
* 从cache中获取用户角色
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
AccountRoleEnum getAccountRoleFromCache(String username);
|
||||
|
||||
/**
|
||||
* 从cache中获取用户信息
|
||||
* @param userName
|
||||
* @return
|
||||
*/
|
||||
Account getAccountFromCache(String userName);
|
||||
|
||||
/**
|
||||
* 判断当前用户是否是管理员工单的审批人
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
boolean isAdminOrderHandler(String username);
|
||||
|
||||
/**
|
||||
* 是否是运维或者研发角色
|
||||
* @param username
|
||||
* @return
|
||||
*/
|
||||
boolean isOpOrRd(String username);
|
||||
|
||||
List<Account> getAdminOrderHandlerFromCache();
|
||||
}
|
||||
|
||||
@@ -226,6 +226,18 @@ public class AccountServiceImpl implements AccountService {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpOrRd(String username) {
|
||||
if (ValidateUtils.isNull(ACCOUNT_ROLE_CACHE)) {
|
||||
flush();
|
||||
}
|
||||
AccountRoleEnum accountRoleEnum = ACCOUNT_ROLE_CACHE.getOrDefault(username, AccountRoleEnum.NORMAL);
|
||||
if (accountRoleEnum.equals(AccountRoleEnum.OP) || accountRoleEnum.equals(AccountRoleEnum.RD)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Account> getAdminOrderHandlerFromCache() {
|
||||
if (ValidateUtils.isEmptyList(ADMIN_ORDER_HANDLER_CACHE)) {
|
||||
|
||||
@@ -25,6 +25,10 @@ public enum OrderTypeEnum {
|
||||
APPLY_EXPAND_CLUSTER (05, "集群扩容", "modifyClusterOrder"),
|
||||
APPLY_REDUCE_CLUSTER (15, "集群缩容", "modifyClusterOrder"),
|
||||
|
||||
ADD_GATEWAY_CONFIG (06, "增加GateWay配置", "addGatewayConfigOrder"),
|
||||
DELETE_GATEWAY_CONFIG (16, "删除GateWay配置", "deleteGatewayConfigOrder"),
|
||||
MODIFY_GATEWAY_CONFIG (26, "修改GateWay配置", "modifyGatewayConfigOrder"),
|
||||
|
||||
;
|
||||
|
||||
private Integer code;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.xiaojukeji.kafka.manager.bpm.common.entry.apply.gateway;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* 增加gateway配置
|
||||
* @author zengqiao
|
||||
* @date 2021/01/12
|
||||
*/
|
||||
public class OrderExtensionAddGatewayConfigDTO {
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "值")
|
||||
private String value;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderExtensionAddGatewayConfigDTO{" +
|
||||
"type='" + type + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", value='" + value + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public boolean legal() {
|
||||
if (ValidateUtils.isBlank(type)
|
||||
|| ValidateUtils.isBlank(name)
|
||||
|| ValidateUtils.isBlank(value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.xiaojukeji.kafka.manager.bpm.common.entry.apply.gateway;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* 删除gateway配置
|
||||
* @author zengqiao
|
||||
* @date 2021/01/12
|
||||
*/
|
||||
public class OrderExtensionDeleteGatewayConfigDTO {
|
||||
@ApiModelProperty(value = "配置ID")
|
||||
private Long id;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderExtensionDeleteGatewayConfigDTO{" +
|
||||
"id=" + id +
|
||||
'}';
|
||||
}
|
||||
|
||||
public boolean legal() {
|
||||
if (ValidateUtils.isNull(id)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.xiaojukeji.kafka.manager.bpm.common.entry.apply.gateway;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* 修改gateway配置
|
||||
* @author zengqiao
|
||||
* @date 2021/01/12
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class OrderExtensionModifyGatewayConfigDTO {
|
||||
@ApiModelProperty(value = "配置ID")
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "值")
|
||||
private String value;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderExtensionModifyGatewayConfigDTO{" +
|
||||
"id=" + id +
|
||||
", type='" + type + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", value='" + value + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public boolean legal() {
|
||||
if (ValidateUtils.isNull(id)
|
||||
|| ValidateUtils.isBlank(name)
|
||||
|| ValidateUtils.isBlank(type)
|
||||
|| ValidateUtils.isBlank(value)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.xiaojukeji.kafka.manager.bpm.common.entry.detail;
|
||||
|
||||
|
||||
public class OrderDetailGatewayConfigData extends AbstractOrderDetailData {
|
||||
private Long id;
|
||||
|
||||
private String type;
|
||||
|
||||
private String name;
|
||||
|
||||
private String value;
|
||||
|
||||
private Long version;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public Long getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setVersion(Long version) {
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderDetailGatewayConfigData{" +
|
||||
"id=" + id +
|
||||
", type='" + type + '\'' +
|
||||
", name='" + name + '\'' +
|
||||
", value='" + value + '\'' +
|
||||
", version=" + version +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.xiaojukeji.kafka.manager.bpm.common.entry.detail;
|
||||
|
||||
/**
|
||||
* gateway config修改
|
||||
* @author zengqiao
|
||||
* @date 2021/01/13
|
||||
*/
|
||||
public class OrderDetailGatewayConfigModifyData extends AbstractOrderDetailData {
|
||||
/**
|
||||
* 旧的Gateway Config
|
||||
*/
|
||||
private OrderDetailGatewayConfigData oldGatewayConfig;
|
||||
|
||||
/**
|
||||
* 新的Gateway Config
|
||||
*/
|
||||
private OrderDetailGatewayConfigData newGatewayConfig;
|
||||
|
||||
public OrderDetailGatewayConfigData getOldGatewayConfig() {
|
||||
return oldGatewayConfig;
|
||||
}
|
||||
|
||||
public void setOldGatewayConfig(OrderDetailGatewayConfigData oldGatewayConfig) {
|
||||
this.oldGatewayConfig = oldGatewayConfig;
|
||||
}
|
||||
|
||||
public OrderDetailGatewayConfigData getNewGatewayConfig() {
|
||||
return newGatewayConfig;
|
||||
}
|
||||
|
||||
public void setNewGatewayConfig(OrderDetailGatewayConfigData newGatewayConfig) {
|
||||
this.newGatewayConfig = newGatewayConfig;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderDetailGatewayConfigModifyData{" +
|
||||
"oldGatewayConfig=" + oldGatewayConfig +
|
||||
", newGatewayConfig=" + newGatewayConfig +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.xiaojukeji.kafka.manager.bpm.order;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.account.AccountService;
|
||||
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.pojo.OrderDO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractGatewayConfigOrder extends AbstractOrder {
|
||||
@Autowired
|
||||
private AccountService accountService;
|
||||
|
||||
@Override
|
||||
public ResultStatus checkAuthority(OrderDO orderDO, String username) {
|
||||
if (!accountService.isAdminOrderHandler(username)) {
|
||||
return ResultStatus.USER_WITHOUT_AUTHORITY;
|
||||
}
|
||||
return ResultStatus.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Account> getApproverList(String extensions) {
|
||||
return accountService.getAdminOrderHandlerFromCache();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.xiaojukeji.kafka.manager.bpm.order.impl.gateway;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.entry.detail.AbstractOrderDetailData;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.handle.OrderHandleBaseDTO;
|
||||
import com.xiaojukeji.kafka.manager.bpm.order.AbstractGatewayConfigOrder;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.Result;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ResultStatus;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.pojo.OrderDO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author zengqiao
|
||||
* @date 2021/01/12
|
||||
*/
|
||||
@Component("addGatewayConfigOrder")
|
||||
public class AddGatewayConfigOrder extends AbstractGatewayConfigOrder {
|
||||
|
||||
@Override
|
||||
public Result<String> checkExtensionFieldsAndGenerateTitle(String extensions) {
|
||||
return Result.buildSuc();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractOrderDetailData getOrderExtensionDetailData(String extensions) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultStatus handleOrderDetail(OrderDO orderDO, OrderHandleBaseDTO baseDTO, String userName) {
|
||||
return ResultStatus.SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.xiaojukeji.kafka.manager.bpm.order.impl.gateway;
|
||||
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.entry.detail.AbstractOrderDetailData;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.handle.OrderHandleBaseDTO;
|
||||
import com.xiaojukeji.kafka.manager.bpm.order.AbstractGatewayConfigOrder;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.Result;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ResultStatus;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.pojo.OrderDO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author zengqiao
|
||||
* @date 2021/01/12
|
||||
*/
|
||||
@Component("deleteGatewayConfigOrder")
|
||||
public class DeleteGatewayConfigOrder extends AbstractGatewayConfigOrder {
|
||||
@Override
|
||||
public Result<String> checkExtensionFieldsAndGenerateTitle(String extensions) {
|
||||
return Result.buildSuc();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractOrderDetailData getOrderExtensionDetailData(String extensions) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultStatus handleOrderDetail(OrderDO orderDO, OrderHandleBaseDTO baseDTO, String userName) {
|
||||
return ResultStatus.SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.xiaojukeji.kafka.manager.bpm.order.impl.gateway;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.OrderTypeEnum;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.entry.apply.gateway.OrderExtensionModifyGatewayConfigDTO;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.entry.detail.AbstractOrderDetailData;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.entry.detail.OrderDetailGatewayConfigData;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.entry.detail.OrderDetailGatewayConfigModifyData;
|
||||
import com.xiaojukeji.kafka.manager.bpm.common.handle.OrderHandleBaseDTO;
|
||||
import com.xiaojukeji.kafka.manager.bpm.order.AbstractGatewayConfigOrder;
|
||||
import com.xiaojukeji.kafka.manager.common.bizenum.gateway.GatewayConfigKeyEnum;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.Result;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ResultStatus;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.pojo.OrderDO;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.pojo.gateway.GatewayConfigDO;
|
||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||
import com.xiaojukeji.kafka.manager.service.service.OperateRecordService;
|
||||
import com.xiaojukeji.kafka.manager.service.service.gateway.GatewayConfigService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author zengqiao
|
||||
* @date 2021/01/12
|
||||
*/
|
||||
@Component("modifyGatewayConfigOrder")
|
||||
public class ModifyGatewayConfigOrder extends AbstractGatewayConfigOrder {
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ModifyGatewayConfigOrder.class);
|
||||
|
||||
@Autowired
|
||||
private GatewayConfigService gatewayConfigService;
|
||||
|
||||
@Autowired
|
||||
private OperateRecordService operateRecordService;
|
||||
|
||||
@Override
|
||||
public Result<String> checkExtensionFieldsAndGenerateTitle(String extensions) {
|
||||
OrderExtensionModifyGatewayConfigDTO orderExtensionDTO = null;
|
||||
try {
|
||||
orderExtensionDTO = JSONObject.parseObject(extensions, OrderExtensionModifyGatewayConfigDTO.class);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("class=ModifyGatewayConfigOrder||method=checkExtensionFieldsAndGenerateTitle||params={}||errMsg={}", extensions, e.getMessage());
|
||||
return Result.buildFrom(ResultStatus.PARAM_ILLEGAL);
|
||||
}
|
||||
if (!orderExtensionDTO.legal()) {
|
||||
return Result.buildFrom(ResultStatus.PARAM_ILLEGAL);
|
||||
}
|
||||
|
||||
GatewayConfigDO gatewayConfigDO = gatewayConfigService.getById(orderExtensionDTO.getId());
|
||||
if (ValidateUtils.isNull(gatewayConfigDO)) {
|
||||
// 配置不存在
|
||||
return Result.buildFrom(ResultStatus.PARAM_ILLEGAL);
|
||||
}
|
||||
|
||||
GatewayConfigKeyEnum configKeyEnum = GatewayConfigKeyEnum.getByConfigType(orderExtensionDTO.getType());
|
||||
if (ValidateUtils.isNull(configKeyEnum)) {
|
||||
// 配置类型不对
|
||||
return Result.buildFrom(ResultStatus.PARAM_ILLEGAL);
|
||||
}
|
||||
|
||||
return new Result<>(OrderTypeEnum.MODIFY_GATEWAY_CONFIG.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractOrderDetailData getOrderExtensionDetailData(String extensions) {
|
||||
OrderExtensionModifyGatewayConfigDTO orderExtensionDTO = null;
|
||||
try {
|
||||
orderExtensionDTO = JSONObject.parseObject(extensions, OrderExtensionModifyGatewayConfigDTO.class);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("class=ModifyGatewayConfigOrder||method=getOrderExtensionDetailData||params={}||errMsg={}", extensions, e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
// 返回的数据
|
||||
OrderDetailGatewayConfigModifyData orderDetailDTO = new OrderDetailGatewayConfigModifyData();
|
||||
|
||||
// 新的配置
|
||||
OrderDetailGatewayConfigData newGatewayConfig = new OrderDetailGatewayConfigData();
|
||||
newGatewayConfig.setId(orderExtensionDTO.getId());
|
||||
newGatewayConfig.setType(orderExtensionDTO.getType());
|
||||
newGatewayConfig.setName(orderExtensionDTO.getName());
|
||||
newGatewayConfig.setValue(orderExtensionDTO.getValue());
|
||||
orderDetailDTO.setNewGatewayConfig(newGatewayConfig);
|
||||
|
||||
GatewayConfigDO gatewayConfigDO = gatewayConfigService.getById(orderExtensionDTO.getId());
|
||||
if (ValidateUtils.isNull(gatewayConfigDO)) {
|
||||
// 旧的配置不存在
|
||||
return orderDetailDTO;
|
||||
}
|
||||
|
||||
// 旧的配置
|
||||
OrderDetailGatewayConfigData oldGatewayConfig = new OrderDetailGatewayConfigData();
|
||||
newGatewayConfig.setId(gatewayConfigDO.getId());
|
||||
newGatewayConfig.setType(gatewayConfigDO.getType());
|
||||
newGatewayConfig.setName(gatewayConfigDO.getName());
|
||||
newGatewayConfig.setValue(gatewayConfigDO.getValue());
|
||||
newGatewayConfig.setVersion(gatewayConfigDO.getVersion());
|
||||
orderDetailDTO.setOldGatewayConfig(oldGatewayConfig);
|
||||
|
||||
return orderDetailDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultStatus handleOrderDetail(OrderDO orderDO, OrderHandleBaseDTO baseDTO, String username) {
|
||||
return ResultStatus.SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import com.xiaojukeji.kafka.manager.notify.common.OrderNotifyTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -24,6 +25,7 @@ public class OrderApplyNotifyService implements ApplicationListener<OrderApplyEv
|
||||
@Value("${notify.order.detail-url}")
|
||||
private String orderDetailUrl;
|
||||
|
||||
@Async
|
||||
@Override
|
||||
public void onApplicationEvent(OrderApplyEvent orderApplyEvent) {
|
||||
OrderDO orderDO = orderApplyEvent.getOrderDO();
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.xiaojukeji.kafka.manager.notify.notifyer.AbstractNotifyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -21,6 +22,7 @@ public class OrderPassedNotifyService implements ApplicationListener<OrderPassed
|
||||
@Value("${notify.order.detail-url}")
|
||||
private String orderDetailUrl;
|
||||
|
||||
@Async
|
||||
@Override
|
||||
public void onApplicationEvent(OrderPassedEvent orderPassEvent) {
|
||||
OrderDO orderDO = orderPassEvent.getOrderDO();
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.xiaojukeji.kafka.manager.notify.notifyer.AbstractNotifyService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.ApplicationListener;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
@@ -21,6 +22,7 @@ public class OrderRefusedNotifyService implements ApplicationListener<OrderRefus
|
||||
@Value("${notify.order.detail-url}")
|
||||
private String orderDetailUrl;
|
||||
|
||||
@Async
|
||||
@Override
|
||||
public void onApplicationEvent(OrderRefusedEvent orderRefuseEvent) {
|
||||
OrderDO orderDO = orderRefuseEvent.getOrderDO();
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.xiaojukeji.kafka.manager.common.bizenum.*;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.Result;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ResultStatus;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ao.PartitionOffsetDTO;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ao.consumer.ConsumerGroupDTO;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.ao.consumer.ConsumerGroup;
|
||||
import com.xiaojukeji.kafka.manager.common.utils.ValidateUtils;
|
||||
import com.xiaojukeji.kafka.manager.common.zookeeper.znode.brokers.TopicMetadata;
|
||||
import com.xiaojukeji.kafka.manager.common.entity.pojo.ClusterDO;
|
||||
@@ -144,16 +144,11 @@ public class ThirdPartServiceImpl implements ThirdPartService {
|
||||
if (ResultStatus.SUCCESS.getCode() != result.getCode()) {
|
||||
return null;
|
||||
}
|
||||
ConsumerGroupDTO consumerGroupDTO = new ConsumerGroupDTO(
|
||||
clusterDO.getId(),
|
||||
dto.getConsumerGroup(),
|
||||
new ArrayList<>(),
|
||||
OffsetLocationEnum.getOffsetStoreLocation(dto.getLocation())
|
||||
);
|
||||
ConsumerGroup consumerGroup = new ConsumerGroup(clusterDO.getId(), dto.getConsumerGroup(), OffsetLocationEnum.getOffsetStoreLocation(dto.getLocation()));
|
||||
return consumerService.resetConsumerOffset(
|
||||
clusterDO,
|
||||
dto.getTopicName(),
|
||||
consumerGroupDTO,
|
||||
consumerGroup,
|
||||
offsetDTOList
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user