Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
zgzx
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
注册表
注册表
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
svn
zgzx
Commits
6be4f1f4
提交
6be4f1f4
authored
11月 20, 2020
作者:
renjiancai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
上级
57b7e436
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
117 行增加
和
4 行删除
+117
-4
BaseRequestPath.java
...src/main/java/com/zrqx/core/constant/BaseRequestPath.java
+2
-0
InputMode.java
...rqx.core/src/main/java/com/zrqx/core/enums/InputMode.java
+100
-0
QueryResourceRelationForm.java
...zrqx/core/form/resource/bg/QueryResourceRelationForm.java
+1
-1
ResourceRelationVo.java
...in/java/com/zrqx/core/vo/resource/ResourceRelationVo.java
+1
-1
DiyTypeController.java
...rqx/resource/bg/controller/diytype/DiyTypeController.java
+11
-0
ResourceLibraryController.java
...controller/resourcelibrary/ResourceLibraryController.java
+2
-2
没有找到文件。
com.zrqx.core/src/main/java/com/zrqx/core/constant/BaseRequestPath.java
浏览文件 @
6be4f1f4
...
...
@@ -52,6 +52,8 @@ public class BaseRequestPath {
public
static
final
String
LIST
=
"/list"
;
/** 获取树形数据 */
public
static
final
String
TREE
=
"/tree"
;
/** 获取树形数据——文章 */
public
static
final
String
ARTICLE_TREE
=
"/article_tree"
;
/** 判断是否存在*/
public
static
final
String
ISEXIST
=
"/isExist"
;
/** 导入 */
...
...
com.zrqx.core/src/main/java/com/zrqx/core/enums/InputMode.java
0 → 100644
浏览文件 @
6be4f1f4
package
com
.
zrqx
.
core
.
enums
;
import
java.util.HashMap
;
import
org.apache.commons.lang3.StringUtils
;
/**
* 资源类型枚举
* @author ycw
* @date
*/
public
enum
InputMode
{
/**EPUB */
EPUB
(
2
,
"EPUB"
),
/** 手动 */
HANDS
(
1
,
"手动"
);
private
final
Integer
code
;
private
final
String
name
;
private
InputMode
(
Integer
code
,
String
name
){
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
InputMode
valueOfCode
(
String
code
)
{
if
(
StringUtils
.
isBlank
(
code
))
{
throw
new
IllegalArgumentException
(
"Library Status "
+
code
+
" is blank"
);
}
for
(
InputMode
mt
:
values
())
{
if
(
mt
.
getCode
().
equals
(
code
))
{
return
mt
;
}
}
throw
new
IllegalArgumentException
(
"Library Status "
+
code
+
" is not exist"
);
}
/**
* 通过ID获取中文名称
* @param code
* @return
*/
public
static
String
getName
(
Integer
code
)
{
if
(
code
==
null
)
{
return
null
;
}
for
(
InputMode
mt
:
values
())
{
if
(
mt
.
getCode
().
equals
(
code
))
{
return
mt
.
getName
();
}
}
return
null
;
}
/**
* 通过中文名称获取ID
* @param code
* @return
*/
public
static
Integer
getCode
(
String
name
)
{
if
(
StringUtils
.
isBlank
(
name
))
{
return
null
;
}
for
(
InputMode
mt
:
values
())
{
if
(
mt
.
getName
().
equals
(
name
))
{
return
mt
.
getCode
();
}
}
return
null
;
}
/**
* 获取所有的枚举,以MAP返回
* @return
*/
public
static
HashMap
<
String
,
String
>
getAllEnumMap
()
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<
String
,
String
>();
for
(
InputMode
mt
:
values
())
{
map
.
put
(
mt
.
getCode
()+
""
,
mt
.
getName
());
}
return
map
;
}
public
Integer
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
com.zrqx.core/src/main/java/com/zrqx/core/form/resource/bg/QueryResourceRelationForm.java
浏览文件 @
6be4f1f4
...
...
@@ -8,6 +8,6 @@ import lombok.Data;
public
class
QueryResourceRelationForm
{
@ApiModelProperty
(
value
=
"当前资源id"
,
required
=
true
)
private
String
id
;
@ApiModelProperty
(
"
资源类型 1杂志、2文章、3PDF
"
)
@ApiModelProperty
(
"
录入方式 1手动、2EPUB
"
)
private
Integer
resourceType
;
}
com.zrqx.core/src/main/java/com/zrqx/core/vo/resource/ResourceRelationVo.java
浏览文件 @
6be4f1f4
...
...
@@ -13,7 +13,7 @@ public class ResourceRelationVo {
private
String
resourceId
;
@ApiModelProperty
(
"资源名"
)
private
String
name
;
@ApiModelProperty
(
"
资源类型1杂志、2文章、3PDF、4图片
"
)
@ApiModelProperty
(
"
录入方式:1:手动 2EPUB
"
)
private
Integer
resourceType
;
@ApiModelProperty
(
"创建时间"
)
private
String
uploadTime
;
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/diytype/DiyTypeController.java
浏览文件 @
6be4f1f4
...
...
@@ -203,6 +203,17 @@ public class DiyTypeController {
tree
(
list
,
voList
);
return
CallBack
.
success
(
voList
);
}
@ApiOperation
(
value
=
"查询文章自定义分类tree"
,
notes
=
"查询列表"
)
@GetMapping
(
value
=
ResourceRequestPath
.
ARTICLE_TREE
)
public
CallBack
<
List
<
DiyTypeVO
>>
article_tree
()
{
Example
example
=
service
.
createExample
();
example
.
createCriteria
().
andEqualTo
(
"status"
,
DiyTypeStatusEnum
.
STATUS_1
.
getCode
()).
andEqualTo
(
"typeName"
,
AllResourceTypeEnum
.
ARTICLE
.
getName
());
PageHelper
.
orderBy
(
"sort"
);
List
<
DiyType
>
list
=
service
.
selectByExample
(
example
);
List
<
DiyTypeVO
>
voList
=
Copy
.
copyList
(
list
,
DiyTypeVO
.
class
,
obj
->
obj
.
getParentId
().
intValue
()
==
0
);
tree
(
list
,
voList
);
return
CallBack
.
success
(
voList
);
}
@ApiOperation
(
value
=
"根据数据类型(一级分类名)查询自定义分类tree"
,
notes
=
"查询列表"
)
@GetMapping
(
value
=
ResourceRequestPath
.
NAME
+
ResourceRequestPath
.
TREE
)
...
...
com.zrqx.resource/src/main/java/com/zrqx/resource/bg/controller/resourcelibrary/ResourceLibraryController.java
浏览文件 @
6be4f1f4
...
...
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.zrqx.core.constant.resource.ResourceRequestPath
;
import
com.zrqx.core.enums.AllResourceTypeEnum
;
import
com.zrqx.core.enums.InputMode
;
import
com.zrqx.core.enums.ResponseCodeEnum
;
import
com.zrqx.core.exception.BaseException
;
import
com.zrqx.core.exception.ParameterValidateException
;
...
...
@@ -208,8 +209,7 @@ public class ResourceLibraryController {
@ApiOperation
(
value
=
"资源类型列表"
,
notes
=
"资源类型"
)
@GetMapping
(
value
=
ResourceRequestPath
.
TYPE
+
ResourceRequestPath
.
LIST
)
public
CallBack
<
Map
<
String
,
String
>>
queryResourceTypeList
(){
Map
<
String
,
String
>
map
=
AllResourceTypeEnum
.
getAllEnumMap
();
//资源类型 1图书、2医家、3文章、4图片、5视频、6音频、7附件
Map
<
String
,
String
>
map
=
InputMode
.
getAllEnumMap
();
map
=
sortList
(
map
);
return
CallBack
.
success
(
map
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论