步骤1:在项目中新建com.bstek.dorado.sample.standardlesson.service包,用于集中放置项目中需要的service。
步骤2:在service包中新建SystemInfoService.java,代码如下:
package com.bstek.dorado.sample.standardlesson.service; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Properties; import org.springframework.stereotype.Component; import com.bstek.dorado.annotation.Expose; import com.bstek.dorado.core.DoradoAbout; @Component public class SystemInfoService { @Expose public Properties getSystemInfo() { Properties info = new Properties(); SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日 hh:mm:ss"); info.setProperty("product", DoradoAbout.getProductTitle()); info.setProperty("vendor", DoradoAbout.getVendor()); info.setProperty("version", DoradoAbout.getVersion()); info.setProperty("time", sdf.format(new Date())); return info; } }