package com.jeequan.jeepay.core.model;

import lombok.Data;

import java.io.Serializable;

/**
 * 微信公众号提醒配置
 **/
@Data
public class DBWxMpConfig implements Serializable {

    public final static String DEFAULT_WX_AUTH_DOMAIN = "https://open.weixin.qq.com/connect/oauth2/authorize";

    public static String mchAuthUrl = "{{mchAuthRedirectUrl}}?appid={{appId}}&scope=snsapi_userinfo&state=&redirect_uri={{paySiteUrl}}/api/wxmpCallback/msg/wxAuthRedirect/{{mchNo}}/{{sysUserId}}&response_type=code#wechat_redirect";

    /** 微信公众号AppId **/
    private String wxAppId;

    /** 微信公众号AppSecret **/
    private String wxAppSecret;

    /** 微信公众号二维码 **/
    private String wxmpUrl;

    /** 微信校验文件名 **/
    private String wxCheckFileName;

    /** 微信校验文件内容 **/
    private String wxCheckFileValue;

    /** 商户授权回调地址（微信公众号端服务器配置） **/
    private String mchAuthRedirectUrl;

    /** 模板消息ID **/
    private String paySuccMsgTemplateId;

    /** 模板消息内容备注 **/
    private String paySuccMsgTemplateContentRemark;

    /** 通知消息模板ID **/
    private String noticeMsgTemplateId;

    public String getPaySuccMsgTemplateContent() {
        // return "[{\"name\":\"first\",\"value\":\"收到新订单\"},{\"name\":\"keyword1\",\"value\":\"{{orderAmount}}\"},{\"name\":\"keyword2\",\"value\":\"{{payProductName}}\"},{\"name\":\"keyword3\",\"value\":\"{{paySuccTime}}\"},{\"name\":\"keyword4\",\"value\":\"{{payOrderId}}\"},{\"name\":\"remark\",\"value\":\"{{remark}}\"}]";
        return "[{\"name\":\"first\",\"value\":\"订单支付成功通知\"},{\"name\":\"amount3\",\"value\":\"{{orderAmount}}\"},{\"name\":\"thing6\",\"value\":\"{{payProductName}}\"},{\"name\":\"time4\",\"value\":\"{{paySuccTime}}\"},{\"name\":\"character_string2\",\"value\":\"{{payOrderId}}\"},{\"name\":\"thing5\",\"value\":\"{{mercName}}\"}]";
    }

    /**
     * 获取通知模板
     * @return
     */
    public String getNoticeMsgTemplateContent() {
        // return "[{\"name\":\"first\",\"value\":\"收到新订单\"},{\"name\":\"keyword1\",\"value\":\"{{orderAmount}}\"},{\"name\":\"keyword2\",\"value\":\"{{payProductName}}\"},{\"name\":\"keyword3\",\"value\":\"{{paySuccTime}}\"},{\"name\":\"keyword4\",\"value\":\"{{payOrderId}}\"},{\"name\":\"remark\",\"value\":\"{{remark}}\"}]";
        return "[{\"name\":\"first\",\"value\":\"门店预警通知\"},{\"name\":\"thing1\",\"value\":\"{{thing1}}\"},{\"name\":\"thing4\",\"value\":\"{{thing4}}\"},{\"name\":\"thing2\",\"value\":\"{{thing2}}\"},{\"name\":\"thing5\",\"value\":\"{{thing5}}\"},{\"name\":\"time6\",\"value\":\"{{time6}}\"}]";
    }
}
