Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 98e6d99f
authored
Mar 19, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add APIs for querying all records.
1 parent
55a3ab0f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
8 deletions
src/main/java/com/glsx/admin/controller/ProductController.java
src/main/java/com/glsx/admin/controller/ProductTypeController.java
src/main/java/com/glsx/admin/remote/ProductFeignClient.java
src/main/java/com/glsx/admin/remote/ProductTypeFeignClient.java
src/main/java/com/glsx/admin/controller/ProductController.java
View file @
98e6d99
...
@@ -36,7 +36,20 @@ public class ProductController {
...
@@ -36,7 +36,20 @@ public class ProductController {
private
ProductFeignClient
productFeignClient
;
private
ProductFeignClient
productFeignClient
;
/**
/**
* 获取产品列表。
* 分页获取产品列表。
*
* @param req 请求体
* @return 结果
*/
@RequestMapping
(
value
=
"/getPageList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
R
getPageList
(
ProductReq
req
)
{
log
.
info
(
"$$$$ /product/getPageList param: {}"
,
JSON
.
toJSONString
(
req
));
PageInfo
<
ProductResp
>
pageInfo
=
productFeignClient
.
getPageList
(
req
);
return
R
.
ok
().
putPageData
(
pageInfo
);
}
/**
* 获取产品列表,不分页。
*
*
* @param req 请求体
* @param req 请求体
* @return 结果
* @return 结果
...
@@ -44,8 +57,8 @@ public class ProductController {
...
@@ -44,8 +57,8 @@ public class ProductController {
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
R
getList
(
ProductReq
req
)
{
public
R
getList
(
ProductReq
req
)
{
log
.
info
(
"$$$$ /product/getList param: {}"
,
JSON
.
toJSONString
(
req
));
log
.
info
(
"$$$$ /product/getList param: {}"
,
JSON
.
toJSONString
(
req
));
PageInfo
<
ProductResp
>
pageInfo
=
productFeignClient
.
getList
(
req
);
List
<
ProductResp
>
respList
=
productFeignClient
.
getList
(
req
);
return
R
.
ok
().
putPageData
(
pageInfo
);
return
R
.
ok
().
data
(
respList
);
}
}
/**
/**
...
...
src/main/java/com/glsx/admin/controller/ProductTypeController.java
View file @
98e6d99
...
@@ -32,7 +32,20 @@ public class ProductTypeController {
...
@@ -32,7 +32,20 @@ public class ProductTypeController {
private
ProductTypeFeignClient
productTypeFeignClient
;
private
ProductTypeFeignClient
productTypeFeignClient
;
/**
/**
* 获取产品类型列表。
* 分页获取产品类型列表。
*
* @param req 请求
* @return 结果
*/
@RequestMapping
(
value
=
"/getPageList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
R
getPageList
(
ProductTypeReq
req
)
{
log
.
info
(
"$$$$ /productType/getPageList param: {}"
,
JSON
.
toJSONString
(
req
));
PageInfo
<
ProductTypeResp
>
pageInfo
=
productTypeFeignClient
.
getPageList
(
req
);
return
R
.
ok
().
putPageData
(
pageInfo
);
}
/**
* 获取产品类型列表,不分页。
*
*
* @param req 请求
* @param req 请求
* @return 结果
* @return 结果
...
@@ -40,8 +53,8 @@ public class ProductTypeController {
...
@@ -40,8 +53,8 @@ public class ProductTypeController {
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
R
getList
(
ProductTypeReq
req
)
{
public
R
getList
(
ProductTypeReq
req
)
{
log
.
info
(
"$$$$ /productType/getList param: {}"
,
JSON
.
toJSONString
(
req
));
log
.
info
(
"$$$$ /productType/getList param: {}"
,
JSON
.
toJSONString
(
req
));
PageInfo
<
ProductTypeResp
>
pageInfo
=
productTypeFeignClient
.
getList
(
req
);
List
<
ProductTypeResp
>
respList
=
productTypeFeignClient
.
getList
(
req
);
return
R
.
ok
().
putPageData
(
pageInfo
);
return
R
.
ok
().
data
(
respList
);
}
}
/**
/**
...
...
src/main/java/com/glsx/admin/remote/ProductFeignClient.java
View file @
98e6d99
...
@@ -21,9 +21,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -21,9 +21,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
*/
*/
@FeignClient
(
name
=
"${feign.server.name}"
,
url
=
"${feign.server.url}"
)
@FeignClient
(
name
=
"${feign.server.name}"
,
url
=
"${feign.server.url}"
)
public
interface
ProductFeignClient
{
public
interface
ProductFeignClient
{
@RequestMapping
(
value
=
"/product/getPageList"
,
method
=
{
RequestMethod
.
GET
})
@ResponseBody
PageInfo
<
ProductResp
>
getPageList
(
@SpringQueryMap
ProductReq
req
);
@RequestMapping
(
value
=
"/product/getList"
,
method
=
{
RequestMethod
.
GET
})
@RequestMapping
(
value
=
"/product/getList"
,
method
=
{
RequestMethod
.
GET
})
@ResponseBody
@ResponseBody
PageInfo
<
ProductResp
>
getList
(
@SpringQueryMap
ProductReq
req
);
List
<
ProductResp
>
getList
(
@SpringQueryMap
ProductReq
req
);
@RequestMapping
(
value
=
"/product/getById"
,
method
=
{
RequestMethod
.
GET
})
@RequestMapping
(
value
=
"/product/getById"
,
method
=
{
RequestMethod
.
GET
})
@ResponseBody
@ResponseBody
...
...
src/main/java/com/glsx/admin/remote/ProductTypeFeignClient.java
View file @
98e6d99
...
@@ -20,9 +20,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -20,9 +20,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
*/
*/
@FeignClient
(
name
=
"${feign.server.name}"
,
url
=
"${feign.server.url}"
)
@FeignClient
(
name
=
"${feign.server.name}"
,
url
=
"${feign.server.url}"
)
public
interface
ProductTypeFeignClient
{
public
interface
ProductTypeFeignClient
{
@RequestMapping
(
value
=
"/productType/getPageList"
,
method
=
{
RequestMethod
.
GET
})
@ResponseBody
PageInfo
<
ProductTypeResp
>
getPageList
(
@SpringQueryMap
ProductTypeReq
req
);
@RequestMapping
(
value
=
"/productType/getList"
,
method
=
{
RequestMethod
.
GET
})
@RequestMapping
(
value
=
"/productType/getList"
,
method
=
{
RequestMethod
.
GET
})
@ResponseBody
@ResponseBody
PageInfo
<
ProductTypeResp
>
getList
(
@SpringQueryMap
ProductTypeReq
req
);
List
<
ProductTypeResp
>
getList
(
@SpringQueryMap
ProductTypeReq
req
);
@RequestMapping
(
value
=
"/productType/getById"
,
method
=
{
RequestMethod
.
GET
})
@RequestMapping
(
value
=
"/productType/getById"
,
method
=
{
RequestMethod
.
GET
})
@ResponseBody
@ResponseBody
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment