Exemple #1
0
        public async Task <ActionResult> PublishAsync([FromForm] string content, [FromForm] string nickName)
        {
            Domain.Segments.Hub hub  = new Domain.Segments.Hub();
            Domain.Resp         resp = await hub.PublishAsync(content, nickName);

            return(Pack(resp));
        }
Exemple #2
0
        public async Task <ActionResult> GetHomePageListAsync()
        {
            Domain.Segments.Hub hub  = new Domain.Segments.Hub();
            Domain.Resp         resp = await hub.GetHomePageListAsync();

            return(Pack(resp));
        }
        public async Task <ActionResult> DeleteAsync(int id)
        {
            Domain.Segments.Hub hub  = new Domain.Segments.Hub();
            Domain.Resp         resp = await hub.Remove(id);

            return(Pack(resp));
        }
Exemple #4
0
        public async Task <ActionResult> GetListAsync(int index, int rows, string order)
        {
            Domain.Segments.Hub hub  = new Domain.Segments.Hub();
            Domain.Resp         resp = await hub.GetListAsync(index, rows, order, Domain.Segments.Segment.SegmentState.Enabled);

            return(Pack(resp));
        }
        public async Task <ActionResult> GetListAsync(int index, int rows, string search, string state)
        {
            if (string.IsNullOrWhiteSpace(search))
            {
                search = "";
            }
            Domain.Segments.Segment.SegmentState s = Domain.Segments.Segment.SegmentState.NotSelected;
            if (Enum.TryParse(typeof(Domain.Segments.Segment.SegmentState), state, true, out object result))
            {
                s = (Domain.Segments.Segment.SegmentState)result;
            }

            Domain.Segments.Hub hub  = new Domain.Segments.Hub();
            Domain.Resp         list = await hub.GetListAsync(index, rows, search, s);

            return(Pack(list));
        }