Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周健威
rs-cloud-platform
Commits
859fdc8a
Commit
859fdc8a
authored
Dec 07, 2020
by
unset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善接口信息
parent
0475e756
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
5 deletions
+54
-5
ImageImgStorage.java
...om/upyuns/platform/rs/website/entity/ImageImgStorage.java
+3
-0
ImageImgStorageBiz.java
...om/upyuns/platform/rs/website/biz/ImageImgStorageBiz.java
+11
-5
ImageInfoRelationBiz.java
.../upyuns/platform/rs/website/biz/ImageInfoRelationBiz.java
+40
-0
No files found.
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/entity/ImageImgStorage.java
View file @
859fdc8a
...
...
@@ -121,4 +121,7 @@ public class ImageImgStorage implements Serializable {
@Transient
List
<
ImageInfoRelation
>
imageInfoRelationList
;
//相似图像
@Transient
List
<
ImageInfoRelation
>
similarImageList
;
}
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/ImageImgStorageBiz.java
View file @
859fdc8a
...
...
@@ -47,9 +47,10 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
imageImgStorage
.
getImageInfoRelationList
().
parallelStream
().
forEach
(
imageInfoRelation
->
{
imageInfoRelation
.
setType
(
1
);
imageInfoRelation
.
setRelationId
(
imageImgStorage
.
getId
());
imageInfoRelationBiz
.
insertSelectiveR
e
(
imageInfoRelation
);
imageInfoRelationBiz
.
addUpdat
e
(
imageInfoRelation
);
});
}
else
{
imageInfoRelationBiz
.
deleteAll
(
imageImgStorage
.
getId
());
}
}
else
{
ImageImgStorage
old
=
selectById
(
imageImgStorage
.
getId
());
...
...
@@ -63,9 +64,11 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
old
.
getImageInfoRelationList
().
parallelStream
().
forEach
(
imageInfoRelation
->
{
imageInfoRelation
.
setType
(
1
);
imageInfoRelation
.
setRelationId
(
old
.
getId
());
imageInfoRelationBiz
.
insertSelectiveR
e
(
imageInfoRelation
);
imageInfoRelationBiz
.
addUpdat
e
(
imageInfoRelation
);
});
}
else
{
imageInfoRelationBiz
.
deleteAll
(
old
.
getId
());
}
}
return
ObjectRestResponse
.
succ
();
...
...
@@ -116,10 +119,13 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
if
(
imageImgStorage
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
NOTEXIST_CODE
));
}
List
<
ImageInfoRelation
>
imageInfoRelationList
=
imageInfoRelationBiz
.
getAllImageRelation
(
i
mageImgStorage
.
getId
()
,
1
);
List
<
ImageInfoRelation
>
imageInfoRelationList
=
imageInfoRelationBiz
.
getAllImageRelation
(
i
d
,
1
);
if
(
imageInfoRelationList
!=
null
)
{
imageImgStorage
.
setImageInfoRelationList
(
imageInfoRelationList
);
}
return
ObjectRestResponse
.
succ
(
imageInfoRelationList
);
if
(
StringUtils
.
isNotBlank
(
imageImgStorage
.
getRelatedIds
()))
{
imageImgStorage
.
setSimilarImageList
(
imageInfoRelationBiz
.
getAllByIds
(
imageImgStorage
.
getRelatedIds
()));
}
return
ObjectRestResponse
.
succ
(
imageImgStorage
);
}
}
\ No newline at end of file
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/ImageInfoRelationBiz.java
View file @
859fdc8a
...
...
@@ -4,6 +4,8 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.upyuns.platform.rs.website.dto.ImageInfoRelationDto
;
import
com.upyuns.platform.rs.website.entity.ImageImgStorage
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
com.upyuns.platform.rs.website.entity.ImageInfoRelation
;
...
...
@@ -12,6 +14,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
/**
...
...
@@ -24,6 +27,25 @@ import java.util.List;
@Service
public
class
ImageInfoRelationBiz
extends
BaseBiz
<
ImageInfoRelationMapper
,
ImageInfoRelation
>
{
public
void
addUpdate
(
ImageInfoRelation
imageInfoRelation
)
{
if
(
imageInfoRelation
.
getId
()
!=
null
)
{
updateSelectiveByIdRe
(
imageInfoRelation
);
}
else
{
insertSelectiveRe
(
imageInfoRelation
);
}
}
public
void
deleteAll
(
Integer
relationId
)
{
List
<
ImageInfoRelation
>
list
=
selectList
(
new
ImageInfoRelation
(){{
setRelationId
(
relationId
);
setType
(
1
);}});
if
(
list
!=
null
)
{
list
.
parallelStream
().
forEach
(
imageInfoRelation
->
{
delete
(
imageInfoRelation
);
});
}
}
/**
* 查询影像图框图片类型
* @param relationId
...
...
@@ -68,4 +90,22 @@ public class ImageInfoRelationBiz extends BaseBiz<ImageInfoRelationMapper,ImageI
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
/**
* 根据Id查询所有相似图片
* @param relationIds
* @return
*/
public
List
<
ImageInfoRelation
>
getAllByIds
(
String
relationIds
)
{
if
(
StringUtils
.
isBlank
(
relationIds
))
{
return
new
ArrayList
<>();
}
String
[]
arr
=
relationIds
.
split
(
","
);
if
(
arr
==
null
)
{
return
new
ArrayList
<>();
}
Example
example
=
new
Example
(
ImageInfoRelation
.
class
);
example
.
createCriteria
().
andEqualTo
(
"id"
,
Arrays
.
asList
(
arr
));
return
mapper
.
selectByExample
(
example
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment