| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.Phone; |
| | | import com.stylefeng.guns.modular.system.service.IPhoneService; |
| | | import com.stylefeng.guns.modular.system.service.IUserInfoService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Autowired |
| | | private IPhoneService phoneService; |
| | | |
| | | @Autowired |
| | | private IUserInfoService userInfoService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取系统所有电话 |
| | | * @return |
| | |
| | | @ApiImplicitParam(value = "定位经度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "定位维度", name = "lnt", required = true, dataType = "double") |
| | | }) |
| | | public ResultUtil queryPhones(Double lat, Double lnt){ |
| | | public ResultUtil queryPhones(Double lat, Double lnt, HttpServletRequest request){ |
| | | try { |
| | | List<Phone> phones = phoneService.queryPhones(lat, lnt); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | List<Phone> phones = phoneService.queryPhones(uid, lat, lnt); |
| | | return ResultUtil.success(phones); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "定位维度", name = "lnt", required = true, dataType = "double"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryCustomerPhone(Double lat, Double lnt){ |
| | | public ResultUtil queryCustomerPhone(Double lat, Double lnt, HttpServletRequest request){ |
| | | try { |
| | | Map<String, Object> map = phoneService.queryCustomerPhone(lat, lnt); |
| | | Integer uid = userInfoService.getUserIdFormRedis(request); |
| | | Map<String, Object> map = phoneService.queryCustomerPhone(uid, lat, lnt); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |