Commit 41f0aa68 authored by zhangc's avatar zhangc

Merge branch 'dm_dev' of http://gitlab.ioubuy.cn/yaobenzhang/dm_project into dm_dev

parents c29b9e57 fae3378a
......@@ -26,7 +26,7 @@ import java.util.List;
*/
@RestController
@RequestMapping("dataGoodsApi")
@Api(tags = "商品详情--controller")
@Api(tags = "平台--数据api-controller")
public class DataGoodsApiController extends BaseController {
/**
* 服务对象
......
......@@ -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) {
......
......@@ -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);
}
......
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;
}
......@@ -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 priceType;
@ApiModelProperty(value = "商品分类名称")
private String categoryName;
@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;
}
......
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;
}
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
......@@ -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());
......
......@@ -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 '响应参数'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment