创建公共方法并引用

作者: gu_lao_rou-p 分类: Java,springBoot 发布时间: 2022-02-15 20:54

方法文件:

package com.Ren.account.util;

import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author: GULAO
 * @created: 2022/2/14 5:36 下午
 * @description: 私有工具类
 **/

public class RenTools {
    public static synchronized String createId(){
        /**
         * @return String
         * @author Gavin
         * @description 通过时间(年月日时分秒毫秒)生产17位数的ID
         * @created 2022/2/13 11:08
         **/
        try {
            Thread.sleep(1);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        String msg = "";
        Date date = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS");
        msg = sdf.format(date).substring(2);
        return msg;
    }


}

引用方法:

import com.Ren.account.util.RenTools;

Warning: Undefined variable $aria_req in /www/wwwroot/l.lvovl.cn/wp-content/themes/JieStyle-Two-master/comments.php on line 26

Warning: Undefined variable $aria_req in /www/wwwroot/l.lvovl.cn/wp-content/themes/JieStyle-Two-master/comments.php on line 27

Warning: Undefined variable $aria_req in /www/wwwroot/l.lvovl.cn/wp-content/themes/JieStyle-Two-master/comments.php on line 28
标签云