| | |
| | | select * from lf.sys_publish |
| | | select length('a31a2492-66f0-430a-875b-24eb6f4752c2') |
| | | |
| | | select * from lf.sys_dir where name='å°ç¾ç¹' |
| | | select * from lf.sys_dir where pid=0 and id>0 order by id |
| | | |
| | | |
| | | |
| | | |
| | |
| | | return fail(ex, null); |
| | | } |
| | | }*/ |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå¡æ³¨å") |
| | | @GetMapping(value = "/selectServerRegister") |
| | | public ResponseMsg<Object> selectServerRegister(HttpServletRequest req) { |
| | | try { |
| | | String rs = fmeService.serverRegister("西æ°ä¸è¾åçº¿å¤©ç¶æ°ç®¡éå·¥ç¨ï¼åé²çª-ä¸å«ï¼ï¼00116DT02ï¼", "http://127.0.0.1/LFData/2d/tiles/01/{z}/{x}/{y}.png", "DOM", req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("失败"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "æå¡ç³è¯·") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "æå¡ID", dataType = "String", paramType = "query", example = "195f77eb-19dd-4e34-afc1-fcff8f758f7b"), |
| | | @ApiImplicitParam(name = "pubid", value = "åå¸ID", dataType = "Integer", paramType = "query", example = "1"), |
| | | }) |
| | | @GetMapping(value = "/serverApply") |
| | | public ResponseMsg<Object> serverApply(String id, Integer pubid, HttpServletRequest req) { |
| | | try { |
| | | String rs = fmeService.serverApply(id, pubid, req); |
| | | if (StringHelper.isEmpty(rs)) { |
| | | return fail("失败"); |
| | | } |
| | | |
| | | return success(rs); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "å é¤èµæº") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "æå¡ID", dataType = "String", paramType = "query", example = "195f77eb-19dd-4e34-afc1-fcff8f758f7b") |
| | | }) |
| | | @GetMapping(value = "/deleteRes") |
| | | public ResponseMsg<Object> deleteRes(String id, HttpServletRequest req) { |
| | | try { |
| | | fmeService.deleteRes(id, req); |
| | | |
| | | return success("OK"); |
| | | } catch (Exception ex) { |
| | | return fail(ex, null); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.lf.server.entity.ctrl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 注åç±» |
| | | * @author WWW |
| | | */ |
| | | public class RegisterEntity { |
| | | public RegisterEntity() { |
| | | } |
| | | |
| | | public RegisterEntity(String name, String uri, String type) { |
| | | tags = new ArrayList<>(); |
| | | tags.add(name); |
| | | |
| | | this.name = name; |
| | | this.address = uri; |
| | | this.detailUrl = uri; |
| | | this.type = type; |
| | | this.description = name; |
| | | this.isrequest = true; |
| | | } |
| | | |
| | | private List<String> tags; |
| | | |
| | | private String name; |
| | | |
| | | private String address; |
| | | |
| | | private String detailUrl; |
| | | |
| | | private String type; |
| | | |
| | | private String description; |
| | | |
| | | private Boolean isrequest; |
| | | |
| | | public List<String> getTags() { |
| | | return tags; |
| | | } |
| | | |
| | | public void setTags(List<String> tags) { |
| | | this.tags = tags; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getAddress() { |
| | | return address; |
| | | } |
| | | |
| | | public void setAddress(String address) { |
| | | this.address = address; |
| | | } |
| | | |
| | | public String getDetailUrl() { |
| | | return detailUrl; |
| | | } |
| | | |
| | | public void setDetailUrl(String detailUrl) { |
| | | this.detailUrl = detailUrl; |
| | | } |
| | | |
| | | public String getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(String type) { |
| | | this.type = type; |
| | | } |
| | | |
| | | public String getDescription() { |
| | | return description; |
| | | } |
| | | |
| | | public void setDescription(String description) { |
| | | this.description = description; |
| | | } |
| | | |
| | | public Boolean getIsrequest() { |
| | | return isrequest; |
| | | } |
| | | |
| | | public void setIsrequest(Boolean isrequest) { |
| | | this.isrequest = isrequest; |
| | | } |
| | | } |
| | |
| | | package com.lf.server.helper; |
| | | |
| | | import com.lf.server.entity.all.StaticData; |
| | | import io.swagger.models.HttpMethod; |
| | | import org.apache.commons.logging.Log; |
| | | import org.apache.commons.logging.LogFactory; |
| | | import org.apache.http.HttpEntity; |
| | |
| | | } |
| | | |
| | | /** |
| | | * POST请æ±ï¼RESTï¼ |
| | | */ |
| | | public static <T> String postForRest(String uri, T t) { |
| | | RestTemplate rest = getRestTemplate(); |
| | | |
| | | return rest.postForObject(uri, t, String.class); |
| | | } |
| | | |
| | | /** |
| | | * DELETE请æ±ï¼RESTï¼ |
| | | */ |
| | | public static void deleteForRest(String uri) { |
| | |
| | | |
| | | import com.lf.server.entity.ctrl.FmeReqEntity; |
| | | import com.lf.server.entity.ctrl.NameValueEntity; |
| | | import com.lf.server.entity.ctrl.RegisterEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.entity.data.PublishEntity; |
| | | import com.lf.server.helper.RestHelper; |
| | |
| | | import com.lf.server.helper.WebHelper; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | |
| | | public String serverRegister(String name, String serverUri, String type, HttpServletRequest req) { |
| | | String url = getUrl("resource/res/item", req); |
| | | |
| | | List<NameValueEntity> list = new ArrayList<>(); |
| | | list.add(new NameValueEntity("tags", new String[]{name})); |
| | | list.add(new NameValueEntity("name", name)); |
| | | list.add(new NameValueEntity("address", serverUri)); |
| | | list.add(new NameValueEntity("detailUrl", serverUri)); |
| | | list.add(new NameValueEntity("type", type)); |
| | | list.add(new NameValueEntity("description", name)); |
| | | list.add(new NameValueEntity("isrequest", true)); |
| | | RegisterEntity entity = new RegisterEntity(name, serverUri, type); |
| | | |
| | | return RestHelper.postForRest(url, list); |
| | | return RestHelper.postForRest(url, entity); |
| | | } |
| | | |
| | | /** |