1 package com.foxinmy.weixin4j.payment.mch;
2
3 import javax.xml.bind.annotation.XmlAccessType;
4 import javax.xml.bind.annotation.XmlAccessorType;
5 import javax.xml.bind.annotation.XmlRootElement;
6
7 @Deprecated
8 @XmlRootElement
9 @XmlAccessorType(XmlAccessType.FIELD)
10 public class SceneInfoApp {
11
12
13
14 private String type;
15
16
17
18 private String name;
19
20
21
22 private String path;
23 private String sceneInfo;
24
25 private SceneInfoApp(String type, String name, String path) {
26 this.type = type;
27 this.name = name;
28 this.path = path;
29 }
30
31 public String getType() {
32 return type;
33 }
34
35 public String getName() {
36 return name;
37 }
38
39 public String getPath() {
40 return path;
41 }
42
43 public String getSceneInfo() {
44 return sceneInfo;
45 }
46
47 public void setSceneInfo(String sceneInfo) {
48 this.sceneInfo = sceneInfo;
49 }
50
51
52
53
54
55
56
57
58 public static SceneInfoApp createIOSAPP(String appName, String bundleId) {
59 SceneInfoApp app = new SceneInfoApp("IOS", appName, bundleId);
60 String sceneInfo = String
61 .format("{\"type\": \"%s\",\"app_name\": \"%s\",\"bundle_id\": \"%s\"}",
62 app.getType(), app.getName(), app.getPath());
63 app.setSceneInfo(sceneInfo);
64 return app;
65 }
66
67
68
69
70
71
72
73
74 public static SceneInfoApp createAndroidAPP(String appName, String packageName) {
75 SceneInfoApp app = new SceneInfoApp("Android", appName, packageName);
76 String sceneInfo = String
77 .format("{\"type\": \"%s\",\"app_name\": \"%s\",\"package_name\": \"%s\"}",
78 app.getType(), app.getName(), app.getPath());
79 app.setSceneInfo(sceneInfo);
80 return app;
81 }
82
83
84
85
86
87
88
89
90
91
92 public static SceneInfoApp createWapAPP(String name, String url) {
93 SceneInfoApp app = new SceneInfoApp("Wap", name, url);
94 String sceneInfo = String.format(
95 "{\"type\": \"%s\",\"wap_name\": \"%s\",\"wap_url\": \"%s\"}",
96 app.getType(), app.getName(), app.getPath());
97 app.setSceneInfo(sceneInfo);
98 return app;
99 }
100 }