Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
yohoufo-fore
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Lixiaodi
7 years ago
Commit
ea7c5dbb9c3f77a6fd20dd83f2c5ee6b4394b4a8
1 parent
edd3bad0
增加测试数据类
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
product/src/main/java/com/yohoufo/product/controller/ProductController.java
product/src/main/java/com/yohoufo/product/controller/test/ExampleResultFactory.java
product/src/main/java/com/yohoufo/product/controller/ProductController.java
View file @
ea7c5db
...
...
@@ -11,6 +11,7 @@ import com.yohoufo.common.ApiResponse;
import
com.yohoufo.common.annotation.IgnoreSession
;
import
com.yohoufo.common.annotation.IgnoreSignature
;
import
com.yohoufo.common.cache.Cachable
;
import
com.yohoufo.product.controller.test.ExampleResultFactory
;
@Controller
public
class
ProductController
{
...
...
@@ -28,10 +29,8 @@ public class ProductController {
@RequestParam
(
value
=
"current_vip_level"
,
required
=
false
,
defaultValue
=
"0"
)
Integer
currentVipLevel
,
@RequestParam
(
value
=
"image_url"
,
required
=
false
)
String
imageUrl
)
{
if
(
null
==
productskn
&&
null
==
productId
)
{
return
new
ApiResponse
(
404
,
"product_skn or product_id Is Null"
,
null
);
}
logger
.
info
(
"queryProductDetailBySKN method=app.product.data productskn is:{},productId is:{}"
,
productskn
,
productId
);
return
new
ApiResponse
.
ApiResponseBuilder
().
data
(
null
).
code
(
200
).
message
(
"product info"
).
build
();
return
new
ApiResponse
.
ApiResponseBuilder
().
data
(
ExampleResultFactory
.
createData
()
).
code
(
200
).
message
(
"product info"
).
build
();
}
}
\ No newline at end of file
...
...
product/src/main/java/com/yohoufo/product/controller/test/ExampleResultFactory.java
0 → 100644
View file @
ea7c5db
package
com
.
yohoufo
.
product
.
controller
.
test
;
public
class
ExampleResultFactory
{
public
static
Object
createData
()
{
String
methodName
=
Thread
.
currentThread
().
getStackTrace
()[
2
].
getMethodName
();
switch
(
methodName
)
{
case
"queryProductDetailBySKN"
:
return
1
;
default
:
return
null
;
}
}
}
...
...
Please
register
or
login
to post a comment