Пример #1
0
 public async Task <ResponseBase> GetUserDataLimit([FromBody] GetUserDataLimitRequest request)
 {
     try
     {
         var action = new GetUserDataLimitAction(_sysUserBll, _areaBll, _shopBll);
         return(await action.ProcessAction(request));
     }
     catch (Exception ex)
     {
         Log.Error(request, ex, this.GetType());
         return(ResponseBase.CodeError());
     }
 }
Пример #2
0
        /// <summary>
        /// 获取用户数据权限信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public async Task <ResponseBase> ProcessAction(GetUserDataLimitRequest request)
        {
            var user = await _sysUserBll.GetSysUser(request.UserId);

            if (user == null)
            {
                return(new ResponseBase(StatusCode.User40001, "用户不存在"));
            }
            switch (user.DataLimitType)
            {
            case (int)DataLimitTypeEnum.All:
                return(await GetUserDataLimitAll());

            case (int)DataLimitTypeEnum.Area:
                return(await GetUserDataLimitArea(user.DataLimitArea));;

            case (int)DataLimitTypeEnum.Shop:
                return(await GetUserDataLimitShop(user.DataLimitShop));
            }
            return(new ResponseBase().GetResponseError(StatusCode.User40003, "用户数据权限类型错误"));
        }