| | |
| | | import com.lf.server.aspect.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.helper.AesHelper; |
| | | import com.lf.server.helper.ClassHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.all.GeomBaseMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "根据ID查询WKT") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "name", value = "映射名称", dataType = "String", paramType = "query", example = "dlgAgnp"), |
| | | @ApiImplicitParam(name = "gid", value = "GID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/selectWktById") |
| | | public ResponseMsg<String> selectWktById(String name, Integer gid) { |
| | | try { |
| | | if (StringHelper.isEmpty(name)) { |
| | | return fail("名称空间和实体名称不能为空", null); |
| | | } |
| | | |
| | | Object obj = ClassHelper.getBean(name.trim() + "Mapper"); |
| | | if (!(obj instanceof GeomBaseMapper)) { |
| | | return fail("查询对象不存在", null); |
| | | } |
| | | |
| | | GeomBaseMapper baseMapper = (GeomBaseMapper) obj; |
| | | String wkt = baseMapper.selectWktById(gid); |
| | | if (!StringHelper.isEmpty(wkt)) { |
| | | wkt = AesHelper.encrypt(wkt); |
| | | } |
| | | |
| | | return success(wkt); |
| | | } catch (Exception ex) { |
| | | return fail(ex.getMessage(), null); |
| | | } |
| | | } |
| | | } |