示例#1
0
        public static IActionResult Success(string inputMsg = null)
        {
            var r = new RetData()
            {
                data = null,
                msg  = inputMsg ?? "操作成功"
            };

            return(new OkObjectResult(r));
        }
示例#2
0
        public static IActionResult ExceptionErr(string inputMsg = null)
        {
            var r = new RetData()
            {
                code    = (int)HttpStatusCode.InternalServerError,
                msg     = inputMsg ?? "系统提示 - 系统错误",
                success = false
            };

            return(new OkObjectResult(r));
        }
示例#3
0
        public static IActionResult Forbidden()
        {
            var r = new RetData()
            {
                code    = (int)HttpStatusCode.Forbidden,
                msg     = "系统提示- 无权限操作",
                success = false
            };

            return(new OkObjectResult(r));
        }
示例#4
0
        public static IActionResult Failure(string msg = "操作失败")
        {
            var r = new RetData()
            {
                data    = null,
                success = false,
                msg     = msg
            };

            return(new OkObjectResult(r));
        }
示例#5
0
        public static IActionResult SuccessData(object data, int page = 0, int size = 0, int total = 0)
        {
            var r = new RetData()
            {
                data  = data,
                page  = page,
                size  = size,
                total = total
            };

            return(new OkObjectResult(r));
        }