Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
5d0a518c
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5d0a518c
编写于
6月 13, 2022
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加openapi
上级
c08a2429
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
355 addition
and
121 deletion
+355
-121
o2server/pom.xml
o2server/pom.xml
+27
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/cache/Cache.java
...ct/src/main/java/com/x/base/core/project/cache/Cache.java
+1
-1
o2server/x_base_core_project/src/main/java/com/x/base/core/project/cache/CacheEhcacheImpl.java
.../java/com/x/base/core/project/cache/CacheEhcacheImpl.java
+105
-105
o2server/x_base_core_project/src/main/java/com/x/base/core/project/cache/CacheManager.java
...main/java/com/x/base/core/project/cache/CacheManager.java
+3
-3
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Cache.java
...t/src/main/java/com/x/base/core/project/config/Cache.java
+6
-6
o2server/x_console/src/main/java/com/x/server/console/server/JettySeverTools.java
...ain/java/com/x/server/console/server/JettySeverTools.java
+2
-1
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/ActionApplication.java
...essplatform/assemble/surface/jaxrs/ActionApplication.java
+5
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/OpenApiAction.java
...processplatform/assemble/surface/jaxrs/OpenApiAction.java
+178
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ReadAction.java
...ocessplatform/assemble/surface/jaxrs/read/ReadAction.java
+4
-0
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/TaskAction.java
...ocessplatform/assemble/surface/jaxrs/task/TaskAction.java
+13
-1
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Task.java
.../java/com/x/processplatform/core/entity/content/Task.java
+11
-4
未找到文件。
o2server/pom.xml
浏览文件 @
5d0a518c
...
...
@@ -379,6 +379,18 @@
<groupId>
org.slf4j
</groupId>
<artifactId>
slf4j-api
</artifactId>
</dependency>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-annotations
</artifactId>
</dependency>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-core
</artifactId>
</dependency>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-jaxrs2
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
${project.artifactId}
</finalName>
...
...
@@ -1077,6 +1089,21 @@
<artifactId>
javax.mail
</artifactId>
<version>
1.6.2
</version>
</dependency>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-annotations
</artifactId>
<version>
2.2.0
</version>
</dependency>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-core
</artifactId>
<version>
2.2.0
</version>
</dependency>
<dependency>
<groupId>
io.swagger.core.v3
</groupId>
<artifactId>
swagger-jaxrs2
</artifactId>
<version>
2.2.0
</version>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/cache/Cache.java
浏览文件 @
5d0a518c
...
...
@@ -13,7 +13,7 @@ import com.x.base.core.project.jaxrs.WrapClearCacheRequest;
public
interface
Cache
{
public
static
final
String
TYPE_EHCACHE
=
"ehcache"
;
//
public static final String TYPE_EHCACHE = "ehcache";
public
static
final
String
TYPE_REDIS
=
"redis"
;
public
static
final
String
TYPE_GUAVA
=
"guava"
;
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/cache/CacheEhcacheImpl.java
浏览文件 @
5d0a518c
package
com.x.base.core.project.cache
;
import
java.lang.management.ManagementFactory
;
import
java.util.List
;
import
java.util.Optional
;
import
org.apache.commons.lang3.BooleanUtils
;
import
com.x.base.core.project.config.Config
;
import
com.x.base.core.project.jaxrs.WrapClearCacheRequest
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
net.sf.ehcache.CacheManager
;
import
net.sf.ehcache.Ehcache
;
import
net.sf.ehcache.Element
;
import
net.sf.ehcache.config.CacheConfiguration
;
import
net.sf.ehcache.config.Configuration
;
import
net.sf.ehcache.config.PersistenceConfiguration
;
import
net.sf.ehcache.management.ManagementService
;
import
net.sf.ehcache.store.MemoryStoreEvictionPolicy
;
public
class
CacheEhcacheImpl
implements
Cache
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
CacheEhcacheImpl
.
class
);
private
CacheManager
cacheManager
;
private
CacheEhcacheNotifyReceiveQueue
notifyReceiveQueue
;
public
CacheEhcacheImpl
(
String
application
)
throws
Exception
{
CacheConfiguration
cacheConfiguration
=
new
CacheConfiguration
();
cacheConfiguration
.
maxEntriesLocalHeap
(
1000
);
cacheConfiguration
.
persistence
(
new
PersistenceConfiguration
().
strategy
(
PersistenceConfiguration
.
Strategy
.
NONE
));
cacheConfiguration
.
timeToIdleSeconds
(
1800
);
cacheConfiguration
.
timeToLiveSeconds
(
3600
);
cacheConfiguration
.
memoryStoreEvictionPolicy
(
MemoryStoreEvictionPolicy
.
LFU
);
Configuration
configuration
=
new
Configuration
();
configuration
.
setDefaultCacheConfiguration
(
cacheConfiguration
);
configuration
.
setName
(
"CacheEhcacheManager-"
+
application
);
this
.
cacheManager
=
new
CacheManager
(
configuration
);
this
.
notifyReceiveQueue
=
new
CacheEhcacheNotifyReceiveQueue
(
this
.
cacheManager
);
notifyReceiveQueue
.
start
();
if
(
BooleanUtils
.
isTrue
(
Config
.
cache
().
getEhcache
().
getJmxEnable
()))
{
ManagementService
.
registerMBeans
(
cacheManager
,
ManagementFactory
.
getPlatformMBeanServer
(),
true
,
true
,
true
,
true
);
}
}
@Override
public
Optional
<
Object
>
get
(
CacheCategory
category
,
CacheKey
key
)
{
Element
element
=
this
.
getCache
(
category
.
toString
()).
get
(
key
.
toString
());
if
(
element
!=
null
)
{
return
Optional
.
ofNullable
(
element
.
getObjectValue
());
}
else
{
return
Optional
.
empty
();
}
}
@Override
public
void
put
(
CacheCategory
category
,
CacheKey
key
,
Object
o
)
{
if
(
null
!=
o
)
{
this
.
getCache
(
category
.
toString
()).
put
(
new
Element
(
key
.
toString
(),
o
));
}
}
@Override
public
void
receive
(
WrapClearCacheRequest
wi
)
{
try
{
wi
.
setType
(
WrapClearCacheRequest
.
TYPE_RECEIVE
);
notifyReceiveQueue
.
send
(
wi
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
@Override
public
void
notify
(
Class
<?>
clz
,
List
<
Object
>
keys
)
{
try
{
ClearCacheRequest
req
=
new
ClearCacheRequest
();
req
.
setType
(
WrapClearCacheRequest
.
TYPE_NOTIFY
);
req
.
setClassName
(
clz
.
getName
());
req
.
setKeys
(
keys
);
this
.
notifyReceiveQueue
.
send
(
req
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
e
);
}
}
@Override
public
void
shutdown
()
{
this
.
notifyReceiveQueue
.
stop
();
this
.
cacheManager
.
shutdown
();
}
@Override
public
String
detail
()
{
return
cacheManager
.
getActiveConfigurationText
();
}
private
synchronized
Ehcache
getCache
(
String
name
)
{
return
cacheManager
.
addCacheIfAbsent
(
name
);
}
}
//
package com.x.base.core.project.cache;
//
//
import java.lang.management.ManagementFactory;
//
import java.util.List;
//
import java.util.Optional;
//
//
import org.apache.commons.lang3.BooleanUtils;
//
//
import com.x.base.core.project.config.Config;
//
import com.x.base.core.project.jaxrs.WrapClearCacheRequest;
//
import com.x.base.core.project.logger.Logger;
//
import com.x.base.core.project.logger.LoggerFactory;
//
//
import net.sf.ehcache.CacheManager;
//
import net.sf.ehcache.Ehcache;
//
import net.sf.ehcache.Element;
//
import net.sf.ehcache.config.CacheConfiguration;
//
import net.sf.ehcache.config.Configuration;
//
import net.sf.ehcache.config.PersistenceConfiguration;
//
import net.sf.ehcache.management.ManagementService;
//
import net.sf.ehcache.store.MemoryStoreEvictionPolicy;
//
//
public class CacheEhcacheImpl implements Cache {
//
//
private static final Logger LOGGER = LoggerFactory.getLogger(CacheEhcacheImpl.class);
//
//
private CacheManager cacheManager;
//
//
private CacheEhcacheNotifyReceiveQueue notifyReceiveQueue;
//
//
public CacheEhcacheImpl(String application) throws Exception {
//
CacheConfiguration cacheConfiguration = new CacheConfiguration();
//
cacheConfiguration.maxEntriesLocalHeap(1000);
//
cacheConfiguration.persistence(new PersistenceConfiguration().strategy(PersistenceConfiguration.Strategy.NONE));
//
cacheConfiguration.timeToIdleSeconds(1800);
//
cacheConfiguration.timeToLiveSeconds(3600);
//
cacheConfiguration.memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.LFU);
//
Configuration configuration = new Configuration();
//
configuration.setDefaultCacheConfiguration(cacheConfiguration);
//
configuration.setName("CacheEhcacheManager-" + application);
//
this.cacheManager = new CacheManager(configuration);
//
this.notifyReceiveQueue = new CacheEhcacheNotifyReceiveQueue(this.cacheManager);
//
notifyReceiveQueue.start();
//
if (BooleanUtils.isTrue(Config.cache().getEhcache().getJmxEnable())) {
//
ManagementService.registerMBeans(cacheManager, ManagementFactory.getPlatformMBeanServer(), true, true, true,
//
true);
//
}
//
}
//
//
@Override
//
public Optional<Object> get(CacheCategory category, CacheKey key) {
//
Element element = this.getCache(category.toString()).get(key.toString());
//
if (element != null) {
//
return Optional.ofNullable(element.getObjectValue());
//
} else {
//
return Optional.empty();
//
}
//
}
//
//
@Override
//
public void put(CacheCategory category, CacheKey key, Object o) {
//
if (null != o) {
//
this.getCache(category.toString()).put(new Element(key.toString(), o));
//
}
//
}
//
//
@Override
//
public void receive(WrapClearCacheRequest wi) {
//
try {
//
wi.setType(WrapClearCacheRequest.TYPE_RECEIVE);
//
notifyReceiveQueue.send(wi);
//
} catch (Exception e) {
//
LOGGER.error(e);
//
}
//
}
//
//
@Override
//
public void notify(Class<?> clz, List<Object> keys) {
//
try {
//
ClearCacheRequest req = new ClearCacheRequest();
//
req.setType(WrapClearCacheRequest.TYPE_NOTIFY);
//
req.setClassName(clz.getName());
//
req.setKeys(keys);
//
this.notifyReceiveQueue.send(req);
//
} catch (Exception e) {
//
LOGGER.error(e);
//
}
//
}
//
//
@Override
//
public void shutdown() {
//
this.notifyReceiveQueue.stop();
//
this.cacheManager.shutdown();
//
}
//
//
@Override
//
public String detail() {
//
return cacheManager.getActiveConfigurationText();
//
}
//
//
private synchronized Ehcache getCache(String name) {
//
return cacheManager.addCacheIfAbsent(name);
//
}
//
//
}
o2server/x_base_core_project/src/main/java/com/x/base/core/project/cache/CacheManager.java
浏览文件 @
5d0a518c
...
...
@@ -35,10 +35,10 @@ public abstract class CacheManager {
if
(
null
==
cache
)
{
if
(
StringUtils
.
equals
(
Config
.
cache
().
getType
(),
Cache
.
TYPE_REDIS
))
{
cache
=
new
CacheRedisImpl
(
name
);
}
else
if
(
StringUtils
.
equals
(
Config
.
cache
().
getType
(),
Cache
.
TYPE_EHCACHE
))
{
cache
=
new
CacheEhcacheImpl
(
name
);
//
} else if (StringUtils.equals(Config.cache().getType(), Cache.TYPE_EHCACHE)) {
//
cache = new CacheEhcacheImpl(name);
}
else
{
cache
=
new
CacheGuavaImpl
(
name
);
cache
=
new
CacheGuavaImpl
(
Cache
.
TYPE_GUAVA
);
}
}
return
cache
;
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Cache.java
浏览文件 @
5d0a518c
...
...
@@ -19,7 +19,7 @@ public class Cache extends ConfigObject {
public
Cache
()
{
this
.
type
=
TYPE_GUAVA
;
this
.
redis
=
Redis
.
defaultInstance
();
this
.
ehcache
=
Ehcache
.
defaultInstance
();
//
this.ehcache = Ehcache.defaultInstance();
this
.
guava
=
Guava
.
defaultInstance
();
}
...
...
@@ -33,8 +33,8 @@ public class Cache extends ConfigObject {
@FieldDescribe
(
"redis配置"
)
private
Redis
redis
;
@FieldDescribe
(
"ehcache配置"
)
private
Ehcache
ehcache
;
//
@FieldDescribe("ehcache配置")
//
private Ehcache ehcache;
@FieldDescribe
(
"guava配置"
)
private
Guava
guava
;
...
...
@@ -43,9 +43,9 @@ public class Cache extends ConfigObject {
return
this
.
redis
==
null
?
new
Redis
()
:
this
.
redis
;
}
public
Ehcache
getEhcache
()
{
return
this
.
ehcache
==
null
?
new
Ehcache
()
:
this
.
ehcache
;
}
//
public Ehcache getEhcache() {
//
return this.ehcache == null ? new Ehcache() : this.ehcache;
//
}
public
Guava
getGuava
()
{
return
this
.
guava
==
null
?
new
Guava
()
:
this
.
guava
;
...
...
o2server/x_console/src/main/java/com/x/server/console/server/JettySeverTools.java
浏览文件 @
5d0a518c
...
...
@@ -46,7 +46,8 @@ public abstract class JettySeverTools {
* 需要在WebAppClassLoader加载 jakarta.xml.bind-api-*.jar
*/
private
static
final
Collection
<
String
>
FILTER_STRINGS
=
Arrays
.
asList
(
"openjpa-*.jar"
,
"ehcache-*.jar"
,
"jetty-all-*.jar"
,
"jetty-proxy-*.jar"
,
"quartz-*.jar"
,
"filters-*.jar"
,
"jakarta.xml.bind-api-*.jar"
);
"jetty-all-*.jar"
,
"jetty-proxy-*.jar"
,
"quartz-*.jar"
,
"filters-*.jar"
,
"jakarta.xml.bind-api-*.jar"
,
"swagger-*.jar"
);
private
static
final
Optional
<
IOFileFilter
>
JARS_FILTER
=
FILTER_STRINGS
.
stream
().
map
(
WildcardFileFilter:
:
new
)
.
map
(
FileFilterUtils:
:
or
).
reduce
(
FileFilterUtils:
:
or
);
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/ActionApplication.java
浏览文件 @
5d0a518c
...
...
@@ -35,6 +35,8 @@ import com.x.processplatform.assemble.surface.jaxrs.work.WorkAction;
import
com.x.processplatform.assemble.surface.jaxrs.workcompleted.WorkCompletedAction
;
import
com.x.processplatform.assemble.surface.jaxrs.worklog.WorkLogAction
;
import
io.swagger.v3.jaxrs2.integration.resources.AcceptHeaderOpenApiResource
;
@ApplicationPath
(
"jaxrs"
)
public
class
ActionApplication
extends
AbstractActionApplication
{
...
...
@@ -69,6 +71,9 @@ public class ActionApplication extends AbstractActionApplication {
classes
.
add
(
SnapAction
.
class
);
classes
.
add
(
AnonymousAction
.
class
);
classes
.
add
(
SignAction
.
class
);
classes
.
add
(
OpenApiAction
.
class
);
// classes.add(AcceptHeaderOpenApiResource.class);
return
classes
;
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/OpenApiAction.java
0 → 100644
浏览文件 @
5d0a518c
package
com.x.processplatform.assemble.surface.jaxrs
;
import
static
io
.
swagger
.
v3
.
jaxrs2
.
integration
.
ServletConfigContextUtils
.
getContextIdFromServletConfig
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
javax.servlet.ServletConfig
;
import
javax.ws.rs.GET
;
import
javax.ws.rs.Path
;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.Application
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.HttpHeaders
;
import
javax.ws.rs.core.MediaType
;
import
javax.ws.rs.core.MultivaluedMap
;
import
javax.ws.rs.core.Response
;
import
javax.ws.rs.core.UriInfo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.fasterxml.jackson.core.util.DefaultPrettyPrinter
;
import
com.x.base.core.project.gson.XGsonBuilder
;
import
io.swagger.v3.core.filter.OpenAPISpecFilter
;
import
io.swagger.v3.core.filter.SpecFilter
;
import
io.swagger.v3.jaxrs2.integration.JaxrsOpenApiContextBuilder
;
import
io.swagger.v3.jaxrs2.integration.resources.BaseOpenApiResource
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.integration.api.OpenAPIConfiguration
;
import
io.swagger.v3.oas.integration.api.OpenApiContext
;
import
io.swagger.v3.oas.models.OpenAPI
;
@Path
(
"/openapi"
)
public
class
OpenApiAction
{
private
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
BaseOpenApiResource
.
class
);
@Context
ServletConfig
servletConfig
;
@Context
Application
application
;
@GET
@Produces
({
MediaType
.
APPLICATION_JSON
})
@Operation
(
hidden
=
true
)
public
Response
getOpenApiJson
(
@Context
HttpHeaders
headers
,
@Context
UriInfo
uriInfo
)
throws
Exception
{
return
this
.
getOpenApi
(
headers
,
servletConfig
,
application
,
uriInfo
,
"json"
);
}
protected
String
getContextId
(
ServletConfig
config
)
{
return
getContextIdFromServletConfig
(
config
);
}
protected
Response
getOpenApi
(
HttpHeaders
headers
,
ServletConfig
config
,
Application
app
,
UriInfo
uriInfo
,
String
type
)
throws
Exception
{
String
ctxId
=
getContextId
(
config
);
System
.
out
.
println
(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
);
System
.
out
.
println
(
"ctxId"
+
ctxId
);
System
.
out
.
println
(
"resourcePackages"
+
resourcePackages
);
System
.
out
.
println
(
"configLocation"
+
configLocation
);
System
.
out
.
println
(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
);
System
.
out
.
println
(
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
);
OpenApiContext
ctx
=
new
JaxrsOpenApiContextBuilder
().
servletConfig
(
config
).
application
(
app
)
.
resourcePackages
(
resourcePackages
).
configLocation
(
configLocation
)
.
openApiConfiguration
(
openApiConfiguration
).
ctxId
(
ctxId
).
buildContext
(
true
);
OpenAPI
oas
=
ctx
.
read
();
boolean
pretty
=
false
;
if
(
ctx
.
getOpenApiConfiguration
()
!=
null
&&
Boolean
.
TRUE
.
equals
(
ctx
.
getOpenApiConfiguration
().
isPrettyPrint
()))
{
pretty
=
true
;
}
if
(
oas
!=
null
)
{
if
(
ctx
.
getOpenApiConfiguration
()
!=
null
&&
ctx
.
getOpenApiConfiguration
().
getFilterClass
()
!=
null
)
{
try
{
OpenAPISpecFilter
filterImpl
=
(
OpenAPISpecFilter
)
Class
.
forName
(
ctx
.
getOpenApiConfiguration
().
getFilterClass
()).
newInstance
();
SpecFilter
f
=
new
SpecFilter
();
oas
=
f
.
filter
(
oas
,
filterImpl
,
getQueryParams
(
uriInfo
.
getQueryParameters
()),
getCookies
(
headers
),
getHeaders
(
headers
));
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"failed to load filter"
,
e
);
}
}
}
if
(
oas
==
null
)
{
return
Response
.
status
(
404
).
build
();
}
if
(
StringUtils
.
isNotBlank
(
type
)
&&
type
.
trim
().
equalsIgnoreCase
(
"yaml"
))
{
return
Response
.
status
(
Response
.
Status
.
OK
)
.
entity
(
pretty
?
ctx
.
getOutputYamlMapper
().
writer
(
new
DefaultPrettyPrinter
()).
writeValueAsString
(
oas
)
:
ctx
.
getOutputYamlMapper
().
writeValueAsString
(
oas
))
.
type
(
"application/yaml"
).
build
();
}
else
{
return
Response
.
status
(
Response
.
Status
.
OK
).
entity
(
XGsonBuilder
.
toJson
(
oas
))
.
type
(
MediaType
.
APPLICATION_JSON_TYPE
).
build
();
}
}
private
static
Map
<
String
,
List
<
String
>>
getQueryParams
(
MultivaluedMap
<
String
,
String
>
params
)
{
Map
<
String
,
List
<
String
>>
output
=
new
HashMap
<>();
if
(
params
!=
null
)
{
params
.
forEach
(
output:
:
put
);
}
return
output
;
}
private
static
Map
<
String
,
String
>
getCookies
(
HttpHeaders
headers
)
{
Map
<
String
,
String
>
output
=
new
HashMap
<>();
if
(
headers
!=
null
)
{
headers
.
getCookies
().
forEach
((
k
,
v
)
->
output
.
put
(
k
,
v
.
getValue
()));
}
return
output
;
}
private
static
Map
<
String
,
List
<
String
>>
getHeaders
(
HttpHeaders
headers
)
{
Map
<
String
,
List
<
String
>>
output
=
new
HashMap
<>();
if
(
headers
!=
null
)
{
headers
.
getRequestHeaders
().
forEach
(
output:
:
put
);
}
return
output
;
}
protected
String
configLocation
;
public
String
getConfigLocation
()
{
return
configLocation
;
}
public
void
setConfigLocation
(
String
configLocation
)
{
this
.
configLocation
=
configLocation
;
}
public
OpenApiAction
configLocation
(
String
configLocation
)
{
setConfigLocation
(
configLocation
);
return
this
;
}
protected
Set
<
String
>
resourcePackages
;
public
Set
<
String
>
getResourcePackages
()
{
return
resourcePackages
;
}
public
void
setResourcePackages
(
Set
<
String
>
resourcePackages
)
{
this
.
resourcePackages
=
resourcePackages
;
}
public
OpenApiAction
resourcePackages
(
Set
<
String
>
resourcePackages
)
{
setResourcePackages
(
resourcePackages
);
return
this
;
}
protected
OpenAPIConfiguration
openApiConfiguration
;
public
OpenAPIConfiguration
getOpenApiConfiguration
()
{
return
openApiConfiguration
;
}
public
void
setOpenApiConfiguration
(
OpenAPIConfiguration
openApiConfiguration
)
{
this
.
openApiConfiguration
=
openApiConfiguration
;
}
public
OpenApiAction
openApiConfiguration
(
OpenAPIConfiguration
openApiConfiguration
)
{
setOpenApiConfiguration
(
openApiConfiguration
);
return
this
;
}
}
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/read/ReadAction.java
浏览文件 @
5d0a518c
...
...
@@ -29,6 +29,10 @@ import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
io.swagger.v3.oas.annotations.OpenAPIDefinition
;
import
io.swagger.v3.oas.annotations.info.Info
;
@OpenAPIDefinition
(
info
=
@Info
(
title
=
"待阅xxx"
))
@Path
(
"read"
)
@JaxrsDescribe
(
"待阅操作"
)
public
class
ReadAction
extends
StandardJaxrsAction
{
...
...
o2server/x_processplatform_assemble_surface/src/main/java/com/x/processplatform/assemble/surface/jaxrs/task/TaskAction.java
浏览文件 @
5d0a518c
...
...
@@ -29,13 +29,25 @@ import com.x.base.core.project.jaxrs.StandardJaxrsAction;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
io.swagger.v3.oas.annotations.OpenAPIDefinition
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.info.Info
;
import
io.swagger.v3.oas.annotations.media.ArraySchema
;
import
io.swagger.v3.oas.annotations.media.Content
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
io.swagger.v3.oas.annotations.responses.ApiResponse
;
@OpenAPIDefinition
(
info
=
@Info
(
title
=
"待办xxx"
))
@Path
(
"task"
)
@JaxrsDescribe
(
"待办操作"
)
public
class
TaskAction
extends
StandardJaxrsAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
TaskAction
.
class
);
@JaxrsMethodDescribe
(
value
=
"根据job获取待办."
,
action
=
ActionListWithJob
.
class
)
@Operation
(
summary
=
"根据指定的job列示待办."
,
tags
=
"Task(待办)"
,
operationId
=
""
,
responses
=
{
@ApiResponse
(
content
=
@Content
(
array
=
@ArraySchema
(
schema
=
@Schema
(
implementation
=
ActionListWithJob
.
Wo
.
class
))))
})
@JaxrsMethodDescribe
(
value
=
"根据指定的job列示待办."
,
action
=
ActionListWithJob
.
class
)
@GET
@Path
(
"list/job/{job}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
...
...
o2server/x_processplatform_core_entity/src/main/java/com/x/processplatform/core/entity/content/Task.java
浏览文件 @
5d0a518c
...
...
@@ -42,6 +42,9 @@ import com.x.processplatform.core.entity.PersistenceProperties;
import
com.x.processplatform.core.entity.element.ActivityType
;
import
com.x.processplatform.core.entity.element.Route
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.media.Schema
;
@Entity
@ContainerEntity
(
dumpSize
=
200
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@Table
(
name
=
PersistenceProperties
.
Content
.
Task
.
table
,
uniqueConstraints
=
{
...
...
@@ -183,6 +186,7 @@ public class Task extends SliceJpaObject implements ProjectionInterface {
}
public
static
final
String
job_FIELDNAME
=
"job"
;
@Schema
(
description
=
"任务标识."
)
@FieldDescribe
(
"任务."
)
@Column
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
job_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
job_FIELDNAME
)
...
...
@@ -191,6 +195,7 @@ public class Task extends SliceJpaObject implements ProjectionInterface {
public
static
final
String
title_FIELDNAME
=
"title"
;
@FieldDescribe
(
"标题."
)
@Parameter
(
description
=
"工作标题."
)
@Column
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
title_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
title_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -390,8 +395,9 @@ public class Task extends SliceJpaObject implements ProjectionInterface {
public
static
final
String
routeList_FIELDNAME
=
"routeList"
;
@FieldDescribe
(
"当前活动可供选择的路由."
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
routeList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
routeList_FIELDNAME
+
JoinIndexNameSuffix
))
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
routeList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
routeList_FIELDNAME
+
JoinIndexNameSuffix
))
@ElementColumn
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
routeList_FIELDNAME
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
@@ -400,8 +406,9 @@ public class Task extends SliceJpaObject implements ProjectionInterface {
public
static
final
String
routeNameList_FIELDNAME
=
"routeNameList"
;
@FieldDescribe
(
"当前活动可供选择的路由名称."
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
routeNameList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
routeNameList_FIELDNAME
+
JoinIndexNameSuffix
))
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
routeNameList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
routeNameList_FIELDNAME
+
JoinIndexNameSuffix
))
@ElementColumn
(
length
=
length_255B
,
name
=
ColumnNamePrefix
+
routeNameList_FIELDNAME
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@CheckPersist
(
allowEmpty
=
true
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录