新增API参数
This commit is contained in:
parent
783514a285
commit
d64ebc30ea
@ -84,6 +84,9 @@ public class GridController extends DefaultBaseController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格列表", notes = "网格列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "areaCode", value = "地区编码", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list/area-code/{areaCode}")
|
||||
public List<GridDTO> listByAreaCode(@PathVariable("areaCode") String areaCode) {
|
||||
@ -91,6 +94,28 @@ public class GridController extends DefaultBaseController {
|
||||
return gridService.listByAreaCode(areaCode, params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "全部网格列表", notes = "全部网格列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "areaCode", value = "地区编码", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-all/area-code/{areaCode}")
|
||||
public List<GridDTO> listAllByAreaCode(@PathVariable("areaCode") String areaCode) {
|
||||
Map<String, Object> params = requestParams();
|
||||
return gridService.listAllByAreaCode(areaCode, params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "子网格列表", notes = "网格列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "areaCode", value = "地区编码", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-sub/area-code/{areaCode}")
|
||||
public List<GridDTO> listSubByAreaCode(@PathVariable("areaCode") String areaCode) {
|
||||
Map<String, Object> params = requestParams();
|
||||
return gridService.listSubByAreaCode(areaCode, params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格(排除查询网格)列表", notes = "网格(排除查询网格)列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list/except/{gridId}")
|
||||
|
@ -0,0 +1,135 @@
|
||||
package ink.wgink.module.map.controller.resource.grid;
|
||||
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import ink.wgink.module.map.pojo.dtos.grid.GridDTO;
|
||||
import ink.wgink.module.map.service.grid.IGridService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName: GridControler
|
||||
* @Description: 网格管理
|
||||
* @Author: wanggeng
|
||||
* @Date: 2021/10/19 10:21 下午
|
||||
* @Version: 1.0
|
||||
*/
|
||||
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "网格接口")
|
||||
@RestController
|
||||
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/grid")
|
||||
public class GridResourceController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
private IGridService gridService;
|
||||
|
||||
@ApiOperation(value = "网格详情", notes = "网格详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "gridIdId", value = "网格ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{gridId}")
|
||||
public GridDTO get(@PathVariable("gridId") String gridId) {
|
||||
return gridService.get(gridId, true, true);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格列表", notes = "网格列表接口")
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
public List<GridDTO> list() {
|
||||
Map<String, Object> params = requestParams();
|
||||
return gridService.list(params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格列表", notes = "网格列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "areaCode", value = "地区编码", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list/area-code/{areaCode}")
|
||||
public List<GridDTO> listByAreaCode(@PathVariable("areaCode") String areaCode) {
|
||||
Map<String, Object> params = requestParams();
|
||||
return gridService.listByAreaCode(areaCode, params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "全部网格列表", notes = "全部网格列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "areaCode", value = "地区编码", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-all/area-code/{areaCode}")
|
||||
public List<GridDTO> listAllByAreaCode(@PathVariable("areaCode") String areaCode) {
|
||||
Map<String, Object> params = requestParams();
|
||||
return gridService.listAllByAreaCode(areaCode, params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "子网格列表", notes = "网格列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "areaCode", value = "地区编码", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-sub/area-code/{areaCode}")
|
||||
public List<GridDTO> listSubByAreaCode(@PathVariable("areaCode") String areaCode) {
|
||||
Map<String, Object> params = requestParams();
|
||||
return gridService.listSubByAreaCode(areaCode, params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格(排除查询网格)列表", notes = "网格(排除查询网格)列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list/except/{gridId}")
|
||||
public List<GridDTO> listExcept(@PathVariable("gridId") String gridId) {
|
||||
Map<String, Object> params = requestParams();
|
||||
return gridService.listExcept(gridId, params);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格分页列表", notes = "网格分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
public SuccessResultList<List<GridDTO>> listPage(ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return gridService.listPage(page);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "网格分页列表", notes = "网格分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage/area-code/{areaCode}")
|
||||
public SuccessResultList<List<GridDTO>> listPageByAreaCode(@PathVariable("areaCode") String areaCode, ListPage page) {
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
return gridService.listPageByAreaCode(areaCode, page);
|
||||
}
|
||||
|
||||
}
|
@ -36,8 +36,8 @@ public class UserLocationResourceController extends DefaultBaseController {
|
||||
|
||||
@ApiOperation(value = "删除用户定位(id列表)", notes = "删除用户定位(id列表)接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query", required = true),
|
||||
@ApiImplicitParam(name = "ids", value = "ID列表,用下划线分隔", paramType = "path", example = "1_2_3")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@DeleteMapping("remove/{ids}")
|
||||
@ -48,8 +48,8 @@ public class UserLocationResourceController extends DefaultBaseController {
|
||||
|
||||
@ApiOperation(value = "修改用户定位", notes = "修改用户定位接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "userLocationId", value = "用户定位ID", paramType = "path")
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query", required = true),
|
||||
@ApiImplicitParam(name = "userLocationId", value = "用户定位ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@PutMapping("update/{userLocationId}")
|
||||
@ -61,8 +61,8 @@ public class UserLocationResourceController extends DefaultBaseController {
|
||||
|
||||
@ApiOperation(value = "用户定位详情", notes = "用户定位详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "userLocationId", value = "用户定位ID", paramType = "path")
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "userLocationId", value = "用户定位ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get/{userLocationId}")
|
||||
@ -72,7 +72,7 @@ public class UserLocationResourceController extends DefaultBaseController {
|
||||
|
||||
@ApiOperation(value = "用户定位列表", notes = "用户定位列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query")
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query", required = false)
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list")
|
||||
@ -83,12 +83,12 @@ public class UserLocationResourceController extends DefaultBaseController {
|
||||
|
||||
@ApiOperation(value = "用户定位分页列表", notes = "用户定位分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query", required = false),
|
||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"),
|
||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"),
|
||||
@ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"),
|
||||
@ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("listpage")
|
||||
@ -99,6 +99,9 @@ public class UserLocationResourceController extends DefaultBaseController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "用户定位统计", notes = "用户定位统计接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "access_token", value = "access_token", paramType = "query"),
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("count")
|
||||
SuccessResultData<Integer> count() {
|
||||
|
@ -234,6 +234,24 @@ public interface IGridService {
|
||||
*/
|
||||
List<GridDTO> listByAreaCode(String areaCode, Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 网格列表
|
||||
*
|
||||
* @param areaCode 区域编码
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<GridDTO> listAllByAreaCode(String areaCode, Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 子网格列表
|
||||
*
|
||||
* @param areaCode 区域编码
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
List<GridDTO> listSubByAreaCode(String areaCode, Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 网格分页列表
|
||||
*
|
||||
@ -242,4 +260,5 @@ public interface IGridService {
|
||||
* @return
|
||||
*/
|
||||
SuccessResultList<List<GridDTO>> listPageByAreaCode(String areaCode, ListPage page);
|
||||
|
||||
}
|
||||
|
@ -351,6 +351,19 @@ public class GridServiceImpl extends DefaultBaseService implements IGridService
|
||||
return list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GridDTO> listAllByAreaCode(String areaCode, Map<String, Object> params) {
|
||||
params.put("areaCodeLike", areaCode);
|
||||
return list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GridDTO> listSubByAreaCode(String areaCode, Map<String, Object> params) {
|
||||
params.put("areaCodeLike", WStringUtil.cutContinuityRepeatCharDesc(areaCode, '0'));
|
||||
params.put("excludeAreaCode", areaCode);
|
||||
return list(params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuccessResultList<List<GridDTO>> listPageByAreaCode(String areaCode, ListPage page) {
|
||||
page.getParams().put("areaCode", areaCode);
|
||||
|
@ -249,6 +249,14 @@
|
||||
AND
|
||||
t1.area_code = #{areaCode}
|
||||
</if>
|
||||
<if test="areaCodeLike != null and areaCodeLike != ''">
|
||||
AND
|
||||
t1.area_code LIKE CONCAT(#{areaCodeLike}, '%')
|
||||
</if>
|
||||
<if test="excludeAreaCode != null and excludeAreaCode != ''">
|
||||
AND
|
||||
t1.area_code != #{excludeAreaCode}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<!-- 网格列表(group) -->
|
||||
|
Loading…
Reference in New Issue
Block a user