package com.zhongshu.card.server.core.test;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.json.JSONUtil;
import com.zhongshu.card.client.utils.DateUtils;
import com.zhongshu.card.server.core.util.CommonUtil;
import com.zhongshu.card.server.core.util.ValidateResult;
import com.zhongshu.card.server.core.util.ValidateUtils;
import groovy.lang.GroovyShell;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Base64;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;

/**
 * @author TRX
 * @date 2024/5/31
 */
public class Test {
    public static void main(String[] args) {
//        Snowflake snowflake = new Snowflake();
//        String orderNo = String.valueOf(snowflake.nextId());
//        System.out.println(orderNo + " = " + orderNo.length());
//
//        String str = "123abc@";
//        ValidateResult result = ValidateUtils.validatePassWord(str);
//        System.out.println("结果：" + result.isSuccess() + " = " + result.getMsg()
//                + " == " + ValidateUtils.isPhoneNumber("18723497166"));
//
//        Map<String, Object> map = new HashMap<>();
//        map.put("orderNo", orderNo);
//        map.put("age", 24);
//        map.put("money", BigDecimal.valueOf(563.21));
//        System.out.println("map = " + JSONUtil.toJsonStr(map));
//
//        BigDecimal b1 = BigDecimal.valueOf(54.32);
//        BigDecimal b2 = BigDecimal.valueOf(564.32);
//        System.out.println("m= " + b1.divide(b2, 5, RoundingMode.HALF_UP));
//
//        GroovyShell groovyShell = new GroovyShell();
//        String res = " println 'Hello, Groovy!' ";
//        Object result1 = groovyShell.evaluate(res);
//        System.out.println("result1 = " + result1);
//
//        try {
//            String stt = "我是";
//            byte[] encoded = Base64.getEncoder().encode(stt.getBytes("utf-8"));
//            System.out.println("base64 = " + new String(encoded));
//            byte[] stt1 = Base64.getDecoder().decode(encoded);
//            System.out.println("stt1 = " + new String(stt1));
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 5);
        System.out.println(calendar.get(Calendar.DAY_OF_WEEK));
    }
}
