/// <summary> /// 设置启用/禁用状态 /// </summary> /// <param name="input"></param> public async Task SetIsEnableAsync(SetEnableDto input) { var menu = await _repository.GetAsync(input.Id); menu.IsEnable = input.IsEnable; await _repository.UpdateAsync(menu); }
/// <summary> /// 设置用户状态 /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task SetIsEnableAsync(SetEnableDto input) { var user = await Repository.GetAsync(input.Id); ThrowIf(user == null, new AdminUserNotExistsException(input.Id.ToString())); user.IsEnable = input.IsEnable; await Repository.UpdateAsync(user); }
public async Task <JsonResultModel <bool> > SetIsEnableAsync([FromBody] SetEnableDto input) { await _service.SetIsEnableAsync(input); return(true.ToSuccess()); }