Search in sources :

Example 1 with TpcMqProducer

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

the class TpcMqProducerServiceImpl method updateStatus.

private void updateStatus(final String producerGroup, final int status) {
    TpcMqProducer tpcMqProducer = mdcMqProducerMapper.getByPid(producerGroup);
    if (tpcMqProducer.getStatus() != null && tpcMqProducer.getStatus() != status) {
        TpcMqProducer update = new TpcMqProducer();
        update.setStatus(status);
        update.setId(tpcMqProducer.getId());
        mdcMqProducerMapper.updateByPrimaryKeySelective(update);
    }
}
Also used : TpcMqProducer(com.paascloud.provider.model.domain.TpcMqProducer)

Example 2 with TpcMqProducer

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

the class TpcMqProducerController method modifyProducerStatusById.

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

Aggregations

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