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
41f0aa68
Commit
41f0aa68
authored
Dec 25, 2020
by
zhangc
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dm_dev' of
http://gitlab.ioubuy.cn/yaobenzhang/dm_project
into dm_dev
parents
c29b9e57
fae3378a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
160 additions
and
33 deletions
+160
-33
DataGoodsApiController.java
.../mall/moduls/controller/goods/DataGoodsApiController.java
+1
-1
manageApplication.java
...manage/src/main/java/com/jz/manage/manageApplication.java
+1
-1
DataGoodsApiController.java
...anage/moduls/controller/goods/DataGoodsApiController.java
+8
-4
DataBasicDto.java
...manage/moduls/controller/goods/bean/dto/DataBasicDto.java
+40
-0
DataGoodsApiDto.java
...age/moduls/controller/goods/bean/dto/DataGoodsApiDto.java
+16
-5
DataInterfaceDto.java
...ge/moduls/controller/goods/bean/dto/DataInterfaceDto.java
+34
-0
DataGoodsApiServiceImpl.java
...z/manage/moduls/service/impl/DataGoodsApiServiceImpl.java
+52
-21
OrderServiceImpl.java
...a/com/jz/manage/moduls/service/impl/OrderServiceImpl.java
+7
-1
DataGoodsApiDao.xml
...anage/src/main/resources/mapper/goods/DataGoodsApiDao.xml
+1
-0
No files found.
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/goods/DataGoodsApiController.java
View file @
41f0aa68
...
...
@@ -26,7 +26,7 @@ import java.util.List;
*/
@RestController
@RequestMapping
(
"dataGoodsApi"
)
@Api
(
tags
=
"
商品详情-
-controller"
)
@Api
(
tags
=
"
平台--数据api
-controller"
)
public
class
DataGoodsApiController
extends
BaseController
{
/**
* 服务对象
...
...
jz-dm-manage/src/main/java/com/jz/manage/manageApplication.java
View file @
41f0aa68
...
...
@@ -11,7 +11,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableTransactionManagement
@MapperScan
(
"com.jz.manage.moduls.mapper"
)
@EnableAspectJAutoProxy
//启动对@AspectJ注解的支持
//
@EnableRedisHttpSession //Redis集中存储Session
@EnableRedisHttpSession
//Redis集中存储Session
public
class
manageApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/DataGoodsApiController.java
View file @
41f0aa68
...
...
@@ -6,6 +6,7 @@ import com.jz.common.utils.StatusCode;
import
com.jz.manage.moduls.controller.BaseController
;
import
com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto
;
import
com.jz.manage.moduls.service.DataGoodsApiService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -23,6 +24,7 @@ import java.util.List;
*/
@RestController
@RequestMapping
(
"dataGoodsApi"
)
@Api
(
tags
=
"平台--数据api-controller"
)
public
class
DataGoodsApiController
extends
BaseController
{
/**
* 服务对象
...
...
@@ -37,11 +39,13 @@ public class DataGoodsApiController extends BaseController {
*/
@GetMapping
(
"/getDataDetails/{id}"
)
@ApiOperation
(
value
=
"点击商品查看商品详情"
,
notes
=
"api商品"
)
public
Result
<
List
<
DataGoodsApiDto
>>
findById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
throws
Exception
{
public
Result
findById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
throws
Exception
{
if
(
id
!=
null
)
{
Result
<
DataGoodsApiDto
>
result
=
new
Result
<>();
// DataGoodsApiDto dataGoodsApi = tDataGoodsApiService.selectById(id);
// return new Result(true, "查询商品详情成功!", StatusCode.OK, dataGoodsApi);
Result
result
=
tDataGoodsApiService
.
selectById
(
id
);
result
.
getData
();
result
.
getCode
();
result
.
getMessage
();
return
result
;
}
return
new
Result
<>(
false
,
"查询商品详情失败!"
,
StatusCode
.
ERROR
);
}
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/bean/dto/DataBasicDto.java
0 → 100644
View file @
41f0aa68
package
com
.
jz
.
manage
.
moduls
.
controller
.
goods
.
bean
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/24
* @Version:
*/
@ApiModel
(
"数据管理-数据详情参数--基本信息"
)
@Data
public
class
DataBasicDto
{
@ApiModelProperty
(
value
=
"数据id"
)
private
Long
dataGoodsId
;
@ApiModelProperty
(
value
=
"数据商品名称"
)
private
String
dataName
;
@ApiModelProperty
(
value
=
"数据类型"
)
private
String
dataType
;
@ApiModelProperty
(
value
=
"商品分类名称"
)
private
String
categoryName
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
uptTime
;
@ApiModelProperty
(
value
=
"数据状态"
)
private
String
dataStatus
;
@ApiModelProperty
(
value
=
"价格类型"
)
private
String
priceType
;
}
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/bean/dto/DataGoodsApiDto.java
View file @
41f0aa68
...
...
@@ -17,21 +17,24 @@ public class DataGoodsApiDto {
@ApiModelProperty
(
value
=
"数据id"
)
private
Long
dataGoodsId
;
@ApiModelProperty
(
value
=
"商品分类名称"
)
private
String
categoryName
;
@ApiModelProperty
(
value
=
"数据商品名称"
)
private
String
dataName
;
@ApiModelProperty
(
value
=
"数据类型"
)
private
String
dataType
;
@ApiModelProperty
(
value
=
"
价格类型
"
)
private
String
priceTyp
e
;
@ApiModelProperty
(
value
=
"
商品分类名称
"
)
private
String
categoryNam
e
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
uptTime
;
@ApiModelProperty
(
value
=
"数据状态"
)
private
String
dataStatus
;
@ApiModelProperty
(
value
=
"价格类型"
)
private
String
priceType
;
@ApiModelProperty
(
value
=
"接口地址"
)
private
String
apiUrl
;
...
...
@@ -71,6 +74,14 @@ public class DataGoodsApiDto {
@ApiModelProperty
(
value
=
"参数分类数字"
)
private
String
paramsDiffNum
;
public
String
getDataStatus
()
{
return
dataStatus
;
}
public
void
setDataStatus
(
String
dataStatus
)
{
this
.
dataStatus
=
dataStatus
;
}
public
String
getParamsDiffNum
()
{
return
paramsDiffNum
;
}
...
...
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/bean/dto/DataInterfaceDto.java
0 → 100644
View file @
41f0aa68
package
com
.
jz
.
manage
.
moduls
.
controller
.
goods
.
bean
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/24
* @Version:
*/
@ApiModel
(
"数据管理-数据详情参数--接口文档"
)
@Data
public
class
DataInterfaceDto
{
@ApiModelProperty
(
value
=
"接口地址"
)
private
String
apiUrl
;
@ApiModelProperty
(
value
=
"接口方法"
)
private
String
apiMethod
;
@ApiModelProperty
(
value
=
"请求方式"
)
private
String
requestType
;
@ApiModelProperty
(
value
=
"返回类型"
)
private
String
returnType
;
@ApiModelProperty
(
value
=
"apiKey"
)
private
String
apiKey
;
@ApiModelProperty
(
value
=
"token"
)
private
String
requestToken
;
}
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/impl/DataGoodsApiServiceImpl.java
View file @
41f0aa68
package
com
.
jz
.
manage
.
moduls
.
service
.
impl
;
import
com.jz.common.constant.ResultMsg
;
import
com.jz.common.utils.Result
;
import
com.jz.common.utils.StatusCode
;
import
com.jz.manage.moduls.controller.goods.bean.dto.DataBasicDto
;
import
com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto
;
import
com.jz.manage.moduls.controller.goods.bean.dto.DataInterfaceDto
;
import
com.jz.manage.moduls.mapper.DataGoodsApiDao
;
import
com.jz.manage.moduls.service.DataGoodsApiService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -36,32 +41,58 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
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
<>();
// 基本信息
DataGoodsApiDto
dataGoods
=
dataGoodsApiDto
.
get
(
0
);
DataBasicDto
dataBasicDto
=
new
DataBasicDto
();
BeanUtils
.
copyProperties
(
dataGoods
,
dataBasicDto
);
// 赋值
// 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); // 响应示例
// }
// }
// 接口文档
DataInterfaceDto
dataInterfaceDto
=
new
DataInterfaceDto
();
BeanUtils
.
copyProperties
(
dataGoods
,
dataInterfaceDto
);
return
null
;
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"
))
{
list4
.
add
(
goodsApiDto
);
}
// 状态码参数
if
(
goodsApiDto
.
getParamsDiffNum
().
equals
(
"05"
))
{
list5
.
add
(
goodsApiDto
);
}
// api返回数据样例
if
(!
StringUtils
.
isEmpty
(
goodsApiDto
.
getReturnDataExample
()))
{
map
.
put
(
"returnDataExample"
,
goodsApiDto
.
getReturnDataExample
());
// 响应示例
}
}
map
.
put
(
"dataParam"
,
dataBasicDto
);
// 基本信息
map
.
put
(
"dataInterfaceParam"
,
dataInterfaceDto
);
// 接口文档
map
.
put
(
"pubParam"
,
list1
);
// 公共参数
map
.
put
(
"reqParam"
,
list2
);
// 请求参数
map
.
put
(
"resParam"
,
list3
);
// 响应参数
map
.
put
(
"reqHeadParam"
,
list4
);
// 请求头参数
map
.
put
(
"statusCodeParam"
,
list5
);
// 状态码参数
Result
result
=
new
Result
();
result
.
setData
(
map
);
return
Result
.
of_success
(
ResultMsg
.
SUCCESS
,
result
);
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/impl/OrderServiceImpl.java
View file @
41f0aa68
...
...
@@ -3,7 +3,9 @@ package com.jz.manage.moduls.service.impl;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.jz.common.bean.PageInfoResponse
;
import
com.jz.common.bean.SysUserDto
;
import
com.jz.common.constant.Constants
;
import
com.jz.common.constant.RedisMessageConstant
;
import
com.jz.manage.moduls.controller.order.bean.OrderDetailDto
;
import
com.jz.manage.moduls.controller.order.bean.OrderDto
;
import
com.jz.manage.moduls.controller.order.bean.OrderRequest
;
...
...
@@ -11,6 +13,7 @@ import com.jz.manage.moduls.mapper.OrderDao;
import
com.jz.manage.moduls.service.OrderService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -18,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
/**
* 订单表(TOrder)表服务实现类
...
...
@@ -32,6 +36,9 @@ public class OrderServiceImpl implements OrderService {
@Autowired
private
OrderDao
orderDao
;
@Autowired
private
RedisTemplate
redisTemplate
;
@Override
public
PageInfoResponse
<
OrderDto
>
queryListOrderInfo
(
OrderRequest
orderRequest
,
HttpServletRequest
req
)
throws
Exception
{
PageInfoResponse
<
OrderDto
>
pageInfoResponse
=
new
PageInfoResponse
<>();
...
...
@@ -39,7 +46,6 @@ public class OrderServiceImpl implements OrderService {
Map
param
=
new
HashMap
();
//从session中获取平台用户id
//SysUserDto user = (SysUserDto) SessionUtils.getUserCurrent(requset,"sysUser");
//param.put("userId", user.getUserId());
//数据行业
if
(
StringUtils
.
isNotEmpty
(
orderRequest
.
getCategoryId
()))
{
param
.
put
(
"categoryId"
,
orderRequest
.
getCategoryId
());
...
...
jz-dm-manage/src/main/resources/mapper/goods/DataGoodsApiDao.xml
View file @
41f0aa68
...
...
@@ -42,6 +42,7 @@
t3.return_type as returnType,
t3.api_key as apiKey,
t3.request_token as requestToken,
t4.params_diff as paramsDiffNum,
(CASE WHEN t4.params_diff = '01' THEN '公共参数'
WHEN t4.params_diff = '02' THEN '请求参数'
WHEN t4.params_diff = '03' THEN '响应参数'
...
...
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