| | |
| | | package com.mzl.flower.web.customer; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.mzl.flower.base.BaseController; |
| | | import com.mzl.flower.base.R; |
| | |
| | | import com.mzl.flower.dto.response.flower.*; |
| | | import com.mzl.flower.service.flower.FlowerCategoryService; |
| | | import com.mzl.flower.service.flower.FlowerService; |
| | | import com.mzl.flower.utils.HttpUtil; |
| | | import com.wechat.pay.java.core.http.HttpMethod; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | return returnData(R.SUCCESS.getCode(), flowerService.getHomeCategoryDaily(page)); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/address/parse") |
| | | @ApiOperation(value = "解析经纬度") |
| | | public ResponseEntity<ReturnDataDTO<?>> getAddress(String location) throws Exception { |
| | | String requestPath = "https://apis.map.qq.com/ws/geocoder/v1/?key=GSBBZ-CJA3U-NNDVH-GE65N-6FIF6-ZGBCU&get_poi=1&location="; |
| | | String pp = URLEncoder.encode(location, "utf-8"); |
| | | requestPath += pp; |
| | | JSONObject json = HttpUtil.doRequest(HttpMethod.GET.name(), requestPath, "json", new HashMap<>(), null, new HashMap<>(), new HashMap<>()); |
| | | return returnData(R.SUCCESS.getCode(), json); |
| | | } |
| | | } |