Skip to content

Commit

Permalink
发送信息
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriZhirkov committed Jan 16, 2020
1 parent 644cb85 commit 63180a9
Show file tree
Hide file tree
Showing 9 changed files with 512 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/example/wechar/LoginController.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class LoginController {

@GetMapping(value = "/wxLogin")
public void wxLogin(HttpServletRequest req, HttpServletResponse resp) throws IOException {
String backUrl = "http://ygtqzh.natapp1.cc/wxAuth/callBack";
String backUrl = "http://zhangzhig.natapp1.cc/wxAuth/callBack";
StringBuffer urlBuffer = new StringBuffer();
urlBuffer.append("https://open.weixin.qq.com/connect/oauth2/authorize?appid=");
urlBuffer.append(AuthUtil.APPID).append("&");
Expand Down
73 changes: 73 additions & 0 deletions src/main/java/com/example/wechar/model/MessageTemplateSend.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package com.example.wechar.model;

/**
* @program: wechar
* @description: 发送模板消息的数据结构
* @author: zzg
* @create: 2020-01-16 16:54
**/

public class MessageTemplateSend {

private String touser;

private String template_id;

private String url;

private TemplateMsgMiniprogram miniprogram;

private TemplateMsgData data;

public String getTouser() {
return touser;
}

public void setTouser(String touser) {
this.touser = touser;
}

public String getTemplate_id() {
return template_id;
}

public void setTemplate_id(String template_id) {
this.template_id = template_id;
}

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public TemplateMsgMiniprogram getMiniprogram() {
return miniprogram;
}

public void setMiniprogram(TemplateMsgMiniprogram miniprogram) {
this.miniprogram = miniprogram;
}

public TemplateMsgData getData() {
return data;
}

public void setData(TemplateMsgData data) {
this.data = data;
}

public MessageTemplateSend(String touser, String template_id, String url, TemplateMsgMiniprogram miniprogram, TemplateMsgData data) {
this.touser = touser;
this.template_id = template_id;
this.url = url;
this.miniprogram = miniprogram;
this.data = data;
}

public MessageTemplateSend() {

}
}
128 changes: 128 additions & 0 deletions src/main/java/com/example/wechar/model/MessageTemplateSendInput.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
package com.example.wechar.model;

/**
* @program: wechar
* @description: 消息模板的输入参数
* @author: zzg
* @create: 2020-01-16 17:25
**/

public class MessageTemplateSendInput {

private String value1;

private String value2;

private String value3;

private String value4;

private String color;

private String remark;

private String first;

private String openId;

private String template_id;

private String url;

public MessageTemplateSendInput(String value1, String value2, String value3,
String value4, String color, String remark,
String first, String openId, String template_id, String url) {
this.value1 = value1;
this.value2 = value2;
this.value3 = value3;
this.value4 = value4;
this.color = color;
this.remark = remark;
this.first = first;
this.openId = openId;
this.template_id = template_id;
this.url = url;
}

public String getValue1() {
return value1;
}

public void setValue1(String value1) {
this.value1 = value1;
}

public String getValue2() {
return value2;
}

public void setValue2(String value2) {
this.value2 = value2;
}

public String getValue3() {
return value3;
}

public void setValue3(String value3) {
this.value3 = value3;
}

public String getValue4() {
return value4;
}

public void setValue4(String value4) {
this.value4 = value4;
}

public String getColor() {
return color;
}

public void setColor(String color) {
this.color = color;
}

public String getRemark() {
return remark;
}

public void setRemark(String remark) {
this.remark = remark;
}

public String getFirst() {
return first;
}

public void setFirst(String first) {
this.first = first;
}

public String getOpenId() {
return openId;
}

public void setOpenId(String openId) {
this.openId = openId;
}

public String getTemplate_id() {
return template_id;
}

public void setTemplate_id(String template_id) {
this.template_id = template_id;
}

public String getUrl() {
return url;
}

public void setUrl(String url) {
this.url = url;
}

public MessageTemplateSendInput() {}
}
86 changes: 86 additions & 0 deletions src/main/java/com/example/wechar/model/TemplateMsgData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package com.example.wechar.model;

/**
* @program: wechar
* @description: 消息模板的数据部分
* @author: zzg
* @create: 2020-01-16 16:48
**/


public class TemplateMsgData {


private TemplateMsgValueColor first;

private TemplateMsgValueColor keyword1;

private TemplateMsgValueColor keyword2;

private TemplateMsgValueColor keyword3;

private TemplateMsgValueColor keyword4;

private TemplateMsgValueColor remark;

public TemplateMsgValueColor getFirst() {
return first;
}

public void setFirst(TemplateMsgValueColor first) {
this.first = first;
}

public TemplateMsgValueColor getKeyword1() {
return keyword1;
}

public void setKeyword1(TemplateMsgValueColor keyword1) {
this.keyword1 = keyword1;
}

public TemplateMsgValueColor getKeyword2() {
return keyword2;
}

public void setKeyword2(TemplateMsgValueColor keyword2) {
this.keyword2 = keyword2;
}

public TemplateMsgValueColor getKeyword3() {
return keyword3;
}

public void setKeyword3(TemplateMsgValueColor keyword3) {
this.keyword3 = keyword3;
}

public TemplateMsgValueColor getRemark() {
return remark;
}

public void setRemark(TemplateMsgValueColor remark) {
this.remark = remark;
}

public TemplateMsgValueColor getKeyword4() {
return keyword4;
}

public void setKeyword4(TemplateMsgValueColor keyword4) {
this.keyword4 = keyword4;
}

public TemplateMsgData(TemplateMsgValueColor first, TemplateMsgValueColor keyword1, TemplateMsgValueColor keyword2,
TemplateMsgValueColor keyword3, TemplateMsgValueColor keyword4, TemplateMsgValueColor remark) {
this.first = first;
this.keyword1 = keyword1;
this.keyword2 = keyword2;
this.keyword3 = keyword3;
this.keyword4 = keyword4;
this.remark = remark;
}

public TemplateMsgData() {}

}
40 changes: 40 additions & 0 deletions src/main/java/com/example/wechar/model/TemplateMsgMiniprogram.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.example.wechar.model;

/**
* @program: wechar
* @description: 消息模板中与小程序所需数据
* @author: zzg
* @create: 2020-01-16 16:52
**/

public class TemplateMsgMiniprogram {

private String appid;

private String pagepath;

public String getAppid() {
return appid;
}

public void setAppid(String appid) {
this.appid = appid;
}

public String getPagepath() {
return pagepath;
}

public void setPagepath(String pagepath) {
this.pagepath = pagepath;
}

public TemplateMsgMiniprogram(String appid, String pagepath) {
this.appid = appid;
this.pagepath = pagepath;
}

public TemplateMsgMiniprogram() {

}
}
38 changes: 38 additions & 0 deletions src/main/java/com/example/wechar/model/TemplateMsgValueColor.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.example.wechar.model;

/**
* @program: wechar
* @description: 发送模板消息中keyword对象
* @author: zzg
* @create: 2020-01-16 16:46
**/

public class TemplateMsgValueColor {

private String value;

private String color;

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

public String getColor() {
return color;
}

public void setColor(String color) {
this.color = color;
}

public TemplateMsgValueColor(String value, String color) {
this.value = value;
this.color = color;
}

public TemplateMsgValueColor() {}
}
Loading

0 comments on commit 63180a9

Please sign in to comment.