package cn.novalon.gym.manage.sys;

import cn.novalon.gym.manage.sys.security.JwtTokenProvider;
import cn.novalon.gym.manage.common.config.JwtProperties;
import org.junit.jupiter.api.Test;

public class TokenGenerator {
    
    @Test
    public void generateTokenForUser1_Dev() {
        // dev环境secret
        JwtProperties jwtProperties = new JwtProperties();
        jwtProperties.setSecret("novalon-gym-manage-jwt-secret-key-for-development-only-2026");
        JwtTokenProvider provider = new JwtTokenProvider(jwtProperties);
        
        String token = provider.generateToken("admin", 1L);
        System.out.println("【Dev环境】Token for userId=1:");
        System.out.println(token);
        System.out.println();
    }
    
    @Test
    public void generateTokenForUser1_Local() {
        // local环境secret
        JwtProperties jwtProperties = new JwtProperties();
        jwtProperties.setSecret("U2FsdGVkX1+vZ5Y9QmKxL8nN3rP7tW2jH4fG6dA8sB1cE5yN0zX3qV7wM4");
        JwtTokenProvider provider = new JwtTokenProvider(jwtProperties);
        
        String token = provider.generateToken("admin", 1L);
        System.out.println("【Local环境】Token for userId=1:");
        System.out.println(token);
        System.out.println();
    }
    
    @Test
    public void generateTokenForUser1_Default() {
        // 默认环境secret
        JwtProperties jwtProperties = new JwtProperties();
        jwtProperties.setSecret("U2FsdGVkX1+vZ5Y9QmKxL8nN3rP7tW2jH4fG6dA8sB1cE5yN0zX3qV7wM4");
        JwtTokenProvider provider = new JwtTokenProvider(jwtProperties);
        
        String token = provider.generateToken("admin", 1L);
        System.out.println("【默认环境】Token for userId=1:");
        System.out.println(token);
    }
}
