Răsfoiți Sursa

补充代码提示的注释

mxd 4 ani în urmă
părinte
comite
27d827aceb

+ 31 - 20
src/main/java/org/ssssssss/magicapi/functions/AssertFunctions.java

@@ -2,6 +2,7 @@ package org.ssssssss.magicapi.functions;
 
 import org.apache.commons.lang3.StringUtils;
 import org.ssssssss.magicapi.config.MagicModule;
+import org.ssssssss.script.annotation.Comment;
 import org.ssssssss.script.exception.MagicScriptAssertException;
 
 import java.util.regex.Pattern;
@@ -13,11 +14,13 @@ public class AssertFunctions implements MagicModule {
 
 	/**
 	 * 判断值不能为null
-	 * @param value	值
-	 * @param code	状态码
-	 * @param message	状态说明
+	 *
+	 * @param value   值
+	 * @param code    状态码
+	 * @param message 状态说明
 	 */
-	public static void notNull(Object value, int code, String message) {
+	@Comment("判断值不能为空")
+	public static void notNull(@Comment("值") Object value, @Comment("判断失败时的code") int code, @Comment("判断失败时的说明") String message) {
 		if (value == null) {
 			throw new MagicScriptAssertException(code, message);
 		}
@@ -25,11 +28,13 @@ public class AssertFunctions implements MagicModule {
 
 	/**
 	 * 判断值不能为empty
-	 * @param value	值
-	 * @param code	状态码
-	 * @param message	状态说明
+	 *
+	 * @param value   值
+	 * @param code    状态码
+	 * @param message 状态说明
 	 */
-	public static void notEmpty(String value, int code, String message) {
+	@Comment("判断值不能为Empty")
+	public static void notEmpty(@Comment("值") String value, @Comment("判断失败时的code") int code, @Comment("判断失败时的说明") String message) {
 		if (StringUtils.isEmpty(value)) {
 			throw new MagicScriptAssertException(code, message);
 		}
@@ -37,11 +42,13 @@ public class AssertFunctions implements MagicModule {
 
 	/**
 	 * 判断值不能为blank
-	 * @param value	值
-	 * @param code	状态码
-	 * @param message	状态说明
+	 *
+	 * @param value   值
+	 * @param code    状态码
+	 * @param message 状态说明
 	 */
-	public static void notBlank(String value, int code, String message) {
+	@Comment("判断值不能为Blank")
+	public static void notBlank(@Comment("值") String value, @Comment("判断失败时的code") int code, @Comment("判断失败时的说明") String message) {
 		if (StringUtils.isBlank(value)) {
 			throw new MagicScriptAssertException(code, message);
 		}
@@ -49,11 +56,13 @@ public class AssertFunctions implements MagicModule {
 
 	/**
 	 * 正则验证值
-	 * @param value	值
-	 * @param code	状态码
-	 * @param message	状态说明
+	 *
+	 * @param value   值
+	 * @param code    状态码
+	 * @param message 状态说明
 	 */
-	public static void regx(String value, String pattern, int code, String message) {
+	@Comment("正则判断")
+	public static void regx(@Comment("值") String value, String pattern, @Comment("判断失败时的code") int code, @Comment("判断失败时的说明") String message) {
 		if (value == null || !Pattern.compile(pattern).matcher(value).matches()) {
 			throw new MagicScriptAssertException(code, message);
 		}
@@ -61,11 +70,13 @@ public class AssertFunctions implements MagicModule {
 
 	/**
 	 * 判断值值是否为true
-	 * @param value	值
-	 * @param code	状态码
-	 * @param message	状态说明
+	 *
+	 * @param value   值
+	 * @param code    状态码
+	 * @param message 状态说明
 	 */
-	public static void isTrue(boolean value, int code, String message) {
+	@Comment("判断值是否为true")
+	public static void isTrue(@Comment("值") boolean value, @Comment("判断失败时的code") int code, @Comment("判断失败时的说明") String message) {
 		if (!value) {
 			throw new MagicScriptAssertException(code, message);
 		}

+ 35 - 17
src/main/java/org/ssssssss/magicapi/functions/DatabaseQuery.java

@@ -16,6 +16,7 @@ import org.ssssssss.magicapi.model.Page;
 import org.ssssssss.magicapi.provider.PageProvider;
 import org.ssssssss.magicapi.provider.ResultProvider;
 import org.ssssssss.script.MagicScriptContext;
+import org.ssssssss.script.annotation.Comment;
 import org.ssssssss.script.annotation.UnableCall;
 
 import java.sql.Connection;
@@ -119,10 +120,12 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 
 	/**
 	 * 开启事务,在一个回调中进行操作
-	 * @param function	回调函数
+	 *
+	 * @param function 回调函数
 	 * @return
 	 */
-	public Object transaction(Function<?, ?> function) {
+	@Comment("开启事务,并在回调中处理")
+	public Object transaction(@Comment("回调函数,如:()=>{....}") Function<?, ?> function) {
 		Transaction transaction = transaction();    //创建事务
 		try {
 			Object val = function.apply(null);
@@ -136,15 +139,18 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 
 	/**
 	 * 开启事务,手动提交和回滚
+	 *
 	 * @return
 	 */
+	@Comment("开启事务,返回事务对象")
 	public Transaction transaction() {
 		return new Transaction(this.dataSourceNode.getDataSourceTransactionManager());
 	}
 
 	/**
 	 * 添加至缓存
-	 * @param value	缓存名
+	 *
+	 * @param value 缓存名
 	 */
 	@UnableCall
 	private <T> T putCacheValue(T value, BoundSql boundSql) {
@@ -156,11 +162,13 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 
 	/**
 	 * 使用缓存
-	 * @param cacheName	缓存名
-	 * @param ttl 过期时间
+	 *
+	 * @param cacheName 缓存名
+	 * @param ttl       过期时间
 	 * @return
 	 */
-	public DatabaseQuery cache(String cacheName, long ttl) {
+	@Comment("使用缓存")
+	public DatabaseQuery cache(@Comment("缓存名") String cacheName, @Comment("过期时间") long ttl) {
 		if (cacheName == null) {
 			return this;
 		}
@@ -172,10 +180,12 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 
 	/**
 	 * 使用缓存(采用默认缓存时间)
-	 * @param cacheName	缓冲名
+	 *
+	 * @param cacheName 缓冲名
 	 * @return
 	 */
-	public DatabaseQuery cache(String cacheName) {
+	@Comment("使用缓存,过期时间采用默认配置")
+	public DatabaseQuery cache(@Comment("缓存名") String cacheName) {
 		return cache(cacheName, 0);
 	}
 
@@ -197,7 +207,8 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 	/**
 	 * 查询List
 	 */
-	public List<Map<String, Object>> select(String sql) {
+	@Comment("查询SQL,返回List类型结果")
+	public List<Map<String, Object>> select(@Comment("`SQL`语句") String sql) {
 		BoundSql boundSql = new BoundSql(sql);
 		return (List<Map<String, Object>>) boundSql.getCacheValue(this.sqlCache, this.cacheName)
 				.orElseGet(() -> putCacheValue(dataSourceNode.getJdbcTemplate().query(boundSql.getSql(), this.rowMapper, boundSql.getParameters()), boundSql));
@@ -206,7 +217,8 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 	/**
 	 * 执行update
 	 */
-	public int update(String sql) {
+	@Comment("执行update操作,返回受影响行数")
+	public int update(@Comment("`SQL`语句") String sql) {
 		BoundSql boundSql = new BoundSql(sql);
 		int value = dataSourceNode.getJdbcTemplate().update(boundSql.getSql(), boundSql.getParameters());
 		if (this.cacheName != null) {
@@ -282,7 +294,8 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 	/**
 	 * 插入并返回主键
 	 */
-	public long insert(String sql){
+	@Comment("执行insert操作,返回插入条数")
+	public long insert(@Comment("`SQL`语句") String sql) {
 		BoundSql boundSql = new BoundSql(sql);
 		KeyHolder keyHolder = new GeneratedKeyHolder();
 		dataSourceNode.getJdbcTemplate().update(con -> {
@@ -294,7 +307,7 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 			this.sqlCache.delete(this.cacheName);
 		}
 		Number key = keyHolder.getKey();
-		if(key == null){
+		if (key == null) {
 			return -1;
 		}
 		return key.longValue();
@@ -303,7 +316,8 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 	/**
 	 * 分页查询
 	 */
-	public Object page(String sql) {
+	@Comment("执行分页查询,分页条件自动获取")
+	public Object page(@Comment("`SQL`语句") String sql) {
 		Page page = pageProvider.getPage(MagicScriptContext.get());
 		return page(sql, page.getLimit(), page.getOffset());
 	}
@@ -311,7 +325,8 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 	/**
 	 * 分页查询(手动传入limit和offset参数)
 	 */
-	public Object page(String sql, long limit, long offset) {
+	@Comment("执行分页查询,分页条件手动传入")
+	public Object page(@Comment("`SQL`语句") String sql, @Comment("限制条数") long limit, @Comment("跳过条数") long offset) {
 		BoundSql boundSql = new BoundSql(sql);
 		Connection connection = null;
 		Dialect dialect;
@@ -340,7 +355,8 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 	/**
 	 * 查询int值
 	 */
-	public Integer selectInt(String sql) {
+	@Comment("查询int值,适合单行单列int的结果")
+	public Integer selectInt(@Comment("`SQL`语句") String sql) {
 		BoundSql boundSql = new BoundSql(sql);
 		return (Integer) boundSql.getCacheValue(this.sqlCache, this.cacheName)
 				.orElseGet(() -> putCacheValue(dataSourceNode.getJdbcTemplate().queryForObject(boundSql.getSql(), boundSql.getParameters(), Integer.class), boundSql));
@@ -349,7 +365,8 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 	/**
 	 * 查询Map
 	 */
-	public Map<String, Object> selectOne(String sql) {
+	@Comment("查询单条结果,查不到返回null")
+	public Map<String, Object> selectOne(@Comment("`SQL`语句") String sql) {
 		BoundSql boundSql = new BoundSql(sql);
 		return (Map<String, Object>) boundSql.getCacheValue(this.sqlCache, this.cacheName)
 				.orElseGet(() -> {
@@ -361,7 +378,8 @@ public class DatabaseQuery extends HashMap<String, DatabaseQuery> implements Mag
 	/**
 	 * 查询单行单列的值
 	 */
-	public Object selectValue(String sql) {
+	@Comment("查询单行单列的值")
+	public Object selectValue(@Comment("`SQL`语句") String sql) {
 		BoundSql boundSql = new BoundSql(sql);
 		return boundSql.getCacheValue(this.sqlCache, this.cacheName)
 				.orElseGet(() -> putCacheValue(dataSourceNode.getJdbcTemplate().queryForObject(boundSql.getSql(), boundSql.getParameters(), Object.class), boundSql));

+ 19 - 9
src/main/java/org/ssssssss/magicapi/functions/MongoCollectionExtension.java

@@ -4,6 +4,7 @@ import com.mongodb.client.FindIterable;
 import com.mongodb.client.MongoCollection;
 import com.mongodb.client.model.UpdateOptions;
 import org.bson.Document;
+import org.ssssssss.script.annotation.Comment;
 
 import java.util.Collections;
 import java.util.List;
@@ -15,27 +16,33 @@ import java.util.stream.Collectors;
  */
 public class MongoCollectionExtension {
 
-	public static void insert(MongoCollection<Document> collection, List<Map<String, Object>> maps) {
+	@Comment("执行批量插入操作")
+	public static void insert(MongoCollection<Document> collection, @Comment("要插入的集合") List<Map<String, Object>> maps) {
 		collection.insertMany(maps.stream().map(Document::new).collect(Collectors.toList()));
 	}
 
-	public static void insert(MongoCollection<Document> collection, Map<String, Object> map) {
+	@Comment("执行单条插入操作")
+	public static void insert(MongoCollection<Document> collection, @Comment("执行插入数据") Map<String, Object> map) {
 		insert(collection, Collections.singletonList(map));
 	}
 
-	public static FindIterable<Document> find(MongoCollection<Document> collection, Map<String, Object> query) {
+	@Comment("执行查询操作")
+	public static FindIterable<Document> find(MongoCollection<Document> collection, @Comment("查询条件") Map<String, Object> query) {
 		return collection.find(new Document(query));
 	}
 
-	public static long update(MongoCollection<Document> collection, Map<String, Object> query, Map<String, Object> update) {
+	@Comment("修改操作,返回修改数量")
+	public static long update(MongoCollection<Document> collection, @Comment("查询条件") Map<String, Object> query, @Comment("修改值") Map<String, Object> update) {
 		return collection.updateOne(new Document(query), new Document(update)).getModifiedCount();
 	}
 
-	public static long updateMany(MongoCollection<Document> collection, Map<String, Object> query, Map<String, Object> update) {
+	@Comment("批量修改,返回修改数量")
+	public static long updateMany(MongoCollection<Document> collection, @Comment("修改条件") Map<String, Object> query, @Comment("修改值") Map<String, Object> update) {
 		return collection.updateMany(new Document(query), new Document(update)).getModifiedCount();
 	}
 
-	public static long updateMany(MongoCollection<Document> collection, Map<String, Object> query, Map<String, Object> update, Map<String, Object> filters) {
+	@Comment("批量修改,返回修改数量")
+	public static long updateMany(MongoCollection<Document> collection, @Comment("查询条件") Map<String, Object> query, @Comment("修改值") Map<String, Object> update, Map<String, Object> filters) {
 		UpdateOptions updateOptions = new UpdateOptions();
 		if (filters != null && !filters.isEmpty()) {
 			Object upsert = filters.get("upsert");
@@ -54,15 +61,18 @@ public class MongoCollectionExtension {
 		return collection.updateMany(new Document(query), new Document(update), updateOptions).getModifiedCount();
 	}
 
-	public static long count(MongoCollection<Document> collection, Map<String, Object> query) {
+	@Comment("查询数量")
+	public static long count(MongoCollection<Document> collection, @Comment("查询") Map<String, Object> query) {
 		return collection.count(new Document(query));
 	}
 
-	public static long remove(MongoCollection<Document> collection, Map<String, Object> query) {
+	@Comment("批量删除,返回删除条数")
+	public static long remove(MongoCollection<Document> collection, @Comment("删除条件") Map<String, Object> query) {
 		return collection.deleteMany(new Document(query)).getDeletedCount();
 	}
 
-	public static long removeOne(MongoCollection<Document> collection, Map<String, Object> query) {
+	@Comment("删除一条,返回删除条数")
+	public static long removeOne(MongoCollection<Document> collection, @Comment("删除条件") Map<String, Object> query) {
 		return collection.deleteOne(new Document(query)).getDeletedCount();
 	}
 }

+ 2 - 0
src/main/java/org/ssssssss/magicapi/functions/MongoFindIterableExtension.java

@@ -3,6 +3,7 @@ package org.ssssssss.magicapi.functions;
 import com.mongodb.client.FindIterable;
 import com.mongodb.client.MongoCursor;
 import org.bson.Document;
+import org.ssssssss.script.annotation.Comment;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -13,6 +14,7 @@ import java.util.Map;
  */
 public class MongoFindIterableExtension {
 
+	@Comment("结果转为List")
 	public static List<Map<String, Object>> list(FindIterable<Document> iterable) {
 		MongoCursor<Document> cursor = iterable.iterator();
 		List<Map<String, Object>> result = new ArrayList<>();

+ 9 - 4
src/main/java/org/ssssssss/magicapi/functions/RequestFunctions.java

@@ -4,6 +4,7 @@ import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartRequest;
 import org.springframework.web.util.WebUtils;
 import org.ssssssss.magicapi.context.RequestContext;
+import org.ssssssss.script.annotation.Comment;
 
 import javax.servlet.http.HttpServletRequest;
 import java.util.Arrays;
@@ -21,7 +22,8 @@ public class RequestFunctions {
 	 *
 	 * @param name 参数名
 	 */
-	public MultipartFile getFile(String name) {
+	@Comment("获取文件")
+	public MultipartFile getFile(@Comment("参数名") String name) {
 		MultipartRequest request = getMultipartHttpServletRequest();
 		return request == null ? null : request.getFile(name);
 	}
@@ -31,7 +33,8 @@ public class RequestFunctions {
 	 *
 	 * @param name 参数名
 	 */
-	public List<MultipartFile> getFiles(String name) {
+	@Comment("获取多个文件")
+	public List<MultipartFile> getFiles(@Comment("参数名") String name) {
 		MultipartRequest request = getMultipartHttpServletRequest();
 		return request == null ? null : request.getFiles(name);
 	}
@@ -41,7 +44,8 @@ public class RequestFunctions {
 	 *
 	 * @param name 参数名
 	 */
-	public List<String> getValues(String name) {
+	@Comment("根据请求参数名获取值")
+	public List<String> getValues(@Comment("参数名") String name) {
 		HttpServletRequest request = get();
 		if (request != null) {
 			String[] values = request.getParameterValues(name);
@@ -55,7 +59,8 @@ public class RequestFunctions {
 	 *
 	 * @param name 参数名
 	 */
-	public List<String> getHeaders(String name) {
+	@Comment("根据header名获取值")
+	public List<String> getHeaders(@Comment("header名") String name) {
 		HttpServletRequest request = get();
 		if (request != null) {
 			Enumeration<String> headers = request.getHeaders(name);

+ 27 - 13
src/main/java/org/ssssssss/magicapi/functions/ResponseFunctions.java

@@ -8,6 +8,7 @@ import org.springframework.web.context.request.RequestAttributes;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
 import org.ssssssss.magicapi.provider.ResultProvider;
+import org.ssssssss.script.annotation.Comment;
 import org.ssssssss.script.functions.ObjectConvertExtension;
 
 import javax.servlet.http.Cookie;
@@ -34,7 +35,8 @@ public class ResponseFunctions {
 	 * @param total  条数
 	 * @param values 数据内容
 	 */
-	public Object page(long total, List<Object> values) {
+	@Comment("返回自定义分页结果")
+	public Object page(@Comment("总条数") long total, @Comment("当前结果集") List<Object> values) {
 		return resultProvider.buildPageResult(total, values);
 	}
 
@@ -43,14 +45,16 @@ public class ResponseFunctions {
 	 *
 	 * @param value json内容
 	 */
-	public ResponseEntity json(Object value) {
+	@Comment("自定义返回json内容")
+	public ResponseEntity json(@Comment("返回对象") Object value) {
 		return ResponseEntity.ok(value);
 	}
 
 	/**
 	 * 添加Header
 	 */
-	public void addHeader(String key, String value) {
+	@Comment("添加response header")
+	public void addHeader(@Comment("header名") String key, @Comment("header值") String value) {
 		if (StringUtils.isNotBlank(key)) {
 			HttpServletResponse response = getResponse();
 			if (response != null) {
@@ -62,7 +66,8 @@ public class ResponseFunctions {
 	/**
 	 * 设置header
 	 */
-	public void setHeader(String key, String value) {
+	@Comment("设置response header")
+	public void setHeader(@Comment("header名") String key, @Comment("header值") String value) {
 		if (StringUtils.isNotBlank(key)) {
 			HttpServletResponse response = getResponse();
 			if (response != null) {
@@ -74,7 +79,8 @@ public class ResponseFunctions {
 	/**
 	 * 添加cookie
 	 */
-	public void addCookie(String name, String value) {
+	@Comment("添加Cookie")
+	public void addCookie(@Comment("cookie名") String name, @Comment("cookie值") String value) {
 		if (StringUtils.isNotBlank(name)) {
 			addCookie(new Cookie(name, value));
 		}
@@ -83,7 +89,8 @@ public class ResponseFunctions {
 	/**
 	 * 批量添加cookie
 	 */
-	public void addCookies(Map<String, String> cookies, Map<String, Object> options) {
+	@Comment("批量添加Cookie")
+	public void addCookies(@Comment("Cookies") Map<String, String> cookies, @Comment("Cookie选项,如`path`、`httpOnly`、`domain`、`maxAge`") Map<String, Object> options) {
 		if (cookies != null) {
 			for (Map.Entry<String, String> entry : cookies.entrySet()) {
 				addCookie(entry.getKey(), entry.getValue(), options);
@@ -94,14 +101,17 @@ public class ResponseFunctions {
 	/**
 	 * 批量添加cookie
 	 */
-	public void addCookies(Map<String, String> cookies) {
+	@Comment("批量添加Cookie")
+	public void addCookies(@Comment("Cookies") Map<String, String> cookies) {
 		addCookies(cookies, null);
 	}
 
 	/**
 	 * 添加cookie
 	 */
-	public void addCookie(String name, String value, Map<String, Object> options) {
+	@Comment("添加Cookie")
+	public void addCookie(@Comment("Cookie名") String name, @Comment("Cookie值") String value,
+						  @Comment("Cookie选项,如`path`、`httpOnly`、`domain`、`maxAge`") Map<String, Object> options) {
 		if (StringUtils.isNotBlank(name)) {
 			Cookie cookie = new Cookie(name, value);
 			if (options != null) {
@@ -127,14 +137,16 @@ public class ResponseFunctions {
 		}
 	}
 
-	public NullValue end(){
+	@Comment("终止输出,执行此方法后不会对结果进行任何输出及处理")
+	public NullValue end() {
 		return NullValue.INSTANCE;
 	}
 
 	/**
 	 * 添加cookie
 	 */
-	public void addCookie(Cookie cookie) {
+	@Comment("添加Cookie")
+	public void addCookie(@Comment("Cookie对象") Cookie cookie) {
 		if (cookie != null) {
 			HttpServletResponse response = getResponse();
 			if (response != null) {
@@ -157,7 +169,8 @@ public class ResponseFunctions {
 	 * @param value 图片内容
 	 * @param mime  图片类型,image/png,image/jpeg,image/gif
 	 */
-	public ResponseEntity image(Object value, String mime) {
+	@Comment("输出图片")
+	public ResponseEntity image(@Comment("图片内容,如`byte[]`") Object value, @Comment("图片类型,如`image/png`、`image/jpeg`、`image/gif`") String mime) {
 		return ResponseEntity.ok().header(HttpHeaders.CONTENT_TYPE, mime).body(value);
 	}
 
@@ -167,13 +180,14 @@ public class ResponseFunctions {
 	 * @param value    文件内容
 	 * @param filename 文件名
 	 */
-	public ResponseEntity download(Object value, String filename) throws UnsupportedEncodingException {
+	@Comment("文件下载")
+	public ResponseEntity download(@Comment("文件内容,如`byte[]`") Object value, @Comment("文件名") String filename) throws UnsupportedEncodingException {
 		return ResponseEntity.ok().contentType(MediaType.APPLICATION_OCTET_STREAM)
 				.header(HttpHeaders.CONTENT_DISPOSITION, "attachment; filename=" + URLEncoder.encode(filename, "UTF-8"))
 				.body(value);
 	}
 
-	public static class NullValue{
+	public static class NullValue {
 		static final NullValue INSTANCE = new NullValue();
 	}
 }

+ 3 - 0
src/main/java/org/ssssssss/magicapi/functions/Transaction.java

@@ -4,6 +4,7 @@ import org.springframework.jdbc.datasource.DataSourceTransactionManager;
 import org.springframework.transaction.TransactionDefinition;
 import org.springframework.transaction.TransactionStatus;
 import org.springframework.transaction.support.DefaultTransactionDefinition;
+import org.ssssssss.script.annotation.Comment;
 import org.ssssssss.script.annotation.UnableCall;
 
 /**
@@ -28,6 +29,7 @@ public class Transaction {
 	/**
 	 * 回滚事务
 	 */
+	@Comment("回滚事务")
 	public void rollback(){
 		this.dataSourceTransactionManager.rollback(this.transactionStatus);
 	}
@@ -35,6 +37,7 @@ public class Transaction {
 	/**
 	 * 提交事务
 	 */
+	@Comment("提交事务")
 	public void commit(){
 		this.dataSourceTransactionManager.commit(this.transactionStatus);
 	}