Exemplo n.º 1
0
        public IActionResult GetControllerList()
        {
            Robj <List <ControllerModel> > robj = new Robj <List <ControllerModel> >();

            try
            {
                List <ControllerModel> controllerList = JcApiHelper.GetControllerList();
                robj.Result = controllerList;
            }
            catch (Exception ex)
            {
                robj.Error(ex.Message);
            }
            return(new JsonResult(robj));
        }
Exemplo n.º 2
0
        public IActionResult GetPType([FromForm] string typeId)
        {
            Robj <PTypeModel> robj = new Robj <PTypeModel>();

            try
            {
                if (string.IsNullOrEmpty(typeId))
                {
                    throw new Exception("参数typeId不能为空");
                }
                PTypeModel ptype = JcApiHelper.GetPTypeModel(typeId);
                robj.Result = ptype;
            }
            catch (Exception ex)
            {
                robj.Error(ex.Message);
            }
            return(new JsonResult(robj));
        }
Exemplo n.º 3
0
        public IActionResult GetAction([FromForm] string actionId)
        {
            Robj <ActionModel> robj = new Robj <ActionModel>();

            try
            {
                if (string.IsNullOrEmpty(actionId))
                {
                    throw new Exception("参数Id不能为空");
                }
                ActionModel action = JcApiHelper.GetAction(actionId);
                robj.Result = action;
            }
            catch (Exception ex)
            {
                robj.Error(ex.Message);
            }
            return(new JsonResult(robj));
        }
Exemplo n.º 4
0
        public IActionResult GetController([FromForm] string controllerId)
        {
            Robj <ControllerModel> robj = new Robj <ControllerModel>();

            try
            {
                if (string.IsNullOrEmpty(controllerId))
                {
                    throw new Exception("参数controllerId不能为空");
                }
                ControllerModel controller = JcApiHelper.GetController(controllerId);
                robj.Result = controller;
            }
            catch (Exception ex)
            {
                robj.Error(ex.Message);
            }
            return(new JsonResult(robj));
        }
Exemplo n.º 5
0
        public IActionResult GetControllerListByIds([FromBody] List <string> ids)
        {
            Robj <List <ControllerModel> > robj = new Robj <List <ControllerModel> >();

            try
            {
                // List<string> ids = idsStr.Split(',').ToList();
                List <ControllerModel> list = new List <ControllerModel>();
                for (int i = 0; i < ids.Count; i++)
                {
                    list.Add(JcApiHelper.GetController(ids[i]));
                }
                robj.Result = list;
            }
            catch (Exception ex)
            {
                robj.Error(ex.Message);
            }
            return(new JsonResult(robj));
        }
Exemplo n.º 6
0
        public IActionResult GetTsModel([FromForm] string itemId, [FromForm] string itemType)
        {
            Robj <TsResultModel> robj = new Robj <TsResultModel>();

            try
            {
                if (string.IsNullOrEmpty(itemId))
                {
                    throw new Exception("参数typeId不能为空");
                }
                if (string.IsNullOrEmpty(itemType))
                {
                    throw new Exception("参数itemType不能为空");
                }
                TsCreator     creator  = new TsCreator();
                TsResultModel tsResult = creator.GetTsResultModel(itemId, itemType);
                robj.Result = tsResult;
            }
            catch (Exception ex)
            {
                robj.Error(ex.Message);
            }
            return(new JsonResult(robj));
        }