/// <summary>
        /// 改变用户状态
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <ResponseBase> ProcessAction(ChangeStatusFlagRequest request)
        {
            var user = await _sysUserBll.GetSysUser(request.UserId);

            if (user == null)
            {
                return(new ResponseBase().GetResponseError(StatusCode.User40001, "用户不存在"));
            }
            await _sysUserBll.SetUserStatusFlag(request.UserId, request.NewStatusFlag);

            return(ResponseBase.Success());
        }
Beispiel #2
0
 public async Task <ResponseBase> ChangeStatusFlag([FromBody] ChangeStatusFlagRequest request)
 {
     try
     {
         var action = new ChangeStatusFlagAction(_sysUserBll);
         return(await action.ProcessAction(request));
     }
     catch (Exception ex)
     {
         Log.Error(request, ex, this.GetType());
         return(ResponseBase.CodeError());
     }
 }