Example #1
0
        public ResponseResult AppAddRoute(string routeName, string userId, string point)
        {
            var        result     = ResponseResult.Default();
            AppService appService = new AppService();

            try
            {
                if (string.IsNullOrEmpty(routeName))
                {
                    return(ResponseResult.Error("routeName不能为空"));
                }
                if (string.IsNullOrEmpty(userId))
                {
                    return(ResponseResult.Error("userId不能为空"));
                }
                if (string.IsNullOrEmpty(point))
                {
                    return(ResponseResult.Error("point不能为空"));
                }
                else
                {
                    bool status = appService.AddRoute(routeName, Convert.ToInt32(userId), point);
                    if (status == true)
                    {
                        return(ResponseResult.Success("添加成功"));
                    }
                    else
                    {
                        return(ResponseResult.Error("添加失败,同一用户下路径名不能重复"));
                    }
                }
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(ex.Message);
            }
            return(result);
        }