package com.red.circle.example.orm;

import com.red.circle.framework.mybatis.entity.BaseEntity;
import com.red.circle.framework.mybatis.generate.GeneratorParam;
import com.red.circle.framework.mybatis.generate.MySqlCodeGenerator;

/**
 * @author pengliang on 2023/11/28
 */
public class OrmCodeGenerator {

  public static void main(String[] args) {
    String username = "aswatall";
    String password = "sTJPg9uvqQrCKC1E";
    // String url = "jdbc:mysql://119.23.230.191:6300/sugartime-back?useUnicode=true&characterEncoding=gbk&useSSL=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai";
    String url = "jdbc:mysql://rm-wz90vxx27777i4mi34o.mysql.rds.aliyuncs.com:3306/aswat_all?useUnicode=true&characterEncoding=gbk&useSSL=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai";
    // String url = "jdbc:p6spy:mysql://119.23.230.191:6300/sugartime-back?characterEncoding=utf8&useUnicode=true&useSSL=false&allowMultiQueries=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
    String tableNames = "game_fruit_user_bet_record,game_fruit_priority_winners,game_fruit_rule,game_fruit_lottery_record,game_fruit_prize,game_fruit_days_record,game_fruit_award_record,game_fruit_round_record";
    String authorName = "lisizhe";

    new MySqlCodeGenerator().generator(new GeneratorParam()
        .setParentPackage("com.red.circle.example.orm.generator")
        .setAuthorName(authorName)
        .setUrl(url)
        .setUsername(username)
        .setPassword(password)
        .setPrefixExcludes("user_,sys_,relation_,cacoo")
        .setTables(tableNames)
        .setEntitySuperClass(BaseEntity.class)
    );
  }

}
