xin
2 days ago debb7b1ef8bb4e96e09b2d878ad821b4b2f3a110
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
package com.oying.modules.winnerlook.client;
 
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
 
import java.util.HashMap;
import java.util.Map;
 
/**
 * @author MinaWu
 * @description
 * @date 2025/5/14 16:41
 */
@Slf4j
public class BaseApi {
    private static final String API_V1_TRIGGER_SEND_MSG = "/api/v1/trigger/SendMsg";
    private static final String API_V1_TRIGGER_SEND_BATCH_MSG = "/api/v1/trigger/SendBatchMsg";
 
    public static String TRIGGER = "101";
 
    /**
     * 发送短信
     *
     * @param userCode     登录名称
     * @param token        token
     * @param desNo        手机号
     * @param msg          内容
     * @param autograph    签名编号
     * @param customerUuid 用户标识字段
     * @return String
     */
    public static String sendMsgByPost(String userCode, String token, String desNo, String msg, String autograph,
                                       String customerUuid, String baseUrl) {
        Map<String, Object> params = new HashMap<>();
        params.put("userCode", userCode);
        params.put("DesNo", desNo);
        params.put("Msg", msg);
        params.put("smsType", TRIGGER);
        if (StringUtils.isNotBlank(autograph)) {
            params.put("autograph", autograph);
        }
        if (StringUtils.isNotBlank(customerUuid)) {
            params.put("customerUuid", customerUuid);
        }
        String xmlResponse = OkHttpService.doPost(params, baseUrl, userCode, token);
        return OkHttpService.parseXmlResponse(xmlResponse);
    }
}