All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.service.MapController.ftl Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
package ${packageName}.service.party;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import ${packageName}.service.party.service.MapService;
import org.yes.tools.core.result.CommonResult;


/**
 * @author Co.
 * @date 2022年 08月24日 15:54:59
 */
@Slf4j
@Tag(name = "地图控制器")
@RestController
public class MapController {

    @Autowired
    private MapService mapService;

    @Operation(summary = "关键字输入提示")
<#if isSpringCloud == 1>
    @GetMapping("party/map/place/suggestion")
<#else >
    @GetMapping("api/party/map/place/suggestion")

    public CommonResult suggestion(@RequestParam("keyword") String keyword) {

        Object suggestion = mapService.suggestion(keyword);
        return CommonResult.success(suggestion);
    }

    @Operation(summary = "地址解析(地址转坐标)")
<#if isSpringCloud == 1>
    @GetMapping("party/map/place/geocoderAddress")
<#else >
    @GetMapping("api/party/map/place/geocoderAddress")

    public CommonResult geocoderAddress(@RequestParam("address") String address) {

        Object geocoder = mapService.geocoderAddress(address);
        return CommonResult.success(geocoder);
    }

    @Operation(summary = "地址解析(坐标转地址)")
<#if isSpringCloud == 1>
    @GetMapping("party/map/place/geocoderLocation")
<#else >
    @GetMapping("api/party/map/place/geocoderLocation")

    public CommonResult geocoderLocation(@RequestParam("location") String location) {

        Object geocoder = mapService.geocoderLocation(location);
        return CommonResult.success(geocoder);
    }

    @Operation(summary = "IP定位")
<#if isSpringCloud == 1>
    @GetMapping("party/map/place/locationIp")
<#else >
    @GetMapping("api/party/map/place/locationIp")

    public CommonResult locationIp() {

        Object locationIp = mapService.locationIp();
        return CommonResult.success(locationIp);
    }

}