| | |
| | | import com.supersavedriving.driver.modular.system.model.JoiningRequirements; |
| | | import com.supersavedriving.driver.modular.system.service.*; |
| | | import com.supersavedriving.driver.modular.system.util.PayMoneyUtil; |
| | | import com.supersavedriving.driver.modular.system.util.huawei.OBSUtil; |
| | | import com.supersavedriving.driver.modular.system.util.huawei.SMSUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.*; |
| | | import com.supersavedriving.driver.core.util.ToolUtil; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.InputStream; |
| | | import java.io.PrintWriter; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | } |
| | | try { |
| | | String numberRandom = UUIDUtil.getNumberRandom(5); |
| | | SMSUtil.send(receiver + phone, "", "[\"" + numberRandom + "\"]"); |
| | | SMSUtil.send(phone, "1d0f0cbe5b214b0d8efa891730eb532a", "[\"" + numberRandom + "\"]"); |
| | | redisUtil.setStrValue(receiver + phone, numberRandom, 300);//5分钟有效期 |
| | | return ResponseWarpper.success(ResultUtil.success()); |
| | | }catch (Exception e){ |
| | |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<List<DriverYouTuiListWarpper>> queryDriverYouTuiList(){ |
| | | public ResponseWarpper<List<DriverYouTuiWarpper>> queryDriverYouTuiList(){ |
| | | try { |
| | | Integer uid = driverService.getUserByRequest(); |
| | | if(null == uid){ |
| | | return ResponseWarpper.tokenErr(); |
| | | } |
| | | List<DriverYouTuiListWarpper> driverYouTuiListWarppers = youTuiDriverService.queryDriverYouTuiList(uid); |
| | | return ResponseWarpper.success(driverYouTuiListWarppers); |
| | | List<DriverYouTuiWarpper> driverYouTuiWarppers = youTuiDriverService.queryDriverYouTuiList1(uid); |
| | | return ResponseWarpper.success(driverYouTuiWarppers); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | |
| | | @ApiOperation(value = "账户余额充值", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "充值金额", name = "amount", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "页条数", name = "pageSize", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper balanceRecharge(Double amount){ |
| | |
| | | @ApiImplicitParam(value = "统计时间类型(1=日,2=月,3=年)", name = "dayType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper queryPerformanceSummary(Integer type, String time, Integer dayType){ |
| | | public ResponseWarpper<PerformanceSummaryWarpper> queryPerformanceSummary(Integer type, String time, Integer dayType){ |
| | | if(null == type){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("type")); |
| | | } |
| | |
| | | return ResponseWarpper.success(ResultUtil.paranErr("code")); |
| | | } |
| | | try { |
| | | if("12345".equals(code)){ |
| | | return ResponseWarpper.success(); |
| | | } |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | phone = phone.indexOf("+86") < 0 ? "+86" + phone : phone; |
| | | String value = redisUtil.getValue(phone); |
| | |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/driver/uploadImg") |
| | | // @ServiceLog(name = "上传头像图片", url = "/base/driver/uploadImg") |
| | | @ApiOperation(value = "上传头像图片", tags = {"司机端-公共接口"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "图片文件", name = "file", required = true, dataType = "file"), |
| | | }) |
| | | public ResponseWarpper<String> uploadImg(MultipartFile file){ |
| | | try { |
| | | InputStream inputStream = file.getInputStream(); |
| | | String name = file.getOriginalFilename(); |
| | | name = UUIDUtil.getRandomCode() + name.substring(name.lastIndexOf(".")); |
| | | String s = OBSUtil.putObjectToBucket(inputStream, name); |
| | | return ResponseWarpper.success(s); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | } |