Эх сурвалжийг харах

Merge branch 'feature/etag' into 'wrdp'

Feature/etag

See merge request o2oa/o2oa!2135
o2null 5 жил өмнө
parent
commit
4a928ed9c7

+ 2 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompleted.java

@@ -5,6 +5,7 @@ import java.util.Map.Entry;
 import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
 import java.util.zip.CRC32;
 
 import org.apache.commons.lang3.BooleanUtils;
@@ -163,6 +164,7 @@ class V2LookupWorkOrWorkCompleted extends BaseAction {
 			_relatedForm.get();
 			_relatedScript.get();
 			list.add(form.getId() + form.getUpdateTime().getTime());
+			list = list.stream().sorted().collect(Collectors.toList());
 			Wo wo = new Wo();
 			wo.setId(form.getId());
 			CRC32 crc = new CRC32();

+ 2 - 0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/form/V2LookupWorkOrWorkCompletedMobile.java

@@ -5,6 +5,7 @@ import java.util.Map.Entry;
 import java.util.Optional;
 import java.util.concurrent.CompletableFuture;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Collectors;
 import java.util.zip.CRC32;
 
 import org.apache.commons.lang3.BooleanUtils;
@@ -164,6 +165,7 @@ class V2LookupWorkOrWorkCompletedMobile extends BaseAction {
 			_relatedForm.get();
 			_relatedScript.get();
 			list.add(form.getId() + form.getUpdateTime().getTime());
+			list = list.stream().sorted().collect(Collectors.toList());
 			Wo wo = new Wo();
 			wo.setId(form.getId());
 			CRC32 crc = new CRC32();

+ 0 - 34
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest1.java

@@ -1,34 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapBoolean;
-import com.x.base.core.project.thread.ParameterRunnable;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest1 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		ThisApplication.context().threadFactory().start(new ParameterRunnable() {
-			public void run() {
-				try {
-					for (int i = 0; i < 180; i++) {
-						System.out.println("aaaaaaaaaaaaaaaaaaaaa" + i);
-						this.parameter.put("asdfasdf", i);
-						Thread.sleep(1000);
-					}
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-
-			}
-		}, "112233");
-		return result;
-	}
-
-	public static class Wo extends WrapBoolean {
-
-	}
-
-}

+ 0 - 22
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest2.java

@@ -1,22 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapString;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest2 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		wo.setValue(ThisApplication.context().threadFactory().alive("112233"));
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends WrapString {
-
-	}
-
-}

+ 0 - 28
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest3.java

@@ -1,28 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import java.util.Map;
-import java.util.TreeMap;
-
-import com.x.base.core.project.gson.XGsonBuilder;
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest3 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		Map<Object, Object> value = ThisApplication.context().threadFactory().parameter("112233").orElse(null);
-		if (null != value) {
-			wo = XGsonBuilder.convert(value, Wo.class);
-		}
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends TreeMap<Object, Object> {
-
-	}
-
-}

+ 0 - 21
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest4.java

@@ -1,21 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapBoolean;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest4 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		wo.setValue(ThisApplication.context().threadFactory().stop("112233"));
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends WrapBoolean {
-
-	}
-}

+ 0 - 23
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest5.java

@@ -1,23 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapBoolean;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest5 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson, String id) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-		System.out.println("Action5_id:" + id);
-		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends WrapBoolean {
-
-	}
-}

+ 0 - 23
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/ActionTest52.java

@@ -1,23 +0,0 @@
-package com.x.processplatform.service.processing.jaxrs.test;
-
-import com.x.base.core.project.http.ActionResult;
-import com.x.base.core.project.http.EffectivePerson;
-import com.x.base.core.project.jaxrs.WrapBoolean;
-import com.x.processplatform.service.processing.ThisApplication;
-
-class ActionTest52 extends BaseAction {
-
-	ActionResult<Wo> execute(EffectivePerson effectivePerson) throws Exception {
-		ActionResult<Wo> result = new ActionResult<>();
-		Wo wo = new Wo();
-		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-		System.out.println("Action52");
-		System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
-		result.setData(wo);
-		return result;
-	}
-
-	public static class Wo extends WrapBoolean {
-
-	}
-}

+ 0 - 104
o2server/x_processplatform_service_processing/src/main/java/com/x/processplatform/service/processing/jaxrs/test/TestAction.java

@@ -1,7 +1,5 @@
 package com.x.processplatform.service.processing.jaxrs.test;
 
-import java.util.Map;
-
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.Consumes;
 import javax.ws.rs.GET;
@@ -166,106 +164,4 @@ public class TestAction extends StandardJaxrsAction {
 		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
 	}
 
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class)
-	@GET
-	@Path("test1")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test1(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<ActionTest1.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest1().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class)
-	@GET
-	@Path("test2")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test2(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<ActionTest2.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest2().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class)
-	@GET
-	@Path("test3")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test3(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<ActionTest3.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest3().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class)
-	@GET
-	@Path("test4")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test4(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<ActionTest4.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest4().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest1.class)
-	@GET
-	@Path("test5/{id}")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test5(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request,
-			@JaxrsParameterDescribe("标识") @PathParam("id") String id) {
-		ActionResult<ActionTest5.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest5().execute(effectivePerson, id);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
-
-	@JaxrsMethodDescribe(value = "test1.", action = ActionTest52.class)
-	@GET
-	@Path("test5/123")
-	@Produces(HttpMediaType.APPLICATION_JSON_UTF_8)
-	@Consumes(MediaType.APPLICATION_JSON)
-	public void test5(@Suspended final AsyncResponse asyncResponse, @Context HttpServletRequest request) {
-		ActionResult<ActionTest52.Wo> result = new ActionResult<>();
-		EffectivePerson effectivePerson = this.effectivePerson(request);
-		try {
-			result = new ActionTest52().execute(effectivePerson);
-		} catch (Exception e) {
-			logger.error(e, effectivePerson, request, null);
-			result.error(e);
-		}
-		asyncResponse.resume(ResponseFactory.getEntityTagActionResultResponse(request, result));
-	}
 }