Score
0
Watch 12 Star 20 Fork 6

HankXV / RecorderJavaApache-2.0

Join us
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
帮助您快速在MySQL\MariaDB上实现日志系统的框架 spread retract

Clone or download
HankXV authored ignore
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

什么是Recorder?

主要用于在游戏中记录日志或者流水(比如货币的花销流水,任务的完成日志),方便后台统计和查询。此框架目前只适用于数据库 MySQL\MariaDB

快速开始

Maven
<dependency>
    <groupId>org.slingerxv</groupId>
    <artifactId>recorder</artifactId>
    <version>2.0-alpha</version>
</dependency>
Gradle
compile 'org.slingerxv:recorder:2.0-alpha'

建立一个日志的Bean

	public class UserLog extends TimeBasedLog {
		@Col(type = SQLType.VARCHAR, size = 255, comment = "user name")
		public String name;
		@Col(comment = "user age")
		public int age;
		@Col(type = SQLType.VARCHAR, size = 255, comment = "user address")
		public String address;
	
		@Override
		public RollType rollType() {
			return RollType.DAY_ROLL;
		}
	}

初始化日志代理,并执行写入任务,完成!


	UserLog userLog = new UserLog();
	userLog.name="HankXV";
	userLog.age=101;
	userLog.address="home";
	new RecorderProxy
	.RecorderProxyBuilder()
	.dataSource(yourDatasource)
	.build()
	.startServer()
	.execute(userLog);
		

更新日志

v2.0-release
1.表检查器支持多表同Bean的检查(垂直分表),表名逗号隔开
v2.0-alpha
此版本为pre-release版本
1.减少了很多复杂的命名
2.日志Bean的字段从私有变为公有,操作更方便
3.增加查询日志的API
4.简化SQLType的名称

Comments ( 0 )

Sign in for post a comment

Java
1
https://gitee.com/HankXV/Recorder.git
git@gitee.com:HankXV/Recorder.git
HankXV
Recorder
Recorder
master

Help Search