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
759b51d0
Commit
759b51d0
authored
Dec 14, 2020
by
ysongq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
主键查询数据详情
parent
be2762d5
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
306 additions
and
6 deletions
+306
-6
StatusCode.java
...-common/src/main/java/com/jz/common/utils/StatusCode.java
+2
-2
DataGoodsApiController.java
...anage/moduls/controller/goods/DataGoodsApiController.java
+22
-1
DataGoodsApiDto.java
...age/moduls/controller/goods/bean/dto/DataGoodsApiDto.java
+214
-0
DataGoodsApiDao.java
...ain/java/com/jz/manage/moduls/mapper/DataGoodsApiDao.java
+7
-1
DataGoodsApiService.java
...ava/com/jz/manage/moduls/service/DataGoodsApiService.java
+8
-1
DataGoodsApiServiceImpl.java
...z/manage/moduls/service/impl/DataGoodsApiServiceImpl.java
+12
-0
DataGoodsApiDao.xml
...anage/src/main/resources/mapper/goods/DataGoodsApiDao.xml
+40
-1
DataGoodsDao.xml
...m-manage/src/main/resources/mapper/goods/DataGoodsDao.xml
+1
-0
No files found.
jz-dm-common/src/main/java/com/jz/common/utils/StatusCode.java
View file @
759b51d0
...
@@ -7,8 +7,8 @@ package com.jz.common.utils;
...
@@ -7,8 +7,8 @@ package com.jz.common.utils;
* @Version:
* @Version:
*/
*/
public
class
StatusCode
{
public
class
StatusCode
{
public
static
final
int
OK
=
300
00
;
// 成功
public
static
final
int
OK
=
2
00
;
// 成功
public
static
final
int
ERROR
=
300
01
;
// 失败
public
static
final
int
ERROR
=
2
01
;
// 失败
public
static
final
int
LOGINERROR
=
30002
;
// 用户名或密码错误
public
static
final
int
LOGINERROR
=
30002
;
// 用户名或密码错误
public
static
final
int
ACCESSERROR
=
30003
;
// 权限不足
public
static
final
int
ACCESSERROR
=
30003
;
// 权限不足
}
}
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/DataGoodsApiController.java
View file @
759b51d0
package
com
.
jz
.
manage
.
moduls
.
controller
.
goods
;
package
com
.
jz
.
manage
.
moduls
.
controller
.
goods
;
import
com.jz.common.entity.DataGoods
;
import
com.jz.common.utils.Result
;
import
com.jz.common.utils.StatusCode
;
import
com.jz.manage.moduls.controller.BaseController
;
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
com.jz.manage.moduls.service.DataGoodsApiService
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -21,5 +28,19 @@ public class DataGoodsApiController extends BaseController {
...
@@ -21,5 +28,19 @@ public class DataGoodsApiController extends BaseController {
@Autowired
@Autowired
private
DataGoodsApiService
tDataGoodsApiService
;
private
DataGoodsApiService
tDataGoodsApiService
;
/**
* 根据主键查询商品详情-api
* @param id
* @return
*/
@GetMapping
(
"/{id}"
)
@ApiOperation
(
value
=
"点击商品查看商品详情"
,
notes
=
"api商品"
)
public
Result
<
DataGoodsApiDto
>
findById
(
@PathVariable
(
value
=
"id"
)
Long
id
)
{
if
(
id
!=
null
)
{
Result
<
DataGoodsApiDto
>
result
=
new
Result
<>();
DataGoodsApiDto
dataGoodsApi
=
tDataGoodsApiService
.
selectById
(
id
);
return
new
Result
<
DataGoodsApiDto
>(
true
,
"查询商品详情成功!"
,
StatusCode
.
OK
,
dataGoodsApi
);
}
return
new
Result
<>(
false
,
"查询商品详情失败!"
);
}
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/controller/goods/bean/dto/DataGoodsApiDto.java
0 → 100644
View file @
759b51d0
package
com
.
jz
.
manage
.
moduls
.
controller
.
goods
.
bean
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.util.Date
;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/14
* @Version:
*/
@ApiModel
(
"数据管理-数据详情参数"
)
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
priceType
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
uptTime
;
@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
;
@ApiModelProperty
(
value
=
"参数分类"
)
private
String
paramsDiff
;
@ApiModelProperty
(
value
=
"参数名称"
)
private
String
paramsName
;
@ApiModelProperty
(
value
=
"参数值"
)
private
String
defaultValue
;
@ApiModelProperty
(
value
=
"参数描述"
)
private
String
paramsDesc
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"api返回数据样例"
)
private
String
returnDataExample
;
public
Long
getDataGoodsId
()
{
return
dataGoodsId
;
}
public
void
setDataGoodsId
(
Long
dataGoodsId
)
{
this
.
dataGoodsId
=
dataGoodsId
;
}
public
String
getCategoryName
()
{
return
categoryName
;
}
public
void
setCategoryName
(
String
categoryName
)
{
this
.
categoryName
=
categoryName
;
}
public
String
getDataName
()
{
return
dataName
;
}
public
void
setDataName
(
String
dataName
)
{
this
.
dataName
=
dataName
;
}
public
String
getDataType
()
{
return
dataType
;
}
public
void
setDataType
(
String
dataType
)
{
this
.
dataType
=
dataType
;
}
public
String
getPriceType
()
{
return
priceType
;
}
public
void
setPriceType
(
String
priceType
)
{
this
.
priceType
=
priceType
;
}
public
Date
getUptTime
()
{
return
uptTime
;
}
public
void
setUptTime
(
Date
uptTime
)
{
this
.
uptTime
=
uptTime
;
}
public
String
getApiUrl
()
{
return
apiUrl
;
}
public
void
setApiUrl
(
String
apiUrl
)
{
this
.
apiUrl
=
apiUrl
;
}
public
String
getApiMethod
()
{
return
apiMethod
;
}
public
void
setApiMethod
(
String
apiMethod
)
{
this
.
apiMethod
=
apiMethod
;
}
public
String
getRequestType
()
{
return
requestType
;
}
public
void
setRequestType
(
String
requestType
)
{
this
.
requestType
=
requestType
;
}
public
String
getReturnType
()
{
return
returnType
;
}
public
void
setReturnType
(
String
returnType
)
{
this
.
returnType
=
returnType
;
}
public
String
getApiKey
()
{
return
apiKey
;
}
public
void
setApiKey
(
String
apiKey
)
{
this
.
apiKey
=
apiKey
;
}
public
String
getRequestToken
()
{
return
requestToken
;
}
public
void
setRequestToken
(
String
requestToken
)
{
this
.
requestToken
=
requestToken
;
}
public
String
getParamsDiff
()
{
return
paramsDiff
;
}
public
void
setParamsDiff
(
String
paramsDiff
)
{
this
.
paramsDiff
=
paramsDiff
;
}
public
String
getParamsName
()
{
return
paramsName
;
}
public
void
setParamsName
(
String
paramsName
)
{
this
.
paramsName
=
paramsName
;
}
public
String
getDefaultValue
()
{
return
defaultValue
;
}
public
void
setDefaultValue
(
String
defaultValue
)
{
this
.
defaultValue
=
defaultValue
;
}
public
String
getReturnDataExample
()
{
return
returnDataExample
;
}
public
void
setReturnDataExample
(
String
returnDataExample
)
{
this
.
returnDataExample
=
returnDataExample
;
}
public
String
getParamsDesc
()
{
return
paramsDesc
;
}
public
void
setParamsDesc
(
String
paramsDesc
)
{
this
.
paramsDesc
=
paramsDesc
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
}
jz-dm-manage/src/main/java/com/jz/manage/moduls/mapper/DataGoodsApiDao.java
View file @
759b51d0
package
com
.
jz
.
manage
.
moduls
.
mapper
;
package
com
.
jz
.
manage
.
moduls
.
mapper
;
import
com.jz.common.base.BaseMapper
;
import
com.jz.common.base.BaseMapper
;
import
com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto
;
import
com.jz.manage.moduls.entity.DataGoodsApi
;
import
com.jz.manage.moduls.entity.DataGoodsApi
;
/**
/**
...
@@ -12,5 +13,10 @@ import com.jz.manage.moduls.entity.DataGoodsApi;
...
@@ -12,5 +13,10 @@ import com.jz.manage.moduls.entity.DataGoodsApi;
public
interface
DataGoodsApiDao
extends
BaseMapper
<
DataGoodsApi
>
{
public
interface
DataGoodsApiDao
extends
BaseMapper
<
DataGoodsApi
>
{
/**
* 主键查询数据商品
* @param id
* @return
*/
DataGoodsApiDto
findById
(
Long
id
);
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/DataGoodsApiService.java
View file @
759b51d0
package
com
.
jz
.
manage
.
moduls
.
service
;
package
com
.
jz
.
manage
.
moduls
.
service
;
import
com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto
;
/**
/**
* api商品(TDataGoodsApi)表服务接口
* api商品(TDataGoodsApi)表服务接口
*
*
...
@@ -8,5 +10,10 @@ package com.jz.manage.moduls.service;
...
@@ -8,5 +10,10 @@ package com.jz.manage.moduls.service;
*/
*/
public
interface
DataGoodsApiService
{
public
interface
DataGoodsApiService
{
/**
* 主键查询数据详情
* @param id
* @return
*/
DataGoodsApiDto
selectById
(
Long
id
);
}
}
\ No newline at end of file
jz-dm-manage/src/main/java/com/jz/manage/moduls/service/impl/DataGoodsApiServiceImpl.java
View file @
759b51d0
package
com
.
jz
.
manage
.
moduls
.
service
.
impl
;
package
com
.
jz
.
manage
.
moduls
.
service
.
impl
;
import
com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto
;
import
com.jz.manage.moduls.mapper.DataGoodsApiDao
;
import
com.jz.manage.moduls.mapper.DataGoodsApiDao
;
import
com.jz.manage.moduls.service.DataGoodsApiService
;
import
com.jz.manage.moduls.service.DataGoodsApiService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -16,4 +17,15 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
...
@@ -16,4 +17,15 @@ public class DataGoodsApiServiceImpl implements DataGoodsApiService {
@Autowired
@Autowired
private
DataGoodsApiDao
tDataGoodsApiDao
;
private
DataGoodsApiDao
tDataGoodsApiDao
;
/**
* 主键查询数据详情
*
* @param id
* @return
*/
@Override
public
DataGoodsApiDto
selectById
(
Long
id
)
{
DataGoodsApiDto
dataGoodsApiDto
=
tDataGoodsApiDao
.
findById
(
id
);
return
dataGoodsApiDto
;
}
}
}
\ No newline at end of file
jz-dm-manage/src/main/resources/mapper/goods/DataGoodsApiDao.xml
View file @
759b51d0
...
@@ -22,5 +22,44 @@
...
@@ -22,5 +22,44 @@
</resultMap>
</resultMap>
<select
id=
"findById"
resultType=
"com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsApiDto"
parameterType=
"map"
>
SELECT
t1.data_goods_id as dataGoodsId,
t1.data_name as dataName,
(CASE WHEN t1.data_type = '01' then 'api'
WHEN t1.data_type = '02' then '数据包' end) dataType,
t2.category_name as categoryName,
t1.upt_time as uptTime,
(CASE WHEN t1.data_status = '01' then '预售'
WHEN t1.data_status = '02' then '在售中'
WHEN t1.data_status = '02' then '下架'
WHEN t1.data_status = '02' then '上架' end) dataStatus,
(CASE WHEN t1.price_type = '01' THEN '免费'
WHEN t1.price_type = '02' THEN '收费' end) priceType,
t3.api_url as apiUrl,
t3.api_method as apiMethod,
t3.request_type as requestType,
t3.return_type as returnType,
t3.api_key as apiKey,
t3.request_token as requestToken,
(CASE WHEN t4.params_diff = '01' THEN '公共参数'
WHEN t4.params_diff = '02' THEN '请求参数'
WHEN t4.params_diff = '03' THEN '响应参数'
WHEN t4.params_diff = '04' THEN '请求头参数'
WHEN t4.params_diff = '05' THEN '状态码参数' end) paramsDiff,
t4.params_name as paramsName,
t4.default_value as defaultValue,
t4.params_desc as paramsDesc,
t4.remark as remark,
t3.return_data_example as returnDataExample
FROM
t_data_goods t1
INNER JOIN t_data_goods_category t2 ON t1.category_id = t2.category_id
INNER JOIN t_data_goods_api t3 ON t1.data_goods_id = t3.data_goods_id
INNER JOIN t_data_goods_api_params t4 ON t3.goods_api = t4.goods_api
WHERE
1= 1 AND
t1.del_flag = 'N'
<if
test=
"dataGoodsId != null"
>
and t1.data_goods_id = #{dataGoodsId}
</if>
</select>
</mapper>
</mapper>
\ No newline at end of file
jz-dm-manage/src/main/resources/mapper/goods/DataGoodsDao.xml
View file @
759b51d0
...
@@ -81,6 +81,7 @@
...
@@ -81,6 +81,7 @@
<if
test=
"dataStatus != null and dataStatus != ''"
>
<if
test=
"dataStatus != null and dataStatus != ''"
>
and data_status = #{dataStatus}
and data_status = #{dataStatus}
</if>
</if>
order by t1.upt_time desc
</select>
</select>
<!--新增所有列-->
<!--新增所有列-->
...
...
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