吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 16187|回复: 99
收起左侧

[其他] 乐心刷步数服务端Spring Boot【首发】【已开源】

  [复制链接]
毛毛毛毛虫 发表于 2020-8-22 16:48
本帖最后由 毛毛毛毛虫 于 2020-9-16 20:56 编辑

52论坛 首发

有服务器的小伙伴可以将就着玩玩,没怎么深入去写
java环境自行配置
项目jdk11
没有服务器的小伙伴 安卓用户可以使用
https://www.52pojie.cn/thread-1243897-1-1.html
已开源的意思是已开源 并不是说源码一定放在论坛 各位网络小警察麻烦自行搜索

介于很多人不会善用搜索引擎 这里附上开源地址(项目是从安卓端移植的,代码质量粗糙,可自行优化)
https://github.com/YYYet/CzStepServer

上传

此处以宝塔面板做演示

进入站点根目录,上传jar包,等待上传完成

创建数据库

创建名为 mysteps 的数据库

用户名设置为 mystep

密码设置为 root

进入管理

mysteps--->导入--->选择文件导入mysteps.sql--->点击执行

数据库导入完成

部署

进入终端,进入站点根目录。即文件上传目录

输入以下命令启动服务,若你想保持前台运行 输入java -jar StepService.jar

java -jar StepService.jar &

如图所示表示启动成功

若出现8080端口占用情况如下

***************************
APPLICATION FAILED TO START
***************************

Description:

Web server failed to start. Port 8080 was already in use.

Action:

Identify and stop the process that's listening on port 8080 or configure this application to listenon another port.

需停止占用端口的应用 方法如下

  1. netstat -lnp|grep 80

  2. kill -9 12095
  3. netstat -lnp|grep 80

    然后重新 使用 java -jar StepService.jar & 运行服务


接口文档

参数说明:

phone        手机号

password  密码

steps          提交的步数

flag             是否开启自动刷步   0为不自动刷步  1为自动刷步   刷步时间为每日中午12点

单次提交步数

get请求

  http://你的域名(或者公网ip:8080)/Service/updateStep?phone=18888888888&password=CZ123456&steps=9990&flag=0

响应

{
        "code": 200,
        "msg": "成功",
        "data": {
                "pedometerRecordHourlyList": [{
                        "id": "08be23751dc24a4bbca0638ad8880973",
                        "userId": 26993431,
                        "deviceId": "M_NULL",
                        "measurementTime": "2020-08-22 00:00:00",
                        "step": "9950,9950,0,0,0,0,0,0,0,0,0,0,4550,5650,0,0,9990,0,0,0,0,0,0,0",
                        "calories": "2487.00,2487.00,0,0,0,0,0,0,0,0,0,0,1137.00,1412.00,0,0,2497.00,0,0,0,0,0,0,0",
                        "distance": "3316.00,3316.00,0,0,0,0,0,0,0,0,0,0,1516.00,1883.00,0,0,3330.00,0,0,0,0,0,0,0",
                        "dataSource": 2,
                        "created": "2020-08-22 00:17:42",
                        "active": 0,
                        "updated": 1598084752590
                }]
        }
}

提交自动刷步

get请求

 http://你的域名(或者公网ip:8080)/Service/updateStep?phone=18888888888&password=CZ123456&steps=9990&flag=1

响应

{
        "code": 508,
        "msg": "已加入数据库进行定时任务"
}

响应码

{
        "code": 200,
        "msg": "成功",
        "data": {
                "pedometerRecordHourlyList": [{
                        "id": "08be23751dc24a4bbca0638ad8880973",
                        "userId": 27753231,
                        "deviceId": "M_NULL",
                        "measurementTime": "2020-08-22 00:00:00",
                        "step": "9950,9950,0,0,0,0,0,0,0,0,0,0,4550,5650,0,0,9990,0,0,0,0,0,0,0",
                        "calories": "2487.00,2487.00,0,0,0,0,0,0,0,0,0,0,1137.00,1412.00,0,0,2497.00,0,0,0,0,0,0,0",
                        "distance": "3316.00,3316.00,0,0,0,0,0,0,0,0,0,0,1516.00,1883.00,0,0,3330.00,0,0,0,0,0,0,0",
                        "dataSource": 2,
                        "created": "2020-08-22 00:17:42",
                        "active": 0,
                        "updated": 1598084752590
                }]
        }
}
{
        "code": 508,
        "msg": "已加入数据库进行定时任务"
}
{
        "code": 407,
        "msg": "密码错误"
}
{
        "code": 510,
        "msg": "手机号长度错误"
}


下载 服务端.txt (53 Bytes, 下载次数: 303)

点评

希望楼主能够解答一下大家的问题。开源的地址也能放出来。  发表于 2020-8-25 17:53

免费评分

