Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
huhu-partner
Project
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guanchen
huhu-partner
Commits
092fb6aa
Commit
092fb6aa
authored
Jun 27, 2019
by
houseme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新配置信息11
parent
e55710df
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
87 deletions
+45
-87
pom.xml
pom.xml
+43
-83
PartnerController.java
...com/lanren/huhu/partner/controller/PartnerController.java
+2
-2
ValidationMessages.properties
src/main/resources/ValidationMessages.properties
+0
-2
No files found.
pom.xml
View file @
092fb6aa
...
...
@@ -21,8 +21,7 @@
<java.version>
1.8
</java.version>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<mainClass>
com.lanren.huhu.partner.PartnerApplication
</mainClass>
<todir>
./data/release/${profiles.active}/
</todir>
<start-class>
com.lanren.huhu.partner.PartnerApplication
</start-class>
</properties>
<dependencies>
...
...
@@ -160,6 +159,17 @@
<id>
test
</id>
<properties>
<profiles.active>
test
</profiles.active>
<mysql.server>
jdbc:mysql://10.9.121.204:3306/huhu
</mysql.server>
<!--<mysql.username>yanfa</mysql.username>-->
<!--<mysql.password>cScdKw%ZKC1i$C!1uAz3Kg$c</mysql.password>-->
<mysql.username>
apihu
</mysql.username>
<mysql.password>
tqH9clYRAxZ@LV4x
</mysql.password>
<redis.host>
10.9.186.167
</redis.host>
<redis.password>
passwdredis
</redis.password>
<spring.profiles.active>
dev
</spring.profiles.active>
<logfile_path>
/Users/chen/Develop/workspace/partner/data/release/dev/logs
</logfile_path>
<!--<providers-path>/data/java/service</providers-path>-->
<providers-path>
/Users/chen/Develop/workspace/partner/data/release/dev
</providers-path>
</properties>
</profile>
<profile>
...
...
@@ -183,110 +193,60 @@
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-
ja
r-plugin
</artifactId>
<version>
2.4
</version>
<artifactId>
maven-
compile
r-plugin
</artifactId>
<version>
3.7.0
</version>
<configuration>
<archive>
<manifest>
<addClasspath>
true
</addClasspath>
<classpathPrefix>
lib/
</classpathPrefix>
<mainClass>
${mainClass}
</mainClass>
</manifest>
<manifestEntries>
<Class-Path>
configs/
</Class-Path>
</manifestEntries>
</archive>
<excludes>
<exclude>
**/*.properties
</exclude>
<exclude>
**/*.xml
</exclude>
<exclude>
**/*.yml
</exclude>
</excludes>
<source>
1.8
</source>
<target>
1.8
</target>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-
assembly
-plugin
</artifactId>
<version>
2.4
</version>
<artifactId>
maven-
war
-plugin
</artifactId>
<version>
3.2.0
</version>
<configuration>
<descriptors>
<descriptor>
assembly.xml
</descriptor>
</descriptors>
<warName>
${project.artifactId}
</warName>
<failOnMissingWebXml>
false
</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<executions>
<execution>
<id>
make-assembly
</id>
<phase>
package
</phase>
<goals>
<goal>
singl
e
</goal>
<goal>
repackag
e
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-antrun-plugin
</artifactId>
<version>
1.8
</version>
<dependencies>
<!-- 支持Ant条件判断 -->
<dependency>
<groupId>
ant-contrib
</groupId>
<artifactId>
ant-contrib
</artifactId>
<version>
1.0b3
</version>
<exclusions>
<exclusion>
<groupId>
ant
</groupId>
<artifactId>
ant
</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>
org.apache.ant
</groupId>
<artifactId>
ant-nodeps
</artifactId>
<version>
1.8.1
</version>
</dependency>
</dependencies>
<artifactId>
maven-resources-plugin
</artifactId>
<configuration>
<!--公钥私钥等后缀文件不过滤-->
<nonFilteredFileExtensions>
<extension>
private
</extension>
<extension>
public
</extension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-source-plugin
</artifactId>
<version>
3.0.1
</version>
<executions>
<execution>
<phase>
package
</phase>
<id>
attach-sources
</id>
<phase>
verify
</phase>
<goals>
<goal>
run
</goal>
<goal>
jar-no-fork
</goal>
</goals>
<configuration>
<target>
<taskdef
resource=
"net/sf/antcontrib/antlib.xml"
classpathref=
"maven.plugin.classpath"
/>
<if>
<equals
arg1=
"${project.packaging}"
arg2=
"jar"
/>
<then>
<copy
file=
"target/${project.artifactId}-${project.version}-bin.zip"
todir=
"${todir}"
/>
</then>
<else>
<echo
message=
"file suffix is not .zip, ignored. [file name:${project.artifactId}.${project.packaging}]"
/>
</else>
</if>
<if>
<equals
arg1=
"${project.packaging}"
arg2=
"war"
/>
<then>
<!--<copy file="target/${project.artifactId}.${project.packaging}"-->
<copy
file=
"target/${project.artifactId}-${project.version}-bin.zip"
todir=
"${todir}"
/>
</then>
<else>
<echo
message=
"file suffix is not .war, ignored. [file name:${project.artifactId}.${project.packaging}]"
/>
</else>
</if>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
...
...
src/main/java/com/lanren/huhu/partner/controller/PartnerController.java
View file @
092fb6aa
package
com
.
lanren
.
huhu
.
partner
.
controller
;
import
com.lanren.huhu.partner.domain.PartnerAccount
;
import
com.lanren.huhu.partner.manager.PartnerAccountManager
;
import
com.lanren.huhu.partner.model.Partner
;
import
com.lanren.huhu.partner.model.PartnerRsp
;
import
com.lanren.huhu.partner.result.Result
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.ObjectError
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
/** * @Author houseme * @Date 2019-06-26 11:00 * @Project partner * @Package com.lanren.huhu.partner.controller * @File: PartnerController */
@RestController
@RequestMapping
(
"/v1/partner"
)
public
class
PartnerController
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
PartnerController
.
class
);
@Autowired
private
PartnerAccountManager
partnerAccountManager
;
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
public
Result
<
PartnerAccount
>
one
(
@PathVariable
(
"id"
)
Integer
id
,
@RequestHeader
HttpHeaders
headers
)
{
if
(
logger
.
isInfoEnabled
())
{
logger
.
info
(
"partner one userId:{},header:{},time:{}"
,
id
,
headers
.
entrySet
().
toString
(),
LocalDateTime
.
now
());
}
return
partnerAccountManager
.
findByUserId
(
id
);
}
@RequestMapping
(
value
=
"/userId/{id}"
,
method
=
RequestMethod
.
POST
)
public
Result
<
PartnerAccount
>
getOne
(
@PathVariable
(
"id"
)
Integer
id
,
@RequestBody
Partner
partner
,
@RequestHeader
HttpHeaders
headers
,
BindingResult
result
)
{
if
(
logger
.
isInfoEnabled
())
{
List
<
String
>
list
=
new
ArrayList
<>();
if
(
result
.
hasErrors
())
{
List
<
ObjectError
>
errors
=
result
.
getAllErrors
();
for
(
ObjectError
objectError
:
errors
)
{
list
.
add
(
objectError
.
getDefaultMessage
());
}
Result
<
PartnerAccount
>
objectResult
=
new
Result
<>();
objectResult
.
setMessage
(
list
.
toString
());
return
objectResult
;
}
logger
.
info
(
"partner one userId:{},header:{},time:{}"
,
id
,
headers
.
entrySet
().
toString
(),
LocalDateTime
.
now
());
}
return
partnerAccountManager
.
findByUserId
(
id
);
}
@RequestMapping
(
value
=
"/level"
,
method
=
RequestMethod
.
POST
)
public
Result
<
PartnerRsp
>
getPartnerLevel
(
@RequestBody
@Valid
Partner
partner
,
@RequestHeader
HttpHeaders
headers
)
{
if
(
logger
.
isInfoEnabled
())
{
logger
.
info
(
"getPartnerLevel userId:{ },header:{},time:{}"
,
partner
.
getUserId
(),
headers
.
keySet
().
toArray
(),
LocalDateTime
.
now
());
}
return
partnerAccountManager
.
getPartnerLevel
(
partner
.
getUserId
());
}
}
\ No newline at end of file
package
com
.
lanren
.
huhu
.
partner
.
controller
;
import
com.lanren.huhu.partner.manager.PartnerAccountManager
;
import
com.lanren.huhu.partner.model.Partner
;
import
com.lanren.huhu.partner.model.PartnerRsp
;
import
com.lanren.huhu.partner.result.Result
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.Valid
;
import
java.time.LocalDateTime
;
/** * @Author houseme * @Date 2019-06-26 11:00 * @Project partner * @Package com.lanren.huhu.partner.controller * @File: PartnerController */
@RestController
@RequestMapping
(
"/v1/partner"
)
public
class
PartnerController
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
PartnerController
.
class
);
@Autowired
private
PartnerAccountManager
partnerAccountManager
;
@RequestMapping
(
value
=
"/level"
,
method
=
RequestMethod
.
POST
)
public
Result
<
PartnerRsp
>
getPartnerLevel
(
@RequestBody
@Valid
Partner
partner
,
@RequestHeader
HttpHeaders
headers
)
{
if
(
logger
.
isInfoEnabled
())
{
logger
.
info
(
"getPartnerLevel userId:{ },header:{},time:{}"
,
partner
.
getUserId
(),
headers
.
keySet
().
toArray
(),
LocalDateTime
.
now
());
}
return
partnerAccountManager
.
getPartnerLevel
(
partner
.
getUserId
());
}
}
\ No newline at end of file
...
...
src/main/resources/ValidationMessages.properties
deleted
100644 → 0
View file @
e55710df
partner.user.id
=
\u7528\u6237
id
\u
4E0D
\u
80FD
\u
5C0F
\u
4E8E0 partner.level.min=
\u5408\u
4F19
\u
4EBA
\u
7B49
\u
7EA7
\u6700\u
4F4E
\u
662F10 partner.level.max=
\u5408\u
4F19
\u
4EBA
\u
7B49
\u
7EA7
\u6700\u
9AD8
\u
662F30
\ 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