From 8c55ab2701c99cec16eff92a26fefdf77fcdd28f Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期一, 25 九月 2023 16:17:44 +0800 Subject: [PATCH] app接口修改 --- cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java | 35 +++++++++++++++++++++++++++++++---- 1 files changed, 31 insertions(+), 4 deletions(-) diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java index c7f2a49..f1a160f 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java +++ b/cloud-server-account/src/main/java/com/dsh/account/controller/ClassDetailsController.java @@ -7,6 +7,7 @@ import com.dsh.account.entity.TStudent; import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; import com.dsh.account.feignclient.course.model.RecordAppoint; +import com.dsh.account.model.vo.DetailsListVo; import com.dsh.account.model.vo.classDetails.*; import com.dsh.account.model.vo.classDetails.classInsVo.*; import com.dsh.account.model.vo.commentDetail.StuCommentsVo; @@ -33,6 +34,7 @@ import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.List; +import java.util.Map; /** @@ -107,6 +109,29 @@ } } + @ResponseBody + @PostMapping("/api/startCource/weeksOfCourseDetailsList") + @ApiOperation(value = "上课首页-课程列表2.0", tags = {"APP-开始上课"}) + @ApiImplicitParams({ + @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), + @ApiImplicitParam(value = "查询时间yyyy-MM-dd", name = "time", required = true, dataType = "string"), + @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), + @ApiImplicitParam(value = "门店id", name = "storeId", required = true, dataType = "int"), + @ApiImplicitParam(value = "用户经度", name = "longitude", required = false, dataType = "string"), + @ApiImplicitParam(value = "用户纬度", name = "latitude", required = false, dataType = "string"), + }) + public ResultUtil<Map<String,Object>> weeksOfCourseDetailsList(String time, Integer stuId, Integer storeId, String longitude, String latitude){ + try { + Integer appUserId = tokenUtil.getUserIdFormRedis(); + if(null == appUserId){ + return ResultUtil.tokenErr(); + } + return ResultUtil.success(tappuService.weeksOfCourseDetailsList(appUserId,stuId,time,storeId,longitude,latitude)); + }catch (Exception e){ + e.printStackTrace(); + return ResultUtil.runErr(); + } + } @ResponseBody @PostMapping("/api/startCource/weeksOfGetHours") @@ -135,9 +160,9 @@ @ApiOperation(value = "上课首页分配课时-课程列表", tags = {"APP-开始上课"}) @ApiImplicitParams({ @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), - @ApiImplicitParam(value = "分配给课包id", name = "packetId", required = true, dataType = "string"), + @ApiImplicitParam(value = "分配给课包id", name = "packetId", required = true, dataType = "Long"), }) - public ResultUtil<Integer> weeksOfAddHours(Integer packetId){ + public ResultUtil<Integer> weeksOfAddHours(Long packetId){ try { Integer appUserId = tokenUtil.getUserIdFormRedis(); if(null == appUserId){ @@ -145,10 +170,12 @@ } TAppGift one = appGiftService.getOne(new LambdaQueryWrapper<TAppGift>().eq(TAppGift::getUserId, appUserId)); Boolean b= false; + Integer i=0; if(one!=null && one.getNum()>0){ - b =appGiftService.weeksOfAddHours(packetId,appUserId,one.getNum()); + i=appGiftService.weeksOfAddHours(packetId,appUserId,one.getNum()); + } - if(b){ + if(i==1){ // 送完清0 one.setNum(0); appGiftService.updateById(one); -- Gitblit v1.7.1