增加评论回复接口和评论列表接口实现以及部分实体调整
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package cn.iocoder.mall.order.application;
|
||||
|
||||
import org.apache.catalina.connector.Connector;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
|
||||
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
|
||||
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@SpringBootApplication(scanBasePackages = {"cn.iocoder.mall.order"})
|
||||
public class OrderApplication {
|
||||
@@ -10,4 +15,26 @@ public class OrderApplication {
|
||||
SpringApplication.run(OrderApplication.class, args);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 解决异常信息:
|
||||
* java.lang.IllegalArgumentException:
|
||||
* Invalid character found in the request target. The valid characters are defined in RFC 7230 and RFC 3986
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public ConfigurableServletWebServerFactory webServerFactory() {
|
||||
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
|
||||
factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
|
||||
@Override
|
||||
public void customize(Connector connector) {
|
||||
connector.setProperty("relaxedQueryChars", "|{}[]");
|
||||
}
|
||||
});
|
||||
return factory;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -4,17 +4,14 @@ import cn.iocoder.common.framework.constant.MallConstants;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.order.api.OrderCommentService;
|
||||
import cn.iocoder.mall.order.api.bo.OrderCommentCreateBO;
|
||||
import cn.iocoder.mall.order.api.bo.OrderCommentPageBO;
|
||||
import cn.iocoder.mall.order.api.dto.OrderCommentCreateDTO;
|
||||
import cn.iocoder.mall.user.sdk.annotation.RequiresLogin;
|
||||
import cn.iocoder.mall.order.api.dto.OrderCommentPageDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
@@ -41,4 +38,12 @@ public class OrderCommentController {
|
||||
public CommonResult<OrderCommentCreateBO> createOrder(@RequestBody @Validated OrderCommentCreateDTO orderCommentCreateDTO) {
|
||||
return success(orderCommentService.createOrderComment(orderCommentCreateDTO));
|
||||
}
|
||||
|
||||
@GetMapping("getOrderCommentPage")
|
||||
//@RequiresLogin
|
||||
@ApiOperation(value = "获取评论分页")
|
||||
public CommonResult<OrderCommentPageBO> getOrderCommentPage(@Validated OrderCommentPageDTO orderCommentPageDTO){
|
||||
return success(orderCommentService.getOrderCommentPage(orderCommentPageDTO));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package cn.iocoder.mall.order.application.controller.users;
|
||||
|
||||
import cn.iocoder.common.framework.constant.MallConstants;
|
||||
import cn.iocoder.common.framework.vo.CommonResult;
|
||||
import cn.iocoder.mall.order.api.OrderCommentReplyService;
|
||||
import cn.iocoder.mall.order.api.bo.OrderCommentCreateBO;
|
||||
import cn.iocoder.mall.order.api.bo.OrderCommentReplyCreateBO;
|
||||
import cn.iocoder.mall.order.api.dto.OrderCommentReplyCreateDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.dubbo.config.annotation.Reference;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import static cn.iocoder.common.framework.vo.CommonResult.success;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 评论回复模块 Api(user)
|
||||
*
|
||||
* @author wtz
|
||||
* @time 2019-05-31 18:00
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(MallConstants.ROOT_PATH_USER + "/order_comment_reply")
|
||||
@Api("用户评论回复模块 ")
|
||||
public class OrderCommentReplyController {
|
||||
|
||||
@Reference(validation = "true", version = "${dubbo.provider.OrderCommentService.version}")
|
||||
private OrderCommentReplyService orderCommentReplyService;
|
||||
|
||||
@PostMapping("create_order_comment")
|
||||
//@RequiresLogin
|
||||
@ApiOperation(value = "创建订单")
|
||||
public CommonResult<OrderCommentReplyCreateBO> createOrderCommentReply(@RequestBody @Validated OrderCommentReplyCreateDTO orderCommentReplyCreateDTO){
|
||||
return success(orderCommentReplyService.createOrderCommentReply(orderCommentReplyCreateDTO));
|
||||
}
|
||||
}
|
||||
@@ -17,7 +17,11 @@ server:
|
||||
context-path: /order-api/
|
||||
|
||||
swagger:
|
||||
enable: false
|
||||
enable: true # 暂时不去掉
|
||||
title: 订单子系统
|
||||
description: 订单子系统
|
||||
version: 1.0.0
|
||||
base-package: cn.iocoder.mall.order.application.controller
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
|
||||
Reference in New Issue
Block a user