参与人数 24吾爱币 +23 热心值 +19 收起 理由
半世流离 + 1 + 1 热心回复!
Icicle丶凌 + 1 + 1 我很赞同!
番茄炒蛋灬 + 1 鼓励转贴优秀软件安全工具和文档!
xbmmw666 + 1 + 1 谢谢@Thanks!
xbwy520 + 1 + 1 鼓励转贴优秀软件安全工具和文档!
syz666 + 1 谢谢@Thanks!
吾爱丨破解 + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
zhangjiti + 1 + 1 谢谢@Thanks!
啊奎 + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
Taikuqingdi + 1 + 1 谢谢@Thanks!
houshuheng + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
supertrue + 1 建议把开源地址放出来,
风雨风5 + 1 + 1 能否写个乐心云函数版本的刷步呢?
L-W-Q + 1 + 1 我把问题发评论里了
caomei666 + 1 开源不应该把源代码发出来?发个成品叫开源???
rogers + 2 + 1 <font style="vertical-align: inherit;"><font style=
nndyky + 1 + 1 鼓励转贴优秀软件安全工具和文档!
cintia + 1 热心回复!
吾爱论坛小朋友 + 1 + 1 鼓励转贴优秀软件安全工具和文档!
TYFLWAPJ + 1 + 1 我很赞同!
weiyangshang + 1 + 1 1H1G1M服务器测试成功,Java环境要自己搭建,Tomcat不行,得自己装jdk11
lipr_ren + 1 + 1 我很赞同!
2595453382 + 1 谢谢@Thanks!
深爱我的女孩 + 1 热心回复!

查看全部评分

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

L-W-Q 发表于 2020-8-24 23:53
重新安装了最新版本的JDK,测试成功,感谢
luppiter 发表于 2020-8-26 21:40
L-W-Q 发表于 2020-8-23 23:14
[操作系统:CentOS / 8.0 x86_64 (64bit)]

您好,我按照教程前期部署工作已经完成。按照此方法装了jdk11 ...

这个报错一般是JDK版本问题,
Class版本号和Java版本对应关系(这里只列举到1.8,后续版本可以推测)
https://www.cnblogs.com/newAndHui/p/11956723.html
L-W-Q 发表于 2020-8-23 23:14
[操作系统:CentOS / 8.0 x86_64 (64bit)]

您好,我按照教程前期部署工作已经完成。按照此方法装了jdk11-(https://blog.csdn.net/u014259503/article/details/86663786). 我操作到(输入以下命令启动服务 java -jar StepService.jar &)时,出现了以下的提示:


[root@instance-m6xzccrd ~]# cd /
[root@instance-m6xzccrd /]# cd www
[root@instance-m6xzccrd www]# cd wwwroot
[root@instance-m6xzccrd wwwroot]# java -jar StepService.jar &
[1] 12306
[root@instance-m6xzccrd wwwroot]# Exception in thread "main" java.lang.UnsupportedClassVersionError: com/chengzzz/stepservice/StepserviceApplication has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
        at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:46)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:109)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)


请问该怎么解决?感谢。
maxage 发表于 2020-9-17 12:59
[C] 纯文本查看 复制代码
2020-09-17 12:48:15 [http-nio-8080-exec-4] ERROR org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/].[dispatcherServlet].log:175 - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'mystep'@'localhost' (using password: YES)
### The error may exist in com/chengzzz/stepservice/dao/UpstepsDao.java (best guess)
### The error may involve com.chengzzz.stepservice.dao.UpstepsDao.selectOne
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'mystep'@'localhost' (using password: YES)] with root cause



请问我get请求后后台提示上面这个内容 网页提示下面这个内容 能帮忙看一下嘛!


[C++] 纯文本查看 复制代码
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Sep 17 12:48:15 CST 2020
There was an unexpected error (type=Internal Server Error, status=500).
Nefelibata 发表于 2020-8-22 17:10
虽然没看懂但是感觉很厉害
深爱我的女孩 发表于 2020-8-22 17:13
小白一个,前来帮顶!
喵了个咪。 发表于 2020-8-22 17:15
小白表示看不懂。。。
zguozzao 发表于 2020-8-22 17:23
小白表示不服
michener 发表于 2020-8-22 17:25
有web界面吗
穹风 发表于 2020-8-22 17:26
求大神还是详细介绍下环境的安装。。。

java环境自行配置
项目jdk11

有宝塔  搞了半天没搞明白  尤其JDK11
﹏詆調℡ 发表于 2020-8-22 17:27
感谢大佬分享
dxs0211 发表于 2020-8-22 17:46
楼主腻害了,试试
梦想哥 发表于 2020-8-22 17:47
不明觉厉,感谢大佬分享
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 提醒:禁止复制他人回复等『恶意灌水』行为,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-11 02:02

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表