Compare commits
65 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b70c8121d | ||
|
|
fd30c5cf36 | ||
|
|
0310bd4a15 | ||
|
|
80ec6d2e3d | ||
|
|
d96f17b847 | ||
|
|
7648eef981 | ||
|
|
79087f33e4 | ||
|
|
d0289d38b3 | ||
|
|
90029faa53 | ||
|
|
ecb5aa1b29 | ||
|
|
1db8ef9d85 | ||
|
|
4bcae2f8d1 | ||
|
|
9bab4cdb25 | ||
|
|
856a9f01dd | ||
|
|
e57cd5e1c8 | ||
|
|
542e23ac1b | ||
|
|
6949f50c7c | ||
|
|
7b43ae3ce1 | ||
|
|
8ca283ca85 | ||
|
|
3728291e73 | ||
|
|
6997dea968 | ||
|
|
7f601c8e60 | ||
|
|
7adc2a7c4b | ||
|
|
f4f082cc86 | ||
|
|
d21d84bc87 | ||
|
|
60f996137f | ||
|
|
11c8d234ff | ||
|
|
125c681669 | ||
|
|
b9347013f0 | ||
|
|
3415f0836f | ||
|
|
22672c8a9e | ||
|
|
a405aa7057 | ||
|
|
e39dd646f5 | ||
|
|
2ca224f7a5 | ||
|
|
d4e97babf4 | ||
|
|
a1c75d010b | ||
|
|
9b6b3af33e | ||
|
|
91833a44bb | ||
|
|
8dc8709499 | ||
|
|
b34d9d6242 | ||
|
|
2c9519a35e | ||
|
|
f5dfce08ed | ||
|
|
5d4e97b206 | ||
|
|
82d3f471f9 | ||
|
|
316909dd61 | ||
|
|
5e308be3ba | ||
|
|
ba80cebc45 | ||
|
|
0f5cdb49c0 | ||
|
|
1ee4b4af30 | ||
|
|
bb38428708 | ||
|
|
a22467d4f1 | ||
|
|
ad90c83cf7 | ||
|
|
cdae6a9868 | ||
|
|
be08001f3f | ||
|
|
333d283e24 | ||
|
|
450d1fb869 | ||
|
|
1412782327 | ||
|
|
6127cd50a9 | ||
|
|
19f4d0395e | ||
|
|
d52edbb23c | ||
|
|
6c6d713c01 | ||
|
|
8ea34c3ee0 | ||
|
|
d357fa7c85 | ||
|
|
6332d1486b | ||
|
|
e709050ba3 |
@@ -1,3 +1,12 @@
|
||||
## 2.0.0.rc46
|
||||
|
||||
现在导入导出都接入底层流程,无需新增接口,只需要实现接口即可。
|
||||
|
||||
- 过程日志不再和操作日志同时存在
|
||||
- 过程日志新增params参数
|
||||
- 通过实现*TsImportHandler*接口编写导入逻辑
|
||||
- 通过实现*TsExportHandler*接口编写导出逻辑
|
||||
|
||||
## 2.0.0.rc4
|
||||
|
||||
- perf:TsTokenConfig不在提供静态方法
|
||||
|
||||
24
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>springboot-parent</name>
|
||||
<description>杭州铁晟科技有限公司基础依赖</description>
|
||||
@@ -35,6 +35,8 @@
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
||||
<hutool.version>5.8.31</hutool.version>
|
||||
</properties>
|
||||
|
||||
<developers>
|
||||
@@ -58,61 +60,61 @@
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-database</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-login</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-web</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-util</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-platform</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-message</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-role</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-poi</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-ademo</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
@@ -36,6 +36,12 @@
|
||||
<artifactId>easyexcel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>3.7.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<repositories>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package com.tiesheng.demo.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tiesheng.web.pojos.RequestUserInfo;
|
||||
import com.tiesheng.web.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.web.service.TieshengWebConfigurer;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.login.pojos.RequestUserInfo;
|
||||
import com.tiesheng.login.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.login.service.TsLoginConfigurer;
|
||||
import com.tiesheng.util.config.GlobalConfig;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.web.service.TieshengWebConfigurer;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -13,24 +14,30 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Objects;
|
||||
|
||||
@Component
|
||||
public class DemoWebConfigurer implements TieshengWebConfigurer {
|
||||
public class DemoWebConfigurer implements TieshengWebConfigurer, TsLoginConfigurer {
|
||||
|
||||
@Autowired
|
||||
GlobalConfig globalConfig;
|
||||
|
||||
|
||||
@Override
|
||||
public RequestUserInfo getCurrentUserName(TokenBean tokenBean) {
|
||||
RequestUserInfo info = new RequestUserInfo();
|
||||
info.setId("1");
|
||||
info.setName("test");
|
||||
info.setId(tokenBean.getId());
|
||||
info.setName(tokenBean.getExtra());
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TokenBean login(CorePlatformUnique platformUnique) {
|
||||
TokenBean tokenBean = null;
|
||||
if (!StrUtil.isEmpty(platformUnique.getUserId())) {
|
||||
tokenBean = new TokenBean(platformUnique.getUserId(), "", globalConfig.getService());
|
||||
tokenBean = new TokenBean(platformUnique.getUserId(), "super");
|
||||
} else if (Objects.equals(platformUnique.getUniqueId(), "1110290049")) {
|
||||
tokenBean = new TokenBean("1", "super");
|
||||
}
|
||||
|
||||
if (tokenBean != null) {
|
||||
tokenBean.setExtra("1110290049");
|
||||
}
|
||||
|
||||
return tokenBean;
|
||||
@@ -39,13 +46,11 @@ public class DemoWebConfigurer implements TieshengWebConfigurer {
|
||||
@Override
|
||||
public void redirect(TokenBean bean, String to, String extra, HttpServletResponse response) {
|
||||
|
||||
// 默认跳转到mobile
|
||||
to = StrUtil.emptyToDefault(to, "mobile");
|
||||
bean.setEnvironmentType(to);
|
||||
|
||||
if (Objects.equals(bean.getEnvironmentType(), "mobile")) {
|
||||
globalConfig.redirect("mobile", "/?token=" + bean.toToken(), response);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TsLoginConfigurer configureLogin() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.tiesheng.demo.config;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Component
|
||||
public class DemoWebMvcConfigurer implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
||||
registry.addResourceHandler("/mobile/**").addResourceLocations("classpath:/mobile/0.0.13/");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,42 +1,49 @@
|
||||
package com.tiesheng.demo.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.TimeInterval;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.log.LogFactory;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.read.listener.ReadListener;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.tiesheng.annotation.role.RoleAuthority;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import com.tiesheng.web.service.CoreMessageService;
|
||||
import com.tiesheng.web.util.ProcessImportConsumer;
|
||||
import com.tiesheng.database.config.DbBackupConfig;
|
||||
import com.tiesheng.demo.pojos.JsonTest;
|
||||
import com.tiesheng.demo.pojos.PoiBean;
|
||||
import com.tiesheng.demo.pojos.TestFile;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import com.tiesheng.message.pojos.MessageReqResp;
|
||||
import com.tiesheng.message.pojos.UserChannel;
|
||||
import com.tiesheng.platform.config.ding.PlatformDingConfig;
|
||||
import com.tiesheng.platform.config.ding.bean.DingUserInfo;
|
||||
import com.tiesheng.util.config.EncryptConfig;
|
||||
import com.tiesheng.util.config.GlobalConfig;
|
||||
import com.tiesheng.util.config.Ip2regionConfig;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.FileUploadPath;
|
||||
import com.tiesheng.util.service.TsCacheService;
|
||||
import com.tiesheng.util.service.http.OkHttpUtil;
|
||||
import com.tiesheng.web.service.CoreLogService;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test")
|
||||
@RoleAuthority(value = "test", group = "test")
|
||||
public class TestController {
|
||||
|
||||
@Autowired
|
||||
@@ -48,60 +55,84 @@ public class TestController {
|
||||
@Autowired
|
||||
EncryptConfig encryptConfig;
|
||||
@Autowired
|
||||
CoreMessageService coreMessageService;
|
||||
@Autowired
|
||||
CoreLogService coreLogService;
|
||||
@Autowired
|
||||
DbBackupConfig dbBackupConfig;
|
||||
@Autowired
|
||||
TsCacheService tsCacheService;
|
||||
@Autowired
|
||||
PlatformDingConfig platformDingConfig;
|
||||
|
||||
|
||||
@RequestMapping("/index")
|
||||
@TokenIgnore
|
||||
public ApiResp<String> index(TokenBean tokenBean) {
|
||||
return ApiResp.respOK("hello world");
|
||||
public void index(HttpServletResponse response) {
|
||||
globalConfig.redirect("mobile", "/test", response);
|
||||
}
|
||||
|
||||
@RequestMapping("/redirect")
|
||||
@TokenIgnore
|
||||
public void redirect(HttpServletResponse response) {
|
||||
@RoleAuthority("redirect")
|
||||
public ApiResp<JsonTest> redirect(@RequestBody JsonTest dto, HttpServletResponse response) {
|
||||
|
||||
ArrayList<String> strings = CollUtil.newArrayList("11111", "22222");
|
||||
coreLogService.addProcess("fdfd", strings, new ProcessImportConsumer<String>() {
|
||||
@Override
|
||||
public int accept(List<String> list) {
|
||||
LogFactory.get().info("list: " + list.size());
|
||||
return 0;
|
||||
}
|
||||
JsonTest jsonTest = new JsonTest();
|
||||
jsonTest.setNow(DateUtil.date());
|
||||
jsonTest.setNow1(DateUtil.date());
|
||||
|
||||
@Override
|
||||
public String getFailFile() {
|
||||
LogFactory.get().info("getFailFile: " + strings.size());
|
||||
return null;
|
||||
}
|
||||
});
|
||||
String jsonString = JSON.toJSONString(jsonTest);
|
||||
LogFactory.get().info(jsonString);
|
||||
|
||||
LogFactory.get().info("strings: " + strings.size());
|
||||
LogFactory.get().info(JSON.toJSONString(dto));
|
||||
|
||||
// ArrayList<String> strings = CollUtil.newArrayList("11111", "22222");
|
||||
// coreLogService.addProcess("fdfd", strings, new ProcessImportConsumer<String>() {
|
||||
// @Override
|
||||
// public int accept(List<String> list) {
|
||||
// LogFactory.get().info("list: " + list.size());
|
||||
// return 0;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getFailFile() {
|
||||
// LogFactory.get().info("getFailFile: " + strings.size());
|
||||
// return null;
|
||||
// }
|
||||
// });
|
||||
//
|
||||
// LogFactory.get().info("strings: " + strings.size());
|
||||
|
||||
|
||||
// tsTokenConfig.validToken("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2NzYwMDY4NzUsImlkIjoiMSIsImVudmlyb25tZW50VHlwZSI6Im1vYmlsZSIsInNlcnZpY2UiOiJjb250ZXN0LXJlc2VydmUiLCJleHRyYSI6IiJ9.nsfxEFpCNHC7eNCS5DJXdu1VDdnHrTjSfgrozND70Lc", true);
|
||||
globalConfig.redirect("mobile", "/test", response);
|
||||
// globalConfig.redirect("mobile", "/test", response);
|
||||
return ApiResp.respOK(jsonTest);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/send")
|
||||
@TokenIgnore
|
||||
public ApiResp<MessageReqResp> sendMessage() {
|
||||
public ApiResp<String> sendMessage() {
|
||||
|
||||
MessageReqResp reqResp = coreMessageService.send(new UserChannel("13567116463", "sms"),
|
||||
JSONUtil.createObj().putOpt("action", "sms-visitor-invite"));
|
||||
// MessageReqResp reqResp = coreMessageService.send(new UserChannel("13567116463", "sms"),
|
||||
// JSONUtil.createObj().putOpt("action", "sms-visitor-invite"));
|
||||
|
||||
return ApiResp.respOK(reqResp);
|
||||
return ApiResp.respOK(null);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/export")
|
||||
@TokenIgnore
|
||||
public ApiResp<String> export() {
|
||||
|
||||
// tsCacheService.put("fdfhdfd", "fdfdfdfd");
|
||||
// String s = tsCacheService.get("fdfhdfd");
|
||||
// LogFactory.get().info("export: " + s);
|
||||
|
||||
platformDingConfig.syncDeptUser("", null, new Consumer<DingUserInfo>() {
|
||||
@Override
|
||||
public void accept(DingUserInfo dingUserInfo) {
|
||||
}
|
||||
});
|
||||
|
||||
// List<TestFile> list = new ArrayList<>();
|
||||
// list.add(new TestFile("11111"));
|
||||
// list.add(new TestFile("22222"));
|
||||
@@ -122,14 +153,13 @@ public class TestController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("searchIP")
|
||||
@PostMapping("searchIP")
|
||||
@TokenIgnore
|
||||
public ApiResp<String> searchIp() {
|
||||
String search = ip2regionConfig.search("127.0.0.1");
|
||||
return ApiResp.respOK(search);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("desensitize")
|
||||
@TokenIgnore
|
||||
public ApiResp<List<TestFile>> desensitize() {
|
||||
@@ -177,18 +207,31 @@ public class TestController {
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
@RequestMapping("poiTool")
|
||||
|
||||
@GetMapping("getwxacode")
|
||||
@TokenIgnore
|
||||
public ApiResp<String> poiTool() {
|
||||
TimeInterval timeInterval = new TimeInterval();
|
||||
|
||||
FileUploadPath file = FileUploadPath.file("/upload/test.xlsx");
|
||||
|
||||
ExcelUtil.getReader(new File(file.getAbsolutePath())).read();
|
||||
|
||||
System.out.println("timeInterval: " + timeInterval.interval());
|
||||
|
||||
return ApiResp.respOK("");
|
||||
public ApiResp<String> getwxacode() {
|
||||
String id = "test_1111111";
|
||||
FileUploadPath path = FileUploadPath.random("png");
|
||||
JSONObject paramJson = new JSONObject();
|
||||
paramJson.put("page", "pages/login/index");
|
||||
paramJson.put("scene", "no=" + id);
|
||||
paramJson.put("env_version", "develop");
|
||||
paramJson.put("width", 430);
|
||||
paramJson.put("is_hyaline", false);
|
||||
paramJson.put("auto_color", false);
|
||||
FileUploadPath file = FileUploadPath.file(id + ".png");
|
||||
try {
|
||||
Request request = OkHttpUtil.ofPost("https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" +
|
||||
"83_7xqG36kdgwuf8zzWLY3jtz7bg4ucziN-0oxbE0X9zBzwbjZ4S4Ss2RM9uHeSIcRp2K-wEp6MLzWhqo2AXj0Jpzd6IiJdUsRxqdHPvEWqAdOgt83vzZwdDf7tZBkGNGeAFASZS",
|
||||
paramJson);
|
||||
Response execute1 = OkHttpUtil.ofHttpClient().build().newCall(request).execute();
|
||||
FileUtil.writeFromStream(execute1.body().byteStream(), file.getAbsolutePath());
|
||||
execute1.close();
|
||||
} catch (Exception e) {
|
||||
throw new ApiException("每分钟最多生成5000个二维码,请稍后再试!");
|
||||
}
|
||||
return ApiResp.respOK(path.getHttpPath());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.tiesheng.demo.pojos;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class JsonTest {
|
||||
|
||||
private Date now;
|
||||
@JSONField(format = "yyyy-MM-dd")
|
||||
private Date now1;
|
||||
private String no;
|
||||
private String name;
|
||||
|
||||
private JsonTest child;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public Date getNow() {
|
||||
return now;
|
||||
}
|
||||
|
||||
public void setNow(Date now) {
|
||||
this.now = now;
|
||||
}
|
||||
|
||||
public Date getNow1() {
|
||||
return now1;
|
||||
}
|
||||
|
||||
public void setNow1(Date now1) {
|
||||
this.now1 = now1;
|
||||
}
|
||||
|
||||
public String getNo() {
|
||||
return no;
|
||||
}
|
||||
|
||||
public void setNo(String no) {
|
||||
this.no = no;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public JsonTest getChild() {
|
||||
return child;
|
||||
}
|
||||
|
||||
public void setChild(JsonTest child) {
|
||||
this.child = child;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.tiesheng.demo.pojos;
|
||||
|
||||
import com.tiesheng.annotation.desensitize.Desensitize;
|
||||
import com.tiesheng.poi.pojos.PoiWriteBase;
|
||||
|
||||
|
||||
@@ -8,7 +7,6 @@ public class TestParent implements PoiWriteBase {
|
||||
|
||||
private String id;
|
||||
|
||||
@Desensitize()
|
||||
private String test;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package com.tiesheng.demo.service;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.tiesheng.message.config.aliyun.AliyunSmsHandler;
|
||||
import com.tiesheng.message.pojos.AliyunTempParam;
|
||||
import com.tiesheng.message.config.aliyun.AliyunTempParam;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Objects;
|
||||
@@ -15,16 +14,17 @@ public class DemoSmsHandler implements AliyunSmsHandler {
|
||||
@Override
|
||||
public AliyunTempParam handler(JSONObject obj) {
|
||||
|
||||
String action = obj.getStr("action");
|
||||
String action = obj.getString("action");
|
||||
|
||||
AliyunTempParam param = new AliyunTempParam();
|
||||
param.setSignName("智慧校园");
|
||||
|
||||
if (Objects.equals(action, "sms-visitor-invite")) {
|
||||
param.setTemplateCode("SMS_276125463");
|
||||
param.setTemplateParam(JSONUtil.createObj()
|
||||
.putOpt("date", DateUtil.today())
|
||||
);
|
||||
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("date", DateUtil.today());
|
||||
param.setTemplateParam(object);
|
||||
}
|
||||
|
||||
return param;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.tiesheng.demo.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.web.pojos.imex.ImportDealDTO;
|
||||
import com.tiesheng.web.service.imex.TsImportHandler;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Service
|
||||
public class UserImportHandler implements TsImportHandler<String> {
|
||||
|
||||
@Override
|
||||
public List<String> ready(ImportDealDTO dto, TokenBean token) {
|
||||
return CollUtil.newArrayList("11111");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplateUrl() {
|
||||
return "/template/xsxxzx_teacher_leader.xlsx";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAction() {
|
||||
return "user_import";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchHandler(List<String> list) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResultFile() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,17 @@ spring:
|
||||
url: jdbc:mysql://47.96.30.85:3306/com_tiesheng_web?useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&queryTimeout=5400&allowMultiQueries=true&serverTimezone=GMT%2B8
|
||||
username: com_tiesheng_web
|
||||
password: 4Xo$XheGFc
|
||||
redis:
|
||||
url: redis://kyF0zUL3011111@47.96.30.85:6234
|
||||
database: 1
|
||||
|
||||
platform:
|
||||
ding:
|
||||
global:
|
||||
corpId: dingebe664cb3baf3a52a39a90f97fcb1e09
|
||||
agentId: 2474444028
|
||||
appKey: dingyvf1niiajfaajyo5
|
||||
appSecret: y6SGZ4fvPbdbj4RVbDWLeMBkGgplaOdnTA_9wN5TDdOV_Y47alYc1LDlIHjsBJE1
|
||||
wxmp:
|
||||
global:
|
||||
app-id: wxa0343fe519824651
|
||||
@@ -18,11 +27,12 @@ tiesheng:
|
||||
token:
|
||||
test-map:
|
||||
"1111":
|
||||
id: "1111"
|
||||
role-id: "student_bks"
|
||||
id: "1"
|
||||
role-id: "1822829641023524865"
|
||||
global:
|
||||
version: 2
|
||||
host: http://localhost:8100
|
||||
service: yrx
|
||||
aliyun:
|
||||
access-key-id: LTAI5tJtbgBCnTY5eS4SmrTf
|
||||
access-key-secret: JIHqpRUFffCHhXaJEVvWN31WcexWqG
|
||||
|
||||
@@ -18,8 +18,4 @@ spring:
|
||||
logging:
|
||||
file:
|
||||
name: runtime/logs/tiesheng.log
|
||||
tiesheng:
|
||||
token:
|
||||
ignore-paths:
|
||||
- /test/index
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 8.4 KiB After Width: | Height: | Size: 8.4 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 5.0 KiB After Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
@@ -0,0 +1,42 @@
|
||||
package com.tiesheng.demo;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.log.LogFactory;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONPath;
|
||||
import com.tiesheng.demo.pojos.JsonTest;
|
||||
import com.tiesheng.login.pojos.RequestUserInfo;
|
||||
|
||||
public class MainTest {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
MainTest test = new MainTest();
|
||||
test.testJsonSelf();
|
||||
|
||||
}
|
||||
|
||||
private void testJsonSelf() {
|
||||
RequestUserInfo info = new RequestUserInfo();
|
||||
info.setId("1");
|
||||
info.setName("name");
|
||||
info.setData(info);
|
||||
String jsonStr = JSON.toJSONString(info);
|
||||
LogFactory.get().info(jsonStr);
|
||||
}
|
||||
|
||||
|
||||
private void testJsonPath() {
|
||||
JsonTest jsonTest = new JsonTest();
|
||||
jsonTest.setNo("1111");
|
||||
jsonTest.setName("1111");
|
||||
jsonTest.setNow(DateUtil.date());
|
||||
jsonTest.setChild(jsonTest);
|
||||
|
||||
JSONPath jsonPath = JSONPath.compile("child.no");
|
||||
String eval = jsonPath.eval(jsonTest, String.class);
|
||||
LogFactory.get().info(eval);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-annotation</artifactId>
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.tiesheng.annotation.desensitize;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Desensitize {
|
||||
|
||||
int prefix() default 1;
|
||||
|
||||
int suffix() default 1;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.tiesheng.annotation.role;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface RoleAuthority {
|
||||
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String value();
|
||||
|
||||
/**
|
||||
* 平台类型
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String platform() default "";
|
||||
|
||||
|
||||
/**
|
||||
* 分组
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String[] group() default {};
|
||||
|
||||
|
||||
/**
|
||||
* 依赖其他权限
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
String[] deps() default {};
|
||||
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.tiesheng.annotation.role;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target({ElementType.METHOD})
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface RoleIgnore {
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-database</artifactId>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-encrypt</artifactId>
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.tiesheng.encrypt.config;
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import cn.hutool.core.util.CharsetUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.tiesheng.util.config.EncryptConfig;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.core.MethodParameter;
|
||||
@@ -66,7 +66,7 @@ public class DecryptRequestBodyAdvice implements RequestBodyAdvice {
|
||||
DecryptHttpInputMessage(HttpInputMessage inputMessage, EncryptConfig encryptConfig) throws Exception {
|
||||
this.headers = inputMessage.getHeaders();
|
||||
String bodyStr = IoUtil.read(inputMessage.getBody(), CharsetUtil.CHARSET_UTF_8);
|
||||
String encryptData = JSONUtil.parseObj(bodyStr).getStr("encryptData");
|
||||
String encryptData = JSON.parseObject(bodyStr).getString("encryptData");
|
||||
if (!StrUtil.isEmpty(encryptData)) {
|
||||
String decrypt = encryptConfig.decrypt(encryptData);
|
||||
this.body = IoUtil.toStream(decrypt, Charset.defaultCharset());
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.tiesheng.encrypt.config;
|
||||
|
||||
import cn.hutool.core.annotation.AnnotationUtil;
|
||||
import cn.hutool.log.LogFactory;
|
||||
import com.tiesheng.util.CommonUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.tiesheng.util.config.EncryptConfig;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -42,7 +42,7 @@ public class EncryptResponseBodyAdvice implements ResponseBodyAdvice<ApiResp> {
|
||||
}
|
||||
|
||||
body.setEncrypt(true);
|
||||
body.setData(encryptConfig.encrypt(CommonUtil.writeJsonString(data)));
|
||||
body.setData(encryptConfig.encrypt(JSON.toJSONString(data)));
|
||||
return body;
|
||||
} catch (Exception var17) {
|
||||
LogFactory.get().info("加密数据异常", var17);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-login</artifactId>
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.tiesheng.login;
|
||||
|
||||
import com.tiesheng.platform.PlatformAutoConfigurer;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
|
||||
@ComponentScan({
|
||||
"com.tiesheng.login.**.*",
|
||||
})
|
||||
@Import(PlatformAutoConfigurer.class)
|
||||
public class LoginAutoConfigurer {
|
||||
}
|
||||
@@ -3,8 +3,12 @@ package com.tiesheng.login.config;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.login.pojos.RequestUserInfo;
|
||||
import com.tiesheng.login.service.TsLoginConfigurer;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.web.bind.support.WebDataBinderFactory;
|
||||
@@ -28,6 +32,8 @@ public class TokenWebMvcConfigurer implements WebMvcConfigurer {
|
||||
|
||||
@Resource
|
||||
TsTokenConfig tsTokenConfig;
|
||||
@Resource
|
||||
TsLoginConfigurer tsLoginConfigurer;
|
||||
|
||||
@Override
|
||||
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
|
||||
@@ -60,6 +66,11 @@ public class TokenWebMvcConfigurer implements WebMvcConfigurer {
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||
|
||||
// 非接口类直接跳过
|
||||
if (!(handler instanceof HandlerMethod)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
String requestURI = request.getRequestURI();
|
||||
String[] ignorePaths = tsTokenConfig.getIgnorePaths();
|
||||
if (ObjUtil.isNotEmpty(ignorePaths)) {
|
||||
@@ -77,6 +88,10 @@ public class TokenWebMvcConfigurer implements WebMvcConfigurer {
|
||||
|
||||
// 过滤不要需要验证的接口(注解)
|
||||
HandlerMethod handlerMethod = (HandlerMethod) handler;
|
||||
if (handlerMethod.getBeanType() == BasicErrorController.class) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TokenIgnore annotation = handlerMethod.getBeanType().getAnnotation(TokenIgnore.class);
|
||||
if (annotation != null) {
|
||||
return true;
|
||||
@@ -86,8 +101,14 @@ public class TokenWebMvcConfigurer implements WebMvcConfigurer {
|
||||
return true;
|
||||
}
|
||||
|
||||
// token验证
|
||||
tsTokenConfig.validToken(request, true);
|
||||
// 验证TOKEN是否存在
|
||||
TokenBean tokenBean = tsTokenConfig.validToken(request, true);
|
||||
|
||||
// 验证用户是否存在
|
||||
RequestUserInfo cachedUserInfo = tsLoginConfigurer.getCachedUserInfo(tokenBean, false);
|
||||
if (cachedUserInfo == null) {
|
||||
throw new ApiException("非法TOKEN,请重新登录");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -6,13 +6,11 @@ import cn.hutool.core.util.URLUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.tiesheng.annotation.operation.OperationIgnore;
|
||||
import com.tiesheng.annotation.token.TokenIgnore;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.login.pojos.CodeExtraDTO;
|
||||
import com.tiesheng.login.pojos.DoLoginInfo;
|
||||
import com.tiesheng.login.pojos.UniqueIndexDTO;
|
||||
import com.tiesheng.login.pojos.WxminiLoginVo;
|
||||
import com.tiesheng.login.service.TieshengLoginConfigurer;
|
||||
import com.tiesheng.login.service.CorePlatformUniqueService;
|
||||
import com.tiesheng.platform.config.ding.PlatformDingConfig;
|
||||
import com.tiesheng.platform.config.ding.bean.DingJsapiSignature;
|
||||
import com.tiesheng.platform.config.ding.bean.DingUserInfo;
|
||||
@@ -23,8 +21,10 @@ import com.tiesheng.platform.config.wxmp.bean.WxConfigBean;
|
||||
import com.tiesheng.platform.config.wxmp.bean.WxJsapiSignature;
|
||||
import com.tiesheng.platform.config.wxmp.bean.WxUserInfo;
|
||||
import com.tiesheng.util.config.GlobalConfig;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -49,7 +49,7 @@ public class LoginController {
|
||||
@Autowired
|
||||
PlatformWxminiConfig platformWxminiConfig;
|
||||
@Autowired
|
||||
TieshengLoginConfigurer tieshengLoginConfigurer;
|
||||
CorePlatformUniqueService corePlatformUniqueService;
|
||||
@Autowired
|
||||
GlobalConfig globalConfig;
|
||||
@Autowired
|
||||
@@ -65,13 +65,13 @@ public class LoginController {
|
||||
@OperationIgnore
|
||||
public void uniqueIndex(UniqueIndexDTO dto, HttpServletResponse response) {
|
||||
if (tsTokenConfig.isValidLoginSign() && !dto.validSign()) {
|
||||
tieshengLoginConfigurer.onSignError(response);
|
||||
corePlatformUniqueService.onSignError(response);
|
||||
return;
|
||||
}
|
||||
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("web_unique_redirect",
|
||||
TokenBean tokenBean = corePlatformUniqueService.login(new DoLoginInfo("web_unique_redirect",
|
||||
dto.getNo(), dto.getPlatform(), dto.getInfo()));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
corePlatformUniqueService.redirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ public class LoginController {
|
||||
@PostMapping("/unique/index")
|
||||
@OperationIgnore
|
||||
public ApiResp<String> uniqueIndex(@RequestBody UniqueIndexDTO dto) {
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo("web_unique_index",
|
||||
TokenBean tokenBean = corePlatformUniqueService.login(new DoLoginInfo("web_unique_index",
|
||||
dto.getNo(), dto.getPlatform(), dto.getInfo()));
|
||||
if (tokenBean == null || StrUtil.isEmpty(tokenBean.getId())) {
|
||||
throw new ApiException("登录失败");
|
||||
@@ -134,9 +134,9 @@ public class LoginController {
|
||||
public void dingOauth2(@PathVariable String service, CodeExtraDTO dto, HttpServletResponse response) {
|
||||
DingUserSimple userSimple = platformDingConfig.getUserIdByCode(service, dto.getCode());
|
||||
DingUserInfo dingUserInfo = platformDingConfig.topapiV2UserGet(service, userSimple.getUserid());
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(dingUserInfo.getAppId(),
|
||||
TokenBean tokenBean = corePlatformUniqueService.login(new DoLoginInfo(dingUserInfo.getAppId(),
|
||||
dingUserInfo.getUserid(), "ding", JSON.toJSONString(dingUserInfo)));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
corePlatformUniqueService.redirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
}
|
||||
|
||||
|
||||
@@ -182,9 +182,9 @@ public class LoginController {
|
||||
@OperationIgnore
|
||||
public void wxmpOauth2(@PathVariable String service, CodeExtraDTO dto, HttpServletResponse response) {
|
||||
WxUserInfo wxUserInfo = platformWxmpConfig.getOAuth2AccessToken(service, dto.getCode());
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(wxUserInfo.getAppId(),
|
||||
TokenBean tokenBean = corePlatformUniqueService.login(new DoLoginInfo(wxUserInfo.getAppId(),
|
||||
wxUserInfo.getOpenid(), "wxmp", JSON.toJSONString(wxUserInfo)));
|
||||
tieshengLoginConfigurer.onLoginRedirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
corePlatformUniqueService.redirect(tokenBean, dto.getTo(), dto.getExtra(), response);
|
||||
}
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ public class LoginController {
|
||||
public ApiResp<WxminiLoginVo> wxminiIndex(@PathVariable String service, String code) {
|
||||
String openid = platformWxminiConfig.jscode2session(service, code);
|
||||
WxConfigBean configBean = platformWxminiConfig.getConfigBean(service);
|
||||
TokenBean tokenBean = tieshengLoginConfigurer.doLogin(new DoLoginInfo(configBean.getAppId(),
|
||||
TokenBean tokenBean = corePlatformUniqueService.login(new DoLoginInfo(configBean.getAppId(),
|
||||
openid, "wxmini", "{}"));
|
||||
|
||||
WxminiLoginVo loginVo = new WxminiLoginVo();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiesheng.web.mapper;
|
||||
package com.tiesheng.login.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.web.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.login.pojos.dao.CoreLogLogin;
|
||||
|
||||
public interface CoreLogLoginMapper extends BaseMapper<CoreLogLogin> {
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiesheng.web.mapper;
|
||||
package com.tiesheng.login.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.tiesheng.web.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.login.pojos.dao.CorePlatformUnique;
|
||||
|
||||
public interface CorePlatformUniqueMapper extends BaseMapper<CorePlatformUnique> {
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.web.pojos;
|
||||
package com.tiesheng.login.pojos;
|
||||
|
||||
/**
|
||||
* 当前token的数据
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.web.pojos.dao;
|
||||
package com.tiesheng.login.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.tiesheng.web.pojos.dao;
|
||||
package com.tiesheng.login.pojos.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.tiesheng.login.service;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tiesheng.login.mapper.CoreLogLoginMapper;
|
||||
import com.tiesheng.login.mapper.CorePlatformUniqueMapper;
|
||||
import com.tiesheng.login.pojos.DoLoginInfo;
|
||||
import com.tiesheng.login.pojos.RequestUserInfo;
|
||||
import com.tiesheng.login.pojos.dao.CoreLogLogin;
|
||||
import com.tiesheng.login.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.config.Ip2regionConfig;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.util.service.TsCacheService;
|
||||
import com.tiesheng.util.service.TsServiceBase;
|
||||
import com.tiesheng.util.service.role.TsAuthorityHandler;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Service
|
||||
public class CorePlatformUniqueService extends TsServiceBase<CorePlatformUniqueMapper, CorePlatformUnique> {
|
||||
|
||||
@Resource
|
||||
CoreLogLoginMapper coreLogLoginMapper;
|
||||
@Resource
|
||||
Ip2regionConfig ip2regionConfig;
|
||||
@Resource
|
||||
TsLoginConfigurer tsLoginConfigurer;
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TokenBean login(DoLoginInfo loginInfo) {
|
||||
|
||||
CorePlatformUnique platformUnique = getOneByColumn("unique_id", loginInfo.getUnique());
|
||||
if (platformUnique == null) {
|
||||
platformUnique = new CorePlatformUnique();
|
||||
platformUnique.setAppId(loginInfo.getAppId());
|
||||
platformUnique.setUniqueId(loginInfo.getUnique());
|
||||
}
|
||||
platformUnique.setPlatform(loginInfo.getPlatform());
|
||||
platformUnique.setInfo(loginInfo.getInfo());
|
||||
saveOrUpdate(platformUnique);
|
||||
|
||||
String oldUserId = platformUnique.getUserId();
|
||||
TokenBean tokenBean = tsLoginConfigurer.login(platformUnique);
|
||||
if (tokenBean != null) {
|
||||
|
||||
// 清除授权信息
|
||||
TsCacheService.of().remove(StrUtil.format(TsAuthorityHandler.CACHE_AUTHORITY,
|
||||
tokenBean.getRoleId(), tokenBean.getId()));
|
||||
|
||||
// 添加登录日志
|
||||
addLoginLog(platformUnique, tokenBean);
|
||||
|
||||
// 更新唯一值
|
||||
if (!StrUtil.isEmpty(tokenBean.getId()) &&
|
||||
!Objects.equals(oldUserId, tokenBean.getId())) {
|
||||
platformUnique.setUserId(tokenBean.getId());
|
||||
saveOrUpdate(platformUnique);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return tokenBean;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 授权登录回调
|
||||
*
|
||||
* @param bean
|
||||
*/
|
||||
public void redirect(TokenBean bean, String to, String extra, HttpServletResponse response) {
|
||||
tsLoginConfigurer.redirect(bean, to, extra, response);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 签名错误的时候
|
||||
*/
|
||||
public void onSignError(HttpServletResponse response) {
|
||||
tsLoginConfigurer.onSignError(response);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// 登录日志
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* 添加登录日志
|
||||
*
|
||||
* @param platformUnique
|
||||
* @param tokenBean
|
||||
*/
|
||||
public void addLoginLog(CorePlatformUnique platformUnique, TokenBean tokenBean) {
|
||||
|
||||
HttpServletRequest request = ServletKit.getRequest();
|
||||
String ip = ServletKit.getClientIP(request);
|
||||
|
||||
CoreLogLogin login = new CoreLogLogin();
|
||||
login.setUserId(tokenBean.getId());
|
||||
login.setPlatform(platformUnique.getPlatform());
|
||||
|
||||
RequestUserInfo requestUserInfo = tsLoginConfigurer.getCachedUserInfo(tokenBean, true);
|
||||
login.setUserName(requestUserInfo.getName());
|
||||
|
||||
login.setIp(ip);
|
||||
login.setAddress(ip2regionConfig.search(login.getIp()));
|
||||
coreLogLoginMapper.insert(login);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.tiesheng.login.service;
|
||||
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.login.pojos.DoLoginInfo;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Configuration
|
||||
public interface TieshengLoginConfigurer {
|
||||
|
||||
/**
|
||||
* 执行登录
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
TokenBean doLogin(DoLoginInfo loginInfo);
|
||||
|
||||
|
||||
/**
|
||||
* 授权登录回调
|
||||
*
|
||||
* @param bean
|
||||
*/
|
||||
void onLoginRedirect(TokenBean bean, String to, String extra, HttpServletResponse response);
|
||||
|
||||
|
||||
/**
|
||||
* 签名错误的时候
|
||||
*/
|
||||
void onSignError(HttpServletResponse response);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.tiesheng.login.service;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.tiesheng.login.pojos.RequestUserInfo;
|
||||
import com.tiesheng.login.pojos.dao.CorePlatformUnique;
|
||||
import com.tiesheng.util.ServletKit;
|
||||
import com.tiesheng.util.config.TsTokenConfig;
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.util.service.TsCacheService;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Configuration
|
||||
public interface TsLoginConfigurer {
|
||||
|
||||
/**
|
||||
* 执行登录
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
TokenBean login(CorePlatformUnique platformUnique);
|
||||
|
||||
|
||||
/**
|
||||
* 授权登录回调
|
||||
*
|
||||
* @param bean
|
||||
*/
|
||||
void redirect(TokenBean bean, String to, String extra, HttpServletResponse response);
|
||||
|
||||
|
||||
/**
|
||||
* 签名错误的时候
|
||||
*/
|
||||
default void onSignError(HttpServletResponse response) {
|
||||
ServletKit.write(response, "404", "text");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前用户的信息
|
||||
*
|
||||
* @param tokenBean
|
||||
* @return
|
||||
*/
|
||||
default RequestUserInfo getCachedUserInfo(TokenBean tokenBean, boolean force) {
|
||||
String key = StrUtil.format(TsTokenConfig.CACHE_REQUEST_LOGIN_KEY, tokenBean.getId());
|
||||
RequestUserInfo obj = TsCacheService.of().getObj(key, RequestUserInfo.class, -1);
|
||||
if (obj == null || force) {
|
||||
obj = getCurrentUserName(tokenBean);
|
||||
}
|
||||
if (obj != null) {
|
||||
TsCacheService.of().putObj(key, obj, 30 * 60);
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户的姓名
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
RequestUserInfo getCurrentUserName(TokenBean userId);
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.tiesheng.login.service.impl;
|
||||
|
||||
import com.tiesheng.util.pojos.TokenBean;
|
||||
import com.tiesheng.login.pojos.DoLoginInfo;
|
||||
import com.tiesheng.login.service.TieshengLoginConfigurer;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @author hao
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnMissingBean(value = TieshengLoginConfigurer.class, ignored = DefaultLoginConfigurer.class)
|
||||
public class DefaultLoginConfigurer implements TieshengLoginConfigurer {
|
||||
|
||||
@Override
|
||||
public TokenBean doLogin(DoLoginInfo loginInfo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoginRedirect(TokenBean bean, String to, String extra, HttpServletResponse response) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSignError(HttpServletResponse response) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,24 @@
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_log_login
|
||||
-- ----------------------------
|
||||
CREATE TABLE `core_log_login`
|
||||
(
|
||||
`id` varchar(50) NOT NULL,
|
||||
`create_time` datetime NOT NULL,
|
||||
`update_time` datetime NOT NULL,
|
||||
`is_deleted` int(6) NOT NULL DEFAULT '0',
|
||||
`user_id` varchar(50) DEFAULT NULL COMMENT '用户id',
|
||||
`user_name` varchar(255) DEFAULT NULL COMMENT '用户姓名',
|
||||
`platform` varchar(50) DEFAULT NULL COMMENT '登录方式',
|
||||
`ip` varchar(100) DEFAULT NULL COMMENT 'ip',
|
||||
`address` varchar(255) DEFAULT NULL COMMENT 'ip地址',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4 COMMENT ='日志-登录';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for core_platform_unique
|
||||
-- ----------------------------
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.web.mapper.CoreLogLoginMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.web.pojos.dao.CoreLogLogin">
|
||||
<mapper namespace="com.tiesheng.login.mapper.CoreLogLoginMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.login.pojos.dao.CoreLogLogin">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_log_login-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tiesheng.web.mapper.CorePlatformUniqueMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.web.pojos.dao.CorePlatformUnique">
|
||||
<mapper namespace="com.tiesheng.login.mapper.CorePlatformUniqueMapper">
|
||||
<resultMap id="BaseResultMap" type="com.tiesheng.login.pojos.dao.CorePlatformUnique">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table core_platform_unique-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.tiesheng.springboot-parent</groupId>
|
||||
<artifactId>springboot-parent</artifactId>
|
||||
<version>2.0.0.rc5</version>
|
||||
<version>2.0.1</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>springboot-message</artifactId>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.tiesheng.message.config.aliyun;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.tiesheng.message.pojos.AliyunTempParam;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public interface AliyunSmsHandler {
|
||||
|
||||
|
||||
@@ -5,13 +5,12 @@ import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.tiesheng.message.pojos.AliyunTempParam;
|
||||
import com.tiesheng.message.pojos.MessageReqResp;
|
||||
import com.tiesheng.message.service.TieshengMessageSender;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.tiesheng.message.service.TsMessageSender;
|
||||
import com.tiesheng.util.exception.ApiException;
|
||||
import com.tiesheng.util.pojos.ApiResp;
|
||||
import com.tiesheng.util.service.http.OkHttpUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -31,7 +30,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "tiesheng.aliyun")
|
||||
public class AliyunSmsSender implements TieshengMessageSender {
|
||||
public class AliyunSmsSender implements TsMessageSender {
|
||||
|
||||
/**
|
||||
* 请求地址
|
||||
@@ -102,12 +101,12 @@ public class AliyunSmsSender implements TieshengMessageSender {
|
||||
|
||||
String respBody = "";
|
||||
try {
|
||||
respBody = HttpUtil.get(ENDPOINT + "?Signature=" + signature + sortQueryStringTmp, 10 * 1000);
|
||||
respBody = OkHttpUtil.get(ENDPOINT + "?Signature=" + signature + sortQueryStringTmp);
|
||||
} catch (Exception e) {
|
||||
respBody = JSONUtil.createObj()
|
||||
.putOpt("Code", "Error")
|
||||
.putOpt("Message", "消息通道异常")
|
||||
.toString();
|
||||
JSONObject object = new JSONObject();
|
||||
object.put("Code", "Error");
|
||||
object.put("Message", "消息通道异常");
|
||||
respBody = object.toJSONString();
|
||||
}
|
||||
return respBody;
|
||||
}
|
||||
@@ -120,17 +119,7 @@ public class AliyunSmsSender implements TieshengMessageSender {
|
||||
* @param tempParam 短信模板
|
||||
* @return
|
||||
*/
|
||||
public MessageReqResp sendSms(String phoneNumbers, AliyunTempParam tempParam) {
|
||||
|
||||
MessageReqResp reqResp = new MessageReqResp("阿里云短信");
|
||||
reqResp.setTarget(phoneNumbers);
|
||||
reqResp.setResult(1);
|
||||
reqResp.setContent(JSONUtil.createObj()
|
||||
.putOpt("PhoneNumbers", phoneNumbers)
|
||||
.putOpt("SignName", tempParam.getSignName())
|
||||
.putOpt("TemplateCode", tempParam.getTemplateCode())
|
||||
.putOpt("TemplateParam", tempParam.getTemplateParam())
|
||||
.toString());
|
||||
public ApiResp<String> sendSms(String phoneNumbers, AliyunTempParam tempParam) {
|
||||
|
||||
// 业务API参数
|
||||
ConcurrentHashMap<String, String> queryMap = new ConcurrentHashMap<>();
|
||||
@@ -141,18 +130,16 @@ public class AliyunSmsSender implements TieshengMessageSender {
|
||||
queryMap.put("TemplateParam", tempParam.getTemplateParam().toString());
|
||||
}
|
||||
|
||||
reqResp.setRespBody(request("SendSms", queryMap));
|
||||
JSONObject respObj = JSONUtil.parseObj(reqResp.getRespBody());
|
||||
if (!Objects.equals(respObj.getStr("Code"), "OK")) {
|
||||
reqResp.setResult(0);
|
||||
reqResp.setToast(respObj.getStr("Message"));
|
||||
JSONObject respObj = JSON.parseObject(request("SendSms", queryMap));
|
||||
if (!Objects.equals(respObj.getString("Code"), "OK")) {
|
||||
return ApiResp.resp130(respObj.getString("Message"));
|
||||
}
|
||||
|
||||
return reqResp;
|
||||
return ApiResp.respOK("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public MessageReqResp send(String user, JSONObject body) {
|
||||
public ApiResp<String> send(String user, JSONObject body) {
|
||||
boolean mobile = Validator.isMobile(user);
|
||||
if (!mobile) {
|
||||
return null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.tiesheng.message.pojos;
|
||||
package com.tiesheng.message.config.aliyun;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
public class AliyunTempParam {
|
||||
|
||||
@@ -1,87 +0,0 @@
|
||||
package com.tiesheng.message.pojos;
|
||||
|
||||
public class MessageReqResp {
|
||||
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 发送对象
|
||||
*/
|
||||
private String target;
|
||||
|
||||
/**
|
||||
* 发送内容
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 返回结果
|
||||
*/
|
||||
private String respBody;
|
||||
|
||||
/**
|
||||
* 结果,0-否,1-是
|
||||
*/
|
||||
private Integer result;
|
||||
|
||||
/**
|
||||
* 提示的异常信息
|
||||
*/
|
||||
private String toast;
|
||||
|
||||
public MessageReqResp(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// setter\getter
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
public void setTarget(String target) {
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getRespBody() {
|
||||
return respBody;
|
||||
}
|
||||
|
||||
public void setRespBody(String respBody) {
|
||||
this.respBody = respBody;
|
||||
}
|
||||
|
||||
public Integer getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(Integer result) {
|
||||
this.result = result;
|
||||
}
|
||||
|
||||
public String getToast() {
|
||||
return toast;
|
||||
}
|
||||
|
||||
public void setToast(String toast) {
|
||||
this.toast = toast;
|
||||
}
|
||||
}
|
||||