Search in sources :

Example 1 with TpcMqConsumer

use of com.paascloud.provider.model.domain.TpcMqConsumer in project paascloud-master by paascloud.

the class TpcMqConsumerServiceImpl method updateStatus.

private void updateStatus(final String consumerGroup, final int status) {
    TpcMqConsumer tpcMqConsumer = tpcMqConsumerMapper.getByCid(consumerGroup);
    if (tpcMqConsumer.getStatus() != null && tpcMqConsumer.getStatus() != status) {
        TpcMqConsumer update = new TpcMqConsumer();
        update.setStatus(status);
        update.setId(tpcMqConsumer.getId());
        tpcMqConsumerMapper.updateByPrimaryKeySelective(update);
    }
}
Also used : TpcMqConsumer(com.paascloud.provider.model.domain.TpcMqConsumer)

Example 2 with TpcMqConsumer

use of com.paascloud.provider.model.domain.TpcMqConsumer in project paascloud-master by paascloud.

the class TpcMqConsumerController method modifyConsumerStatusById.

/**
 * 更改消费者状态.
 *
 * @param updateStatusDto the update status dto
 *
 * @return the wrapper
 */
@PostMapping(value = "/modifyStatusById")
@ApiOperation(httpMethod = "POST", value = "更改消费者状态")
@LogAnnotation
public Wrapper modifyConsumerStatusById(@ApiParam(value = "更改消费者状态") @RequestBody UpdateStatusDto updateStatusDto) {
    logger.info("修改consumer状态 updateStatusDto={}", updateStatusDto);
    Long consumerId = updateStatusDto.getId();
    LoginAuthDto loginAuthDto = getLoginAuthDto();
    TpcMqConsumer consumer = new TpcMqConsumer();
    consumer.setId(consumerId);
    consumer.setStatus(updateStatusDto.getStatus());
    consumer.setUpdateInfo(loginAuthDto);
    int result = tpcMqConsumerService.update(consumer);
    return super.handleResult(result);
}
Also used : TpcMqConsumer(com.paascloud.provider.model.domain.TpcMqConsumer) LoginAuthDto(com.paascloud.base.dto.LoginAuthDto) LogAnnotation(com.paascloud.core.annotation.LogAnnotation) ApiOperation(io.swagger.annotations.ApiOperation)

Aggregations

TpcMqConsumer (com.paascloud.provider.model.domain.TpcMqConsumer)2 LoginAuthDto (com.paascloud.base.dto.LoginAuthDto)1 LogAnnotation (com.paascloud.core.annotation.LogAnnotation)1 ApiOperation (io.swagger.annotations.ApiOperation)1