Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
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
姚本章
dm_project
Commits
69fa602e
Commit
69fa602e
authored
Dec 24, 2020
by
ysongq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
6e296055
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
83 additions
and
23 deletions
+83
-23
DataGoodsApiController.java
.../mall/moduls/controller/goods/DataGoodsApiController.java
+4
-1
DataGoodsApiDto.java
...all/moduls/controller/goods/bean/dto/DataGoodsApiDto.java
+1
-1
DataGoodsApiServiceImpl.java
.../dm/mall/moduls/service/impl/DataGoodsApiServiceImpl.java
+16
-11
DepartmentController.java
...nage/moduls/controller/customer/DepartmentController.java
+1
-1
DataGoodsApiController.java
...anage/moduls/controller/goods/DataGoodsApiController.java
+5
-3
DataGoodsApiDto.java
...age/moduls/controller/goods/bean/dto/DataGoodsApiDto.java
+11
-0
DataGoodsApiDao.java
...ain/java/com/jz/manage/moduls/mapper/DataGoodsApiDao.java
+3
-1
DataGoodsApiService.java
...ava/com/jz/manage/moduls/service/DataGoodsApiService.java
+3
-2
DataGoodsApiServiceImpl.java
...z/manage/moduls/service/impl/DataGoodsApiServiceImpl.java
+39
-3
No files found.
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/goods/DataGoodsApiController.java
View file @
69fa602e
...
...
@@ -44,7 +44,10 @@ public class DataGoodsApiController extends BaseController {
public
Result
<
List
<
DataGoodsApiDto
>>
findById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
if
(
id
!=
null
)
{
Result
result
=
tDataGoodsApiService
.
selectById
(
id
);
return
new
Result
(
true
,
"查询商品详情成功!"
,
StatusCode
.
OK
,
result
);
result
.
getMessage
();
result
.
getCode
();
result
.
getData
();
return
result
;
}
return
new
Result
<>(
false
,
"查询商品详情失败!"
,
StatusCode
.
ERROR
);
}
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/goods/bean/dto/DataGoodsApiDto.java
View file @
69fa602e
...
...
@@ -161,7 +161,7 @@ public class DataGoodsApiDto implements Serializable {
@ApiModelProperty
(
value
=
"api请求样例"
)
private
String
requestExample
;
@ApiModelProperty
(
value
=
"
公共参数
数字"
)
@ApiModelProperty
(
value
=
"
参数分类
数字"
)
private
String
paramsDiffNum
;
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/DataGoodsApiServiceImpl.java
View file @
69fa602e
package
com
.
jz
.
dm
.
mall
.
moduls
.
service
.
impl
;
import
com.jz.common.constant.ResultCode
;
import
com.jz.common.constant.ResultMsg
;
import
com.jz.common.utils.Result
;
import
com.jz.common.utils.StatusCode
;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.DataDetailsDto
;
import
com.jz.dm.mall.moduls.controller.goods.bean.dto.DataGoodsApiDto
;
import
com.jz.dm.mall.moduls.mapper.DataGoodsApiDao
;
import
com.jz.dm.mall.moduls.service.DataGoodsApiService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -36,11 +40,13 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
@Override
public
Result
selectById
(
Long
id
)
{
List
<
DataGoodsApiDto
>
dataGoodsApiDto
=
tDataGoodsApiDao
.
selectById
(
id
);
if
(
dataGoodsApiDto
.
size
()
==
0
)
{
return
Result
.
error
(
StatusCode
.
ERROR
,
"查询异常!"
);
}
List
<
DataGoodsApiDto
>
list1
=
new
ArrayList
<>();
List
<
DataGoodsApiDto
>
list2
=
new
ArrayList
<>();
List
<
DataGoodsApiDto
>
list3
=
new
ArrayList
<>();
List
<
DataGoodsApiDto
>
list4
=
new
ArrayList
<>();
List
<
DataGoodsApiDto
>
list5
=
new
ArrayList
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
for
(
DataGoodsApiDto
goodsApiDto
:
dataGoodsApiDto
)
{
if
(
goodsApiDto
.
getParamsDiffNum
().
equals
(
"01"
))
{
...
...
@@ -52,15 +58,13 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
if
(
goodsApiDto
.
getParamsDiffNum
().
equals
(
"03"
))
{
list3
.
add
(
goodsApiDto
);
}
if
(
goodsApiDto
.
getParamsDiffNum
().
equals
(
"04"
))
{
list4
.
add
(
goodsApiDto
);
if
(
!
StringUtils
.
isEmpty
(
goodsApiDto
.
getRequestExample
()
))
{
map
.
put
(
"requestExample"
,
goodsApiDto
.
getRequestExample
());
// 请求示例
}
if
(
goodsApiDto
.
getParamsDiffNum
().
equals
(
"05"
))
{
list5
.
add
(
goodsApiDto
);
if
(
!
StringUtils
.
isEmpty
(
goodsApiDto
.
getReturnDataExample
()
))
{
map
.
put
(
"returnDataExample"
,
goodsApiDto
.
getReturnDataExample
());
// 响应示例
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
// 商品详情
DataGoodsApiDto
goods
=
dataGoodsApiDto
.
get
(
0
);
DataDetailsDto
data
=
new
DataDetailsDto
();
...
...
@@ -81,10 +85,11 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
map
.
put
(
"pubParam"
,
list1
);
// 公共参数
map
.
put
(
"reqParam"
,
list2
);
// 请求参数
map
.
put
(
"resParam"
,
list3
);
// 响应参数
map
.
put
(
"reqExaParam"
,
list4
);
// 请求示例
map
.
put
(
"resExaParam"
,
list5
);
// 响应示例
Result
result
=
new
Result
();
result
.
setData
(
map
);
return
result
;
return
Result
.
of_success
(
ResultMsg
.
SUCCESS
,
result
)
;
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/customer/DepartmentController.java
View file @
69fa602e
...
...
@@ -28,7 +28,7 @@ import javax.servlet.http.HttpServletRequest;
*/
@RestController
@RequestMapping
(
"department"
)
@Api
(
tags
=
"企业
api
"
)
@Api
(
tags
=
"企业
信息管理--controller
"
)
public
class
DepartmentController
extends
BaseController
{
/**
* 服务对象
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/DataGoodsApiController.java
View file @
69fa602e
...
...
@@ -13,6 +13,8 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
* api商品(TDataGoodsApi)表控制层
*
...
...
@@ -35,11 +37,11 @@ public class DataGoodsApiController extends BaseController {
*/
@GetMapping
(
"/getDataDetails/{id}"
)
@ApiOperation
(
value
=
"点击商品查看商品详情"
,
notes
=
"api商品"
)
public
Result
<
DataGoodsApiDto
>
findById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
throws
Exception
{
public
Result
<
List
<
DataGoodsApiDto
>
>
findById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
throws
Exception
{
if
(
id
!=
null
)
{
Result
<
DataGoodsApiDto
>
result
=
new
Result
<>();
DataGoodsApiDto
dataGoodsApi
=
tDataGoodsApiService
.
selectById
(
id
);
return
new
Result
<
DataGoodsApiDto
>
(
true
,
"查询商品详情成功!"
,
StatusCode
.
OK
,
dataGoodsApi
);
//
DataGoodsApiDto dataGoodsApi = tDataGoodsApiService.selectById(id);
// return new Result
(true, "查询商品详情成功!", StatusCode.OK, dataGoodsApi);
}
return
new
Result
<>(
false
,
"查询商品详情失败!"
,
StatusCode
.
ERROR
);
}
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/bean/dto/DataGoodsApiDto.java
View file @
69fa602e
...
...
@@ -68,6 +68,17 @@ public class DataGoodsApiDto {
@ApiModelProperty
(
value
=
"api返回数据样例"
)
private
String
returnDataExample
;
@ApiModelProperty
(
value
=
"参数分类数字"
)
private
String
paramsDiffNum
;
public
String
getParamsDiffNum
()
{
return
paramsDiffNum
;
}
public
void
setParamsDiffNum
(
String
paramsDiffNum
)
{
this
.
paramsDiffNum
=
paramsDiffNum
;
}
public
Long
getDataGoodsId
()
{
return
dataGoodsId
;
}
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/mapper/DataGoodsApiDao.java
View file @
69fa602e
...
...
@@ -5,6 +5,8 @@ import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto;
import
com.jz.manage.moduls.entity.DataGoodsApi
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* api商品(TDataGoodsApi)表数据库访问层
*
...
...
@@ -19,5 +21,5 @@ public interface DataGoodsApiDao extends BaseMapper<DataGoodsApi> {
* @param id
* @return
*/
DataGoodsApiDto
findById
(
@Param
(
"dataGoodsId"
)
Long
id
);
List
<
DataGoodsApiDto
>
findById
(
@Param
(
"dataGoodsId"
)
Long
id
);
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/DataGoodsApiService.java
View file @
69fa602e
package
com
.
jz
.
manage
.
moduls
.
service
;
import
com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto
;
import
com.jz.common.utils.Result
;
/**
* api商品(TDataGoodsApi)表服务接口
...
...
@@ -15,5 +16,5 @@ public interface DataGoodsApiService {
* @param id
* @return
*/
DataGoodsApiDto
selectById
(
Long
id
)
throws
Exception
;
Result
selectById
(
Long
id
)
throws
Exception
;
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/impl/DataGoodsApiServiceImpl.java
View file @
69fa602e
package
com
.
jz
.
manage
.
moduls
.
service
.
impl
;
import
com.jz.common.utils.Result
;
import
com.jz.common.utils.StatusCode
;
import
com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto
;
import
com.jz.manage.moduls.mapper.DataGoodsApiDao
;
import
com.jz.manage.moduls.service.DataGoodsApiService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* api商品(TDataGoodsApi)表服务实现类
*
...
...
@@ -24,8 +31,37 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
* @return
*/
@Override
public
DataGoodsApiDto
selectById
(
Long
id
)
{
DataGoodsApiDto
dataGoodsApiDto
=
tDataGoodsApiDao
.
findById
(
id
);
return
dataGoodsApiDto
;
public
Result
selectById
(
Long
id
)
{
List
<
DataGoodsApiDto
>
dataGoodsApiDto
=
tDataGoodsApiDao
.
findById
(
id
);
if
(
dataGoodsApiDto
.
size
()
==
0
)
{
return
Result
.
error
(
StatusCode
.
ERROR
,
"查询异常!"
);
}
// 基本信息
List
<
DataGoodsApiDto
>
list1
=
new
ArrayList
<>();
List
<
DataGoodsApiDto
>
list2
=
new
ArrayList
<>();
List
<
DataGoodsApiDto
>
list3
=
new
ArrayList
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
// for (DataGoodsApiDto goodsApiDto : dataGoodsApiDto) {
// if (goodsApiDto.getParamsDiffNum().equals("01")) {
// list1.add(goodsApiDto);
// }
// if (goodsApiDto.getParamsDiffNum().equals("02")) {
// list2.add(goodsApiDto);
// }
// if (goodsApiDto.getParamsDiffNum().equals("03")) {
// list3.add(goodsApiDto);
// }
// if (goodsApiDto.getParamsDiffNum().equals("04")) {
// String requestExample = goodsApiDto.getRequestExample();
// map.put("requestExample", requestExample); // 请求示例
// }
// if (goodsApiDto.getParamsDiffNum().equals("05")) {
// String returnDataExample = goodsApiDto.getReturnDataExample();
// map.put("returnDataExample", returnDataExample); // 响应示例
// }
// }
return
null
;
}
}
\ 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