Esempio n. 1
0
        /// <summary>
        /// 查询列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public List <UserModel> GetList(UserGetListRequest request)
        {
            List <DbParameter> paramenters = new List <DbParameter>();
            string             sqlWhere    = CreateWhereSql(request, paramenters);

            return(base.GetModels(sqlWhere, paramenters, request.Row, request.Page));
        }
Esempio n. 2
0
        /// <summary>
        /// 查询列表
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public List <UserModel> GetList(UserGetListRequest request)
        {
            List <DbParameter> paramenters = new List <DbParameter>();
            string             sqlWhere    = CreateWhereSql(request, paramenters);

            sqlWhere += " order by t_user.c_create_time desc ";
            return(base.GetModels(sqlWhere, paramenters, request.Rows, request.Page));
        }
        public UserGetListResponse Handle(UserGetListRequest request)
        {
            var users = userRepository.FindAll();

            return(new UserGetListResponse(
                       users.Select(x => new UserSummary(x.Id, x.UserName)).ToList()
                       ));
        }
Esempio n. 4
0
        public bool TranslateAkkaGetListResponseToExternalMessage(Response akkaResponse)
        {
            UserGetListResponse response    = akkaResponse as UserGetListResponse;
            UserGetListRequest  request     = response.OriginalRequest as UserGetListRequest;
            HTTPSourcedRequest  httpRequest = request.OriginalHTTPRequest;


            HTTPExternalInterface.HandleRequestResponse(new HTTPDestinedRequestResponse(MicroServices.ProcessingStatus.Processed, response.ListOfUserStates, httpRequest), false);
            return(true);
        }
        public IActionResult Index()
        {
            var request  = new UserGetListRequest();
            var response = bus.Handle(request);

            var summaries = response.Summaries
                            .Select(x => new UserSummaryViewModel(x.Id, x.UserName))
                            .ToList();

            return(View(summaries));
        }
        public BasicResponse <List <UserInfo> > GetUserList(UserGetListRequest userrequest)
        {
            var userresponse = new BasicResponse <List <UserInfo> >();

            userrequest.PagerInfo.PageIndex = userrequest.PagerInfo.PageIndex - 1;
            if (userrequest.PagerInfo.PageIndex < 0)
            {
                userrequest.PagerInfo.PageIndex = 0;
            }
            int rowcount       = 0;
            var userModelLists = _Repository.GetUserList(userrequest.PagerInfo.PageIndex, userrequest.PagerInfo.PageSize, out rowcount);
            var userInfoLists  = new List <UserInfo>();

            foreach (var item in userModelLists)
            {
                var UserInfo = ObjectConverter.Copy <UserModel, UserInfo>(item);
                userInfoLists.Add(UserInfo);
            }
            userresponse.Data = userInfoLists;
            return(userresponse);
        }
Esempio n. 7
0
        public ServerResponse <UserGetListResponse> GetList(UserGetListRequest request)
        {
            ServerResponse <UserGetListResponse> response = new ServerResponse <UserGetListResponse>();

            try
            {
                //查数据
                var list = dal.GetList(request);
                //查总记录数
                var count = dal.GetCount(JsonHelper.CloneObject <UserGetCountRequest>(request));
                response.Data = new UserGetListResponse()
                {
                    DataList = list, Count = count
                };
                response.Code = ServerResponseType.成功;
            }
            catch (Exception ex)
            {
                response.Code     = ServerResponseType.调用异常;
                response.ErrorMsg = ex.ToString();
                Log.LogHelper.WriteErrorLog(GetType(), ex);
            }
            return(response);
        }
Esempio n. 8
0
 public UserGetListResponse(IActorRef requestor, ImmutableList <UserState> reply, UserGetListRequest originalRequest) : base(requestor, reply, originalRequest)
 {
 }
Esempio n. 9
0
 public ServerResponse <UserGetListResponse> GetList(UserGetListRequest request)
 {
     return(Action <UserGetListResponse>(request, "api/User/list"));
 }
Esempio n. 10
0
 public BasicResponse <List <UserInfo> > GetUserList(UserGetListRequest userrequest)
 {
     return(_userService.GetUserList(userrequest));
 }
        public BasicResponse <List <UserInfo> > GetUserList(UserGetListRequest userrequest)
        {
            var responseStr = HttpClientHelper.Post(Webapi + "/v1/User/GetPageList?token=" + Token, JSONHelper.ToJSONString(userrequest));

            return(JSONHelper.ParseJSONString <BasicResponse <List <UserInfo> > >(responseStr));
        }
Esempio n. 12
0
        public void TranslateExternalGetListRequestToAkkaMessage(HTTPSourcedRequest externalRequest)
        {
            UserGetListRequest getListRequest = new UserGetListRequest(ReplyTo, externalRequest);

            SendTo.Tell(getListRequest, ReplyTo);
        }
 public UserGetListResponse Handle(UserGetListRequest request)
 {
     return(jsonsLoader.Generate <UserGetListResponse>());
 }