Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
4cf63037
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,发现更多精彩内容 >>
提交
4cf63037
编写于
7月 07, 2020
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
应用市场应用安装1
上级
105433a9
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
255 addition
and
3 deletion
+255
-3
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Collect.java
...src/main/java/com/x/base/core/project/config/Collect.java
+1
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ConnectionAction.java
.../com/x/base/core/project/connection/ConnectionAction.java
+30
-0
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_program_center.java
...c/main/java/com/x/base/core/project/x_program_center.java
+2
-1
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/market/ActionInstallOrUpdate.java
.../x/program/center/jaxrs/market/ActionInstallOrUpdate.java
+42
-0
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/Application.java
...in/java/com/x/program/center/core/entity/Application.java
+15
-1
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/Attachment.java
...ain/java/com/x/program/center/core/entity/Attachment.java
+1
-1
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/InstallLog.java
...ain/java/com/x/program/center/core/entity/InstallLog.java
+159
-0
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/PersistenceProperties.java
...m/x/program/center/core/entity/PersistenceProperties.java
+4
-0
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/Structure.java
...main/java/com/x/program/center/core/entity/Structure.java
+1
-0
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/config/Collect.java
浏览文件 @
4cf63037
...
...
@@ -36,6 +36,7 @@ public class Collect extends ConfigObject {
public
static
String
ADDRESS_COLLECT_VALIDATE
=
"/o2_collect_assemble/jaxrs/unit/validate"
;
public
static
String
ADDRESS_COLLECT_VALIDATE_CODE
=
"/o2_collect_assemble/jaxrs/unit/validate/codeanswer"
;
public
static
String
ADDRESS_COLLECT_APPLICATION_LIST
=
"/o2_collect_assemble/jaxrs/application/list"
;
public
static
String
ADDRESS_COLLECT_APPLICATION_DOWN
=
"/o2_collect_assemble/jaxrs/application/download"
;
public
static
String
COLLECT_TOKEN
=
"c-token"
;
public
static
Collect
defaultInstance
()
{
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/connection/ConnectionAction.java
浏览文件 @
4cf63037
...
...
@@ -21,13 +21,16 @@ import com.x.base.core.project.tools.ListTools;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.client.methods.HttpPost
;
import
org.apache.http.entity.ContentType
;
import
org.apache.http.entity.mime.MultipartEntityBuilder
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
org.apache.mina.core.session.IoSession
;
public
class
ConnectionAction
{
...
...
@@ -194,6 +197,32 @@ public class ConnectionAction {
return
read
(
response
,
connection
);
}
public
static
byte
[]
getFile
(
String
address
,
List
<
NameValuePair
>
heads
)
throws
Exception
{
try
(
CloseableHttpClient
httpclient
=
HttpClients
.
createDefault
()){
HttpGet
httpget
=
new
HttpGet
(
address
);
if
(
ListTools
.
isNotEmpty
(
heads
))
{
String
name
;
String
value
;
for
(
NameValuePair
o
:
heads
)
{
name
=
Objects
.
toString
(
o
.
getName
(),
""
);
value
=
Objects
.
toString
(
o
.
getValue
(),
""
);
if
(
StringUtils
.
isNotEmpty
(
name
)
&&
StringUtils
.
isNotEmpty
(
value
))
{
httpget
.
addHeader
(
name
,
value
);
}
}
}
HttpResponse
response
=
httpclient
.
execute
(
httpget
);
HttpEntity
entity
=
response
.
getEntity
();
if
(
entity
!=
null
)
{
InputStream
in
=
entity
.
getContent
();
if
(
in
!=
null
){
return
IOUtils
.
toByteArray
(
in
);
}
}
}
return
null
;
}
public
static
ActionResponse
multiFormPost
(
String
address
,
List
<
NameValuePair
>
heads
,
String
fileName
,
byte
[]
bytes
,
Map
<
String
,
String
>
map
)
throws
Exception
{
ActionResponse
response
=
new
ActionResponse
();
...
...
@@ -231,6 +260,7 @@ public class ConnectionAction {
response
.
setMessage
(
"convert to json error, address:"
+
address
+
", method: multiFormPost, because:"
+
e
.
getMessage
()
+
", value:"
+
value
+
"."
);
}
httpClient
.
close
();
}
catch
(
Exception
e
)
{
response
.
setType
(
ActionResponse
.
Type
.
connectFatal
);
response
.
setMessage
(
...
...
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_program_center.java
浏览文件 @
4cf63037
...
...
@@ -10,8 +10,9 @@ import com.x.base.core.project.annotation.ModuleType;
"com.x.program.center.core.entity.Captcha"
,
"com.x.program.center.core.entity.Code"
,
"com.x.program.center.core.entity.PromptErrorLog"
,
"com.x.program.center.core.entity.UnexpectedErrorLog"
,
"com.x.program.center.core.entity.Structure"
,
"com.x.program.center.core.entity.WarnLog"
,
"com.x.program.center.core.entity.validation.Meta"
,
"com.x.p
ortal.core.entity.Page
"
,
"com.x.program.center.core.entity.validation.Meta"
,
"com.x.p
rogram.center.core.entity.InstallLog
"
,
"com.x.program.center.core.entity.Application"
,
"com.x.program.center.core.entity.Attachment"
,
"com.x.portal.core.entity.Page"
,
"com.x.portal.core.entity.Portal"
,
"com.x.organization.core.entity.Group"
,
"com.x.organization.core.entity.Custom"
,
"com.x.organization.core.entity.Role"
,
"com.x.organization.core.entity.Person"
,
"com.x.organization.core.entity.Identity"
,
...
...
o2server/x_program_center/src/main/java/com/x/program/center/jaxrs/market/ActionInstallOrUpdate.java
0 → 100644
浏览文件 @
4cf63037
package
com.x.program.center.jaxrs.market
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
com.x.base.core.project.bean.WrapCopier
;
import
com.x.base.core.project.bean.WrapCopierFactory
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
com.x.base.core.project.exception.ExceptionEntityNotExist
;
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.program.center.core.entity.Application
;
import
com.x.program.center.core.entity.Attachment
;
import
java.util.ArrayList
;
import
java.util.List
;
class
ActionInstallOrUpdate
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
String
id
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
if
(
effectivePerson
.
isAnonymous
())
{
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Application
app
=
emc
.
find
(
id
,
Application
.
class
);
if
(
null
==
app
)
{
throw
new
ExceptionEntityNotExist
(
id
,
Application
.
class
);
}
Wo
wo
=
new
Wo
();
wo
.
setValue
(
true
);
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wo
extends
WrapBoolean
{
}
}
\ No newline at end of file
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/Application.java
浏览文件 @
4cf63037
...
...
@@ -10,7 +10,7 @@ import org.apache.openjpa.persistence.jdbc.Index;
import
javax.persistence.*
;
import
java.util.Date
;
@ContainerEntity
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@Entity
@Table
(
name
=
PersistenceProperties
.
Application
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
Application
.
table
+
JpaObject
.
IndexNameMiddle
...
...
@@ -117,6 +117,12 @@ public class Application extends SliceJpaObject {
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
grade_FIELDNAME
)
private
Double
grade
;
public
static
final
String
commentCount_FIELDNAME
=
"commentCount"
;
@FieldDescribe
(
"评论数"
)
@Column
(
name
=
ColumnNamePrefix
+
commentCount_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
commentCount_FIELDNAME
)
private
Integer
commentCount
;
public
static
final
String
orderNumber_FIELDNAME
=
"orderNumber"
;
@FieldDescribe
(
"排序号,升序排列,为空在最后"
)
@Column
(
name
=
ColumnNamePrefix
+
orderNumber_FIELDNAME
)
...
...
@@ -260,4 +266,12 @@ public class Application extends SliceJpaObject {
public
void
setGrade
(
Double
grade
)
{
this
.
grade
=
grade
;
}
public
Integer
getCommentCount
()
{
return
commentCount
;
}
public
void
setCommentCount
(
Integer
commentCount
)
{
this
.
commentCount
=
commentCount
;
}
}
\ No newline at end of file
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/Attachment.java
浏览文件 @
4cf63037
...
...
@@ -15,7 +15,7 @@ import org.apache.openjpa.persistence.jdbc.Index;
import
javax.persistence.*
;
import
java.util.Date
;
@ContainerEntity
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@Entity
@Table
(
name
=
PersistenceProperties
.
Attachment
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
Attachment
.
table
+
JpaObject
.
IndexNameMiddle
...
...
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/InstallLog.java
0 → 100644
浏览文件 @
4cf63037
package
com.x.program.center.core.entity
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.SliceJpaObject
;
import
com.x.base.core.entity.annotation.CheckPersist
;
import
com.x.base.core.entity.annotation.ContainerEntity
;
import
com.x.base.core.project.annotation.FieldDescribe
;
import
org.apache.openjpa.persistence.jdbc.Index
;
import
javax.persistence.*
;
import
java.util.Date
;
@ContainerEntity
(
dumpSize
=
1000
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@Entity
@Table
(
name
=
PersistenceProperties
.
InstallLog
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
InstallLog
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
JpaObject
.
CREATETIMECOLUMN
,
JpaObject
.
UPDATETIMECOLUMN
,
JpaObject
.
SEQUENCECOLUMN
})
})
@Inheritance
(
strategy
=
InheritanceType
.
TABLE_PER_CLASS
)
public
class
InstallLog
extends
SliceJpaObject
{
private
static
final
long
serialVersionUID
=
-
1080102795064855623L
;
private
static
final
String
TABLE
=
PersistenceProperties
.
InstallLog
.
table
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
@FieldDescribe
(
"数据库主键,自动生成."
)
@Id
@Column
(
length
=
length_id
,
name
=
ColumnNamePrefix
+
id_FIELDNAME
)
private
String
id
=
createId
();
/* 以上为 JpaObject 默认字段 */
public
void
onPersist
()
throws
Exception
{
}
public
static
final
String
name_FIELDNAME
=
"name"
;
@FieldDescribe
(
"名称"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
name_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
name_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
false
)
private
String
name
;
public
static
final
String
category_FIELDNAME
=
"category"
;
@FieldDescribe
(
"分类"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
category_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
category_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
category
;
public
static
final
String
version_FIELDNAME
=
"version"
;
@FieldDescribe
(
"版本"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
version_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
version
;
public
static
final
String
status_FIELDNAME
=
"status"
;
@FieldDescribe
(
"状态:valid|invalid."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
status_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
false
)
private
String
status
;
public
static
final
String
installPerson_FIELDNAME
=
"installPerson"
;
@FieldDescribe
(
"安装用户."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
installPerson_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
installPerson
;
public
static
final
String
installTime_FIELDNAME
=
"installTime"
;
@FieldDescribe
(
"安装时间"
)
@Column
(
name
=
ColumnNamePrefix
+
installTime_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
installTime_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
Date
installTime
;
public
static
final
String
unInstallPerson_FIELDNAME
=
"unInstallPerson"
;
@FieldDescribe
(
"卸载用户."
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
unInstallPerson_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
String
unInstallPerson
;
public
static
final
String
unInstallTime_FIELDNAME
=
"unInstallTime"
;
@FieldDescribe
(
"卸载时间"
)
@Column
(
name
=
ColumnNamePrefix
+
unInstallTime_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
unInstallTime_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
Date
unInstallTime
;
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCategory
()
{
return
category
;
}
public
void
setCategory
(
String
category
)
{
this
.
category
=
category
;
}
public
String
getVersion
()
{
return
version
;
}
public
void
setVersion
(
String
version
)
{
this
.
version
=
version
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getInstallPerson
()
{
return
installPerson
;
}
public
void
setInstallPerson
(
String
installPerson
)
{
this
.
installPerson
=
installPerson
;
}
public
Date
getInstallTime
()
{
return
installTime
;
}
public
void
setInstallTime
(
Date
installTime
)
{
this
.
installTime
=
installTime
;
}
public
String
getUnInstallPerson
()
{
return
unInstallPerson
;
}
public
void
setUnInstallPerson
(
String
unInstallPerson
)
{
this
.
unInstallPerson
=
unInstallPerson
;
}
public
Date
getUnInstallTime
()
{
return
unInstallTime
;
}
public
void
setUnInstallTime
(
Date
unInstallTime
)
{
this
.
unInstallTime
=
unInstallTime
;
}
}
\ No newline at end of file
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/PersistenceProperties.java
浏览文件 @
4cf63037
...
...
@@ -72,6 +72,10 @@ public final class PersistenceProperties extends AbstractPersistenceProperties {
public
static
final
String
table
=
"CTE_ATTACHMENT"
;
}
public
static
class
InstallLog
{
public
static
final
String
table
=
"CTE_INSTALL_LOG"
;
}
public
static
class
Validation
{
public
static
class
Meta
{
public
static
final
String
table
=
"VAL_META"
;
...
...
o2server/x_program_center_core_entity/src/main/java/com/x/program/center/core/entity/Structure.java
浏览文件 @
4cf63037
...
...
@@ -197,6 +197,7 @@ public class Structure extends StorageObject {
private
String
description
;
public
static
final
String
descriptionLob_FIELDNAME
=
"descriptionLob"
;
@FieldDescribe
(
"详细描述."
)
@Lob
@Basic
(
fetch
=
FetchType
.
EAGER
)
@Column
(
length
=
JpaObject
.
length_10M
,
name
=
ColumnNamePrefix
+
descriptionLob_FIELDNAME
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录