Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
99efb9d5
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,发现更多精彩内容 >>
提交
99efb9d5
编写于
5月 24, 2022
作者:
O
o2sword
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
论坛优化:小黑屋;匿名发布
上级
7549a6ff
变更
18
展开全部
隐藏空白更改
内联
并排
Showing
18 changed file
with
792 addition
and
296 deletion
+792
-296
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_bbs_assemble_control.java
.../java/com/x/base/core/project/x_bbs_assemble_control.java
+1
-1
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/Business.java
...ol/src/main/java/com/x/bbs/assemble/control/Business.java
+23
-0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/ActionApplication.java
...a/com/x/bbs/assemble/control/jaxrs/ActionApplication.java
+3
-1
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/BBSJaxrsFilter.java
...java/com/x/bbs/assemble/control/jaxrs/BBSJaxrsFilter.java
+2
-1
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionSave.java
...om/x/bbs/assemble/control/jaxrs/replyinfo/ActionSave.java
+15
-6
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/shutup/ActionHasShutup.java
.../x/bbs/assemble/control/jaxrs/shutup/ActionHasShutup.java
+34
-0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/shutup/ActionListPaging.java
...x/bbs/assemble/control/jaxrs/shutup/ActionListPaging.java
+90
-0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/shutup/ActionSave.java
...a/com/x/bbs/assemble/control/jaxrs/shutup/ActionSave.java
+121
-0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/shutup/BaseAction.java
...a/com/x/bbs/assemble/control/jaxrs/shutup/BaseAction.java
+7
-0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/shutup/ShutupAction.java
...com/x/bbs/assemble/control/jaxrs/shutup/ShutupAction.java
+85
-0
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectSave.java
...assemble/control/jaxrs/subjectinfo/ActionSubjectSave.java
+68
-132
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/SubjectInfoManagerUserAction.java
...ntrol/jaxrs/subjectinfo/SubjectInfoManagerUserAction.java
+112
-114
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/queue/NickNameConsumeQueue.java
...om/x/bbs/assemble/control/queue/NickNameConsumeQueue.java
+6
-3
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/UserManagerService.java
...om/x/bbs/assemble/control/service/UserManagerService.java
+27
-14
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/UserPermissionService.java
...x/bbs/assemble/control/service/UserPermissionService.java
+20
-5
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSShutup.java
...core_entity/src/main/java/com/x/bbs/entity/BBSShutup.java
+122
-0
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSSubjectInfo.java
...entity/src/main/java/com/x/bbs/entity/BBSSubjectInfo.java
+33
-0
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/PersistenceProperties.java
...src/main/java/com/x/bbs/entity/PersistenceProperties.java
+23
-19
未找到文件。
o2server/x_base_core_project/src/main/java/com/x/base/core/project/x_bbs_assemble_control.java
浏览文件 @
99efb9d5
...
...
@@ -11,7 +11,7 @@ import com.x.base.core.project.annotation.ModuleType;
"com.x.bbs.entity.BBSOperationRecord"
,
"com.x.bbs.entity.BBSUserInfo"
,
"com.x.bbs.entity.BBSUserRole"
,
"com.x.bbs.entity.BBSRoleInfo"
,
"com.x.bbs.entity.BBSPermissionRole"
,
"com.x.bbs.entity.BBSPermissionInfo"
,
"com.x.bbs.entity.BBSConfigSetting"
,
"com.x.bbs.entity.BBSVoteRecord"
,
"com.x.bbs.entity.BBSVoteOption"
,
"com.x.bbs.entity.BBSVoteOptionGroup"
,
"com.x.bbs.entity.BBSSubjectVoteResult"
},
storeJars
=
{
"com.x.bbs.entity.BBSVoteOptionGroup"
,
"com.x.bbs.entity.BBSSubjectVoteResult"
,
"com.x.bbs.entity.BBSShutup"
},
storeJars
=
{
"x_bbs_core_entity"
,
"x_organization_core_express"
,
"x_organization_core_entity"
},
storageTypes
=
{
StorageType
.
bbs
})
public
class
x_bbs_assemble_control
extends
Deployable
{
...
...
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/Business.java
浏览文件 @
99efb9d5
...
...
@@ -174,4 +174,27 @@ public class Business {
}
return
operationRecordFactory
;
}
/**
* 判断用户是否管理员权限
* 1、person.isManager()
* 2、xadmin
* 3、CMSManager
*
* @param person
* @return
* @throws Exception
*/
public
boolean
isManager
(
EffectivePerson
person
)
throws
Exception
{
// 如果用户的身份是平台的超级管理员,那么就是超级管理员权限
if
(
person
.
isManager
()
)
{
return
true
;
}
else
{
if
(
organization
().
person
().
hasRole
(
person
,
OrganizationDefinition
.
Manager
,
OrganizationDefinition
.
BBSManager
))
{
return
true
;
}
}
return
false
;
}
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/ActionApplication.java
浏览文件 @
99efb9d5
...
...
@@ -22,6 +22,7 @@ import com.x.bbs.assemble.control.jaxrs.replyinfo.ReplyInfoManagerUserAction;
import
com.x.bbs.assemble.control.jaxrs.roleinfo.RoleInfoAction
;
import
com.x.bbs.assemble.control.jaxrs.sectioninfo.SectionInfoAction
;
import
com.x.bbs.assemble.control.jaxrs.sectioninfo.SectionInfoManagerUserAction
;
import
com.x.bbs.assemble.control.jaxrs.shutup.ShutupAction
;
import
com.x.bbs.assemble.control.jaxrs.subjectinfo.SubjectAttachmentAction
;
import
com.x.bbs.assemble.control.jaxrs.subjectinfo.SubjectInfoAction
;
import
com.x.bbs.assemble.control.jaxrs.subjectinfo.SubjectInfoManagerUserAction
;
...
...
@@ -54,7 +55,8 @@ public class ActionApplication extends AbstractActionApplication {
this
.
classes
.
add
(
BBSConfigSettingAnonymousAction
.
class
);
this
.
classes
.
add
(
AttachmentAction
.
class
);
this
.
classes
.
add
(
PictureAction
.
class
);
this
.
classes
.
add
(
ShutupAction
.
class
);
return
this
.
classes
;
}
}
\ No newline at end of file
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/BBSJaxrsFilter.java
浏览文件 @
99efb9d5
...
...
@@ -35,6 +35,7 @@ import com.x.bbs.assemble.control.ThisApplication;
"/jaxrs/logout/*"
,
"/jaxrs/mobile/*"
,
"/jaxrs/picture/*"
,
"/jaxrs/shutup/*"
,
"/jaxrs/attachment/*"
}
,
asyncSupported
=
true
)
public
class
BBSJaxrsFilter
extends
AnonymousCipherManagerUserJaxrsFilter
{
...
...
@@ -63,4 +64,4 @@ public class BBSJaxrsFilter extends AnonymousCipherManagerUserJaxrsFilter {
e
.
printStackTrace
();
}
}
}
\ No newline at end of file
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/replyinfo/ActionSave.java
浏览文件 @
99efb9d5
...
...
@@ -5,6 +5,7 @@ import java.util.List;
import
javax.servlet.http.HttpServletRequest
;
import
com.x.base.core.project.exception.ExceptionAccessDenied
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
...
...
@@ -52,14 +53,22 @@ public class ActionSave extends BaseAction {
String
hostName
=
request
.
getRemoteAddr
();
Wi
wrapIn
=
null
;
try
{
wrapIn
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
}
catch
(
Exception
e
)
{
if
(!
effectivePerson
.
isAnonymous
()
&&
this
.
userManagerService
.
personHasShutup
(
effectivePerson
.
getDistinguishedName
())){
check
=
false
;
Exception
exception
=
new
ExceptionReplyInfoProcess
(
e
,
"系统在将JSON信息转换为对象时发生异常。JSON:"
+
jsonElement
.
toString
());
Exception
exception
=
new
ExceptionAccessDenied
(
effectivePerson
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
if
(
check
)
{
try
{
wrapIn
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionReplyInfoProcess
(
e
,
"系统在将JSON信息转换为对象时发生异常。JSON:"
+
jsonElement
.
toString
());
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
check
)
{
...
...
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/shutup/ActionHasShutup.java
0 → 100644
浏览文件 @
99efb9d5
package
com.x.bbs.assemble.control.jaxrs.shutup
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
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.bbs.assemble.control.ThisApplication
;
import
com.x.bbs.assemble.control.jaxrs.userinfo.BaseAction
;
import
com.x.bbs.entity.BBSShutup
;
/**
* @author sword
*/
public
class
ActionHasShutup
extends
BaseAction
{
protected
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wo
wrap
=
new
Wo
();
wrap
.
setValue
(
false
);
result
.
setData
(
wrap
);
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Long
count
=
emc
.
countEqual
(
BBSShutup
.
class
,
BBSShutup
.
person_FIELDNAME
,
effectivePerson
.
getDistinguishedName
());
if
(
count
>
0
){
wrap
.
setValue
(
true
);
}
}
return
result
;
}
public
static
class
Wo
extends
WrapBoolean
{
}
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/shutup/ActionListPaging.java
0 → 100644
浏览文件 @
99efb9d5
package
com.x.bbs.assemble.control.jaxrs.shutup
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
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.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.base.core.project.tools.StringTools
;
import
com.x.bbs.assemble.control.Business
;
import
com.x.bbs.entity.BBSShutup
;
import
com.x.bbs.entity.BBSShutup_
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.persistence.EntityManager
;
import
javax.persistence.Tuple
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Predicate
;
import
javax.persistence.criteria.Root
;
import
java.util.List
;
class
ActionListPaging
extends
BaseAction
{
ActionResult
<
List
<
Wo
>>
execute
(
EffectivePerson
effectivePerson
,
Integer
page
,
Integer
size
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
if
(!
business
.
isManager
(
effectivePerson
)){
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
ActionResult
<
List
<
Wo
>>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
Predicate
p
=
this
.
toFilterPredicate
(
effectivePerson
,
business
,
wi
);
List
<
Wo
>
wos
=
emc
.
fetchDescPaging
(
BBSShutup
.
class
,
Wo
.
copier
,
p
,
page
,
size
,
BBSShutup
.
createTime_FIELDNAME
);
result
.
setData
(
wos
);
result
.
setCount
(
emc
.
count
(
BBSShutup
.
class
,
p
));
return
result
;
}
}
private
Predicate
toFilterPredicate
(
EffectivePerson
effectivePerson
,
Business
business
,
Wi
wi
)
throws
Exception
{
EntityManager
em
=
business
.
entityManagerContainer
().
get
(
BBSShutup
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Tuple
>
cq
=
cb
.
createQuery
(
Tuple
.
class
);
Root
<
BBSShutup
>
root
=
cq
.
from
(
BBSShutup
.
class
);
Predicate
p
=
cb
.
conjunction
();
if
(
StringUtils
.
isNotEmpty
(
wi
.
getPerson
())){
String
person
=
business
.
organization
().
person
().
get
(
wi
.
getPerson
());
if
(
StringUtils
.
isEmpty
(
person
)){
person
=
wi
.
getPerson
();
}
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
BBSShutup_
.
person
),
person
));
}
return
p
;
}
public
class
Wi
extends
GsonPropertyObject
{
@FieldDescribe
(
"禁言用户"
)
private
String
person
;
public
String
getPerson
()
{
return
person
;
}
public
void
setPerson
(
String
person
)
{
this
.
person
=
person
;
}
}
public
static
class
Wo
extends
BBSShutup
{
private
static
final
long
serialVersionUID
=
4928128631701115688L
;
static
WrapCopier
<
BBSShutup
,
Wo
>
copier
=
WrapCopierFactory
.
wo
(
BBSShutup
.
class
,
Wo
.
class
,
null
,
ListTools
.
toList
(
JpaObject
.
FieldsUnmodifyExcludeId
,
BBSShutup
.
unmuteDateTime_FIELDNAME
,
BBSShutup
.
operator_FIELDNAME
));
}
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/shutup/ActionSave.java
0 → 100644
浏览文件 @
99efb9d5
package
com.x.bbs.assemble.control.jaxrs.shutup
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.entity.JpaObject
;
import
com.x.base.core.entity.annotation.CheckPersistType
;
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.exception.ExceptionFieldEmpty
;
import
com.x.base.core.project.gson.GsonPropertyObject
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.jaxrs.WoId
;
import
com.x.base.core.project.tools.DateTools
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.bbs.assemble.control.Business
;
import
com.x.bbs.entity.BBSShutup
;
import
org.apache.commons.lang3.StringUtils
;
class
ActionSave
extends
BaseAction
{
ActionResult
<
Wo
>
execute
(
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
Business
business
=
new
Business
(
emc
);
if
(!
business
.
isManager
(
effectivePerson
)){
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
Wi
wi
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
if
(
StringUtils
.
isBlank
(
wi
.
getPerson
())){
throw
new
ExceptionFieldEmpty
(
BBSShutup
.
person_FIELDNAME
);
}
if
(
StringUtils
.
isBlank
(
wi
.
getUnmuteDate
())){
throw
new
ExceptionFieldEmpty
(
BBSShutup
.
unmuteDate_FIELDNAME
);
}
if
(
StringUtils
.
isBlank
(
wi
.
getReason
())){
throw
new
ExceptionFieldEmpty
(
BBSShutup
.
reason_FIELDNAME
);
}
BBSShutup
shutup
=
Wi
.
copier
.
copy
(
wi
);
if
(
StringUtils
.
isNotBlank
(
wi
.
getId
())){
shutup
=
emc
.
find
(
wi
.
getId
(),
BBSShutup
.
class
);
if
(
shutup
==
null
){
throw
new
ExceptionEntityNotExist
(
wi
.
getId
());
}
wi
.
copyTo
(
shutup
);
}
emc
.
beginTransaction
(
BBSShutup
.
class
);
shutup
.
setUnmuteDateTime
(
DateTools
.
parse
(
shutup
.
getUnmuteDate
()));
shutup
.
setOperator
(
effectivePerson
.
getDistinguishedName
());
if
(
StringUtils
.
isBlank
(
wi
.
getId
()))
{
emc
.
persist
(
shutup
,
CheckPersistType
.
all
);
}
else
{
emc
.
check
(
shutup
,
CheckPersistType
.
all
);
}
emc
.
commit
();
Wo
wo
=
new
Wo
();
wo
.
setId
(
shutup
.
getId
());
result
.
setData
(
wo
);
return
result
;
}
}
public
static
class
Wi
extends
GsonPropertyObject
{
static
WrapCopier
<
Wi
,
BBSShutup
>
copier
=
WrapCopierFactory
.
wi
(
Wi
.
class
,
BBSShutup
.
class
,
null
,
ListTools
.
toList
(
JpaObject
.
FieldsUnmodifyExcludeId
,
BBSShutup
.
unmuteDateTime_FIELDNAME
,
BBSShutup
.
operator_FIELDNAME
));
@FieldDescribe
(
"数据库主键."
)
private
String
id
;
@FieldDescribe
(
"被禁言用户"
)
private
String
person
;
@FieldDescribe
(
"解封时间"
)
private
String
unmuteDate
;
@FieldDescribe
(
"禁言原因"
)
private
String
reason
;
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getPerson
()
{
return
person
;
}
public
void
setPerson
(
String
person
)
{
this
.
person
=
person
;
}
public
String
getUnmuteDate
()
{
return
unmuteDate
;
}
public
void
setUnmuteDate
(
String
unmuteDate
)
{
this
.
unmuteDate
=
unmuteDate
;
}
public
String
getReason
()
{
return
reason
;
}
public
void
setReason
(
String
reason
)
{
this
.
reason
=
reason
;
}
}
public
static
class
Wo
extends
WoId
{
}
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/shutup/BaseAction.java
0 → 100644
浏览文件 @
99efb9d5
package
com.x.bbs.assemble.control.jaxrs.shutup
;
import
com.x.base.core.project.jaxrs.StandardJaxrsAction
;
public
class
BaseAction
extends
StandardJaxrsAction
{
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/shutup/ShutupAction.java
0 → 100644
浏览文件 @
99efb9d5
package
com.x.bbs.assemble.control.jaxrs.shutup
;
import
com.google.gson.JsonElement
;
import
com.x.base.core.project.annotation.JaxrsDescribe
;
import
com.x.base.core.project.annotation.JaxrsMethodDescribe
;
import
com.x.base.core.project.annotation.JaxrsParameterDescribe
;
import
com.x.base.core.project.http.ActionResult
;
import
com.x.base.core.project.http.EffectivePerson
;
import
com.x.base.core.project.http.HttpMediaType
;
import
com.x.base.core.project.jaxrs.ResponseFactory
;
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
javax.servlet.http.HttpServletRequest
;
import
javax.ws.rs.*
;
import
javax.ws.rs.container.AsyncResponse
;
import
javax.ws.rs.container.Suspended
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.MediaType
;
import
java.util.List
;
/**
* @author sword
*/
@Path
(
"shutup"
)
@JaxrsDescribe
(
"论坛用户禁言服务"
)
public
class
ShutupAction
extends
StandardJaxrsAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ShutupAction
.
class
);
@JaxrsMethodDescribe
(
value
=
"校验当前用户是否被禁言."
,
action
=
ActionHasShutup
.
class
)
@GET
@Path
(
"has/shutup"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
hasShutup
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
)
{
ActionResult
<
ActionHasShutup
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionHasShutup
().
execute
(
effectivePerson
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"保存."
,
action
=
ActionSave
.
class
)
@POST
@Path
(
"save"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
save
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
JsonElement
jsonElement
)
{
ActionResult
<
ActionSave
.
Wo
>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionSave
().
execute
(
effectivePerson
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
));
}
@JaxrsMethodDescribe
(
value
=
"分页查询."
,
action
=
ActionListPaging
.
class
)
@POST
@Path
(
"list/paging/{page}/size/{size}"
)
@Produces
(
HttpMediaType
.
APPLICATION_JSON_UTF_8
)
@Consumes
(
MediaType
.
APPLICATION_JSON
)
public
void
listPaging
(
@Suspended
final
AsyncResponse
asyncResponse
,
@Context
HttpServletRequest
request
,
@JaxrsParameterDescribe
(
"分页"
)
@PathParam
(
"page"
)
Integer
page
,
@JaxrsParameterDescribe
(
"每页数量"
)
@PathParam
(
"size"
)
Integer
size
,
JsonElement
jsonElement
)
{
ActionResult
<
List
<
ActionListPaging
.
Wo
>>
result
=
new
ActionResult
<>();
EffectivePerson
effectivePerson
=
this
.
effectivePerson
(
request
);
try
{
result
=
new
ActionListPaging
().
execute
(
effectivePerson
,
page
,
size
,
jsonElement
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
,
effectivePerson
,
request
,
jsonElement
);
result
.
error
(
e
);
}
asyncResponse
.
resume
(
ResponseFactory
.
getEntityTagActionResultResponse
(
request
,
result
,
jsonElement
));
}
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/ActionSubjectSave.java
浏览文件 @
99efb9d5
package
com.x.bbs.assemble.control.jaxrs.subjectinfo
;
import
java.util.Date
;
import
java.util.List
;
import
javax.servlet.http.HttpServletRequest
;
import
org.apache.commons.lang3.StringUtils
;
import
com.google.gson.JsonElement
;
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.cache.CacheManager
;
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.WoId
;
import
com.x.base.core.project.logger.Logger
;
import
com.x.base.core.project.logger.LoggerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.bbs.assemble.control.Business
;
import
com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionSubjectInfoProcess
;
import
com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionSubjectOperation
;
import
com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionSubjectSave
;
import
com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionSubjectWrapIn
;
import
com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionVoteOptionEmpty
;
import
com.x.bbs.assemble.control.jaxrs.subjectinfo.exception.ExceptionWrapInConvert
;
import
com.x.bbs.entity.BBSForumInfo
;
import
com.x.bbs.entity.BBSSectionInfo
;
import
com.x.bbs.entity.BBSSubjectInfo
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.List
;
public
class
ActionSubjectSave
extends
BaseAction
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ActionSubjectSave
.
class
);
private
static
final
String
ANONYMOUS_NAME
=
"匿名"
;
private
static
final
String
TYPE_CATEGORY
=
"投票"
;
protected
ActionResult
<
Wo
>
execute
(
HttpServletRequest
request
,
EffectivePerson
effectivePerson
,
JsonElement
jsonElement
)
throws
Exception
{
ActionResult
<
Wo
>
result
=
new
ActionResult
<>();
BBSSectionInfo
sectionInfo
=
null
;
BBSSubjectInfo
subjectInfo
=
null
;
Wi
wrapIn
=
null
;
Wo
wo
=
new
Wo
();
Boolean
check
=
true
;
try
{
wrapIn
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionWrapInConvert
(
e
,
jsonElement
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
if
(
check
)
{
// 对需要保存的信息进行基础的信息验证,如果验证不通过,则抛出PromptException
try
{
SubjectPropertyValidator
.
baseValidate
(
request
,
wrapIn
);
}
catch
(
Exception
e
)
{
check
=
false
;
result
.
error
(
e
);
}
if
(!
effectivePerson
.
isAnonymous
()
&&
this
.
userManagerService
.
personHasShutup
(
effectivePerson
.
getDistinguishedName
())){
throw
new
ExceptionAccessDenied
(
effectivePerson
);
}
Wi
wrapIn
=
this
.
convertToWrapIn
(
jsonElement
,
Wi
.
class
);
SubjectPropertyValidator
.
baseValidate
(
request
,
wrapIn
);
// 查询版块信息是否存在
if
(
check
)
{
try
{
sectionInfo
=
sectionInfoServiceAdv
.
get
(
wrapIn
.
getSectionId
());
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionSubjectInfoProcess
(
e
,
"根据指定ID查询版块信息时发生异常.ID:"
+
wrapIn
.
getSectionId
());
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
BBSSectionInfo
sectionInfo
=
sectionInfoServiceAdv
.
get
(
wrapIn
.
getSectionId
());
if
(
sectionInfo
==
null
){
throw
new
ExceptionEntityNotExist
(
wrapIn
.
getSectionId
(),
BBSSectionInfo
.
class
);
}
if
(
check
)
{
if
(
wrapIn
.
getTypeCategory
()
==
null
||
wrapIn
.
getTypeCategory
().
isEmpty
())
{
wrapIn
.
setTypeCategory
(
"信息"
);
}
else
{
try
{
SubjectPropertyValidator
.
typeCategoryValidate
(
sectionInfo
,
wrapIn
);
}
catch
(
Exception
e
)
{
check
=
false
;
result
.
error
(
e
);
}
}
}
if
(
check
)
{
if
(
wrapIn
.
getType
()
==
null
||
wrapIn
.
getType
().
isEmpty
())
{
wrapIn
.
setType
(
"未知类别"
);
}
else
{
try
{
SubjectPropertyValidator
.
subjectTypeValidate
(
sectionInfo
,
wrapIn
);
}
catch
(
Exception
e
)
{
check
=
false
;
result
.
error
(
e
);
}
}
if
(
StringUtils
.
isBlank
(
wrapIn
.
getTypeCategory
()))
{
wrapIn
.
setTypeCategory
(
"信息"
);
}
else
{
SubjectPropertyValidator
.
typeCategoryValidate
(
sectionInfo
,
wrapIn
);
}
if
(
check
)
{
if
(
"投票"
.
equals
(
wrapIn
.
getTypeCategory
()))
{
// 如果是投票贴,判断投票选项是否存在
if
(
wrapIn
.
getOptionGroups
()
==
null
||
wrapIn
.
getOptionGroups
().
isEmpty
())
{
check
=
false
;
Exception
exception
=
new
ExceptionVoteOptionEmpty
();
result
.
error
(
exception
);
}
}
if
(
StringUtils
.
isBlank
(
wrapIn
.
getType
()))
{
wrapIn
.
setType
(
"未知类别"
);
}
else
{
SubjectPropertyValidator
.
subjectTypeValidate
(
sectionInfo
,
wrapIn
);
}
if
(
check
)
{
try
{
subjectInfo
=
Wi
.
copier
.
copy
(
wrapIn
);
if
(
StringUtils
.
isNotEmpty
(
wrapIn
.
getId
()
))
{
subjectInfo
.
setId
(
wrapIn
.
getId
());
}
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionSubjectWrapIn
(
e
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
if
(
TYPE_CATEGORY
.
equals
(
wrapIn
.
getTypeCategory
()))
{
// 如果是投票贴,判断投票选项是否存在
if
(
ListTools
.
isEmpty
(
wrapIn
.
getOptionGroups
()))
{
throw
new
ExceptionVoteOptionEmpty
();
}
}
if
(
check
)
{
subjectInfo
.
setForumId
(
sectionInfo
.
getForumId
());
subjectInfo
.
setForumName
(
sectionInfo
.
getForumName
());
subjectInfo
.
setMainSectionId
(
sectionInfo
.
getMainSectionId
());
subjectInfo
.
setMainSectionName
(
sectionInfo
.
getMainSectionName
());
subjectInfo
.
setSectionId
(
sectionInfo
.
getId
());
subjectInfo
.
setSectionName
(
sectionInfo
.
getSectionName
());
subjectInfo
.
setCreatorName
(
effectivePerson
.
getDistinguishedName
());
subjectInfo
.
setLatestReplyTime
(
new
Date
());
subjectInfo
.
setTypeCategory
(
wrapIn
.
getTypeCategory
());
subjectInfo
.
setType
(
wrapIn
.
getType
());
subjectInfo
.
setTitle
(
subjectInfo
.
getTitle
().
trim
());
subjectInfo
.
setVoteLimitTime
(
wrapIn
.
getVoteLimitTime
());
subjectInfo
.
setVotePersonVisible
(
wrapIn
.
getVotePersonVisible
());
subjectInfo
.
setVoteResultVisible
(
wrapIn
.
getVoteResultVisible
());
subjectInfo
.
setGrade
(
wrapIn
.
getGrade
());
BBSSubjectInfo
subjectInfo
=
Wi
.
copier
.
copy
(
wrapIn
);
if
(
StringUtils
.
isNotEmpty
(
wrapIn
.
getId
()
))
{
subjectInfo
.
setId
(
wrapIn
.
getId
());
}
subjectInfo
.
setForumId
(
sectionInfo
.
getForumId
());
subjectInfo
.
setForumName
(
sectionInfo
.
getForumName
());
subjectInfo
.
setMainSectionId
(
sectionInfo
.
getMainSectionId
());
subjectInfo
.
setMainSectionName
(
sectionInfo
.
getMainSectionName
());
subjectInfo
.
setSectionId
(
sectionInfo
.
getId
());
subjectInfo
.
setSectionName
(
sectionInfo
.
getSectionName
());
subjectInfo
.
setCreatorName
(
effectivePerson
.
getDistinguishedName
());
subjectInfo
.
setLatestReplyTime
(
new
Date
());
subjectInfo
.
setTypeCategory
(
wrapIn
.
getTypeCategory
());
subjectInfo
.
setType
(
wrapIn
.
getType
());
subjectInfo
.
setTitle
(
subjectInfo
.
getTitle
().
trim
());
subjectInfo
.
setVoteLimitTime
(
wrapIn
.
getVoteLimitTime
());
subjectInfo
.
setVotePersonVisible
(
wrapIn
.
getVotePersonVisible
());
subjectInfo
.
setVoteResultVisible
(
wrapIn
.
getVoteResultVisible
());
subjectInfo
.
setGrade
(
wrapIn
.
getGrade
());
if
(
BooleanUtils
.
isTrue
(
wrapIn
.
getAnonymousSubject
())){
subjectInfo
.
setNickName
(
ANONYMOUS_NAME
);
}
else
{
Business
business
=
new
Business
(
null
);
subjectInfo
.
setNickName
(
business
.
organization
().
person
().
getNickName
(
effectivePerson
.
getDistinguishedName
()));
subjectInfo
.
setAnonymousSubject
(
false
);
}
if
(
check
)
{
subjectInfo
.
setMachineName
(
wrapIn
.
getSubjectMachineName
());
subjectInfo
.
setSystemType
(
wrapIn
.
getSubjectSystemName
());
try
{
subjectInfo
=
subjectInfoServiceAdv
.
save
(
subjectInfo
,
wrapIn
.
getContent
());
wo
.
setId
(
subjectInfo
.
getId
());
subjectInfo
.
setMachineName
(
wrapIn
.
getSubjectMachineName
());
subjectInfo
.
setSystemType
(
wrapIn
.
getSubjectSystemName
());
subjectInfo
=
subjectInfoServiceAdv
.
save
(
subjectInfo
,
wrapIn
.
getContent
());
wo
.
setId
(
subjectInfo
.
getId
());
CacheManager
.
notify
(
BBSSubjectInfo
.
class
);
CacheManager
.
notify
(
BBSSectionInfo
.
class
);
CacheManager
.
notify
(
BBSForumInfo
.
class
);
CacheManager
.
notify
(
BBSSubjectInfo
.
class
);
CacheManager
.
notify
(
BBSSectionInfo
.
class
);
CacheManager
.
notify
(
BBSForumInfo
.
class
);
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionSubjectSave
(
e
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
check
)
{
if
(
"投票"
.
equals
(
wrapIn
.
getTypeCategory
()))
{
try
{
subjectVoteService
.
saveVoteOptions
(
subjectInfo
,
wrapIn
.
getOptionGroups
());
}
catch
(
Exception
e
)
{
check
=
false
;
Exception
exception
=
new
ExceptionSubjectOperation
(
e
,
"系统在保存投票选项信息时发生异常"
);
result
.
error
(
exception
);
logger
.
error
(
e
,
effectivePerson
,
request
,
null
);
}
}
if
(
TYPE_CATEGORY
.
equals
(
wrapIn
.
getTypeCategory
()))
{
subjectVoteService
.
saveVoteOptions
(
subjectInfo
,
wrapIn
.
getOptionGroups
());
}
result
.
setData
(
wo
);
return
result
;
...
...
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/jaxrs/subjectinfo/SubjectInfoManagerUserAction.java
浏览文件 @
99efb9d5
此差异已折叠。
点击以展开。
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/queue/NickNameConsumeQueue.java
浏览文件 @
99efb9d5
...
...
@@ -3,6 +3,7 @@ package com.x.bbs.assemble.control.queue;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
com.x.base.core.container.EntityManagerContainer
;
...
...
@@ -65,9 +66,11 @@ public class NickNameConsumeQueue extends AbstractQueue<String> {
private
void
updateSubjectNickName
(
String
id
,
String
nickName
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
BBSSubjectInfo
bbsSubjectInfo
=
emc
.
find
(
id
,
BBSSubjectInfo
.
class
);
emc
.
beginTransaction
(
BBSSubjectInfo
.
class
);
bbsSubjectInfo
.
setNickName
(
nickName
);
emc
.
commit
();
if
(!
BooleanUtils
.
isTrue
(
bbsSubjectInfo
.
getAnonymousSubject
()))
{
emc
.
beginTransaction
(
BBSSubjectInfo
.
class
);
bbsSubjectInfo
.
setNickName
(
nickName
);
emc
.
commit
();
}
}
}
...
...
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/UserManagerService.java
浏览文件 @
99efb9d5
...
...
@@ -7,18 +7,19 @@ import com.x.base.core.container.EntityManagerContainer;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.tools.ListTools
;
import
com.x.bbs.assemble.control.Business
;
import
com.x.bbs.entity.BBSShutup
;
/**
* 用户组织顶层组织信息管理服务类
*
*
* @author LIYI
*
*/
public
class
UserManagerService
{
/**
* 根据用户唯一标识来获取用户对象
*
*
* @param flag
* @return
* @throws Exception
...
...
@@ -37,10 +38,10 @@ public class UserManagerService {
throw
e
;
}
}
/**
* 根据员工姓名获取组织名称,多个身份只取第一个组织
*
*
* @param employeeName
* @return
* @throws Exception
...
...
@@ -62,10 +63,10 @@ public class UserManagerService {
throw
e
;
}
}
/**
* 根据员工身份获取组织名称
*
*
* @param employeeName
* @return
* @throws Exception
...
...
@@ -81,7 +82,7 @@ public class UserManagerService {
throw
e
;
}
}
public
String
checkUnitExistsWithFlag
(
String
unitName
)
throws
Exception
{
Business
business
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
...
...
@@ -93,7 +94,7 @@ public class UserManagerService {
throw
e
;
}
}
public
List
<
String
>
listUnitNamesWithPerson
(
String
personName
)
throws
Exception
{
Business
business
=
null
;
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
...
...
@@ -124,7 +125,7 @@ public class UserManagerService {
}
/**
* 根据身份名称获取顶层组织名称
*
*
* @param identity
* @return
* @throws Exception
...
...
@@ -167,7 +168,7 @@ public class UserManagerService {
/**
* 根据组织名称获取所有下级组织名称列表
*
*
* @param query_creatorUnitName
* @return
* @throws Exception
...
...
@@ -184,12 +185,12 @@ public class UserManagerService {
}
}
/**
* 判断用户是否有指定的平台角色,比如BBS系统管理员
*
*
* @param name
* @param string
* @return
...
...
@@ -278,4 +279,16 @@ public class UserManagerService {
throw
e
;
}
}
}
\ No newline at end of file
/**
* 判断指定用户是否被禁用
* @param person
* @return
* @throws Exception
*/
public
boolean
personHasShutup
(
String
person
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
return
emc
.
countEqual
(
BBSShutup
.
class
,
BBSShutup
.
person_FIELDNAME
,
person
)
>
0
;
}
}
}
o2server/x_bbs_assemble_control/src/main/java/com/x/bbs/assemble/control/service/UserPermissionService.java
浏览文件 @
99efb9d5
...
...
@@ -6,6 +6,8 @@ import java.util.List;
import
java.util.Optional
;
import
com.google.gson.Gson
;
import
com.x.base.core.container.EntityManagerContainer
;
import
com.x.base.core.container.factory.EntityManagerContainerFactory
;
import
com.x.base.core.project.cache.Cache
;
import
com.x.base.core.project.cache.CacheManager
;
import
com.x.base.core.project.gson.XGsonBuilder
;
...
...
@@ -17,11 +19,12 @@ import com.x.bbs.assemble.control.ThisApplication;
import
com.x.bbs.assemble.control.jaxrs.MethodExcuteResult
;
import
com.x.bbs.assemble.control.service.bean.RoleAndPermission
;
import
com.x.bbs.entity.BBSPermissionInfo
;
import
com.x.bbs.entity.BBSShutup
;
import
com.x.bbs.entity.BBSUserInfo
;
/**
* 用户组织顶层组织信息管理服务类
*
*
* @author LIYI
*
*/
...
...
@@ -79,7 +82,7 @@ public class UserPermissionService {
/**
* 获取人员的权限信息,优先使用缓存的人员信息
*
*
* @param userName
* @return
* @throws Exception
...
...
@@ -108,7 +111,7 @@ public class UserPermissionService {
/**
* 获取用户信息,优先使用缓存信息
*
*
* @param userName
* @return
* @throws Exception
...
...
@@ -279,7 +282,7 @@ public class UserPermissionService {
logger
.
error
(
e
);
}
}
if
(
methodExcuteResult
.
getSuccess
()
)
{
// 获取可访问的论坛ID列表
if
(
ListTools
.
isNotEmpty
(
forumViewPermissionList
))
{
for
(
BBSPermissionInfo
permission
:
forumViewPermissionList
)
{
...
...
@@ -337,4 +340,16 @@ public class UserPermissionService {
return
methodExcuteResult
;
}
}
\ No newline at end of file
/**
* 判断指定用户是否被禁用
* @param person
* @return
* @throws Exception
*/
public
boolean
personHasShutup
(
String
person
)
throws
Exception
{
try
(
EntityManagerContainer
emc
=
EntityManagerContainerFactory
.
instance
().
create
())
{
return
emc
.
countEqual
(
BBSShutup
.
class
,
BBSShutup
.
person_FIELDNAME
,
person
)
>
0
;
}
}
}
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSShutup.java
0 → 100644
浏览文件 @
99efb9d5
package
com.x.bbs.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
;
/**
* 禁言人员
*
* @author sword
* @date 2022/05/20 10:53
**/
@ContainerEntity
(
dumpSize
=
200
,
type
=
ContainerEntity
.
Type
.
content
,
reference
=
ContainerEntity
.
Reference
.
strong
)
@Entity
@Table
(
name
=
PersistenceProperties
.
BBSShutup
.
table
,
uniqueConstraints
=
{
@UniqueConstraint
(
name
=
PersistenceProperties
.
BBSShutup
.
table
+
JpaObject
.
IndexNameMiddle
+
JpaObject
.
DefaultUniqueConstraintSuffix
,
columnNames
=
{
JpaObject
.
IDCOLUMN
,
JpaObject
.
CREATETIMECOLUMN
,
JpaObject
.
UPDATETIMECOLUMN
,
JpaObject
.
SEQUENCECOLUMN
})
})
@Inheritance
(
strategy
=
InheritanceType
.
TABLE_PER_CLASS
)
public
class
BBSShutup
extends
SliceJpaObject
{
private
static
final
long
serialVersionUID
=
5779755036387970393L
;
private
static
final
String
TABLE
=
PersistenceProperties
.
BBSShutup
.
table
;
@Override
public
String
getId
()
{
return
id
;
}
@Override
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
@FieldDescribe
(
"数据库主键,自动生成."
)
@Id
@Column
(
length
=
length_id
,
name
=
ColumnNamePrefix
+
id_FIELDNAME
)
private
String
id
=
createId
();
@Override
public
void
onPersist
()
throws
Exception
{
}
public
static
final
String
operator_FIELDNAME
=
"operator"
;
@FieldDescribe
(
"操作者"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
operator_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
false
)
private
String
operator
;
public
static
final
String
person_FIELDNAME
=
"person"
;
@FieldDescribe
(
"被禁言用户"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
person_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
person_FIELDNAME
,
unique
=
true
)
@CheckPersist
(
allowEmpty
=
false
)
private
String
person
;
public
static
final
String
unmuteDate_FIELDNAME
=
"unmuteDate"
;
@FieldDescribe
(
"解封时间"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
unmuteDate_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
false
)
private
String
unmuteDate
;
public
static
final
String
unmuteDateTime_FIELDNAME
=
"unmuteDateTime"
;
@FieldDescribe
(
"解封时间date类型"
)
@Column
(
name
=
ColumnNamePrefix
+
unmuteDateTime_FIELDNAME
)
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
unmuteDateTime_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
false
)
private
Date
unmuteDateTime
;
public
static
final
String
reason_FIELDNAME
=
"reason"
;
@FieldDescribe
(
"禁言原因"
)
@Column
(
length
=
JpaObject
.
length_255B
,
name
=
ColumnNamePrefix
+
reason_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
false
)
private
String
reason
;
public
String
getPerson
()
{
return
person
;
}
public
void
setPerson
(
String
person
)
{
this
.
person
=
person
;
}
public
String
getUnmuteDate
()
{
return
unmuteDate
;
}
public
void
setUnmuteDate
(
String
unmuteDate
)
{
this
.
unmuteDate
=
unmuteDate
;
}
public
Date
getUnmuteDateTime
()
{
return
unmuteDateTime
;
}
public
void
setUnmuteDateTime
(
Date
unmuteDateTime
)
{
this
.
unmuteDateTime
=
unmuteDateTime
;
}
public
String
getReason
()
{
return
reason
;
}
public
void
setReason
(
String
reason
)
{
this
.
reason
=
reason
;
}
public
String
getOperator
()
{
return
operator
;
}
public
void
setOperator
(
String
operator
)
{
this
.
operator
=
operator
;
}
}
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/BBSSubjectInfo.java
浏览文件 @
99efb9d5
...
...
@@ -377,6 +377,12 @@ public class BBSSubjectInfo extends SliceJpaObject {
@CheckPersist
(
allowEmpty
=
false
)
private
Boolean
votePersonVisible
=
false
;
public
static
final
String
anonymousSubject_FIELDNAME
=
"anonymousSubject"
;
@FieldDescribe
(
"是否匿名发布"
)
@Column
(
name
=
ColumnNamePrefix
+
anonymousSubject_FIELDNAME
)
@CheckPersist
(
allowEmpty
=
true
)
private
Boolean
anonymousSubject
=
false
;
public
static
final
String
orderNumber_FIELDNAME
=
"orderNumber"
;
@FieldDescribe
(
"排序号"
)
@Column
(
name
=
ColumnNamePrefix
+
orderNumber_FIELDNAME
)
...
...
@@ -394,6 +400,17 @@ public class BBSSubjectInfo extends SliceJpaObject {
@CheckPersist
(
allowEmpty
=
true
)
private
List
<
String
>
attachmentList
;
public
static
final
String
editorList_FIELDNAME
=
"editorList"
;
@FieldDescribe
(
"编辑者列表"
)
@PersistentCollection
(
fetch
=
FetchType
.
EAGER
)
@OrderColumn
(
name
=
ORDERCOLUMNCOLUMN
)
@ContainerTable
(
name
=
TABLE
+
ContainerTableNameMiddle
+
editorList_FIELDNAME
,
joinIndex
=
@Index
(
name
=
TABLE
+
IndexNameMiddle
+
editorList_FIELDNAME
+
JoinIndexNameSuffix
))
@ElementColumn
(
length
=
JpaObject
.
length_id
,
name
=
ColumnNamePrefix
+
editorList_FIELDNAME
)
@ElementIndex
(
name
=
TABLE
+
IndexNameMiddle
+
editorList_FIELDNAME
+
ElementIndexNameSuffix
)
@CheckPersist
(
allowEmpty
=
true
)
private
List
<
String
>
editorList
;
public
static
final
String
machineName_FIELDNAME
=
"machineName"
;
@FieldDescribe
(
"设备类别:手机|平板电脑|个人电脑等"
)
@Column
(
length
=
JpaObject
.
length_64B
,
name
=
ColumnNamePrefix
+
machineName_FIELDNAME
)
...
...
@@ -849,4 +866,20 @@ public class BBSSubjectInfo extends SliceJpaObject {
public
void
setNickName
(
String
nickName
)
{
this
.
nickName
=
nickName
;
}
public
Boolean
getAnonymousSubject
()
{
return
anonymousSubject
;
}
public
void
setAnonymousSubject
(
Boolean
anonymousSubject
)
{
this
.
anonymousSubject
=
anonymousSubject
;
}
public
List
<
String
>
getEditorList
()
{
return
editorList
;
}
public
void
setEditorList
(
List
<
String
>
editorList
)
{
this
.
editorList
=
editorList
;
}
}
o2server/x_bbs_core_entity/src/main/java/com/x/bbs/entity/PersistenceProperties.java
浏览文件 @
99efb9d5
...
...
@@ -3,76 +3,80 @@ package com.x.bbs.entity;
import
com.x.base.core.entity.AbstractPersistenceProperties
;
public
final
class
PersistenceProperties
extends
AbstractPersistenceProperties
{
public
static
class
BBSForumInfo
{
public
static
final
String
table
=
"BBS_FORUMINFO"
;
}
public
static
class
BBSSectionInfo
{
public
static
final
String
table
=
"BBS_SECTIONINFO"
;
}
public
static
class
BBSSubjectVoteResult
{
public
static
final
String
table
=
"BBS_SUBJECT_VOTERESULT"
;
}
public
static
class
BBSVoteOption
{
public
static
final
String
table
=
"BBS_VOTEOPTION"
;
}
public
static
class
BBSVoteOptionGroup
{
public
static
final
String
table
=
"BBS_VOTEOPTIONGROUP"
;
}
public
static
class
BBSVoteRecord
{
public
static
final
String
table
=
"BBS_VOTERECORD"
;
}
public
static
class
BBSSubjectInfo
{
public
static
final
String
table
=
"BBS_SUBJECTINFO"
;
}
public
static
class
BBSSubjectPictureBase64
{
public
static
final
String
table
=
"BBS_SUBJECTPICBASE64"
;
}
public
static
class
BBSSubjectContent
{
public
static
final
String
table
=
"BBS_SUBJECTCONTENT"
;
}
public
static
class
BBSReplyInfo
{
public
static
final
String
table
=
"BBS_REPLYINFO"
;
}
public
static
class
BBSOperationRecord
{
public
static
final
String
table
=
"BBS_OPERATIONRECORD"
;
}
public
static
class
BBSUserInfo
{
public
static
final
String
table
=
"BBS_USERINFO"
;
}
public
static
class
BBSPermissionInfo
{
public
static
final
String
table
=
"BBS_PERMISSIONINFO"
;
}
public
static
class
BBSRoleInfo
{
public
static
final
String
table
=
"BBS_ROLEINFO"
;
}
public
static
class
BBSPermissionRole
{
public
static
final
String
table
=
"BBS_PERMISSIONROLE"
;
}
public
static
class
BBSUserRole
{
public
static
final
String
table
=
"BBS_USERROLE"
;
}
public
static
class
BBSSubjectAttachment
{
public
static
final
String
table
=
"BBS_SUBJECTATTACHMENT"
;
}
public
static
class
BBSConfigSetting
{
public
static
final
String
table
=
"BBS_CONFIGSETTING"
;
}
}
\ No newline at end of file
public
static
class
BBSShutup
{
public
static
final
String
table
=
"BBS_SHUTUP"
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录