格式化
This commit is contained in:
@@ -180,7 +180,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
|
|
||||||
private byte[] lastPathBytes;
|
private byte[] lastPathBytes;
|
||||||
|
|
||||||
private final ByteArray body;
|
private final ByteArray bodyBytes;
|
||||||
|
|
||||||
private byte[] headerBytes;
|
private byte[] headerBytes;
|
||||||
|
|
||||||
@@ -206,9 +206,9 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
this(context, new ByteArray());
|
this(context, new ByteArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected HttpRequest(HttpContext context, ByteArray body) {
|
protected HttpRequest(HttpContext context, ByteArray bodyBytes) {
|
||||||
super(context);
|
super(context);
|
||||||
this.body = body;
|
this.bodyBytes = bodyBytes;
|
||||||
this.remoteAddrHeader = context.remoteAddrHeader;
|
this.remoteAddrHeader = context.remoteAddrHeader;
|
||||||
this.remoteAddrHeaders = context.remoteAddrHeaders;
|
this.remoteAddrHeaders = context.remoteAddrHeaders;
|
||||||
this.localHeader = context.localHeader;
|
this.localHeader = context.localHeader;
|
||||||
@@ -219,7 +219,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
@SuppressWarnings("OverridableMethodCallInConstructor")
|
@SuppressWarnings("OverridableMethodCallInConstructor")
|
||||||
protected HttpRequest(HttpContext context, WebRequest req) {
|
protected HttpRequest(HttpContext context, WebRequest req) {
|
||||||
super(context);
|
super(context);
|
||||||
this.body = new ByteArray();
|
this.bodyBytes = new ByteArray();
|
||||||
this.remoteAddrHeader = null;
|
this.remoteAddrHeader = null;
|
||||||
this.remoteAddrHeaders = null;
|
this.remoteAddrHeaders = null;
|
||||||
this.localHeader = null;
|
this.localHeader = null;
|
||||||
@@ -235,7 +235,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
this.rpc = req.rpc;
|
this.rpc = req.rpc;
|
||||||
this.traceid = req.getTraceid();
|
this.traceid = req.getTraceid();
|
||||||
if (req.getBody() != null) {
|
if (req.getBody() != null) {
|
||||||
this.body.put(req.getBody());
|
this.bodyBytes.put(req.getBody());
|
||||||
}
|
}
|
||||||
if (req.getHeaders() != null) {
|
if (req.getHeaders() != null) {
|
||||||
this.headers.setAll(req.getHeaders());
|
this.headers.setAll(req.getHeaders());
|
||||||
@@ -266,7 +266,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
|
|
||||||
public WebRequest createSimpleRequest(String contextPath) {
|
public WebRequest createSimpleRequest(String contextPath) {
|
||||||
WebRequest req = new WebRequest();
|
WebRequest req = new WebRequest();
|
||||||
req.setBody(body.length() == 0 ? null : body.getBytes());
|
req.setBody(bodyBytes.length() == 0 ? null : bodyBytes.getBytes());
|
||||||
if (!getHeaders().isEmpty()) {
|
if (!getHeaders().isEmpty()) {
|
||||||
req.setHeaders(headers);
|
req.setHeaders(headers);
|
||||||
if (headers.contains(Rest.REST_HEADER_RPC)) { // 外部request不能包含RPC的header信息
|
if (headers.contains(Rest.REST_HEADER_RPC)) { // 外部request不能包含RPC的header信息
|
||||||
@@ -328,7 +328,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
@Override
|
@Override
|
||||||
protected int readHeader(final ByteBuffer buf, final Request last) {
|
protected int readHeader(final ByteBuffer buf, final Request last) {
|
||||||
final ByteBuffer buffer = buf;
|
final ByteBuffer buffer = buf;
|
||||||
ByteArray bytes = body;
|
ByteArray bytes = bodyBytes;
|
||||||
if (this.readState == READ_STATE_ROUTE) {
|
if (this.readState == READ_STATE_ROUTE) {
|
||||||
int rs = readMethodUriLine(buffer);
|
int rs = readMethodUriLine(buffer);
|
||||||
if (rs != 0) {
|
if (rs != 0) {
|
||||||
@@ -419,7 +419,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
if (lr == 0) {
|
if (lr == 0) {
|
||||||
this.readState = READ_STATE_END;
|
this.readState = READ_STATE_END;
|
||||||
if (bytes.isEmpty()) {
|
if (bytes.isEmpty()) {
|
||||||
this.bodyParsed = true; // no body data
|
this.bodyParsed = true; // no bodyBytes data
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
buffer.clear();
|
buffer.clear();
|
||||||
@@ -432,7 +432,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
}
|
}
|
||||||
this.readState = READ_STATE_END;
|
this.readState = READ_STATE_END;
|
||||||
if (bytes.isEmpty()) {
|
if (bytes.isEmpty()) {
|
||||||
this.bodyParsed = true; // no body data
|
this.bodyParsed = true; // no bodyBytes data
|
||||||
} else if (!getmethod && this.contentLength < 0 && keepAlive) {
|
} else if (!getmethod && this.contentLength < 0 && keepAlive) {
|
||||||
// keep-alive=true: Content-Length和chunk必然是二选一。
|
// keep-alive=true: Content-Length和chunk必然是二选一。
|
||||||
// keep-alive=false: Content-Length可有可无.
|
// keep-alive=false: Content-Length可有可无.
|
||||||
@@ -493,12 +493,12 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
throw new RedkaleException("invalid chunk end");
|
throw new RedkaleException("invalid chunk end");
|
||||||
}
|
}
|
||||||
this.readState = READ_STATE_END;
|
this.readState = READ_STATE_END;
|
||||||
if (this.body.isEmpty()) {
|
if (this.bodyBytes.isEmpty()) {
|
||||||
this.bodyParsed = true; // no body data
|
this.bodyParsed = true; // no bodyBytes data
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
ByteArray bodyBytes = this.body;
|
ByteArray bodyBytes = this.bodyBytes;
|
||||||
if (this.chunkedCurrOffset < this.chunkedLength) {
|
if (this.chunkedCurrOffset < this.chunkedLength) {
|
||||||
for (; ; ) {
|
for (; ; ) {
|
||||||
if (remain-- < 1) {
|
if (remain-- < 1) {
|
||||||
@@ -565,7 +565,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
|
|
||||||
private int loadHeaderBytes(final ByteBuffer buf) {
|
private int loadHeaderBytes(final ByteBuffer buf) {
|
||||||
final ByteBuffer buffer = buf;
|
final ByteBuffer buffer = buf;
|
||||||
ByteArray bytes = body; // body当temp buffer使用
|
ByteArray bytes = bodyBytes; // body当temp buffer使用
|
||||||
int remain = buffer.remaining();
|
int remain = buffer.remaining();
|
||||||
byte b1, b2, b3, b4;
|
byte b1, b2, b3, b4;
|
||||||
for (; ; ) {
|
for (; ; ) {
|
||||||
@@ -638,7 +638,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
Charset charset = this.context.getCharset();
|
Charset charset = this.context.getCharset();
|
||||||
int remain = buffer.remaining();
|
int remain = buffer.remaining();
|
||||||
int size;
|
int size;
|
||||||
ByteArray bytes = body; // body当temp buffer使用
|
ByteArray bytes = bodyBytes; // body当temp buffer使用
|
||||||
// 读method
|
// 读method
|
||||||
if (this.method == null) {
|
if (this.method == null) {
|
||||||
boolean flag = false;
|
boolean flag = false;
|
||||||
@@ -1085,9 +1085,9 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
if (headerBytes == null) {
|
if (headerBytes == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (body.isEmpty()) { // body当temp buffer使用
|
if (bodyBytes.isEmpty()) { // body当temp buffer使用
|
||||||
readHeaderLines(ByteBuffer.wrap(headerBytes), body);
|
readHeaderLines(ByteBuffer.wrap(headerBytes), bodyBytes);
|
||||||
body.clear();
|
bodyBytes.clear();
|
||||||
} else { // 存有body数据
|
} else { // 存有body数据
|
||||||
readHeaderLines(ByteBuffer.wrap(headerBytes), new ByteArray());
|
readHeaderLines(ByteBuffer.wrap(headerBytes), new ByteArray());
|
||||||
}
|
}
|
||||||
@@ -1221,7 +1221,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
if (!context.sameHeader || !context.lazyHeader) {
|
if (!context.sameHeader || !context.lazyHeader) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
HttpRequest req = new HttpRequest(context, this.body);
|
HttpRequest req = new HttpRequest(context, this.bodyBytes);
|
||||||
req.headerLength = this.headerLength;
|
req.headerLength = this.headerLength;
|
||||||
req.headerBytes = this.headerBytes;
|
req.headerBytes = this.headerBytes;
|
||||||
req.headerParsed = this.headerParsed;
|
req.headerParsed = this.headerParsed;
|
||||||
@@ -1294,13 +1294,13 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
this.requestPath = null;
|
this.requestPath = null;
|
||||||
this.queryBytes = null;
|
this.queryBytes = null;
|
||||||
this.boundary = false;
|
this.boundary = false;
|
||||||
this.bodyParsed = false;
|
|
||||||
this.moduleid = 0;
|
this.moduleid = 0;
|
||||||
this.actionid = 0;
|
this.actionid = 0;
|
||||||
this.annotations = null;
|
this.annotations = null;
|
||||||
this.remoteAddr = null;
|
this.remoteAddr = null;
|
||||||
this.params.clear();
|
this.params.clear();
|
||||||
this.body.clear();
|
this.bodyBytes.clear();
|
||||||
|
this.bodyParsed = false;
|
||||||
// 内部
|
// 内部
|
||||||
this.actionEntry = null;
|
this.actionEntry = null;
|
||||||
super.recycle();
|
super.recycle();
|
||||||
@@ -1319,7 +1319,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
unzipEncoding();
|
unzipEncoding();
|
||||||
}
|
}
|
||||||
if (this.getContentType() != null && this.contentType.toLowerCase().contains("x-www-form-urlencoded")) {
|
if (this.getContentType() != null && this.contentType.toLowerCase().contains("x-www-form-urlencoded")) {
|
||||||
addParameter(body, true, 0, body.length());
|
addParameter(bodyBytes, true, 0, bodyBytes.length());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1334,18 +1334,18 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
try {
|
try {
|
||||||
if ("gzip".equalsIgnoreCase(this.contentEncoding)) {
|
if ("gzip".equalsIgnoreCase(this.contentEncoding)) {
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
ByteArrayInputStream in = new ByteArrayInputStream(body.content(), 0, body.length());
|
ByteArrayInputStream in = new ByteArrayInputStream(bodyBytes.content(), 0, bodyBytes.length());
|
||||||
GZIPInputStream ungzip = new GZIPInputStream(in);
|
GZIPInputStream ungzip = new GZIPInputStream(in);
|
||||||
int n;
|
int n;
|
||||||
byte[] buffer = array().content();
|
byte[] buffer = array().content();
|
||||||
while ((n = ungzip.read(buffer)) > 0) {
|
while ((n = ungzip.read(buffer)) > 0) {
|
||||||
out.write(buffer, 0, n);
|
out.write(buffer, 0, n);
|
||||||
}
|
}
|
||||||
body.clear();
|
bodyBytes.clear();
|
||||||
body.put(out.toByteArray());
|
bodyBytes.put(out.toByteArray());
|
||||||
} else if ("deflate".equalsIgnoreCase(this.contentEncoding)) {
|
} else if ("deflate".equalsIgnoreCase(this.contentEncoding)) {
|
||||||
Inflater infl = new Inflater();
|
Inflater infl = new Inflater();
|
||||||
infl.setInput(body.content(), 0, body.length());
|
infl.setInput(bodyBytes.content(), 0, bodyBytes.length());
|
||||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
int n;
|
int n;
|
||||||
byte[] buffer = array().content();
|
byte[] buffer = array().content();
|
||||||
@@ -1357,8 +1357,8 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
out.write(buffer, 0, n);
|
out.write(buffer, 0, n);
|
||||||
}
|
}
|
||||||
infl.end();
|
infl.end();
|
||||||
body.clear();
|
bodyBytes.clear();
|
||||||
body.put(out.toByteArray());
|
bodyBytes.put(out.toByteArray());
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RedkaleException("invalid encoding content");
|
throw new RedkaleException("invalid encoding content");
|
||||||
@@ -1799,7 +1799,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
* @return 内容
|
* @return 内容
|
||||||
*/
|
*/
|
||||||
public String getBody(final Charset charset) {
|
public String getBody(final Charset charset) {
|
||||||
return charset == null ? body.toString() : body.toString(charset);
|
return charset == null ? bodyBytes.toString() : bodyBytes.toString(charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1809,7 +1809,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
*/
|
*/
|
||||||
@ConvertDisabled
|
@ConvertDisabled
|
||||||
public String getBodyUTF8() {
|
public String getBodyUTF8() {
|
||||||
return body.toString(StandardCharsets.UTF_8);
|
return bodyBytes.toString(StandardCharsets.UTF_8);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1820,7 +1820,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
* @return 内容
|
* @return 内容
|
||||||
*/
|
*/
|
||||||
public <T> T getBodyJson(java.lang.reflect.Type type) {
|
public <T> T getBodyJson(java.lang.reflect.Type type) {
|
||||||
if (isEmpty(body)) {
|
if (isEmpty(bodyBytes)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Convert convert = this.reqConvert;
|
Convert convert = this.reqConvert;
|
||||||
@@ -1828,9 +1828,9 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
convert = context.getJsonConvert();
|
convert = context.getJsonConvert();
|
||||||
}
|
}
|
||||||
if (type == byte[].class) {
|
if (type == byte[].class) {
|
||||||
return (T) body.getBytes();
|
return (T) bodyBytes.getBytes();
|
||||||
}
|
}
|
||||||
return (T) convert.convertFrom(type, body.content());
|
return (T) convert.convertFrom(type, bodyBytes.content());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1842,13 +1842,13 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
* @return 内容
|
* @return 内容
|
||||||
*/
|
*/
|
||||||
public <T> T getBodyJson(Convert convert, java.lang.reflect.Type type) {
|
public <T> T getBodyJson(Convert convert, java.lang.reflect.Type type) {
|
||||||
if (isEmpty(body)) {
|
if (isEmpty(bodyBytes)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (type == byte[].class) {
|
if (type == byte[].class) {
|
||||||
return (T) body.getBytes();
|
return (T) bodyBytes.getBytes();
|
||||||
}
|
}
|
||||||
return (T) convert.convertFrom(type, body.content());
|
return (T) convert.convertFrom(type, bodyBytes.content());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1857,7 +1857,7 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
* @return 内容
|
* @return 内容
|
||||||
*/
|
*/
|
||||||
public byte[] getBody() {
|
public byte[] getBody() {
|
||||||
return body.length() == 0 ? null : body.getBytes();
|
return bodyBytes.length() == 0 ? null : bodyBytes.getBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1867,13 +1867,13 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
*/
|
*/
|
||||||
@ConvertDisabled
|
@ConvertDisabled
|
||||||
protected ByteArray getDirectBody() {
|
protected ByteArray getDirectBody() {
|
||||||
return body;
|
return bodyBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void updateBody(byte[] body) {
|
protected void updateBody(byte[] body) {
|
||||||
this.body.clear();
|
this.bodyBytes.clear();
|
||||||
if (body != null) {
|
if (body != null) {
|
||||||
this.body.put(body);
|
this.bodyBytes.put(body);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1895,8 +1895,8 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
+ (this.getHost() != null ? (", \r\n host: " + this.host) : "")
|
+ (this.getHost() != null ? (", \r\n host: " + this.host) : "")
|
||||||
+ (this.getContentLength() >= 0 ? (", \r\n contentLength: " + this.contentLength) : "")
|
+ (this.getContentLength() >= 0 ? (", \r\n contentLength: " + this.contentLength) : "")
|
||||||
+ (this.contentEncoding != null ? (", \r\n contentEncoding: " + this.contentEncoding) : "")
|
+ (this.contentEncoding != null ? (", \r\n contentEncoding: " + this.contentEncoding) : "")
|
||||||
+ (this.body.length() > 0 ? (", \r\n bodyLength: " + this.body.length()) : "")
|
+ (this.bodyBytes.length() > 0 ? (", \r\n bodyLength: " + this.bodyBytes.length()) : "")
|
||||||
+ (this.boundary || this.body.isEmpty()
|
+ (this.boundary || this.bodyBytes.isEmpty()
|
||||||
? ""
|
? ""
|
||||||
: (", \r\n bodyContent: "
|
: (", \r\n bodyContent: "
|
||||||
+ (this.respConvertType == null || this.respConvertType == ConvertType.JSON
|
+ (this.respConvertType == null || this.respConvertType == ConvertType.JSON
|
||||||
@@ -1949,10 +1949,10 @@ public class HttpRequest extends Request<HttpContext> {
|
|||||||
context.getCharset(),
|
context.getCharset(),
|
||||||
this.getContentType(),
|
this.getContentType(),
|
||||||
this.params.map(),
|
this.params.map(),
|
||||||
new BufferedInputStream(in, Math.max(body.length(), 8192)) {
|
new BufferedInputStream(in, Math.max(bodyBytes.length(), 8192)) {
|
||||||
{
|
{
|
||||||
body.copyTo(this.buf);
|
bodyBytes.copyTo(this.buf);
|
||||||
this.count = body.length();
|
this.count = bodyBytes.length();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
null);
|
null);
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ public abstract class AbstractDataSqlSource extends AbstractDataSource
|
|||||||
protected String tableNotExistSqlstates;
|
protected String tableNotExistSqlstates;
|
||||||
|
|
||||||
// 用于复制表结构使用, sql语句必须包含IF NOT EXISTS判断,确保重复执行不会报错
|
// 用于复制表结构使用, sql语句必须包含IF NOT EXISTS判断,确保重复执行不会报错
|
||||||
protected String tablecopySQL;
|
protected String tableCopySQL;
|
||||||
|
|
||||||
protected AnyValue config;
|
protected AnyValue config;
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ public abstract class AbstractDataSqlSource extends AbstractDataSource
|
|||||||
|
|
||||||
this.tableNotExistSqlstates =
|
this.tableNotExistSqlstates =
|
||||||
";" + readConfProps.getProperty(DATA_SOURCE_TABLENOTEXIST_SQLSTATES, "42000;42S02") + ";";
|
";" + readConfProps.getProperty(DATA_SOURCE_TABLENOTEXIST_SQLSTATES, "42000;42S02") + ";";
|
||||||
this.tablecopySQL = readConfProps.getProperty(
|
this.tableCopySQL = readConfProps.getProperty(
|
||||||
DATA_SOURCE_TABLECOPY_SQLTEMPLATE, "CREATE TABLE IF NOT EXISTS #{newtable} LIKE #{oldtable}");
|
DATA_SOURCE_TABLECOPY_SQLTEMPLATE, "CREATE TABLE IF NOT EXISTS #{newtable} LIKE #{oldtable}");
|
||||||
|
|
||||||
this.autoDDL = "true".equals(readConfProps.getProperty(DATA_SOURCE_TABLE_AUTODDL, "false"));
|
this.autoDDL = "true".equals(readConfProps.getProperty(DATA_SOURCE_TABLE_AUTODDL, "false"));
|
||||||
@@ -851,7 +851,7 @@ public abstract class AbstractDataSqlSource extends AbstractDataSource
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected String getTableCopySql(EntityInfo info, String newTable) {
|
protected String getTableCopySql(EntityInfo info, String newTable) {
|
||||||
return tablecopySQL.replace("#{newtable}", newTable).replace("#{oldtable}", info.table);
|
return tableCopySQL.replace("#{newtable}", newTable).replace("#{oldtable}", info.table);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Serializable getSQLAttrValue(EntityInfo info, Attribute attr, Serializable val) {
|
protected Serializable getSQLAttrValue(EntityInfo info, Attribute attr, Serializable val) {
|
||||||
|
|||||||
@@ -2401,7 +2401,7 @@ public final class CacheMemorySource extends AbstractCacheSource {
|
|||||||
List<T> list = new ArrayList<>();
|
List<T> list = new ArrayList<>();
|
||||||
CacheEntry entry = find(key, CacheEntryType.ZSET);
|
CacheEntry entry = find(key, CacheEntryType.ZSET);
|
||||||
if (entry == null) {
|
if (entry == null) {
|
||||||
for (int i = 0; i < members.length; i++) {
|
for (String member : members) {
|
||||||
list.add(null);
|
list.add(null);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ package org.redkale.source;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import org.redkale.annotation.Nullable;
|
||||||
import org.redkale.util.Attribute;
|
import org.redkale.util.Attribute;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,7 +16,7 @@ import org.redkale.util.Attribute;
|
|||||||
public interface DataResultSetRow {
|
public interface DataResultSetRow {
|
||||||
|
|
||||||
// 可以为空
|
// 可以为空
|
||||||
public EntityInfo getEntityInfo();
|
public @Nullable EntityInfo getEntityInfo();
|
||||||
|
|
||||||
// index从1开始
|
// index从1开始
|
||||||
public Object getObject(int index);
|
public Object getObject(int index);
|
||||||
|
|||||||
@@ -36,11 +36,11 @@ public interface DistributeTableStrategy<T> {
|
|||||||
* 获取DataSource资源名,为null表示没有分布物理库 <br>
|
* 获取DataSource资源名,为null表示没有分布物理库 <br>
|
||||||
* 新增对象或更新单个对象(DataSource.insert、DataSource.update)时调用本方法 <br>
|
* 新增对象或更新单个对象(DataSource.insert、DataSource.update)时调用本方法 <br>
|
||||||
*
|
*
|
||||||
* @param bean 实体对象
|
* @param entity 实体对象
|
||||||
* @return DataSource资源名
|
* @return DataSource资源名
|
||||||
* @since 2.8.0
|
* @since 2.8.0
|
||||||
*/
|
*/
|
||||||
default String getSource(T bean) {
|
default String getSource(T entity) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,10 +71,10 @@ public interface DistributeTableStrategy<T> {
|
|||||||
* 新增对象或更新单个对象(DataSource.insert、DataSource.update)时调用本方法获取表名 <br>
|
* 新增对象或更新单个对象(DataSource.insert、DataSource.update)时调用本方法获取表名 <br>
|
||||||
*
|
*
|
||||||
* @param table 模板表的表名
|
* @param table 模板表的表名
|
||||||
* @param bean 实体对象
|
* @param entity 实体对象
|
||||||
* @return 带库名的全表名
|
* @return 带库名的全表名
|
||||||
*/
|
*/
|
||||||
public String getTable(String table, T bean);
|
public String getTable(String table, T entity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取对象的表名 <br>
|
* 获取对象的表名 <br>
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import org.redkale.util.YamlProvider.YamlLoader;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 简单的yml读取器
|
* 简单的yml读取器
|
||||||
* TODO 待实现
|
|
||||||
*
|
*
|
||||||
* <p>详情见: https://redkale.org
|
* <p>详情见: https://redkale.org
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user