| | |
| | | import com.supersavedriving.driver.modular.system.util.weChat.WeChatUtil; |
| | | import com.supersavedriving.driver.modular.system.util.weChat.model.Code2Session; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.authc.UsernamePasswordToken; |
| | |
| | | * @author pzb |
| | | * @Date 2023/2/8 18:52 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class DriverServiceImpl extends ServiceImpl<DriverMapper, Driver> implements IDriverService { |
| | | |
| | |
| | | String pictureName = "driver_" + driverId + ".png"; |
| | | File file = FileUtil.writeFromStream(release, new File(filePath + pictureName)); |
| | | HttpRequest post = HttpUtil.createPost(adminUrl + "/upload/image"); |
| | | HttpRequest form = post.form("file", file); |
| | | HttpResponse execute = form.execute(); |
| | | post.form("file", file); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(200 != status){ |
| | | throw new RuntimeException("上传图片异常"); |
| | |
| | | String pictureName = "driver_" + driverId + ".png"; |
| | | File file = FileUtil.writeFromStream(release, new File(filePath + pictureName)); |
| | | HttpRequest post = HttpUtil.createPost(adminUrl + "/upload/image"); |
| | | HttpRequest form = post.form("file", file); |
| | | HttpResponse execute = form.execute(); |
| | | post.form("file", file); |
| | | HttpResponse execute = post.execute(); |
| | | int status = execute.getStatus(); |
| | | if(200 != status){ |
| | | throw new RuntimeException("上传图片异常"); |
| | |
| | | return ResultUtil.success(tokenWarpper); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String s = ShiroKit.md5(MD5AndKL.MD5("123456"), "i#sm4"); |
| | | System.out.println(s); |
| | | } |
| | | |
| | | /** |
| | | * 司机密码登录 |
| | |
| | | Double lat = driverPositionWarpper.getLat(); |
| | | Integer driverId = driverPositionWarpper.getDriverId(); |
| | | Integer orderId = driverPositionWarpper.getOrderId(); |
| | | log.info("存储地理空间:{}", driverPositionWarpper); |
| | | redisUtil.setStrValue("daijia:DRIVER" + driverId, lon + "," + lat, 30); |
| | | Query query = Query.query(Criteria.where("driverId").is(driverId)); |
| | | Location old = this.mongoTemplate.findOne(query, Location.class); |