Пример #1
0
        //------------------------------------------------------------------------------
        public virtual void GetChannelListByUuid()
        {
            string _uuid = (string)util.GetParamValue(_context, "uuid");

            ResponseChannelList wrapper = new ResponseChannelList();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "channel/get/by-uuid";

            List<Channel> objs = api.GetChannelListByUuid(
                _uuid
            );

            // get data
            wrapper.data = objs;

            util.SerializeTypeToResponse(_format, _context, wrapper);
        }
Пример #2
0
        //------------------------------------------------------------------------------
        public virtual void GetChannelList()
        {
            ResponseChannelList wrapper = new ResponseChannelList();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "channel/get";

            List<Channel> objs = api.GetChannelList(
            );

            // get data
            wrapper.data = objs;

            util.SerializeTypeToResponse(_format, _context, wrapper);
        }
Пример #3
0
        //------------------------------------------------------------------------------
        public virtual void GetChannelListByOrgIdByTypeId()
        {
            string _org_id = (string)util.GetParamValue(_context, "org_id");
            string _type_id = (string)util.GetParamValue(_context, "type_id");

            ResponseChannelList wrapper = new ResponseChannelList();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "channel/get/by-org-id/by-type-id";

            List<Channel> objs = api.GetChannelListByOrgIdByTypeId(
                _org_id
                , _type_id
            );

            // get data
            wrapper.data = objs;

            util.SerializeTypeToResponse(_format, _context, wrapper);
        }
Пример #4
0
        //------------------------------------------------------------------------------
        public virtual void BrowseChannelListByFilter()
        {
            ResponseChannelList wrapper = new ResponseChannelList();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "channel/browse/by-filter";

            SearchFilter obj = new SearchFilter();
            obj.page = Convert.ToInt32(util.GetParamValue(_context, "page"));
            obj.page_size = Convert.ToInt32(util.GetParamValue(_context, "page-size"));
            obj.filter = util.GetParamValue(_context, "filter");

            ChannelResult result = api.BrowseChannelListByFilter(obj);
            wrapper.info.Add("total_rows", result.total_rows);
            wrapper.info.Add("total_pages", result.total_pages);
            wrapper.info.Add("page", result.page);
            wrapper.info.Add("page_size", result.page_size);

            // get data
            wrapper.data = result.data;

            util.SerializeTypeToResponse(_format, _context, wrapper);
        }