shichongfu
2023-04-25 ce0b49552668d3331055e2b1a1447a743dc54939
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
package com.product.admin.test;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import com.product.common.utils.HttpTest;
 
/**
 * 
* Copyright  LX-BASE
* @Title: LX-BASE-
* @Project: MessageTemplateTest
* @Date:  2020-05-27 16:27   
* @Author: 杜洪波
* @Description:
 */
public class MessageTemplateTest extends HttpTest{
 
    public static void main(String[] args) {
//        listPushMessageTemplate(); //消息模板列表
//        addPushMessageTemplate();  //消息模板新增
//        updateMessageTemplate();   //消息模板修改
//        deleteMessageTemplate();   //消息模板删除
//        selectMessageTemplate();   //消息模板详情
    }
    
    public static void listMessageTemplate() {
        Map<String,Object> map=new HashMap<>();
        map.put("url", "/api/message/add-template/v1");
        map.put("~table~", "product_sys_message_template");
        map.put("filter", "");
        map.put("cpage",1);
        map.put("pagesize",10);
        testPost(map);
    }
    
    public static void addMessageTemplate() {
        Map<String,Object> map=new HashMap<>();
        map.put("url", "/api/message/add-template/v1");
        map.put("~table~", "product_sys_message_template");
        map.put("template_name", "测试模板1");      //模板名称
        map.put("template_code", "模板分类");       //模板分类
        map.put("module_uuid", "001");            //关联模块
        map.put("function_uuid", "001");           //关联功能
        map.put("template_remark", "模板描述");      //模板描述
        map.put("template_receiver", "");          //主送人
        map.put("client_type", "客户端类型");          //客户端类型
        
        List template_language = new ArrayList();
        
        Map template_language1 = new HashMap();
        template_language1.put("language_code", "zh");
        template_language1.put("content_type", "1");
        template_language1.put("content", "你好!{{staff_name:sys}}");
        
        Map template_language2 = new HashMap();
        template_language2.put("language_code", "zh");
        template_language2.put("content_type", "2");
        template_language2.put("content", "你好!{{staff_name:sys}},欢迎进入{{company_name:sys}}");
        
        Map template_language3 = new HashMap();
        template_language3.put("language_code", "cn");
        template_language3.put("content_type", "1");
        template_language3.put("content", "hello!{{staff_name:sys}}");
        
        Map template_language4 = new HashMap();
        template_language4.put("language_code", "cn");
        template_language4.put("content_type", "2");
        template_language4.put("content", "hello!{{staff_name:sys}},welcome to {{compay_name:sys}}");
        
        template_language.add(template_language1);
        template_language.add(template_language2);
        template_language.add(template_language3);
        template_language.add(template_language4);
        
        map.put("product_sys_message_template_language", template_language);
        testPost(map);
    }
    
    public static void updateMessageTemplate() {
        Map<String,Object> map=new HashMap<>();
        map.put("url", "/api/message/update-template/v1");
        map.put("~table~", "product_sys_message_template");
        map.put("uuid", "asdfsdfsf-asasas");    //uuid
        map.put("template_name", "测试模板1");      //模板名称
        map.put("template_code", "模板分类");       //模板分类
        map.put("module_uuid", "001");            //关联模块
        map.put("function_uuid", "001");           //关联功能
        map.put("template_remark", "模板描述");      //模板描述
        map.put("template_receiver", "");          //主送人
        map.put("client_type", "客户端类型");          //客户端类型
        
        List template_language = new ArrayList();
        
        Map template_language1 = new HashMap();
        template_language1.put("uuid", "d4d744b2-a475-4082-a55a-aeaaf4d2fd73");
        template_language1.put("language_code", "cn");
        template_language1.put("content_type", "1");
        template_language1.put("content", "你好!{{staff_name:sys}}");
        
        Map template_language2 = new HashMap();
        template_language2.put("uuid", "d455fbfa-00de-4f9a-bd0b-94d0cd223c37");
        template_language2.put("language_code", "cn");
        template_language2.put("content_type", "2");
        template_language2.put("content", "你好!{{staff_name:sys}},欢迎进入{{company_name:sys}}");
        
        Map template_language3 = new HashMap();
        template_language3.put("uuid", "99675fb9-28c0-43a6-aa40-64e85b606300");
        template_language3.put("language_code", "zh");
        template_language3.put("content_type", "1");
        template_language3.put("content", "hello!{{staff_name:sys}}");
        
        Map template_language4 = new HashMap();
        template_language4.put("uuid", "ddd06ba3-d04a-4667-b21b-a38a15c60c97");
        template_language4.put("language_code", "zh");
        template_language4.put("content_type", "2");
        template_language4.put("content", "hello!{{staff_name:sys}},welcome to {{compay_name:sys}}");
        
        template_language.add(template_language1);
        template_language.add(template_language2);
        template_language.add(template_language3);
        template_language.add(template_language4);
        
        map.put("product_sys_message_template_language", template_language);
        
        testPost(map);
    }
    
    public static void deleteMessageTemplate() {
        Map<String,Object> map=new HashMap<>();
        map.put("url", "/api/message/add-template/v1");
        map.put("~table~", "product_sys_message_template");
        map.put("uuid", "asdfsdfsf-asasas");    //uuid
    }
    
    public static void selectMessageTemplate() {
        Map<String,Object> map=new HashMap<>();
        map.put("url", "/api/message/add-template/v1");
        map.put("~table~", "product_sys_message_template");
        map.put("uuid", "asdfsdfsf-asasas");    //uuid
    }
}