package com.jianshui.web.controller.sandbox;

import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONCreator;
import com.jianshui.common.core.domain.AjaxResult;
import com.jianshui.common.utils.encrypt.InvoiceEncryptUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author 巩权林
 * @Date 2022/9/24 11:08
 **/
@RestController
@RequestMapping("/sandbox")
public class IndexController {

    @PostMapping("/encrypt")
    public AjaxResult encrypt(@RequestBody JSONObject requestBody) {
        String key = requestBody.getString("key");
        String order = requestBody.getString("order");
        String encryptTest = InvoiceEncryptUtil.encrypt(order, key);
        return AjaxResult.success("success", encryptTest);
    }
}
