Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix custom parameter comment data compatibility issue #47

Open
wants to merge 223 commits into
base: release_201903010_v8.1.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
223 commits
Select commit Hold shift + click to select a range
f4c7944
搜索
NiccoloTang Feb 25, 2019
5a95d1c
合并主干
NiccoloTang Mar 10, 2019
2ee9aca
Update README.md
EhsanTang Mar 19, 2019
cff6664
Update README.md
EhsanTang Mar 25, 2019
cdbc79a
Update README.md
EhsanTang Mar 25, 2019
622e65c
Update README.md
EhsanTang Mar 25, 2019
d5a33c5
添加项目环境
NiccoloTang Mar 30, 2019
3ad73ae
debug页面支持环境切换
NiccoloTang Mar 31, 2019
c83b46d
评论分页问题
NiccoloTang Mar 31, 2019
5ec9a62
邮箱切换端口
NiccoloTang Mar 31, 2019
f39c27c
Merge branch 'master' of https://github.com/EhsanTang/ApiManager
NiccoloTang Mar 31, 2019
cd8af0d
icon
NiccoloTang Mar 31, 2019
3155e9a
接口模板bug
NiccoloTang Mar 31, 2019
05c793e
Update README.md
EhsanTang Mar 31, 2019
ebbab37
Update README.md
EhsanTang Mar 31, 2019
7751012
WJY 开发者宣言
NiccoloTang Mar 31, 2019
ed4603f
WJY 开发者宣言
NiccoloTang Mar 31, 2019
27d58ed
Merge branch 'master' of https://github.com/EhsanTang/ApiManager
NiccoloTang Mar 31, 2019
25b8f7e
宣言
NiccoloTang Mar 31, 2019
b7d83d1
宣言
NiccoloTang Mar 31, 2019
01f5179
Update README.md
EhsanTang Apr 1, 2019
14adbaf
Merge remote-tracking branch 'remotes/github/master' into feature_201…
NiccoloTang Apr 14, 2019
092a278
Query、Page 优化
NiccoloTang Apr 14, 2019
8f4e11f
转义符替换
NiccoloTang Apr 14, 2019
56065eb
删除修改排序的代码
NiccoloTang Apr 14, 2019
53ab8c4
Update README.md
EhsanTang Apr 19, 2019
23d9efe
后端搜索,能正常搜索到数据:跳转地址、分页、按项目搜索、搜索类型等需要调试
NiccoloTang Apr 30, 2019
ef9b1a0
邮件发送bug
NiccoloTang May 12, 2019
dac08a2
邮箱发送超时bug
NiccoloTang May 12, 2019
eac4597
搜索漏提交的代码
NiccoloTang May 12, 2019
2b74906
邮箱发送超时bug
NiccoloTang May 12, 2019
5f3135f
邮件发送无响应bug修改
NiccoloTang May 12, 2019
5ee8525
资源上传,项目为空的bug
NiccoloTang May 20, 2019
a7450be
资源更新失败bug
NiccoloTang May 20, 2019
f610165
添加content-type 备注
NiccoloTang Jun 2, 2019
95c5b76
articleDto
NiccoloTang Jun 2, 2019
2c058dc
添加articleDto
NiccoloTang Jun 2, 2019
98ea375
搜索权限校验、搜索不支持url搜索问题等待排查
NiccoloTang Jun 2, 2019
2791424
搜索调试
NiccoloTang Jun 2, 2019
d0b71d3
Merge remote-tracking branch 'remotes/github/master' into feature_201…
NiccoloTang Jun 2, 2019
bea07d7
缺陷暂时不支持搜索
NiccoloTang Jun 9, 2019
bfa2667
url支持分词
NiccoloTang Jun 9, 2019
e96100b
搜索地址调试完成,前端文档详情、后端文档详情待优化
NiccoloTang Jun 15, 2019
7ec796c
后端分页bug
NiccoloTang Jun 16, 2019
53ddb02
升级版本号
NiccoloTang Jun 16, 2019
4e25b81
TODO 代理、调试模式文案&插件
NiccoloTang Jun 17, 2019
3591b6b
缺陷分页bug
NiccoloTang Jun 17, 2019
92a114c
插件调试-兼容就版
NiccoloTang Jun 30, 2019
f78e318
Merge remote-tracking branch 'remotes/github/master' into feature_201…
NiccoloTang Jun 30, 2019
2d5cf84
修改版本号
NiccoloTang Jun 30, 2019
d170ea7
修改版本号
NiccoloTang Jun 30, 2019
1976a4c
索引创建调整
NiccoloTang Jun 30, 2019
538eda4
缺陷跳转失败bug
NiccoloTang Jun 30, 2019
fac6c6e
缺陷跳转失败bug
NiccoloTang Jun 30, 2019
8d42cb0
兼容旧版调试插件
NiccoloTang Jun 30, 2019
06f236f
Revert "兼容旧版调试插件"
NiccoloTang Jun 30, 2019
0ea577c
索引创建bug
NiccoloTang Jun 30, 2019
72e4e5d
全量重建索引时才输出提示
NiccoloTang Jun 30, 2019
cca7389
前端查询私有项目报错bug
NiccoloTang Jun 30, 2019
91d6a69
前端页面debug跳转bug
NiccoloTang Jul 7, 2019
a7de1e2
修改 DICTIONARY ->TABLE
NiccoloTang Jul 11, 2019
13673a9
Revert: 搜索调试
NiccoloTang Jul 11, 2019
8a3f91a
首页图片
NiccoloTang Oct 19, 2019
5767185
添加透明图片
NiccoloTang Oct 19, 2019
a8508d1
首页优化
NiccoloTang Oct 19, 2019
5aedfaf
首页优化
NiccoloTang Oct 19, 2019
b9d9f9c
首页优化
NiccoloTang Oct 19, 2019
bf4304f
百度统计
NiccoloTang Oct 19, 2019
0001b1b
百度统计
NiccoloTang Oct 19, 2019
62d7bc9
百度统计
NiccoloTang Oct 19, 2019
99d3a8e
首页图片访问阿里云
NiccoloTang Oct 19, 2019
0cfbdc6
首页图片访问阿里云
NiccoloTang Oct 19, 2019
ae7ff15
图片上传静态化bug
NiccoloTang Oct 19, 2019
b3bd86b
免登陆
NiccoloTang Oct 19, 2019
27891c8
添加透明背景
NiccoloTang Oct 26, 2019
d6840f3
默认不开启阿里云图片
NiccoloTang Oct 26, 2019
50960f1
V8.1.5正式发布
NiccoloTang Oct 26, 2019
529fb41
更新数据库
NiccoloTang Oct 26, 2019
a82e1b5
更新数据库
NiccoloTang Oct 26, 2019
80b87f4
添加插件首页
NiccoloTang Oct 27, 2019
dfb0b6c
首页菜单换行bug,插件主页优化
NiccoloTang Nov 3, 2019
bdea1bb
支持插件查询模块为空的数据
NiccoloTang Nov 3, 2019
3191ebe
登陆超时
NiccoloTang Nov 3, 2019
561b19e
登陆超时
NiccoloTang Nov 3, 2019
c29c83d
登陆超时
NiccoloTang Nov 3, 2019
7c1e480
post
NiccoloTang Nov 3, 2019
c877d94
模拟慢查询接口
NiccoloTang Nov 3, 2019
adea089
Update README.md
EhsanTang Nov 9, 2019
0bf0324
更新qq
NiccoloTang Nov 9, 2019
62dbf7a
content-type用户误解问题
NiccoloTang Nov 16, 2019
f599439
Merge branch 'master' of https://github.com/EhsanTang/ApiManager
NiccoloTang Nov 16, 2019
79ccf32
content-type用户误解问题
NiccoloTang Nov 16, 2019
7f10309
Revert "content-type用户误解问题"
NiccoloTang Nov 16, 2019
5732271
删除广告提示
NiccoloTang Nov 16, 2019
6c600f8
删除广告提示
NiccoloTang Nov 16, 2019
e4fb1ac
删除广告提示
NiccoloTang Nov 16, 2019
8750b2d
登陆超时问题
NiccoloTang Nov 16, 2019
b6f6a39
帮组 -> 帮助
NiccoloTang Nov 16, 2019
c4620e8
帮组 -> 帮助
NiccoloTang Nov 16, 2019
bd92c22
帮组 -> 帮助
NiccoloTang Nov 16, 2019
ddb4906
插件bug
NiccoloTang Nov 17, 2019
92aa728
插件bug
NiccoloTang Nov 17, 2019
cfb91a9
插件bug
NiccoloTang Nov 17, 2019
b3e93a7
插件bug
NiccoloTang Nov 17, 2019
0a3871a
插件bug
NiccoloTang Nov 17, 2019
ee53bb1
添加索引
NiccoloTang Dec 4, 2019
5c3affb
空格呆着word下载失败bug
NiccoloTang Jan 3, 2020
13e839e
新增字段version
NiccoloTang Feb 9, 2020
dd02944
使用interface
NiccoloTang Feb 9, 2020
ab8c71b
使用interface
NiccoloTang Feb 9, 2020
f15cc0d
删除模块需要先删除接口
NiccoloTang Feb 9, 2020
65280c8
系统生成的ID携带用户MD5
NiccoloTang Feb 9, 2020
02c87db
项目前缀问题
NiccoloTang Feb 9, 2020
8af3416
项目前缀问题
NiccoloTang Feb 9, 2020
fe380bb
底层支持多用户切换
NiccoloTang Feb 9, 2020
d134af1
底层支持多用户切换
NiccoloTang Feb 9, 2020
e2fe0c1
底层支持多用户切换
NiccoloTang Feb 9, 2020
580fb36
debug融合interface
NiccoloTang Feb 9, 2020
d5fe587
debug数据升级
NiccoloTang Feb 9, 2020
40b81b9
debug数据升级
NiccoloTang Feb 9, 2020
8ab3459
添加uniKey
NiccoloTang Feb 16, 2020
b5ac363
添加uniKey
NiccoloTang Feb 16, 2020
d99c14d
添加uniKey
NiccoloTang Feb 16, 2020
58ff95a
添加uniKey
NiccoloTang Feb 16, 2020
274d6ac
添加uniKey
NiccoloTang Feb 16, 2020
cfc1c82
添加uniKey
NiccoloTang Feb 16, 2020
c04deca
添加uniKey
NiccoloTang Feb 16, 2020
bc99e20
添加uniKey
NiccoloTang Feb 16, 2020
17db36f
get 参数存储bug
NiccoloTang Feb 16, 2020
d6552e1
get 参数存储bug
NiccoloTang Feb 16, 2020
7596cb1
get 参数存储bug
NiccoloTang Feb 16, 2020
ca9998b
get 参数存储bug
NiccoloTang Feb 16, 2020
2d19768
Update README.md
EhsanTang Feb 16, 2020
76e3a39
Bump commons-fileupload from 1.1.1 to 1.3.3 in /api
dependabot[bot] Feb 16, 2020
68382e3
Bump pdfbox from 2.0.2 to 2.0.15 in /api
dependabot[bot] Feb 16, 2020
f35b020
Bump fastjson from 1.2.7 to 1.2.25 in /api
dependabot[bot] Feb 16, 2020
8f080ae
Bump spring_version from 4.2.0.RELEASE to 5.2.3.RELEASE in /api
dependabot[bot] Feb 16, 2020
62b5a3a
首页添加url
NiccoloTang Feb 29, 2020
fddf1c6
首页添加url
NiccoloTang Feb 29, 2020
a32fa99
项目列表查询
NiccoloTang Feb 29, 2020
365b546
项目查询有哈市
NiccoloTang Feb 29, 2020
9577675
项目成员数据修复
NiccoloTang Feb 29, 2020
9359c78
项目成员数据修复
NiccoloTang Mar 1, 2020
d7ae939
接口过长截断
NiccoloTang Mar 1, 2020
3d767d9
接口过长截断:需要测试
NiccoloTang Mar 1, 2020
8b1dac2
接口过长截断:需要测试
NiccoloTang Mar 1, 2020
5b74d79
接口过长截断:需要测试
NiccoloTang Mar 1, 2020
769ee4f
Revert: 项目列表查询
NiccoloTang Mar 1, 2020
c361745
接口过长截断:需要测试
NiccoloTang Mar 1, 2020
c59dc27
接口过长截断:需要测试
NiccoloTang Mar 1, 2020
b73dd8a
接口过长截断:需要测试
NiccoloTang Mar 1, 2020
bc76b2d
debug数据迁移bug
NiccoloTang Mar 1, 2020
4dbb739
模块重复bug
NiccoloTang Mar 1, 2020
ae985b2
bug修改
NiccoloTang Mar 1, 2020
62faaa8
模块为空的bug
NiccoloTang Mar 1, 2020
c06c9df
接口拷贝bug
NiccoloTang Mar 1, 2020
7848766
uniKey 模块
NiccoloTang Mar 1, 2020
b318f43
Merge branch 'master' of https://github.com/EhsanTang/ApiManager
NiccoloTang Mar 1, 2020
b0afb63
调试插件放宽至200
NiccoloTang Mar 1, 2020
c30c9a3
数据大小调整,优化时间
NiccoloTang Mar 1, 2020
cd82607
js上传
NiccoloTang Mar 1, 2020
7639fef
Bump jackson-databind from 2.4.1 to 2.9.10.3 in /api
dependabot[bot] Mar 4, 2020
20e8d4d
js\css加速
NiccoloTang Mar 6, 2020
44e6e3a
js\css加速
NiccoloTang Mar 6, 2020
e95c7bb
批量查询
NiccoloTang Mar 6, 2020
85adbb3
批量查询
NiccoloTang Mar 7, 2020
fcb3592
接口返回真是的接口、模块、项目ID
NiccoloTang Mar 7, 2020
a30c822
插件广告
NiccoloTang Mar 7, 2020
4f83812
插件广告
NiccoloTang Mar 7, 2020
2fe5709
插件广告
NiccoloTang Mar 7, 2020
997471f
插件广告
NiccoloTang Mar 7, 2020
5ae9202
插件广告
NiccoloTang Mar 7, 2020
6160791
富文本编辑器问题
NiccoloTang Mar 10, 2020
4f143a8
Merge pull request #52 from EhsanTang/dependabot/maven/api/com.alibab…
EhsanTang Mar 14, 2020
fc6f135
Merge pull request #53 from EhsanTang/dependabot/maven/api/spring_ver…
EhsanTang Mar 14, 2020
861bbbd
Merge pull request #54 from EhsanTang/dependabot/maven/api/com.faster…
EhsanTang Mar 14, 2020
f243d0d
Merge pull request #51 from EhsanTang/dependabot/maven/api/commons-fi…
EhsanTang Mar 14, 2020
5735ad9
Merge pull request #50 from EhsanTang/dependabot/maven/api/org.apache…
EhsanTang Mar 14, 2020
d721808
用户新增attr字段
NiccoloTang Mar 14, 2020
2380b5e
用户打标
NiccoloTang Mar 14, 2020
8a520a5
用户打标
NiccoloTang Mar 14, 2020
686a5d7
用户打标
NiccoloTang Mar 14, 2020
53b6d1a
用户打标
NiccoloTang Mar 14, 2020
8b2e516
异常打印新增url
NiccoloTang Mar 15, 2020
54fd2bb
异常打印新增url
NiccoloTang Mar 15, 2020
ba80a9a
异常打印新增url
NiccoloTang Mar 15, 2020
35abef7
异常打印新增url
NiccoloTang Mar 15, 2020
b884255
批量查询模块
NiccoloTang Mar 15, 2020
e8449e6
批量查询模块
NiccoloTang Mar 15, 2020
24aa8f6
用户注册不为空校验
NiccoloTang Mar 15, 2020
9260b37
DTO adapter异常
NiccoloTang Mar 15, 2020
86a267b
优化项目列表查询速度
NiccoloTang Mar 15, 2020
e25b124
优化项目查询速度
NiccoloTang Mar 15, 2020
0fa7bba
异常处理,单个异常不影响全部
NiccoloTang Mar 15, 2020
7c7a0c3
图片上传非根目录解决
NiccoloTang Mar 21, 2020
0921417
插件项目共享同步数据bug
NiccoloTang Apr 6, 2020
ef5fdfb
相对路径部署问题
NiccoloTang Apr 11, 2020
590ae8e
相对路径部署问题
NiccoloTang Apr 11, 2020
7ae861e
相对路径部署问题
NiccoloTang Apr 11, 2020
181effc
用户登录类型
NiccoloTang Apr 12, 2020
f3b91e8
用户登录类型
NiccoloTang Apr 12, 2020
a64a018
授权登陆,支持多域名
NiccoloTang Apr 19, 2020
66ca697
广告
NiccoloTang Apr 19, 2020
9af9bc1
github登陆
NiccoloTang Apr 19, 2020
4b970c4
授权登陆异常提示
NiccoloTang Apr 19, 2020
5bc3ca1
样式
NiccoloTang Apr 19, 2020
16a6163
首次登陆不需要验证码
NiccoloTang Apr 19, 2020
0055832
删除项目bug
NiccoloTang Jun 6, 2020
a985d00
修改邮件空指针bug
NiccoloTang Jun 6, 2020
d3269a1
mock跨域问题
NiccoloTang Jun 14, 2020
1eee417
图片上传失败的问题
NiccoloTang Jun 14, 2020
856600a
图片上传失败的问题
NiccoloTang Jun 14, 2020
91f0efc
图片上传失败的问题
NiccoloTang Jun 14, 2020
e0f3143
图片上传失败的问题
NiccoloTang Jun 14, 2020
0e1a18c
vip 插件接口数量控制
NiccoloTang Jul 19, 2020
ec2fdaa
记录用户登录时间
NiccoloTang Sep 2, 2020
c2f939c
记录用户登录时间
NiccoloTang Sep 2, 2020
1011909
记录用户登录时间
NiccoloTang Sep 2, 2020
6958a59
延长第三方登陆时间
NiccoloTang Sep 2, 2020
049a99b
延长第三方登陆时间
NiccoloTang Sep 2, 2020
939976f
延长第三方登陆时间
NiccoloTang Sep 2, 2020
01dacd3
延长第三方登陆时间
NiccoloTang Aug 12, 2021
7daad08
延长第三方登陆时间
NiccoloTang Aug 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# 域名临时切换为 http://123.56.41.127/ !!!!
[官网在线使用地址 http://123.56.41.127/](http://123.56.41.127/)
[官网在线使用地址 http://api.crap.cn](http://api.crap.cn)

# CrapApi
[官网在线使用地址crap.cn](http://crap.cn)
Expand All @@ -24,11 +23,16 @@ CrapApi是完全免费开源项目,源码在GitHub、码云上可以获取,
```
```
当然项目发展离不开你的支持,如果觉得项目确实不错,可以在码云上捐赠!
付费用户群:263949884,捐助100元及以上可加入付费用户群,可享有需求优先解决、协助部署、二次开发帮助,官网账号升级(添加赞助标识等
付费用户群:263949884,捐助100元及以上可加入付费用户群,可享有需求优先解决、协助部署、二次开发帮助)
所有捐赠将用于阿里云服务器采购、CDN、RDS数据库、带宽升级等网站性能优化!
```
<img width = "100%" height="200" src="http://api.crap.cn/resources/upload/images/2018-11/30125847sFDcfL.CAV.5gLaDc.1.png?ddd"/>

[CrapApi用户]
```
阿里巴巴
拉勾
```

[CrapApi能做什么?]
```
Expand All @@ -53,7 +57,7 @@ Windows系统:2G内存以上,jdk7及以上,Tomcat7及以上,mysql5.6及
[演示&帮助文档&部署文档]
```
帮助文档地址:http://api.crap.cn
用户交流群:254450938[1群] 535449678[2群]
用户交流群:959969432[3群]
```

[主要技术]
Expand All @@ -73,18 +77,6 @@ API接口管理系统,API接口管理,在线API接口管理,API接口调试工

<img width = "100" height = "100" align=left src="http://api.crap.cn/resources/images/wepay.jpg"/>

```
各位好,我是Nico,一名年纪轻轻就秃了头的程序猿,
好人有好报,求各位打赏,帮我集资买瓶生发水吧!
打赏10元,你的程序从此告别bug;打赏50元,你的头发茂盛的想亚马逊丛林;
打赏100元,加入"穿着特步相亲也能轻松俘获女神的VIP QQ群(263949884),
Nico将竭诚为你提供协助部署、升级帮助、问题解答等各种羞羞的服务...
或者
如果你宁愿情人节独自在办公室加班修bug,也不给我买生发水
至少帮我在 Gitee 或 GitHub 上点个赞好不好?
:)
```


最新消息:</br>
[2016 年9月获得码云推荐]</br>
Expand Down
1 change: 1 addition & 0 deletions api/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
.project
.settings
.classpath
**/*.DS_Store
104 changes: 87 additions & 17 deletions api/2019-02-17.V8.1.2.sql → api/2019-10-26.V8.1.5.sql

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- 编译时的编码 -->
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<spring_version>4.2.0.RELEASE</spring_version>
<spring_version>5.2.3.RELEASE</spring_version>
<mybatis.version>3.4.6</mybatis.version>
<mybatis-generator-core.version>1.3.7</mybatis-generator-core.version>
<mybatis-spring.version>1.3.2</mybatis-spring.version>
Expand All @@ -24,7 +24,7 @@
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<!-- 25.1-android 兼容1.7 25.1-jre 1.8及以上-->
<version>25.1-android</version>
<version>27.1-jre</version>
</dependency>

<!-- aliyun oss -->
Expand Down Expand Up @@ -110,12 +110,12 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.4.1</version>
<version>2.9.10.3</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.1.1</version>
<version>1.3.3</version>
</dependency>
<!-- Spring -->
<dependency>
Expand Down Expand Up @@ -236,7 +236,7 @@
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.2</version>
<version>2.0.15</version>
</dependency>
<!-- End:get text from pdf -->
<!-- get text from doc -->
Expand Down Expand Up @@ -279,7 +279,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.7</version>
<version>1.2.25</version>
</dependency>
<!-- 定时认为quartz
<dependency>
Expand Down Expand Up @@ -335,6 +335,12 @@
<version>2.3.28</version>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.6</version>
<scope>provided</scope>
</dependency>
</dependencies>

<build>
Expand Down
44 changes: 44 additions & 0 deletions api/src/main/java/cn/crap/ability/ProjectAbility.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package cn.crap.ability;

import cn.crap.adapter.ProjectUserAdapter;
import cn.crap.dto.LoginInfoDto;
import cn.crap.enu.ProjectUserType;
import cn.crap.model.ProjectPO;
import cn.crap.model.ProjectUserPO;
import cn.crap.service.ProjectService;
import cn.crap.service.ProjectUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
* 项目能力
* @author Ehsan
* @date 2020/2/29 23:11
*/
@Service
public class ProjectAbility {

@Autowired
private ProjectService projectService;

@Autowired
private ProjectUserService projectUserService;

/**
* 添加项目:需要将自己设置为项目用户,查询的时候可以不需要关联查询
* @param project
* @return
* @throws Exception
*/
public boolean addProject(ProjectPO project, LoginInfoDto user) throws Exception{
if (projectService.insert(project)) {
ProjectUserPO projectUser = ProjectUserAdapter.getInitProjectUserPO(project, user);
projectUser.setType(ProjectUserType.CREATOR.getByteType());
projectUser.setSequence(project.getSequence());
projectUser.setProjectName(project.getName());
return projectUserService.insert(projectUser);
}
return false;
}

}
66 changes: 24 additions & 42 deletions api/src/main/java/cn/crap/adapter/ArticleAdapter.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
package cn.crap.adapter;

import cn.crap.dto.ArticleDto;
import cn.crap.dto.ArticleDTO;
import cn.crap.dto.SearchDto;
import cn.crap.enu.ArticleStatus;
import cn.crap.enu.ArticleType;
import cn.crap.enu.LuceneSearchType;
import cn.crap.enu.ProjectType;
import cn.crap.framework.SpringContextHolder;
import cn.crap.enu.*;
import cn.crap.model.Article;
import cn.crap.model.ArticleWithBLOBs;
import cn.crap.model.Module;
import cn.crap.model.Project;
import cn.crap.service.tool.ModuleCache;
import cn.crap.service.tool.ProjectCache;
import cn.crap.model.ModulePO;
import cn.crap.model.ProjectPO;
import cn.crap.utils.*;

import java.util.ArrayList;
Expand All @@ -25,12 +19,12 @@
* Avoid exposing sensitive data and modifying data that is not allowed to be modified
*/
public class ArticleAdapter {
public static ArticleDto getDto(Article model, Module module, Project project){
public static ArticleDTO getDto(Article model, ModulePO module, ProjectPO project){
if (model == null){
return null;
}

ArticleDto dto = new ArticleDto();
ArticleDTO dto = new ArticleDTO();
BeanUtil.copyProperties(model, dto);

dto.setCanCommentName(new Byte("1").equals(model.getCanComment()) ? "是" : "否");
Expand All @@ -49,15 +43,15 @@ public static ArticleDto getDto(Article model, Module module, Project project){
return dto;
}

public static ArticleDto getDtoWithBLOBs(ArticleWithBLOBs model, Module module, Project project) {
public static ArticleDTO getDtoWithBLOBs(ArticleWithBLOBs model, ModulePO module, ProjectPO project) {
if (model == null) {
return null;
}
ArticleDto dto = getDto(model, module, project);
ArticleDTO dto = getDto(model, module, project);
dto.setContent(model.getContent());
dto.setMarkdown(model.getMarkdown());
dto.setUseMarkdown(false);
if (AttributeUtils.getAttributeMap(model.getAttributes()).containsKey(IAttributeConst.MARK_DOWN)){
if (AttributeUtils.containAttr(model.getAttributes(), AttributeEnum.MARK_DOWN)){
dto.setUseMarkdown(true);
}
dto.setStatusName(ArticleStatus.getNameByValue(model.getStatus()));
Expand All @@ -69,7 +63,7 @@ public static ArticleDto getDtoWithBLOBs(ArticleWithBLOBs model, Module module,
* @param dto
* @return
*/
public static ArticleWithBLOBs getModel(ArticleDto dto){
public static ArticleWithBLOBs getModel(ArticleDTO dto){
if (dto == null){
return null;
}
Expand All @@ -80,22 +74,22 @@ public static ArticleWithBLOBs getModel(ArticleDto dto){
return model;
}

public static List<ArticleDto> getDtoWithBLOBs(List<ArticleWithBLOBs> models, Module module){
public static List<ArticleDTO> getDtoWithBLOBs(List<ArticleWithBLOBs> models, ModulePO module){
if (models == null){
return new ArrayList<>();
}
List<ArticleDto> dtos = new ArrayList<>();
List<ArticleDTO> dtos = new ArrayList<>();
for (ArticleWithBLOBs model : models){
dtos.add(getDtoWithBLOBs(model, module, null));
}
return dtos;
}

public static List<ArticleDto> getDto(List<Article> models, Module module, Project project){
public static List<ArticleDTO> getDto(List<Article> models, ModulePO module, ProjectPO project){
if (models == null){
return new ArrayList<>();
}
List<ArticleDto> dtos = new ArrayList<>();
List<ArticleDTO> dtos = new ArrayList<>();
for (Article model : models){
dtos.add(getDto(model, module, project));
}
Expand All @@ -118,31 +112,19 @@ public static List<SearchDto> getSearchDto(List<ArticleWithBLOBs> models){
}

public static SearchDto getSearchDto(ArticleWithBLOBs model){
ModuleCache moduleCache = SpringContextHolder.getBean("moduleCache", ModuleCache.class);
ProjectCache projectCache = SpringContextHolder.getBean("projectCache", ProjectCache.class);
Project project = projectCache.get(model.getProjectId());
SearchDto dto = new SearchDto();
String modelId = model.getId();
dto.setId(modelId);
dto.setCreateTime(model.getCreateTime());
dto.setContent(MyString.getStr(model.getBrief()) + MyString.getStr(model.getContent()));
dto.setModuleName(moduleCache.get(modelId).getName());
dto.setTitle(model.getName());
dto.setType("Article");
String articleUrl = "#/article/detail?projectId=%s&modelId=%s&type=%s&id=%s";
dto.setUrl(String.format(articleUrl, model.getProjectId(), model.getModuleId(), model.getType(), modelId));
dto.setVersion("");
dto.setProjectId(model.getProjectId());

dto.setNeedCreateIndex(false);
if(LuceneSearchType.Yes.getByteValue().equals(project.getLuceneSearch())){
dto.setNeedCreateIndex(true);
}
ProjectPO project = ServiceFactory.getInstance().getProjectCache().get(model.getProjectId());
boolean open = false;
if(LuceneSearchType.Yes.getByteValue().equals(project.getLuceneSearch())){
open = true;
}

// 私有项目不能建立索引
if(project.getType() == ProjectType.PRIVATE.getType()){
dto.setNeedCreateIndex(false);
open = false;
}
return dto;

return new SearchDto(model.getProjectId(), model.getModuleId(), model.getId(), model.getName(),
model.getType().equals(ArticleType.ARTICLE.name()) ? TableId.ARTICLE : TableId.DICTIONARY,
MyString.getStr(model.getBrief()) + MyString.getStr(model.getContent()), null, open, model.getCreateTime());
}
}
46 changes: 38 additions & 8 deletions api/src/main/java/cn/crap/adapter/BugAdapter.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package cn.crap.adapter;

import cn.crap.dto.BugDTO;
import cn.crap.enu.BugPriority;
import cn.crap.enu.BugSeverity;
import cn.crap.enu.BugStatus;
import cn.crap.enu.BugType;
import cn.crap.dto.SearchDto;
import cn.crap.enu.*;
import cn.crap.model.BugPO;
import cn.crap.model.Module;
import cn.crap.model.Project;
import cn.crap.model.ModulePO;
import cn.crap.model.ProjectPO;
import cn.crap.utils.BeanUtil;
import cn.crap.utils.DateFormartUtil;
import cn.crap.utils.MyString;
import cn.crap.utils.ServiceFactory;
import org.springframework.util.Assert;

import java.util.ArrayList;
Expand All @@ -24,7 +23,7 @@
* Avoid exposing sensitive data and modifying data that is not allowed to be modified
*/
public class BugAdapter {
public static BugDTO getDto(BugPO model, Module module, Project project){
public static BugDTO getDto(BugPO model, ModulePO module, ProjectPO project){
if (model == null){
return null;
}
Expand Down Expand Up @@ -57,7 +56,7 @@ public static BugPO getPO(BugDTO bugDTO){
}


public static BugDTO getDTO(Project project, Module module){
public static BugDTO getDTO(ProjectPO project, ModulePO module){
Assert.notNull(project, "project 不能为空");
BugPO bugPO = new BugPO();
bugPO.setType(BugType.FUNCTION.getByteValue());
Expand Down Expand Up @@ -94,4 +93,35 @@ public static List<BugDTO> getDto(List<BugPO> models){
}
return dtos;
}

public static List<SearchDto> getSearchDto(List<BugPO> models){
if (models == null){
return new ArrayList<>();
}
List<SearchDto> dtos = new ArrayList<>();
for (BugPO model : models){
try {
dtos.add(getSearchDto(model));
}catch (Exception e){
e.printStackTrace();
}
}
return dtos;
}

public static SearchDto getSearchDto(BugPO model){
ProjectPO project = ServiceFactory.getInstance().getProjectCache().get(model.getProjectId());
boolean open = false;
if(LuceneSearchType.Yes.getByteValue().equals(project.getLuceneSearch())){
open = true;
}

// 私有项目不能建立索引
if(project.getType() == ProjectType.PRIVATE.getType()){
open = false;
}

return new SearchDto(model.getProjectId(), model.getModuleId(), model.getId(), model.getName(), TableId.BUG,
MyString.getStr(model.getContent()), null, open, model.getCreateTime());
}
}
Loading