From 4941d32b890cc644e92a3294cfb9b987cf55b284 Mon Sep 17 00:00:00 2001
From: wen <1455474577@qq.com>
Date: Fri, 7 Jan 2022 17:59:40 +0800
Subject: [PATCH 1/7] =?UTF-8?q?=E6=90=AD=E5=BB=BA=E7=95=99=E8=A8=80?=
=?UTF-8?q?=E6=9D=BF=E6=9C=8D=E5=8A=A1=E6=A1=86=E6=9E=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
xhpc-modules/pom.xml | 1 +
xhpc-modules/xhpc-message-board/pom.xml | 143 ++++++++++++++++++
.../board/XhpcMessageBoardApplication.java | 37 +++++
.../api/XhpcMessageBoardApiController.java | 41 +++++
.../domain/SendMessageToPlatformRequest.java | 31 ++++
.../service/XhpcMessageBoardService.java | 12 ++
.../impl/XhpcMessageBoardServiceImpl.java | 5 +
.../src/main/resources/banner.txt | 10 ++
.../src/main/resources/bootstrap.yml | 25 +++
.../src/main/resources/logback.xml | 75 +++++++++
10 files changed, 380 insertions(+)
create mode 100644 xhpc-modules/xhpc-message-board/pom.xml
create mode 100644 xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/XhpcMessageBoardApplication.java
create mode 100644 xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/api/XhpcMessageBoardApiController.java
create mode 100644 xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/domain/SendMessageToPlatformRequest.java
create mode 100644 xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/service/XhpcMessageBoardService.java
create mode 100644 xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/service/impl/XhpcMessageBoardServiceImpl.java
create mode 100644 xhpc-modules/xhpc-message-board/src/main/resources/banner.txt
create mode 100644 xhpc-modules/xhpc-message-board/src/main/resources/bootstrap.yml
create mode 100644 xhpc-modules/xhpc-message-board/src/main/resources/logback.xml
diff --git a/xhpc-modules/pom.xml b/xhpc-modules/pom.xml
index 561957dd..e5a4a82c 100644
--- a/xhpc-modules/pom.xml
+++ b/xhpc-modules/pom.xml
@@ -19,6 +19,7 @@
xhpc-wxma
xhpc-invoice
xhpc-tradebill
+ xhpc-message-board
xhpc-modules
diff --git a/xhpc-modules/xhpc-message-board/pom.xml b/xhpc-modules/xhpc-message-board/pom.xml
new file mode 100644
index 00000000..efffedac
--- /dev/null
+++ b/xhpc-modules/xhpc-message-board/pom.xml
@@ -0,0 +1,143 @@
+
+
+
+ xhpc-modules
+ com.ruoyi
+ 3.0.0
+
+ 4.0.0
+
+ xhpc-message-board
+
+
+ 留言板服务
+
+
+
+ 8
+ 8
+
+
+
+
+
+
+ junit
+ junit
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-discovery
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-nacos-config
+
+
+
+
+ com.alibaba.cloud
+ spring-cloud-starter-alibaba-sentinel
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+
+
+ io.springfox
+ springfox-swagger-ui
+ ${swagger.fox.version}
+
+
+
+
+ mysql
+ mysql-connector-java
+
+
+
+
+ com.ruoyi
+ ruoyi-common-datasource
+
+
+
+
+ com.ruoyi
+ ruoyi-common-datascope
+
+
+
+
+ com.ruoyi
+ ruoyi-common-log
+
+
+
+
+ com.ruoyi
+ ruoyi-common-swagger
+
+
+ com.ruoyi
+ ruoyi-common-core
+
+
+ com.squareup.okhttp3
+ okhttp
+
+
+ com.ruoyi
+ xhpc-common
+ 3.0.0
+ compile
+
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+ 3.10.2
+ compile
+
+
+
+
+
+ ${project.artifactId}
+
+
+ src/main/resources
+
+
+ src/main/java
+
+ **/*.xml
+
+
+
+
+
+ org.springframework.boot
+ spring-boot-maven-plugin
+ 2.4.0
+
+
+
+ repackage
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/XhpcMessageBoardApplication.java b/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/XhpcMessageBoardApplication.java
new file mode 100644
index 00000000..27a76f51
--- /dev/null
+++ b/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/XhpcMessageBoardApplication.java
@@ -0,0 +1,37 @@
+package com.xhpc.board;
+
+import com.xhpc.common.security.annotation.EnableCustomConfig;
+import com.xhpc.common.security.annotation.EnableRyFeignClients;
+import com.xhpc.common.swagger.annotation.EnableCustomSwagger2;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+/**
+ * @author WH
+ * @date 2021/12/7 14:55
+ * @since version-1.0
+ */
+@EnableCustomConfig
+@EnableCustomSwagger2
+@EnableRyFeignClients
+@SpringBootApplication
+@MapperScan("com.xhpc.board.mapper")
+public class XhpcMessageBoardApplication {
+
+ public static void main(String[] args) {
+
+ SpringApplication.run(XhpcMessageBoardApplication.class, args);
+ System.out.println("(♥◠‿◠)ノ゙ 留言板模块启动成功 ლ(´ڡ`ლ)゙ \n" +
+ " .-------. ____ __ \n" +
+ " | _ _ \\ \\ \\ / / \n" +
+ " | ( ' ) | \\ _. / ' \n" +
+ " |(_ o _) / _( )_ .' \n" +
+ " | (_,_).' __ ___(_ o _)' \n" +
+ " | |\\ \\ | || |(_,_)' \n" +
+ " | | \\ `' /| `-' / \n" +
+ " | | \\ / \\ / \n" +
+ " ''-' `'-' `-..-' ");
+ }
+
+}
diff --git a/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/api/XhpcMessageBoardApiController.java b/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/api/XhpcMessageBoardApiController.java
new file mode 100644
index 00000000..eed7651e
--- /dev/null
+++ b/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/api/XhpcMessageBoardApiController.java
@@ -0,0 +1,41 @@
+package com.xhpc.board.api;
+
+import com.xhpc.board.domain.SendMessageToPlatformRequest;
+import com.xhpc.board.service.XhpcMessageBoardService;
+import com.xhpc.common.core.web.controller.BaseController;
+import com.xhpc.common.core.web.domain.AjaxResult;
+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 javax.annotation.Resource;
+
+/**
+ * 小程序的InvoiceController
+ *
+ * @author WH
+ * @date 2021/12/23 13:49
+ * @since version-1.0
+ */
+@RestController
+@RequestMapping("/api/message-board/")
+public class XhpcMessageBoardApiController extends BaseController {
+
+ @Resource
+ XhpcMessageBoardService xhpcMessageBoardService;
+
+ /**
+ * 用户发起聊天,发送聊天记录给平台客服
+ *
+ * @author WH
+ * @date 2021/12/28 18:51
+ * @since version-1.0
+ */
+ @PostMapping("/user/message")
+ public AjaxResult sendMessageToPlatform(@RequestBody SendMessageToPlatformRequest userMessage) {
+
+ return AjaxResult.success();
+ }
+
+}
diff --git a/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/domain/SendMessageToPlatformRequest.java b/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/domain/SendMessageToPlatformRequest.java
new file mode 100644
index 00000000..1a7a2aa4
--- /dev/null
+++ b/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/domain/SendMessageToPlatformRequest.java
@@ -0,0 +1,31 @@
+package com.xhpc.board.domain;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+/**
+ * 用户所发送的信息的包装类
+ *
+ * @author WH
+ * @date 2022/1/7 17:19
+ * @since version-1.0
+ */
+@NoArgsConstructor
+@Data
+public class SendMessageToPlatformRequest {
+
+ @JsonProperty("sendMessageTime")
+ private String sendMessageTime;
+ @JsonProperty("senderAccount")
+ private String senderAccount;
+ @JsonProperty("senderType")
+ private Integer senderType;
+ @JsonProperty("senderContent")
+ private String senderContent;
+ @JsonProperty("receiveId")
+ private String receiveId;
+ @JsonProperty("receiverType")
+ private Integer receiverType;
+
+}
diff --git a/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/service/XhpcMessageBoardService.java b/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/service/XhpcMessageBoardService.java
new file mode 100644
index 00000000..cae8b8ce
--- /dev/null
+++ b/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/service/XhpcMessageBoardService.java
@@ -0,0 +1,12 @@
+package com.xhpc.board.service;
+
+/**
+ * 留言板服务的Service
+ *
+ * @author WH
+ * @date 2022/1/7 17:57
+ * @since version-1.0
+ */
+public class XhpcMessageBoardService {
+
+}
diff --git a/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/service/impl/XhpcMessageBoardServiceImpl.java b/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/service/impl/XhpcMessageBoardServiceImpl.java
new file mode 100644
index 00000000..9fee818f
--- /dev/null
+++ b/xhpc-modules/xhpc-message-board/src/main/java/com/xhpc/board/service/impl/XhpcMessageBoardServiceImpl.java
@@ -0,0 +1,5 @@
+package com.xhpc.board.service.impl;
+
+public class XhpcMessageBoardServiceImpl {
+
+}
diff --git a/xhpc-modules/xhpc-message-board/src/main/resources/banner.txt b/xhpc-modules/xhpc-message-board/src/main/resources/banner.txt
new file mode 100644
index 00000000..27cacb9c
--- /dev/null
+++ b/xhpc-modules/xhpc-message-board/src/main/resources/banner.txt
@@ -0,0 +1,10 @@
+Spring Boot Version: ${spring-boot.version}
+Spring Application Name: ${spring.application.name}
+ _ __ _ _
+ (_) / _|(_)| |
+ _ __ _ _ ___ _ _ _ ______ | |_ _ | | ___
+| '__|| | | | / _ \ | | | || ||______|| _|| || | / _ \
+| | | |_| || (_) || |_| || | | | | || || __/
+|_| \__,_| \___/ \__, ||_| |_| |_||_| \___|
+ __/ |
+ |___/
\ No newline at end of file
diff --git a/xhpc-modules/xhpc-message-board/src/main/resources/bootstrap.yml b/xhpc-modules/xhpc-message-board/src/main/resources/bootstrap.yml
new file mode 100644
index 00000000..b4365277
--- /dev/null
+++ b/xhpc-modules/xhpc-message-board/src/main/resources/bootstrap.yml
@@ -0,0 +1,25 @@
+# Tomcat
+server:
+ port: 9805
+
+# Spring
+spring:
+ application:
+ # 应用名称
+ name: xhpc-message-board
+ profiles:
+ # 环境配置
+ active: dev
+ cloud:
+ nacos:
+ discovery:
+ # 服务注册地址
+ server-addr: 127.0.0.1:8848
+ config:
+ # 配置中心地址
+ server-addr: 127.0.0.1:8848
+ # 配置文件格式
+ file-extension: yml
+ # 共享配置
+ shared-configs:
+ - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
\ No newline at end of file
diff --git a/xhpc-modules/xhpc-message-board/src/main/resources/logback.xml b/xhpc-modules/xhpc-message-board/src/main/resources/logback.xml
new file mode 100644
index 00000000..66683df0
--- /dev/null
+++ b/xhpc-modules/xhpc-message-board/src/main/resources/logback.xml
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+
+
+
+ ${log.pattern}
+
+
+
+
+
+ ${log.path}/info.log
+
+
+
+ ${log.path}/info.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+ ${log.pattern}
+
+
+
+ INFO
+
+ ACCEPT
+
+ DENY
+
+
+
+
+ ${log.path}/error.log
+
+
+
+ ${log.path}/error.%d{yyyy-MM-dd}.log
+
+ 60
+
+
+ ${log.pattern}
+
+
+
+ ERROR
+
+ ACCEPT
+
+ DENY
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 4184b9dc0f69b28fb0e8f330e1cdb633d6f3ebd4 Mon Sep 17 00:00:00 2001
From: wen <1455474577@qq.com>
Date: Mon, 10 Jan 2022 13:16:35 +0800
Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8DtokenService.getLoginUser?=
=?UTF-8?q?()=E8=BF=94=E5=9B=9ELoginUser=E4=B8=AD=E7=9A=84userType?=
=?UTF-8?q?=E4=B8=BAnull=E7=9A=84=E9=97=AE=E9=A2=98=20by=20yy?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../java/com/xhpc/system/controller/SysUserController.java | 5 +++++
.../src/main/resources/mapper/system/SysUserMapper.xml | 1 +
2 files changed, 6 insertions(+)
diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/xhpc/system/controller/SysUserController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/xhpc/system/controller/SysUserController.java
index b001f44c..6430a50e 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/com/xhpc/system/controller/SysUserController.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/com/xhpc/system/controller/SysUserController.java
@@ -11,6 +11,7 @@ import com.xhpc.common.core.web.page.TableDataInfo;
import com.xhpc.common.log.annotation.Log;
import com.xhpc.common.log.enums.BusinessType;
import com.xhpc.common.security.annotation.PreAuthorize;
+import com.xhpc.common.util.UserTypeUtil;
import com.xhpc.system.api.domain.SysRole;
import com.xhpc.system.api.domain.SysUser;
import com.xhpc.system.api.model.LoginUser;
@@ -107,6 +108,10 @@ public class SysUserController extends BaseController {
sysUserVo.setTenantId(sysUser.getTenantId());
sysUserVo.setRoles(roles);
sysUserVo.setPermissions(permissions);
+ sysUserVo.setUsername(username);
+ sysUserVo.setUserType(UserTypeUtil.USER_TYPE);
+ sysUserVo.setUserTypeUtil(UserTypeUtil.USER);
+ sysUserVo.setUserid(sysUser.getUserId());
return R.ok(sysUserVo);
}
diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
index 8e553c57..679b6328 100644
--- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
+++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -27,6 +27,7 @@
+
From 690627c017732b2db3c8d6d019160f813660ad1d Mon Sep 17 00:00:00 2001
From: wen <1455474577@qq.com>
Date: Thu, 13 Jan 2022 18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ME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../com/xhpc/system/api/model/LoginUser.java | 2 +-
.../com/xhpc/common/api/UserTypeService.java | 4 +-
.../{invoice => }/XhpcInvoiceApplication.java | 2 +-
.../controller/XhpcInvoiceController.java | 2 +-
.../service/impl/XhpcInvoiceServiceImpl.java | 60 +++++++++++--------
.../src/main/resources/bootstrap.yml | 3 +-
.../XhpcInvoiceMapHistoryOrderMapper.xml | 1 +
7 files changed, 43 insertions(+), 31 deletions(-)
rename xhpc-modules/xhpc-invoice/src/main/java/com/xhpc/{invoice => }/XhpcInvoiceApplication.java (98%)
diff --git a/ruoyi-api/ruoyi-api-system/src/main/java/com/xhpc/system/api/model/LoginUser.java b/ruoyi-api/ruoyi-api-system/src/main/java/com/xhpc/system/api/model/LoginUser.java
index cae15e70..49878ee4 100644
--- a/ruoyi-api/ruoyi-api-system/src/main/java/com/xhpc/system/api/model/LoginUser.java
+++ b/ruoyi-api/ruoyi-api-system/src/main/java/com/xhpc/system/api/model/LoginUser.java
@@ -25,7 +25,7 @@ public class LoginUser implements Serializable
private Long userid;
/**
- * 用户名
+ * 用户账号(手机号、账号)
*/
private String username;
diff --git a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java
index 4508fe61..48058043 100644
--- a/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java
+++ b/xhpc-modules/xhpc-common/src/main/java/com/xhpc/common/api/UserTypeService.java
@@ -8,6 +8,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;
+import java.util.Map;
/**
* @author yuyang
@@ -18,11 +19,12 @@ public interface UserTypeService {
/**
* 根据手机号(账号),用户id和类型 获取用户信息
+ *
* @param
* @return
*/
@GetMapping("/common/getUser")
- R getUser(@RequestParam(value = "phone")String phone,@RequestParam(value = "userId")Long userId,@RequestParam(value = "userType")Integer userType,@RequestParam(value = "serialNumber")String serialNumber,@RequestParam(value = "tenantId")String tenantId);
+ R