package com.tofly.monitor.controller;

import org.jasypt.encryption.StringEncryptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * @date 2019/9/10  14:44
 */
@RestController
public class EncryptController {

    @Autowired
    private StringEncryptor stringEncryptor;

    @RequestMapping("/encrypt")
    public String encrypt(String word){
        return stringEncryptor.encrypt(word);
    }

    @RequestMapping("decrypt")
    public String decrypt(String word) {
        String encrypt = stringEncryptor.decrypt(word);
        return encrypt;
    }
}
