Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
Overview
Overview
Details
Activity
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
常超
map-parent
Commits
a0ebbc6a
Commit
a0ebbc6a
authored
Apr 15, 2021
by
chentian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加image标准模块
parent
02eb01a4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
132 additions
and
2 deletions
+132
-2
service/image/pom.xml
+16
-0
service/image/src/main/java/com/founder/image/ImageApplication.java
+29
-0
service/image/src/main/java/com/founder/image/controller/ImageController.java
+36
-0
service/image/src/main/java/com/founder/image/service/ImageService.java
+25
-0
service/image/src/main/resources/bootstrap.properties
+17
-0
service/pom.xml
+7
-0
serviceapi/imageapi/src/main/java/com/founder/imageapi/controller/ImageController.java
+2
-2
No files found.
service/image/pom.xml
0 → 100644
View file @
a0ebbc6a
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
service
</artifactId>
<groupId>
com.founder
</groupId>
<version>
0.0.1-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
image
</artifactId>
</project>
\ No newline at end of file
service/image/src/main/java/com/founder/image/ImageApplication.java
0 → 100644
View file @
a0ebbc6a
package
com
.
founder
.
image
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
;
import
org.springframework.boot.web.client.RestTemplateBuilder
;
import
org.springframework.cloud.client.discovery.EnableDiscoveryClient
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.web.client.RestTemplate
;
@SpringBootApplication
(
exclude
=
DataSourceAutoConfiguration
.
class
)
//排除自动配置
@ComponentScan
(
basePackages
=
{
"com.founder"
})
@EnableDiscoveryClient
@EnableFeignClients
public
class
ImageApplication
{
@Autowired
private
RestTemplateBuilder
restTemplateBuilder
;
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ImageApplication
.
class
,
args
);
}
@Bean
public
RestTemplate
restTemplate
(){
return
restTemplateBuilder
.
build
();}
}
service/image/src/main/java/com/founder/image/controller/ImageController.java
0 → 100644
View file @
a0ebbc6a
package
com
.
founder
.
image
.
controller
;
import
com.founder.commonutils.peopleEntity.CameraFaceTask
;
import
com.founder.commonutils.peopleEntity.FaceSearchParam
;
import
com.founder.commonutils.publicEntity.MapRestResult
;
import
com.founder.image.service.ImageService
;
import
io.swagger.annotations.Api
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* Created by Founder on 2021/4/14.
*/
@Api
(
description
=
"第三方图像接口管理-云天励飞"
)
@RestController
@RequestMapping
(
"/image"
)
@Component
public
class
ImageController
{
@Autowired
private
ImageService
imageService
;
// 人脸动态检索接口接口
@PostMapping
(
value
=
"/getFaceImageByUploadImage"
)
public
MapRestResult
getFaceIdsByUploadImage
(
@RequestPart
(
value
=
"files"
,
required
=
true
)
MultipartFile
[]
files
,
FaceSearchParam
faceSearchParam
)
{
MapRestResult
result
=
imageService
.
getFaceImageByUploadImage
(
files
,
faceSearchParam
);
return
result
;
}
// 人像回溯接口
@PostMapping
(
value
=
"/sendTask"
)
public
MapRestResult
sendTask
(
@RequestBody
CameraFaceTask
cameraFaceTask
)
{
MapRestResult
result
=
imageService
.
sendTask
(
cameraFaceTask
);
return
result
;
}
}
service/image/src/main/java/com/founder/image/service/ImageService.java
0 → 100644
View file @
a0ebbc6a
package
com
.
founder
.
image
.
service
;
import
com.founder.commonutils.peopleEntity.CameraFaceTask
;
import
com.founder.commonutils.peopleEntity.FaceSearchParam
;
import
com.founder.commonutils.publicEntity.MapRestResult
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestPart
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* Created by Founder on 2021/4/14.
*/
@FeignClient
(
"imageapi"
)
public
interface
ImageService
{
//人脸动态检索接口
@PostMapping
(
value
=
"/image/getFaceImageByUploadImage"
)
public
MapRestResult
getFaceImageByUploadImage
(
@RequestPart
(
value
=
"files"
,
required
=
true
)
MultipartFile
[]
files
,
@RequestParam
(
value
=
"faceSearchParam"
)
FaceSearchParam
faceSearchParam
);
//人像回溯接口
@PostMapping
(
value
=
"/image/sendTask"
)
public
MapRestResult
sendTask
(
@RequestBody
CameraFaceTask
cameraFaceTask
)
;
}
service/image/src/main/resources/bootstrap.properties
0 → 100644
View file @
a0ebbc6a
#配置中心地址
spring.cloud.nacos.config.server-addr
=
47.92.48.137:8848
spring.cloud.nacos.discovery.server-addr
=
47.92.48.137:8848
spring.profiles.active
=
dev
# 该配置影响统一配置中心中的dataId
spring.application.name
=
image
#dev
spring.cloud.nacos.config.namespace
=
052aa986-5c18-4013-a91a-583dc01aaf8b
#prod
#spring.cloud.nacos.config.namespace=1ffd9d32-3f03-4eb8-bf12-98b1ce397390
#spring.cloud.nacos.config.ext-config[0].data-id=image.properties
# 开启动态刷新配置,否则配置文件修改,工程无法感知
#spring.cloud.nacos.config.ext-config[0].refresh=true
service/pom.xml
View file @
a0ebbc6a
...
...
@@ -13,6 +13,7 @@
<module>
asj
</module>
<module>
publicapi
</module>
<module>
es
</module>
<module>
image
</module>
</modules>
<artifactId>
service
</artifactId>
<dependencies>
...
...
@@ -157,5 +158,10 @@
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-openfeign
</artifactId>
<version>
2.2.0.RELEASE
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
serviceapi/imageapi/src/main/java/com/founder/imageapi/controller/ImageController.java
View file @
a0ebbc6a
...
...
@@ -48,8 +48,8 @@ public class ImageController {
// 人脸动态检索接口接口
@OperLog
(
message
=
"人脸动态检索接口"
,
operation
=
OperationType
.
QUERY
)
@ApiOperation
(
value
=
"人脸动态检索接口"
)
@PostMapping
(
value
=
"/getFaceImageByUploadImage"
,
consumes
=
"multipart/*"
,
headers
=
"content-type=multipart/form-data"
)
public
MapRestResult
getFaceIdsByUploadImage
(
@RequestPar
am
(
value
=
"files"
,
required
=
true
)
MultipartFile
[]
files
,
FaceSearchParam
faceSearchParam
)
{
@PostMapping
(
value
=
"/getFaceImageByUploadImage"
)
public
MapRestResult
getFaceIdsByUploadImage
(
@RequestPar
t
(
value
=
"files"
,
required
=
true
)
MultipartFile
[]
files
,
FaceSearchParam
faceSearchParam
)
{
long
startTime
=
new
Date
().
getTime
();
MapRestResult
result
=
imageService
.
getFaceImageByUploadImage
(
files
,
faceSearchParam
);
long
endTime
=
new
Date
().
getTime
();
...
...
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