Jboot 1.x 升级到 Jboot 2.x 教程

    • StrUtils -> StrUtil
    • FileUtils -> FileUtil
    • ClassKits -> ClassUtil
    • RequestUtils -> RequestUtil
    • ArrayUtils -> ArrayUtil
    • JbootHttpKit -> HttpUtil
    • @JBootRPCService -> 修改为 @RPCInject 和 @RPCBean

    例如:

    修改为:

    1. JbootCache cache = Jboot.getCache();

    其他同理。

    • 删除代码生成器生成的 Service类的 join 系列方法和 keep 方法
    • 删除代码生成器生成的ServiceImpl的@Singleton注解
    • 修改代码生成器生成的 Service类的 Save和SaveOrUpdate方法,修改其返回内容为 : Object

    修改为

      同时:

      修改为

      1. public Object saveOrUpdate()
      • 修改为: onConstantConfig
      • onJfinalRouteConfig 修改为: onRouteConfig
      • onJfinalEngineConfig 修改为:onEngineConfig
      • onJfinalPluginConfig 修改为:
      • onJFinalStartBefore 修改为:onStartBefore
      • onJFinalStart 修改为:onStart
      • onJFinalStop 修改为:onStop

      其他错误,都是 修改了包名,解决方案是:删除错误的 import ,然后重新导入即可。

      例如:

      注解 修改为了 com.jfinal.aop.Inject 等等。