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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package com.product.admin.test;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import com.product.admin.config.CmnConst;
import com.product.common.utils.HttpTest;
 
/**
 * 
* Copyright  LX-BASE
* @Title: LX-BASE-
* @Project: MailTemplateTest
* @Date:  2020-05-23 16:27   
* @Author: 杜洪波
* @Description:邮件模板测试
 */
public class MailTemplateTest extends HttpTest{
 
    public static void main(String[] args) {
//        listMailTemplate();        //邮件模板列表
//        addMailTemplate();        //邮件模板新增
//        updateMailTemplate();    //邮件模板修改
        deleteMailTemplate();    //邮件模板删除
//        findMailTemplate();        //邮件模板详情
//        sendMail();                //发邮件
    }
    
    public static void listMailTemplate() {
        Map<String,Object> map=new HashMap<>();
        map.put("url/api", "/api/mailtemplate/list-template/v1");
        map.put("~table~", "product_sys_mail_template");
        map.put("cpage",1);
        map.put("pagesize",10);
        testPost(map);
    }
    
    public static void findMailTemplate() {
        Map<String,Object> map=new HashMap<>();
        map.put("url/api", "/api/mailtemplate/find-template/v1");
        map.put("~table~", "product_sys_mail_template");
        map.put("uuid", "f367177b-2b4a-403a-96c8-8c4b8c2543a8");//uuid    
        testPost(map);
    }
    
    public static void addMailTemplate() {
        Map<String,Object> map=new HashMap<>();
        map.put("url/api", "/api/mailtemplate/add-template/v1");
        map.put("~table~", "product_sys_mail_template");
        map.put("template_name", "测试邮件模板2");          //模板名称
        map.put("template_remark", "模板描述2");        //模板描述
        map.put("module_uuid", "001");                //关联模块
        map.put("function_uuid", "001");            //关联功能
        map.put("template_addressee", "1074825718@qq.com");       //收件人
        map.put("template_receiver", "主送人2");        //主送人
        map.put("template_carbon_copy", "抄送人2");    //抄送人
        map.put("template_code", "模板分类2");        //模板分类
        map.put("is_used", "1");                    //是否启用
        
        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", "cn");    //语言代码
        template_language2.put("content_type", "1");
        template_language2.put("content", "hello!{{staff_name:sys}}");    //字段值
        
        Map template_language3 = new HashMap();
        template_language3.put("language_code", "zh");    //语言代码    
        template_language3.put("content_type", "2");    //字段名
        template_language3.put("content", "你好!{{staff_name:sys}},欢迎进入{{company_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(CmnConst.PRODUCT_SYS_MAIL_TEMPLATE_LANGUAGE, template_language);
        
        testPost(map);
    }
    
    public static void updateMailTemplate() {
        Map<String,Object> map=new HashMap<>();
        map.put("url/api", "/api/mailtemplate/update-template/v1");
        map.put("~table~", "product_sys_mail_template");
        map.put("uuid", "f367177b-2b4a-403a-96c8-8c4b8c2543a8");
        map.put("template_name", "测试邮件模板1");          //模板名称
        map.put("template_remark", "模板描述");        //模板描述
        map.put("module_uuid", "001");                //关联模块
        map.put("function_uuid", "001");            //关联功能
        map.put("template_addressee", "1074825718@qq.com");       //收件人
        map.put("template_receiver", "主送人1");        //主送人
        map.put("template_carbon_copy", "抄送人1");    //抄送人
        map.put("template_code", "模板分类1");        //模板分类
        map.put("is_used", "1");                    //是否启用
        map.put("is_show_send_face", "1");            //是否显示发送界面
        
        List template_language = new ArrayList();
        
        Map template_language1 = new HashMap();
        template_language1.put("uuid", "48d3aa6a-9d63-4ac2-8647-ef523534278f");
        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("uuid", "ed04ab0d-be25-4bd0-bc22-1bdfed5057bb");
        template_language2.put("language_code", "cn");    //语言代码
        template_language2.put("content_type", "1");
        template_language2.put("content", "hello!{{staff_name:sys}}");    //字段值
        
        Map template_language3 = new HashMap();
        template_language3.put("uuid", "a32f8af2-f2dd-45dc-a367-838373e8ce02");
        template_language3.put("language_code", "zh");    //语言代码    
        template_language3.put("content_type", "2");    //字段名
        template_language3.put("content", "你好!{{staff_name:sys}},欢迎进入{{company_name:sys}}");    //字段值
        
        Map template_language4 = new HashMap();
        template_language4.put("uuid", "e1003f93-959d-4615-a4d4-72c616b60254");
        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(CmnConst.PRODUCT_SYS_MAIL_TEMPLATE_LANGUAGE, template_language);
        
        testPost(map);
    }
    
    public static void deleteMailTemplate() {
        Map<String,Object> map=new HashMap<>();
        map.put("url/api", "/api/mailtemplate/delete-template/v1");
        map.put("~table~", "product_sys_mail_template");
        map.put("uuid", "c8dee59b-8750-4fa2-bcb1-56fb24806d9a");//uuid
        testPost(map);
    }
    
    public static void sendMail() {
        Map<String,Object> map=new HashMap<>();
        map.put("url/api", "/api/mail/send-mail/v1");
        map.put("~table~", "product_sys_mail_template");
        map.put("uuid", "925af160-9651-47e4-b8cc-a68f130b0da2");//uuid
        testPost(map);
    }
}