package com.product.admin.test; import org.junit.Assert; import org.junit.Test; import com.product.common.utils.HttpTest; import com.product.core.sign.HmacUtils; import com.product.core.sign.HmacUtils.Algorithm; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class TokenTest extends HttpTest { public static void main(String[] args) { DictTest.findtDict();//更具uuid获取数据字典详情接口 // DictTest.addtDict();//数据字典新增结构 // DictTest.listDict();//数据字典列表查询结构 // DictTest.updateDict();//数据字典更新结构 // DictTest.deleteDictionary();//数据字典删除结构 // DictTest.listDictByname();//更具字典名获取数据字典接口 } public static void findtDict() { Map m = new HashMap(); m.put("~table~", "product_sys_dict"); m.put("url/api", "/api/dictionary/find-dict/v1"); m.put("uuid", "e874ae20-e574-4e83-b6f3-f785a3b09b23"); m.put("uuid", "e874ae20-e574-4e83-b6f3-f785a3b09b23"); // m.put("created_utc_datetime", 1594789998000L); // m.put("dict_name", "客户端类型"); // m.put("dict_label", "H5业务端33"); // List template_language = new ArrayList(); // Map template_language1 = new HashMap(); // template_language1.put("zh-CN", "你好"); // // template_language.add(template_language1); // m.put("dict_label", template_language); testPost(m); } public static void addtDict() { Map m = new HashMap(); m.put("~table~", "product_sys_dict"); m.put("url/api", "/api/dictionary/add-dictionary/v1"); m.put("uuid", "9b130c51-ad65-4755-9f82-0c3f22b66b6c"); m.put("dict_name", "客户端类型"); m.put("dict_label", "H5业务端33"); m.put("dict_value", "223232223333453266622223"); m.put("system_language_code", "E34448"); m.put("system_client_type", "E34448"); m.put("system_client_version", "E34448"); m.put("is_used", "1"); m.put("sequence", 1); m.put("created_utc_datetime", 1594789998000L); List template_language = new ArrayList(); Map template_language1 = new HashMap(); template_language1.put("uuid", "43f8a6f8-6c2c-443b-868f-ab73888b4dea"); template_language1.put("zh-CN", "你好,我是修改"); Map template_language2 = new HashMap(); template_language2.put("en", "hello,is update"); template_language.add(template_language1); template_language.add(template_language2); m.put("dict_label", template_language); testPost(m); } public static void listDict() { Map m = new HashMap(); m.put("~table~", "product_sys_dict"); m.put("url/api", "/api/dictionary/list-dictionary/v1"); m.put("cpage", "1"); m.put("pagesize", "50"); testPost(m); } public static void listDictByname() { Map m = new HashMap(); m.put("~table~", "product_sys_dict"); m.put("url/api", "/api/dictionary/list-dictionary-byname/v1"); m.put("dict_name", "客户端类型"); m.put("cpage", "1"); m.put("pagesize", "10"); testPost(m); } public static void updateDict() { Map m = new HashMap(); m.put("~table~", "product_sys_dict"); m.put("url/api", "/api/dictionary/update-dictionary/v1"); m.put("uuid", "9b130c51-ad65-4755-9f82-0c3f22b66b6c"); m.put("dict_name", "客户端类型"); m.put("dict_label", "测试111ttttttttt"); m.put("dict_value", "测据111333333333"); m.put("is_used", "1"); m.put("sequence", "10"); List template_language = new ArrayList(); Map template_language1 = new HashMap(); template_language1.put("zh-CN", "你好@@@@@ ,我是修改"); template_language1.put("uuid","43f8a6f8-6c2c-443b-868f-ab73888b4dea"); Map template_language2 = new HashMap(); template_language2.put("en", "hello is update"); template_language2.put("uuid","97ad3ba9-7538-485d-a766-102e498505d2"); template_language.add(template_language1); template_language.add(template_language2); m.put("dict_label", template_language); testPost(m); } public static void deleteDictionary() { Map m = new HashMap(); m.put("~table~", "product_sys_dict"); m.put("url/api", "/api/dictionary/delete-dictionary/v1"); m.put("uuid", "086aa3f8-41d9-4f7c-a4ae-1912cc36c6f0"); testPost(m); } }