Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-service
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 244d4271
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
e041c7c1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
55 additions
and
13 deletions
src/main/java/com/glsx/smart/controller/ProductController.java
src/main/java/com/glsx/smart/controller/ProductTypeController.java
src/main/java/com/glsx/smart/service/SmartProductService.java
src/main/java/com/glsx/smart/service/SmartProductTypeService.java
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartProductTypeServiceImpl.java
src/main/java/com/glsx/smart/controller/ProductController.java
View file @
244d427
...
@@ -28,13 +28,25 @@ public class ProductController {
...
@@ -28,13 +28,25 @@ public class ProductController {
private
SmartProductService
productService
;
private
SmartProductService
productService
;
/**
/**
* 获取产品列表。
* 分页获取产品列表。
*
* @param req 请求体
* @return 结果
*/
@RequestMapping
(
value
=
"/getPageList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
PageInfo
<
SmartProduct
>
getPageList
(
SmartProduct
req
)
{
log
.
info
(
"$$$$ /product/getPageList param: {}"
,
JSON
.
toJSONString
(
req
));
return
productService
.
getPageList
(
req
);
}
/**
* 获取产品列表,不分页。
*
*
* @param req 请求体
* @param req 请求体
* @return 结果
* @return 结果
*/
*/
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
PageInfo
<
SmartProduct
>
getList
(
SmartProduct
req
)
{
public
List
<
SmartProduct
>
getList
(
SmartProduct
req
)
{
log
.
info
(
"$$$$ /product/getList param: {}"
,
JSON
.
toJSONString
(
req
));
log
.
info
(
"$$$$ /product/getList param: {}"
,
JSON
.
toJSONString
(
req
));
return
productService
.
getList
(
req
);
return
productService
.
getList
(
req
);
}
}
...
...
src/main/java/com/glsx/smart/controller/ProductTypeController.java
View file @
244d427
...
@@ -28,13 +28,25 @@ public class ProductTypeController {
...
@@ -28,13 +28,25 @@ public class ProductTypeController {
private
SmartProductTypeService
productTypeService
;
private
SmartProductTypeService
productTypeService
;
/**
/**
* 获取产品类型列表。
* 分页获取产品类型列表。
*
* @param req 请求
* @return 结果
*/
@RequestMapping
(
value
=
"/getPageList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
PageInfo
<
SmartProductType
>
getPageList
(
SmartProductType
req
)
{
log
.
info
(
"$$$$ /productType/getPageList param: {}"
,
JSON
.
toJSONString
(
req
));
return
productTypeService
.
getPageList
(
req
);
}
/**
* 获取产品类型列表,不分页。
*
*
* @param req 请求
* @param req 请求
* @return 结果
* @return 结果
*/
*/
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
PageInfo
<
SmartProductType
>
getList
(
SmartProductType
req
)
{
public
List
<
SmartProductType
>
getList
(
SmartProductType
req
)
{
log
.
info
(
"$$$$ /productType/getList param: {}"
,
JSON
.
toJSONString
(
req
));
log
.
info
(
"$$$$ /productType/getList param: {}"
,
JSON
.
toJSONString
(
req
));
return
productTypeService
.
getList
(
req
);
return
productTypeService
.
getList
(
req
);
}
}
...
...
src/main/java/com/glsx/smart/service/SmartProductService.java
View file @
244d427
...
@@ -14,7 +14,9 @@ import com.glsx.smart.dao.entity.SmartProduct;
...
@@ -14,7 +14,9 @@ import com.glsx.smart.dao.entity.SmartProduct;
*/
*/
public
interface
SmartProductService
{
public
interface
SmartProductService
{
PageInfo
<
SmartProduct
>
getList
(
SmartProduct
product
);
PageInfo
<
SmartProduct
>
getPageList
(
SmartProduct
product
);
List
<
SmartProduct
>
getList
(
SmartProduct
product
);
SmartProduct
getById
(
Long
id
);
SmartProduct
getById
(
Long
id
);
...
...
src/main/java/com/glsx/smart/service/SmartProductTypeService.java
View file @
244d427
...
@@ -14,7 +14,9 @@ import com.glsx.smart.dao.entity.SmartProductType;
...
@@ -14,7 +14,9 @@ import com.glsx.smart.dao.entity.SmartProductType;
*/
*/
public
interface
SmartProductTypeService
{
public
interface
SmartProductTypeService
{
PageInfo
<
SmartProductType
>
getList
(
SmartProductType
productType
);
PageInfo
<
SmartProductType
>
getPageList
(
SmartProductType
productType
);
List
<
SmartProductType
>
getList
(
SmartProductType
productType
);
SmartProductType
getById
(
Long
id
);
SmartProductType
getById
(
Long
id
);
...
...
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
View file @
244d427
...
@@ -41,11 +41,15 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
...
@@ -41,11 +41,15 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
PageInfo
<
SmartProduct
>
getList
(
SmartProduct
product
)
{
public
PageInfo
<
SmartProduct
>
get
Page
List
(
SmartProduct
product
)
{
super
.
startPagination
(
product
);
super
.
startPagination
(
product
);
return
PageInfo
.
of
(
this
.
getList
(
product
));
}
@Override
public
List
<
SmartProduct
>
getList
(
SmartProduct
product
)
{
List
<
SmartProduct
>
productList
=
productMapper
.
getList
(
product
);
List
<
SmartProduct
>
productList
=
productMapper
.
getList
(
product
);
PageInfo
<
SmartProduct
>
pageInfo
=
PageInfo
.
of
(
productList
);
return
productList
;
return
pageInfo
;
}
}
/**
/**
...
...
src/main/java/com/glsx/smart/service/impl/SmartProductTypeServiceImpl.java
View file @
244d427
...
@@ -34,17 +34,27 @@ public class SmartProductTypeServiceImpl extends BaseService implements SmartPro
...
@@ -34,17 +34,27 @@ public class SmartProductTypeServiceImpl extends BaseService implements SmartPro
private
SmartProductTypeMapper
productTypeMapper
;
private
SmartProductTypeMapper
productTypeMapper
;
/**
/**
* 获取产品类型列表。
*
分页
获取产品类型列表。
*
*
* @param productType 请求
* @param productType 请求
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
PageInfo
<
SmartProductType
>
getList
(
SmartProductType
productType
)
{
public
PageInfo
<
SmartProductType
>
get
Page
List
(
SmartProductType
productType
)
{
super
.
startPagination
(
productType
);
super
.
startPagination
(
productType
);
return
PageInfo
.
of
(
this
.
getList
(
productType
));
}
/**
* 获取产品类型列表,不分页。
*
* @param productType 请求
* @return 结果
*/
@Override
public
List
<
SmartProductType
>
getList
(
SmartProductType
productType
)
{
List
<
SmartProductType
>
productTypeList
=
productTypeMapper
.
getList
(
productType
);
List
<
SmartProductType
>
productTypeList
=
productTypeMapper
.
getList
(
productType
);
PageInfo
<
SmartProductType
>
pageInfo
=
PageInfo
.
of
(
productTypeList
);
return
productTypeList
;
return
pageInfo
;
}
}
/**
/**
...
...
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