diff --git a/src/main/java/com/gxwebsoft/common/core/Constants.class b/src/main/java/com/gxwebsoft/common/core/Constants.class new file mode 100644 index 0000000..0a42052 Binary files /dev/null and b/src/main/java/com/gxwebsoft/common/core/Constants.class differ diff --git a/src/main/java/com/gxwebsoft/common/core/annotation/QueryField.class b/src/main/java/com/gxwebsoft/common/core/annotation/QueryField.class new file mode 100644 index 0000000..11a0d26 Binary files /dev/null and b/src/main/java/com/gxwebsoft/common/core/annotation/QueryField.class differ diff --git a/src/main/java/com/gxwebsoft/common/core/annotation/QueryType.class b/src/main/java/com/gxwebsoft/common/core/annotation/QueryType.class new file mode 100644 index 0000000..b3b9b84 Binary files /dev/null and b/src/main/java/com/gxwebsoft/common/core/annotation/QueryType.class differ diff --git a/src/main/java/com/gxwebsoft/common/core/web/SimpleBaseController.java b/src/main/java/com/gxwebsoft/common/core/web/SimpleBaseController.java new file mode 100644 index 0000000..40ad05d --- /dev/null +++ b/src/main/java/com/gxwebsoft/common/core/web/SimpleBaseController.java @@ -0,0 +1,52 @@ +package com.gxwebsoft.common.core.web; + +import org.springframework.web.bind.annotation.RestController; + +/** + * 简化版控制器基类,用于代码生成 + * Created by WebSoft on 2019-10-29 15:55 + */ +@RestController +public class SimpleBaseController { + + /** + * 响应成功结果 + * + * @param data 数据内容 + * @param 数据类型 + * @return 响应结果 + */ + protected ApiResult success(T data) { + return new ApiResult(0, "操作成功", data); + } + + /** + * 响应成功结果 + * + * @return 响应结果 + */ + protected ApiResult success(String message) { + return new ApiResult(0, message, null); + } + + /** + * 响应失败结果 + * + * @param message 错误信息 + * @return 响应结果 + */ + protected ApiResult fail(String message) { + return new ApiResult(1, message, null); + } + + /** + * 响应失败结果 + * + * @param code 错误码 + * @param message 错误信息 + * @return 响应结果 + */ + protected ApiResult fail(int code, String message) { + return new ApiResult(code, message, null); + } +} \ No newline at end of file