|
@@ -5,10 +5,7 @@ import cn.hutool.core.lang.Dict;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ruoyi.demo.entity.*;
|
|
|
-import com.ruoyi.demo.entity.bo.CallBackBean;
|
|
|
-import com.ruoyi.demo.entity.bo.PlanAddBo;
|
|
|
-import com.ruoyi.demo.entity.bo.PlanBo;
|
|
|
-import com.ruoyi.demo.entity.bo.PlanItemAddBo;
|
|
|
+import com.ruoyi.demo.entity.bo.*;
|
|
|
import com.ruoyi.demo.entity.vo.*;
|
|
|
import com.ruoyi.demo.mapper.*;
|
|
|
import com.ruoyi.demo.service.PlanService;
|
|
@@ -310,21 +307,22 @@ public class PlanServiceImpl implements PlanService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public int planPushUpDown(String appkey, List<String> planIds) {
|
|
|
+ public int planPushUpDown(UpDownBo bo) {
|
|
|
// app是否可用
|
|
|
App app = appMapper.selectOne(new QueryWrapper<App>()
|
|
|
- .eq("appkey", appkey)
|
|
|
+ .eq("appkey", bo.getAppkey())
|
|
|
.eq("state", 1)
|
|
|
.eq("deleted", "0"));
|
|
|
if (app == null)
|
|
|
return -1;
|
|
|
// 校验
|
|
|
Map<String, Object> params = Dict.create()
|
|
|
- .set("appkey", appkey)
|
|
|
- .set("planIds", planIds);
|
|
|
+ .set("appkey", bo.getAppkey())
|
|
|
+ .set("planIds", bo.getPlanIds())
|
|
|
+ .set("sign", bo.getSign());
|
|
|
if (!SignUtil.verify(params, app.getAppSecret()))
|
|
|
return -3;
|
|
|
- for (String planId : planIds){
|
|
|
+ for (String planId : bo.getPlanIds()){
|
|
|
Plan plan = planMapper.selectOne(new QueryWrapper<Plan>()
|
|
|
.eq("plan_id", planId)
|
|
|
.eq("deleted", "0"));
|
|
@@ -348,6 +346,23 @@ public class PlanServiceImpl implements PlanService {
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public String pushGetSign(UpDownBo bo) {
|
|
|
+ // app是否可用
|
|
|
+ App app = appMapper.selectOne(new QueryWrapper<App>()
|
|
|
+ .eq("appkey", bo.getAppkey())
|
|
|
+ .eq("state", 1)
|
|
|
+ .eq("deleted", "0"));
|
|
|
+ if (app == null)
|
|
|
+ return "error";
|
|
|
+ // 校验
|
|
|
+ Map<String, Object> params = Dict.create()
|
|
|
+ .set("appkey", bo.getAppkey())
|
|
|
+ .set("planIds", bo.getPlanIds())
|
|
|
+ .set("sign", bo.getSign());
|
|
|
+ return SignUtil.sign(params, app.getAppSecret());
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public MyPage<PlanManageListVo> getPlanManageList(PlanBo bo) {
|
|
|
QueryWrapper<Plan> planQueryWrapper = new QueryWrapper<>();
|