All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.stalary.easydoc.data.JsonResult Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
/**
 * @(#)JSONResult.java, 2018-09-26.
 * 

* Copyright 2018 Stalary. */ package com.stalary.easydoc.data; import com.alibaba.fastjson.JSONObject; /** * JsonResult * * @author lirongqian * @since 2018/09/26 */ public class JsonResult { public static JSONObject ok() { return ok(null); } public static JSONObject ok(T data) { return new JSONObject() .fluentPut("success", true) .fluentPut("code", 0) .fluentPut("data", data); } public static JSONObject failed() { return failed(null); } public static JSONObject failed(String msg) { return new JSONObject() .fluentPut("success", false) .fluentPut("code", -1) .fluentPut("msg", msg); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy