Compare commits
360 Commits
feature/re
...
master
Author | SHA1 | Date |
---|---|---|
|
5eb778c21c | |
|
43b79969ee | |
|
8dca878499 | |
|
4e09f1055e | |
|
5d3857506d | |
|
e3a27c5199 | |
|
9c7e6ea4a1 | |
|
c3d1fba84a | |
|
906a56c431 | |
|
74ac63338a | |
|
d71f75bfe7 | |
|
70d3d32bc5 | |
|
81cfc52881 | |
|
23c8fb7410 | |
|
4b5187f5dc | |
|
8734ca0502 | |
|
67d1f6cc19 | |
|
1f85f77ca3 | |
|
5083e455ab | |
|
a74e6412e0 | |
|
502fcb3072 | |
|
f90bc03b48 | |
|
5357e25635 | |
|
93655e9f63 | |
|
4d50a05ed7 | |
|
0005e1da6b | |
|
f3e5e93173 | |
|
76e7619eac | |
|
44af6d3b60 | |
|
2ab7a54774 | |
|
1479666516 | |
|
6b42b596de | |
|
700ded15ec | |
|
23d1028e13 | |
|
d5ff1265d7 | |
|
56402b081b | |
|
23a0c7fd48 | |
|
17edba85e5 | |
|
5f5b9ec9ab | |
|
c755d11609 | |
|
f02c000855 | |
|
2ba4ab57b0 | |
|
60949dfa90 | |
|
447cd262ad | |
|
0f7743abb1 | |
|
ccd4372a68 | |
|
7150bcf495 | |
|
196ba38b15 | |
|
0d29d79af6 | |
|
43f11e5db2 | |
|
fca80acccb | |
|
ef36122845 | |
|
d8e55d9021 | |
|
dbabbb686e | |
|
61d8a0ca88 | |
|
54b79c03ca | |
|
50e410eb54 | |
|
b74323dfcc | |
|
f1acb5c183 | |
|
085e852f19 | |
|
f6ed1d4982 | |
|
71b034673e | |
|
14f6021416 | |
|
a97285ba3c | |
|
a87d8c2295 | |
|
53fcee7ada | |
|
619bc45f17 | |
|
502a10efe3 | |
|
c9637b5ae6 | |
|
96141843ef | |
|
500ff7f3d3 | |
|
7fd5caec09 | |
|
a9b0d8806c | |
|
156d3c18c2 | |
|
9b675ab620 | |
|
a3a0435850 | |
|
0bfcbe9f0e | |
|
37800e7f03 | |
|
598c353014 | |
|
e5e70950ae | |
|
9b4f92beed | |
|
d0238c2320 | |
|
7ce5ac3965 | |
|
c5ecdac49d | |
|
a2090eecb8 | |
|
ef826ce25f | |
|
7cf4de3530 | |
|
3db4b4d000 | |
|
de0f0fc2f9 | |
|
84f274bbc6 | |
|
5726a63ec7 | |
|
ed9cad897f | |
|
6f3ba08098 | |
|
6794ef4e10 | |
|
8753c08c4a | |
|
940b6b4125 | |
|
a547800d96 | |
|
0dcf869ce3 | |
|
20b74ebdcd | |
|
00693ef802 | |
|
8ca5ff3290 | |
|
dc5ea06789 | |
|
2ab3f8a7c6 | |
|
c556b006b7 | |
|
14576812ae | |
|
4ebcb60f17 | |
|
90bed7d0b0 | |
|
888ac7f8f4 | |
|
387b3a0e68 | |
|
2ef2fabc66 | |
|
35ec6d7485 | |
|
5cb6952434 | |
|
43944084c2 | |
|
41d617b26f | |
|
eaf4a778dd | |
|
335aaccdbb | |
|
c34fe50549 | |
|
eeae4fb8ef | |
|
416e64f859 | |
|
4523a29c53 | |
|
ad6ca564c5 | |
|
a503ef5112 | |
|
f94104bf55 | |
|
94e74096d0 | |
|
9f0e8ae5f9 | |
|
2ad2c4eb96 | |
|
ec0c8aa32a | |
|
b27884e889 | |
|
942c72937f | |
|
ff14025812 | |
|
36644813b4 | |
|
752b3b0418 | |
|
6c7e09065c | |
|
6810cd2270 | |
|
3fb4d72bfe | |
|
c48498e441 | |
|
f8004e0fb2 | |
|
09b3e8f7d2 | |
|
703664701b | |
|
aebc53b950 | |
|
5a684c3829 | |
|
ed5909b837 | |
|
794702fd6a | |
|
b1b991631b | |
|
ba58dbc613 | |
|
dcd28a33c2 | |
|
d142c9b5f2 | |
|
1d39e93585 | |
|
4341a990db | |
|
50acc32060 | |
|
e15c52df80 | |
|
743865c050 | |
|
bf7fa5accc | |
|
f458e9e3cb | |
|
9483cc91ae | |
|
4c90ed1bb8 | |
|
8cff519d1c | |
|
8077d0bd12 | |
|
79bb17e7f5 | |
|
07011fef2a | |
|
e93acf0421 | |
|
56e2ecb00f | |
|
405262f1d0 | |
|
fc88d6fcfc | |
|
e51d11402c | |
|
da5c462a33 | |
|
472a82d7cc | |
|
29bedd38f4 | |
|
ecf2d4d66f | |
|
fe85a885b2 | |
|
158066bc9d | |
|
eb011a2634 | |
|
f22bb0dde2 | |
|
4369932fa7 | |
|
39059b6f4c | |
|
d419eb53a7 | |
|
337a72b06c | |
|
af07e353ee | |
|
864002567b | |
|
0e2c6e6e7d | |
|
b24626ee9b | |
|
a5c21b391b | |
|
40eb64b043 | |
|
32a50b8394 | |
|
1a56de7de0 | |
|
3f915a7ac8 | |
|
206d13ef24 | |
|
af4c617408 | |
|
583d90f42d | |
|
a17b4667db | |
|
78020b38c1 | |
|
489db2410d | |
|
6d9976e0e6 | |
|
daa17a6caa | |
|
535b175fab | |
|
ff6b2cdf30 | |
|
f5037353d9 | |
|
2d8ee1bb8e | |
|
13f5f5f52a | |
|
a044b8c367 | |
|
87cc661a7f | |
|
54c6eb463b | |
|
c69d7e032f | |
|
2f4d335c33 | |
|
c13fcadc1f | |
|
212dd4f1da | |
|
8500650f8e | |
|
8ee438d3c3 | |
|
63fcfc941d | |
|
083b94232d | |
|
1350eb52f5 | |
|
214d933b70 | |
|
adf6cc178d | |
|
7d3c43a1e8 | |
|
078fa26c7f | |
|
1b7b096f50 | |
|
e813ee9dff | |
|
103cac2670 | |
|
0a5801a116 | |
|
1f10b247b9 | |
|
52bac53e6c | |
|
59e1e87b2a | |
|
0ea4df338e | |
|
33d27fdedc | |
|
38d47a0bca | |
|
a9a2fb5d68 | |
|
572ea22d4e | |
|
59b59a06f8 | |
|
1f584d5e9d | |
|
303999e3e7 | |
|
ba510ac671 | |
|
2bcef6635e | |
|
34962cae82 | |
|
e39f863f6c | |
|
f2c09097fe | |
|
e19f77a6d0 | |
|
b30a70cbae | |
|
e1aa7302a9 | |
|
0e114c87c0 | |
|
1bf1ab1619 | |
|
41bdbfaa81 | |
|
4b60032c5e | |
|
3f19cd60ea | |
|
ecc03229bd | |
|
477d1c0dea | |
|
7597e9d74d | |
|
cb2f059fff | |
|
097ecfa023 | |
|
91b2ade9f8 | |
|
97a9ebdf56 | |
|
e26568d0df | |
|
cecfc17172 | |
|
deabcf1b37 | |
|
aacf29a3db | |
|
cb5dbc7919 | |
|
af0638438c | |
|
2efdbfe773 | |
|
afc35ca586 | |
|
5a5ab268dd | |
|
7e40833bb7 | |
|
461b75cce2 | |
|
05f8858b6c | |
|
da5366bc6f | |
|
c363c0c6d9 | |
|
57fffd4e27 | |
|
69d3b7cdc4 | |
|
2b8c8abd5a | |
|
3859feb21d | |
|
57bdbdca3b | |
|
7891130482 | |
|
cc295c0512 | |
|
efff0788aa | |
|
27fac6cf9c | |
|
367c359b5e | |
|
295316619c | |
|
f9f7361a16 | |
|
5b359ed6a3 | |
|
b4ae47cf28 | |
|
89ff879055 | |
|
f8034850cb | |
|
dd16eb0106 | |
|
570c7bb656 | |
|
e679fd847e | |
|
7c3621ac2d | |
|
bd23402389 | |
|
1c014c13d1 | |
|
c78b731816 | |
|
be124c92fa | |
|
103a6e7db7 | |
|
63f14ce3d1 | |
|
00385906c3 | |
|
d2e1697e4e | |
|
da69a15cb9 | |
|
13d4e21691 | |
|
f4e4ef40c1 | |
|
e97b6492b2 | |
|
79bf09e235 | |
|
74c13643a8 | |
|
25efe0d49a | |
|
7e0540104f | |
|
415e25cdd7 | |
|
7b99089c67 | |
|
e44f6b8a0f | |
|
e09584800a | |
|
47717bae9c | |
|
2672fc9e33 | |
|
61ac03de38 | |
|
8d04847cd2 | |
|
ee27b542cd | |
|
e559b6d04d | |
|
0d9a485c19 | |
|
bb64605dc4 | |
|
c7a59a0d99 | |
|
6dedc5a170 | |
|
32dd0de4cb | |
|
821d852b5b | |
|
7c527151b0 | |
|
200e5c1d32 | |
|
999616a0cd | |
|
dfeabe5897 | |
|
bd4998b73d | |
|
789cf9f3d9 | |
|
f5309a6759 | |
|
70aa6a6b27 | |
|
09dfd88a12 | |
|
c6a92b1e62 | |
|
628c9e57bb | |
|
bcf7cb7e3d | |
|
1594bc4a74 | |
|
019ff6943f | |
|
8316bd1e76 | |
|
93efb588e2 | |
|
3cd55dbbb9 | |
|
cf6dcdee4c | |
|
7a742d7338 | |
|
382f32de5f | |
|
02c090a971 | |
|
2b791a875a | |
|
cb5af5202f | |
|
71f1c01674 | |
|
7b0c1f6fbf | |
|
d8c964f98b | |
|
b2a3596f20 | |
|
f77029ead8 | |
|
e34ce61003 | |
|
b2dd5112c4 | |
|
4bb2498fc8 | |
|
f5f2693e8e | |
|
5f4404ae1d | |
|
746742ed14 | |
|
aabccf6d99 | |
|
c7b780d2ef | |
|
dc2b5c9daa | |
|
b30dbfbe2e | |
|
dbc9381724 | |
|
d5acfb00ae | |
|
84f3caf7af | |
|
8fda8397f2 | |
|
d5157ce481 | |
|
c59ab0d20a |
|
@ -0,0 +1,24 @@
|
||||||
|
# docker一定要有openjdk8的镜像如果没有执行以下命令
|
||||||
|
# docker pull openjdk:8
|
||||||
|
FROM openjdk:8
|
||||||
|
# 作者信息
|
||||||
|
#LABEL authors="${发布人} <${邮箱}>"
|
||||||
|
|
||||||
|
# 创建我的工作目录(手动创建文件夹,此步骤省略)
|
||||||
|
#RUN mkdir /root/yun
|
||||||
|
|
||||||
|
# 暴露端口(和服务端口保持一致)
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
# 创建着陆点(创建文件夹) 后续路径和这个路径一致
|
||||||
|
WORKDIR "/root/mcwl"
|
||||||
|
|
||||||
|
|
||||||
|
# 复制新的运行程序 ./代表的是相对路径 读取的着陆点
|
||||||
|
COPY ./ncwl-ai.jar /root/mcwl/ncwl-ai.jar
|
||||||
|
|
||||||
|
# 挂载出去日志目录 项目名不加jar
|
||||||
|
VOLUME /root/mcwl/logs/ncwl-ai
|
||||||
|
|
||||||
|
# 运行你的jar 运行的是你copy出来的新的jar包
|
||||||
|
CMD ["java", "-jar", "/root/mcwl/ncwl-ai.jar"]
|
|
@ -135,6 +135,11 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aliyun</groupId>
|
<groupId>com.aliyun</groupId>
|
||||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||||
|
|
|
@ -146,7 +146,7 @@ public class OssUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getOssFilePath(String filePath){
|
public static String getOssFilePath(String filePath){
|
||||||
String fileSuf = filePath.substring(filePath.indexOf(".") + 1);
|
String fileSuf = filePath.substring(filePath.lastIndexOf(".") + 1);
|
||||||
return getOssDefaultPath() + UUID.randomUUID().toString() + "." + fileSuf;
|
return getOssDefaultPath() + UUID.randomUUID().toString() + "." + fileSuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
//package com.mcwl.web.controller.communityCenter;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//import com.mcwl.communityCenter.service.AIService;
|
||||||
|
//import com.mcwl.communityCenter.webSocket.ChatWebSocket;
|
||||||
|
//import lombok.RequiredArgsConstructor;
|
||||||
|
//import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
//import org.springframework.web.bind.annotation.RestController;
|
||||||
|
//import reactor.core.publisher.Flux;
|
||||||
|
//
|
||||||
|
//@RequiredArgsConstructor
|
||||||
|
//@RestController
|
||||||
|
//@RequestMapping("/chat")
|
||||||
|
//public class ChatController {
|
||||||
|
//
|
||||||
|
// private final AIService aiService;
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * ai
|
||||||
|
// */
|
||||||
|
// @GetMapping("/ai")
|
||||||
|
// public Flux<String> switchUserMode(String msg) throws Exception {
|
||||||
|
// return aiService.getDeepSeekResponseStream(msg);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//}
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
|
import com.mcwl.communityCenter.domain.vo.CommunityDetailVo;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityAdviceService;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区通知
|
||||||
|
*/
|
||||||
|
@Api(tags = "社区通知")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("communityAdvice")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CommunityAdviceController {
|
||||||
|
|
||||||
|
private final CommunityAdviceService communityAdviceService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取通知列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取通知列表")
|
||||||
|
@PostMapping("adviceList")
|
||||||
|
public TableDataInfo getCommunityAdviceList(@RequestBody CommunityAdvicePageRes communityAdvicePageRes) {
|
||||||
|
return communityAdviceService.getCommunityAdviceList(communityAdvicePageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,23 +1,20 @@
|
||||||
package com.mcwl.web.controller.communityCenter;
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
|
||||||
import com.mcwl.common.core.page.PageDomain;
|
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.communityCenter.domain.Community;
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
import com.mcwl.communityCenter.domain.dto.CommunityDto;
|
import com.mcwl.communityCenter.domain.vo.CommunityDetailVo;
|
||||||
import com.mcwl.communityCenter.domain.vo.CommunityVo;
|
|
||||||
import com.mcwl.communityCenter.service.CommunityService;
|
import com.mcwl.communityCenter.service.CommunityService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 社区
|
* 社区
|
||||||
|
@ -38,39 +35,104 @@ public class CommunityController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "社区列表")
|
@ApiOperation(value = "社区列表")
|
||||||
@PostMapping("list")
|
@PostMapping("list")
|
||||||
public TableDataInfo getCommunityList(@RequestBody PageDomain pageDomain) {
|
public TableDataInfo getCommunityList(@RequestBody @Valid CommunityListPageRes communityListPageRes) {
|
||||||
return communityService.listByPage(pageDomain);
|
return communityService.listByPage(communityListPageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "社区详情")
|
||||||
|
@GetMapping("detail")
|
||||||
|
public R<CommunityDetailVo> getCommunityDetail(@Valid
|
||||||
|
@ApiParam(value = "社区id", required = true)
|
||||||
|
@NotNull(message = "社区id不能为空")
|
||||||
|
Long communityId) {
|
||||||
|
|
||||||
|
CommunityDetailVo communityDetailVo = communityService.getCommunityDetail(communityId);
|
||||||
|
return R.ok(communityDetailVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑社区
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "编辑社区")
|
||||||
|
@PostMapping("edit")
|
||||||
|
public R<Object> editCommunity(@RequestBody @Valid EditCommunityRes editCommunityRes) {
|
||||||
|
|
||||||
|
communityService.editCommunity(editCommunityRes);
|
||||||
|
return R.ok("编辑成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我加入的社区
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "我加入的社区")
|
||||||
|
@PostMapping("myJoin")
|
||||||
|
public TableDataInfo getMyJoinCommunity(@RequestBody JoinCommunityListPageRes joinCommunityListPageRes) {
|
||||||
|
|
||||||
|
return communityService.getMyJoinCommunity(joinCommunityListPageRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加社区
|
* 添加社区
|
||||||
*
|
|
||||||
* @param communityDto 社区参数
|
|
||||||
* @return 添加结果
|
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "添加社区")
|
@ApiOperation(value = "添加社区")
|
||||||
@PostMapping("add")
|
@PostMapping("addCommunity")
|
||||||
public AjaxResult addCommunity(@RequestBody CommunityDto communityDto) {
|
public R<Object> addCommunity(@RequestBody @Valid AddCommunityRes addCommunityRes) {
|
||||||
Community community = new Community();
|
communityService.addCommunity(addCommunityRes);
|
||||||
BeanUtil.copyProperties(communityDto, community);
|
return R.ok("社区添加成功");
|
||||||
communityService.save(community);
|
|
||||||
return AjaxResult.success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除社区
|
* 加入社区
|
||||||
*
|
|
||||||
* @param id 社区id
|
|
||||||
* @return 删除结果
|
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除社区")
|
@ApiOperation(value = "加入社区")
|
||||||
@PostMapping("delete")
|
@PostMapping("join")
|
||||||
public AjaxResult deleteCommunity(@NotNull(message = "id不能为空")
|
public R<Object> joinCommunity(@RequestBody @Valid JoinCommunityRes joinCommunityRes) {
|
||||||
@ApiParam(value = "id", required = true)
|
|
||||||
Long id) {
|
return communityService.joinCommunity(joinCommunityRes);
|
||||||
communityService.removeById(id);
|
}
|
||||||
return AjaxResult.success();
|
|
||||||
|
/**
|
||||||
|
* 退出社区
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "退出社区")
|
||||||
|
@PostMapping("quit")
|
||||||
|
public R<Object> quitCommunity(@RequestBody @Valid QuitCommunityRes quitCommunityRes) {
|
||||||
|
Long tenantId = quitCommunityRes.getTenantId();
|
||||||
|
Long communityId = quitCommunityRes.getCommunityId();
|
||||||
|
|
||||||
|
return communityService.quitCommunity(tenantId, communityId);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 删除社区
|
||||||
|
// *
|
||||||
|
// * @param id 社区id
|
||||||
|
// * @return 删除结果
|
||||||
|
// */
|
||||||
|
// @ApiOperation(value = "删除社区")
|
||||||
|
// @GetMapping("delete")
|
||||||
|
// public R<Object> deleteCommunity(@NotNull(message = "id不能为空")
|
||||||
|
// @ApiParam(value = "id", required = true)
|
||||||
|
// @Valid
|
||||||
|
// Long id) {
|
||||||
|
// Community community = communityService.getById(id);
|
||||||
|
// if (Objects.isNull(community)) {
|
||||||
|
// return R.fail(HttpStatus.SHOW_ERROR_MSG, "该社区不存在");
|
||||||
|
// }
|
||||||
|
// communityService.removeById(id);
|
||||||
|
// return R.ok();
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否加入社区
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "是否加入社区")
|
||||||
|
@PostMapping("isJoin")
|
||||||
|
public R<Object> isJoinCommunity(@RequestBody @Valid JoinCommunityRes joinCommunityRes) {
|
||||||
|
|
||||||
|
return communityService.isJoinCommunity(joinCommunityRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityFileLogService;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityFileService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件
|
||||||
|
*/
|
||||||
|
@Api(tags = "社区文件")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("communityFile")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CommunityFileController {
|
||||||
|
|
||||||
|
private final CommunityFileService communityFileService;
|
||||||
|
|
||||||
|
private final CommunityFileLogService communityFileLogService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "社区文件列表")
|
||||||
|
@PostMapping("/list")
|
||||||
|
public TableDataInfo getCommunityFileList(@RequestBody @Valid CommunityFilePageListRes communityFilePageListRes) {
|
||||||
|
return communityFileService.getCommunityFileList(communityFilePageListRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件上传
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "社区文件上传")
|
||||||
|
@PostMapping("/upload")
|
||||||
|
public R<String> upload(@RequestBody @Valid CommunityUploadFileRes communityUploadFileRes) {
|
||||||
|
return communityFileService.upload(communityUploadFileRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区文件下载
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "社区文件下载")
|
||||||
|
@PostMapping("/download")
|
||||||
|
public R<String> download(@RequestBody @Valid CommunityDownloadFileRes communityDownloadFileRes) {
|
||||||
|
return communityFileService.download(communityDownloadFileRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.communityCenter.domain.Community;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityService;
|
||||||
|
import com.mcwl.communityCenter.service.CommunityUserService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区用户
|
||||||
|
*/
|
||||||
|
@Api(tags = "社区用户")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("communityUser")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class CommunityUserController {
|
||||||
|
|
||||||
|
private final CommunityUserService communityUserService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区用户列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "社区用户列表")
|
||||||
|
@PostMapping("list")
|
||||||
|
public TableDataInfo getCommunityUserList(@RequestBody @Valid CommunityUserListPageRes communityUserListPageRes) {
|
||||||
|
|
||||||
|
return communityUserService.getCommunityUserList(communityUserListPageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拉黑
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "拉黑")
|
||||||
|
@PostMapping("black")
|
||||||
|
public R<Object> black(@RequestBody @Valid BlackListRes blackListRes) {
|
||||||
|
|
||||||
|
return communityUserService.black(blackListRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消拉黑
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "取消拉黑")
|
||||||
|
@PostMapping("unBlack")
|
||||||
|
public R<Object> unBlack(@RequestBody @Valid UnBlackListRes unBlackListRes) {
|
||||||
|
|
||||||
|
return communityUserService.unBlack(unBlackListRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管理/取消管理
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "管理/取消管理")
|
||||||
|
@PostMapping("manage")
|
||||||
|
public R<Object> manage(@RequestBody @Valid CommunityUserManageRes communityUserManageRes) {
|
||||||
|
|
||||||
|
return communityUserService.manage(communityUserManageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.obs.services.ObsClient;
|
||||||
|
import com.obs.services.exception.ObsException;
|
||||||
|
import com.obs.services.model.DownloadFileRequest;
|
||||||
|
import com.obs.services.model.DownloadFileResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/3/8
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@RequestMapping("/downFile")
|
||||||
|
@RestController
|
||||||
|
public class DownloadFile {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ObsClient obsClient;
|
||||||
|
|
||||||
|
@Value("${huawei.obs.bucketName}")
|
||||||
|
private String bucketName;
|
||||||
|
|
||||||
|
@GetMapping("/down")
|
||||||
|
public R down(@RequestParam String objectKey, String path) {
|
||||||
|
|
||||||
|
try {
|
||||||
|
DownloadFileRequest request = new DownloadFileRequest(bucketName, objectKey);
|
||||||
|
// 设置下载对象的本地文件路径
|
||||||
|
request.setDownloadFile(path);
|
||||||
|
// 设置分段下载时的最大并发数
|
||||||
|
request.setTaskNum(10);
|
||||||
|
// 设置分段大小为10MB
|
||||||
|
request.setPartSize(10 * 1024 * 1024);
|
||||||
|
// 开启断点续传模式
|
||||||
|
request.setEnableCheckpoint(true);
|
||||||
|
// 进行断点续传下载
|
||||||
|
DownloadFileResult result = obsClient.downloadFile(request);
|
||||||
|
System.out.println("downloadFile successfully");
|
||||||
|
System.out.println("Etag:" + result.getObjectMetadata().getEtag());
|
||||||
|
} catch (ObsException e) {
|
||||||
|
System.out.println("downloadFile failed");
|
||||||
|
// 请求失败,打印http状态码
|
||||||
|
System.out.println("HTTP Code:" + e.getResponseCode());
|
||||||
|
// 请求失败,打印服务端错误码
|
||||||
|
System.out.println("Error Code:" + e.getErrorCode());
|
||||||
|
// 请求失败,打印详细错误信息
|
||||||
|
System.out.println("Error Message:" + e.getErrorMessage());
|
||||||
|
// 请求失败,打印请求id
|
||||||
|
System.out.println("Request ID:" + e.getErrorRequestId());
|
||||||
|
System.out.println("Host ID:" + e.getErrorHostId());
|
||||||
|
e.printStackTrace();
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println("downloadFile failed");
|
||||||
|
// 其他异常信息打印
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.communityCenter.domain.IncomeInfo;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
|
import com.mcwl.communityCenter.domain.vo.IncomeInfoVo;
|
||||||
|
import com.mcwl.communityCenter.service.IncomeInfoService;
|
||||||
|
import com.mcwl.communityCenter.service.PublishCollectService;
|
||||||
|
import com.mcwl.communityCenter.service.PublishService;
|
||||||
|
import com.mcwl.communityCenter.service.QuestionService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收益明细
|
||||||
|
*/
|
||||||
|
@Api(tags = "收益明细")
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("incomeInfo")
|
||||||
|
public class IncomeInfoController {
|
||||||
|
|
||||||
|
private final IncomeInfoService incomeInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 明细列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "明细列表")
|
||||||
|
@PostMapping("incomeList")
|
||||||
|
public TableDataInfo incomeList(@Valid @RequestBody IncomeInfoListPageRes incomeInfoListPageRes) {
|
||||||
|
return incomeInfoService.incomeList(incomeInfoListPageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社区收益
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "社区收益")
|
||||||
|
@GetMapping("communityIncome")
|
||||||
|
public R<IncomeInfoVo> communityIncome() {
|
||||||
|
return incomeInfoService.communityIncome();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,18 +1,22 @@
|
||||||
package com.mcwl.web.controller.communityCenter;
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.common.utils.StringUtils;
|
import com.mcwl.common.utils.StringUtils;
|
||||||
import com.mcwl.communityCenter.domain.Community;
|
import com.mcwl.communityCenter.domain.Community;
|
||||||
import com.mcwl.communityCenter.service.InviteService;
|
import com.mcwl.communityCenter.service.InviteService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
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;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -21,10 +25,11 @@ import java.util.List;
|
||||||
/**
|
/**
|
||||||
* 邀请
|
* 邀请
|
||||||
*/
|
*/
|
||||||
@Api(tags = "邀请")
|
@Api(tags = "社区邀请")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("invite")
|
@RequestMapping("invite")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Valid
|
||||||
public class InviteController {
|
public class InviteController {
|
||||||
|
|
||||||
private final InviteService inviteService;
|
private final InviteService inviteService;
|
||||||
|
@ -34,13 +39,15 @@ public class InviteController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "邀请码链接")
|
@ApiOperation(value = "邀请码链接")
|
||||||
@GetMapping("inviteCode")
|
@GetMapping("inviteCode")
|
||||||
public AjaxResult inviteCode(Long communityId) {
|
public R<String> inviteCode(@NotNull(message = "社区不能为空")
|
||||||
|
@ApiParam(value = "社区", required = true)
|
||||||
|
Long communityId) {
|
||||||
// 获取邀请码链接
|
// 获取邀请码链接
|
||||||
String inviteCode = inviteService.getInviteCode(communityId);
|
String inviteCode = inviteService.getInviteCode(communityId);
|
||||||
if (StringUtils.isBlank(inviteCode)) {
|
if (StringUtils.isBlank(inviteCode)) {
|
||||||
return AjaxResult.warn("获取邀请码失败");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取邀请码失败");
|
||||||
}
|
}
|
||||||
return AjaxResult.success(inviteCode);
|
return R.ok(inviteCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -48,14 +55,15 @@ public class InviteController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "接受邀请")
|
@ApiOperation(value = "接受邀请")
|
||||||
@GetMapping("acceptInvite")
|
@GetMapping("acceptInvite")
|
||||||
public AjaxResult acceptInvite(@NotNull(message = "社区不能为空") Long communityId,
|
@Valid
|
||||||
@NotBlank(message = "邀请码不能为空") String inviteCode) {
|
public R<Object> acceptInvite(@NotNull(message = "社区不能为空")
|
||||||
// 接受邀请
|
@ApiParam(value = "社区", required = true)
|
||||||
boolean result = inviteService.acceptInvite(communityId, inviteCode);
|
Long communityId,
|
||||||
if (result) {
|
@NotBlank(message = "邀请码不能为空")
|
||||||
return AjaxResult.success("接受邀请成功");
|
@ApiParam(value = "邀请码", required = true)
|
||||||
}
|
String inviteCode) {
|
||||||
return AjaxResult.warn("接受邀请失败");
|
|
||||||
|
return inviteService.acceptInvite(communityId, inviteCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.MyPublishCollectPageRes;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.MyPublishPageRes;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.PersonHomePageRes;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.QuestionPageRes;
|
||||||
|
import com.mcwl.communityCenter.service.PublishCollectService;
|
||||||
|
import com.mcwl.communityCenter.service.PublishService;
|
||||||
|
import com.mcwl.communityCenter.service.QuestionService;
|
||||||
|
import com.mcwl.communityCenter.service.impl.PublishCommentLikeServiceImpl;
|
||||||
|
import com.mcwl.communityCenter.service.impl.PublishServiceImpl;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
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.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个人主页
|
||||||
|
*/
|
||||||
|
@Api(tags = "个人主页")
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("personHome")
|
||||||
|
public class PersonHomeController {
|
||||||
|
|
||||||
|
private final PublishService publishService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个人主页列表
|
||||||
|
*/
|
||||||
|
@PostMapping("getPersonHomeList")
|
||||||
|
@ApiOperation(value = "个人主页列表")
|
||||||
|
public TableDataInfo getPersonHomeList(@RequestBody @Valid PersonHomePageRes personHomePageRes) {
|
||||||
|
|
||||||
|
return publishService.getPersonHomeList(personHomePageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,106 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.resource.domain.request.PlatForm;
|
||||||
|
import com.mcwl.resource.service.PlatFormService;
|
||||||
|
import com.mcwl.web.controller.common.OssUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 官方app
|
||||||
|
* @Author:ChenYan
|
||||||
|
* @Project:mcwl-ai
|
||||||
|
* @Package:com.mcwl.web.controller.communityCenter
|
||||||
|
* @Filename:PlaFormController
|
||||||
|
* @Description TODO
|
||||||
|
* @Date:2025/3/4 16:36
|
||||||
|
*/
|
||||||
|
@Api(tags = "官方app")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("app")
|
||||||
|
public class PlaFormController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PlatFormService platFormService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台官方联系列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "官方连接方式二维码列表")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public R<List<PlatForm>> list() {
|
||||||
|
|
||||||
|
return R.ok(platFormService.listplatForm());
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* url
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "官方二维码文件")
|
||||||
|
@PostMapping("/UrlFile")
|
||||||
|
public AjaxResult zipUrlFile(@RequestParam MultipartFile file) {
|
||||||
|
String s = OssUtil.uploadMultipartFile(file);
|
||||||
|
return AjaxResult.success("上传成功", s);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 添加平台官方联系
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "添加")
|
||||||
|
@PostMapping("/insert")
|
||||||
|
public R<Boolean> add(@RequestBody PlatForm platForm) {
|
||||||
|
boolean save = platFormService.save(platForm);
|
||||||
|
return R.ok(save);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改平台官方联系
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改")
|
||||||
|
@PostMapping("/update")
|
||||||
|
public AjaxResult updateModel(@RequestBody PlatForm platForm) {
|
||||||
|
|
||||||
|
platFormService.updateById(platForm);
|
||||||
|
|
||||||
|
return AjaxResult.success("修改成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询详情
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询平台app详情")
|
||||||
|
@GetMapping("/selectModelById")
|
||||||
|
public R<PlatForm> selectModelById(@Valid @NotNull(message = "id不能为空") @RequestParam Long id) {
|
||||||
|
PlatForm byId = platFormService.getById(id);
|
||||||
|
return R.ok(byId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除联系
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除联系")
|
||||||
|
@GetMapping("delete")
|
||||||
|
public AjaxResult delete(@Valid @NotNull(message = "id不能为空") @RequestParam Long id) {
|
||||||
|
platFormService.removeById(id);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,83 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.CommentDelRes;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.CommentDetailRes;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.CommentRes;
|
||||||
|
import com.mcwl.communityCenter.domain.vo.CommentVo;
|
||||||
|
import com.mcwl.communityCenter.service.PublishCommentService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
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.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社群评论
|
||||||
|
*/
|
||||||
|
@Api(tags = "社群评论")
|
||||||
|
@RequestMapping("publishComment")
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
|
||||||
|
public class PublishCommentController extends BaseController {
|
||||||
|
|
||||||
|
private final PublishCommentService publishCommentService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加发布评论
|
||||||
|
*
|
||||||
|
* @param commentRes 评论请求参数
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "添加发布评论")
|
||||||
|
@PostMapping("/save")
|
||||||
|
public R<Object> save(@RequestBody @Valid CommentRes commentRes) {
|
||||||
|
|
||||||
|
return publishCommentService.addComment(commentRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取评论详情
|
||||||
|
*
|
||||||
|
* @param commentDetailRes 评论详情请求参数
|
||||||
|
* @return 评论详情
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取评论详情")
|
||||||
|
@PostMapping("/detail")
|
||||||
|
public R<List<CommentVo>> getComment(@RequestBody @Valid CommentDetailRes commentDetailRes) {
|
||||||
|
|
||||||
|
return publishCommentService.getComment(commentDetailRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 点赞或取消点赞评论
|
||||||
|
// * @param commentDetailRes 评论请求参数
|
||||||
|
// * @return 更新后的点赞数
|
||||||
|
// */
|
||||||
|
// @ApiOperation(value = "点赞或取消点赞评论")
|
||||||
|
// @PostMapping("/like")
|
||||||
|
// public AjaxResult like(@RequestBody @Valid CommentDetailRes commentDetailRes) {
|
||||||
|
//
|
||||||
|
// return publishCommentService.like(commentDetailRes);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除评论")
|
||||||
|
@PostMapping("/delete")
|
||||||
|
public R<Object> delete(@RequestBody @Valid CommentDelRes commentDelRes) {
|
||||||
|
|
||||||
|
return publishCommentService.removeCommentById(commentDelRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,79 +0,0 @@
|
||||||
package com.mcwl.web.controller.communityCenter;
|
|
||||||
|
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
|
||||||
import com.mcwl.communityCenter.domain.PublicModelCommentVo;
|
|
||||||
import com.mcwl.communityCenter.domain.PublishCommission;
|
|
||||||
import com.mcwl.communityCenter.service.PublishCommissionService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**社群评论
|
|
||||||
* @Author:ChenYan
|
|
||||||
* @Project:mcwl-ai
|
|
||||||
* @Package:com.mcwl.web.controller.communityCenter
|
|
||||||
* @Filename:PublishCommissionController
|
|
||||||
* @Description TODO
|
|
||||||
* @Date:2025/1/17 14:21
|
|
||||||
*/
|
|
||||||
@Api(tags = "社群评论")
|
|
||||||
@RequestMapping("PublishCommission")
|
|
||||||
@RestController
|
|
||||||
public class PublishCommissionController extends BaseController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PublishCommissionService publishCommissionService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取评论
|
|
||||||
* @param publishCommission
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "获取评论")
|
|
||||||
@GetMapping("/comment/{Id}")
|
|
||||||
public List<PublicModelCommentVo> getComment(@RequestBody PublishCommission publishCommission) {
|
|
||||||
|
|
||||||
return publishCommissionService.getComment(publishCommission);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加评论
|
|
||||||
* @param publishCommission
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "添加评论")
|
|
||||||
@PostMapping("/save")
|
|
||||||
public ResponseEntity<String> save(@RequestBody PublishCommission publishCommission) {
|
|
||||||
publishCommissionService.save(publishCommission);
|
|
||||||
return ResponseEntity.ok("评论成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞或取消点赞评论
|
|
||||||
* @param userId 用户ID
|
|
||||||
* @param commentId 评论ID
|
|
||||||
* @return 更新后的点赞数
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "点赞或取消点赞评论")
|
|
||||||
@PostMapping("/{commentId}/like")
|
|
||||||
public ResponseEntity<Integer> toggleLike(@PathVariable Long commentId, @RequestParam Long userId) {
|
|
||||||
int updatedLikes = publishCommissionService.toggleLike(userId, commentId);
|
|
||||||
return ResponseEntity.ok(updatedLikes);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "删除评论")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ResponseEntity<String> delete(@PathVariable Long id) {
|
|
||||||
publishCommissionService.removeById(id);
|
|
||||||
return ResponseEntity.ok("删除成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,28 +0,0 @@
|
||||||
package com.mcwl.web.controller.communityCenter;
|
|
||||||
|
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
|
||||||
import com.mcwl.communityCenter.service.PublishCommissionLikeService;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**社群评论区点赞
|
|
||||||
* @Author:ChenYan
|
|
||||||
* @Project:mcwl-ai
|
|
||||||
* @Package:com.mcwl.web.controller.communityCenter
|
|
||||||
* @Filename:PublishCommissionLikeController
|
|
||||||
* @Description TODO
|
|
||||||
* @Date:2025/1/17 14:21
|
|
||||||
*/
|
|
||||||
@Api(tags = "社群评论区点赞")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("PublishCommissionLike")
|
|
||||||
public class PublishCommissionLikeController extends BaseController {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private PublishCommissionLikeService publishCommissionLikeService;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,30 +1,27 @@
|
||||||
package com.mcwl.web.controller.communityCenter;
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.common.core.page.PageDomain;
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.communityCenter.domain.Community;
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
|
||||||
import com.mcwl.common.core.page.PageDomain;
|
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
|
||||||
import com.mcwl.communityCenter.domain.Publish;
|
|
||||||
import com.mcwl.communityCenter.domain.dto.PublishRes;
|
|
||||||
import com.mcwl.communityCenter.domain.vo.PublishVo;
|
import com.mcwl.communityCenter.domain.vo.PublishVo;
|
||||||
import com.mcwl.communityCenter.service.PublishService;
|
import com.mcwl.communityCenter.service.PublishService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发布
|
* 发布
|
||||||
*/
|
*/
|
||||||
@Api(tags = "发布")
|
@Api(tags = "社区帖子发布")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("publish")
|
@RequestMapping("publish")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@ -32,50 +29,89 @@ public class PublishController {
|
||||||
|
|
||||||
private final PublishService publishService;
|
private final PublishService publishService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取发布列表
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "获取发布列表")
|
|
||||||
@PostMapping("list")
|
|
||||||
public TableDataInfo getCommunityList(@RequestBody PageDomain pageDomain) {
|
|
||||||
return publishService.listByPage(pageDomain);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取发布详情
|
* 获取发布详情
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取发布详情")
|
@ApiOperation(value = "获取发布详情")
|
||||||
@GetMapping("detail")
|
@PostMapping("detail")
|
||||||
public AjaxResult getPublishDetail(Long id) {
|
public R<PublishVo> getPublishDetail(@RequestBody @Valid PublishDetailRes publishDetailRes) {
|
||||||
|
|
||||||
PublishVo publishVo = publishService.getDetail(id);
|
PublishVo publishVo = publishService.getDetail(publishDetailRes);
|
||||||
if (Objects.isNull(publishVo)) {
|
if (Objects.isNull(publishVo)) {
|
||||||
return AjaxResult.error("获取详情失败");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "获取详情失败");
|
||||||
}
|
}
|
||||||
return AjaxResult.success(publishVo);
|
return R.ok(publishVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "添加")
|
@ApiOperation(value = "发布")
|
||||||
@PostMapping("add")
|
@PostMapping("publish")
|
||||||
public AjaxResult addPublish(@RequestBody PublishRes publishRes) {
|
public R<Object> publish(@RequestBody @Valid PublishRes publishRes) {
|
||||||
Publish publish = new Publish();
|
return publishService.publish(publishRes);
|
||||||
BeanUtil.copyProperties(publishRes, publish);
|
|
||||||
return AjaxResult.success(publishService.save(publish));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取发布列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取发布列表")
|
||||||
|
@PostMapping("publishList")
|
||||||
|
public TableDataInfo publishList(@RequestBody @Valid PublishPageRes publishPageRes) {
|
||||||
|
return publishService.publishList(publishPageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 获取发布图片列表
|
||||||
|
// */
|
||||||
|
// @ApiOperation(value = "获取发布图片列表")
|
||||||
|
// @PostMapping("publishImage")
|
||||||
|
// public TableDataInfo publishImage(@RequestBody @Valid PublishPageRes publishPageRes) {
|
||||||
|
// return publishService.publishImage(publishPageRes);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取发布文件列表
|
||||||
|
// */
|
||||||
|
// @ApiOperation(value = "获取发布文件列表")
|
||||||
|
// @PostMapping("publishFile")
|
||||||
|
// public TableDataInfo publishFile(@RequestBody @Valid PublishPageRes publishPageRes) {
|
||||||
|
// return publishService.publishFile(publishPageRes);
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除")
|
@ApiOperation(value = "删除")
|
||||||
@GetMapping("remove")
|
@GetMapping("remove")
|
||||||
public AjaxResult deletePublish(Long id) {
|
public R<Object> deletePublish(@NotNull(message = "id不能为空") @ApiParam(value = "id") @Valid Long id) {
|
||||||
return AjaxResult.success(publishService.removeById(id));
|
publishService.removeById(id);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 精选/取消精选
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "精选/取消精选")
|
||||||
|
@GetMapping("elite")
|
||||||
|
public R<Object> elitePublish(@NotNull(message = "社区id不能为空")
|
||||||
|
@ApiParam(value = "社区id")
|
||||||
|
@Valid Long communityId,
|
||||||
|
@NotNull(message = "发布文章id不能为空")
|
||||||
|
@ApiParam(value = "发布文章id")
|
||||||
|
@Valid Long publishId) {
|
||||||
|
publishService.elitePublish(communityId, publishId);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收藏/取消收藏
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "收藏/取消收藏")
|
||||||
|
@PostMapping("collect")
|
||||||
|
public R<Object> collectPublish(@RequestBody @Valid PublishCollectRes publishCollectRes) {
|
||||||
|
publishService.collectPublish(publishCollectRes);
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.PublishCommentLikeRes;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.PublishLikeRes;
|
||||||
|
import com.mcwl.communityCenter.service.PublishCommentLikeService;
|
||||||
|
import com.mcwl.communityCenter.service.PublishLikeService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
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.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 社群发布点赞
|
||||||
|
*/
|
||||||
|
@Api(tags = "社群发布点赞")
|
||||||
|
@RestController
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("PublishLike")
|
||||||
|
public class PublishLikeController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
private final PublishLikeService publishLikeService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞/取消点赞
|
||||||
|
*/
|
||||||
|
@PostMapping("/like")
|
||||||
|
@ApiOperation(value = "点赞/取消点赞")
|
||||||
|
public R<Object> like(@RequestBody @Valid PublishLikeRes publishLikeRes) {
|
||||||
|
publishLikeService.like(publishLikeRes);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.*;
|
||||||
|
import com.mcwl.communityCenter.service.QuestionCommentService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
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.validation.Valid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提问评论
|
||||||
|
*/
|
||||||
|
@Api(tags = "社区提问评论")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("questionComment")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class QuestionCommentController {
|
||||||
|
|
||||||
|
private final QuestionCommentService questionCommentService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提问评论
|
||||||
|
*/
|
||||||
|
@PostMapping("comment")
|
||||||
|
@ApiOperation(value = "新增提问评论")
|
||||||
|
public R<Object> comment(@Valid @RequestBody QuestionCommentRes questionCommentRes) {
|
||||||
|
return questionCommentService.comment(questionCommentRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取提问评论列表
|
||||||
|
* @param questionCommentPageRes 请求参数
|
||||||
|
* @return 评论列表
|
||||||
|
*/
|
||||||
|
@PostMapping("list")
|
||||||
|
@ApiOperation(value = "获取提问评论列表")
|
||||||
|
public TableDataInfo list(@RequestBody @Valid QuestionCommentPageRes questionCommentPageRes) {
|
||||||
|
return questionCommentService.listByPage(questionCommentPageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 采纳评论
|
||||||
|
*/
|
||||||
|
@PostMapping("adopt")
|
||||||
|
@ApiOperation(value = "采纳评论")
|
||||||
|
public R<Object> adopt(@Valid @RequestBody QuestionCommentAdoptRes questionCommentAdoptRes) {
|
||||||
|
return questionCommentService.adopt(questionCommentAdoptRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,28 +1,32 @@
|
||||||
package com.mcwl.web.controller.communityCenter;
|
package com.mcwl.web.controller.communityCenter;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.common.core.page.PageDomain;
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.domain.entity.SysUser;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
|
import com.mcwl.communityCenter.domain.dto.QuestionDetailRes;
|
||||||
import com.mcwl.communityCenter.domain.dto.QuestionPageRes;
|
import com.mcwl.communityCenter.domain.dto.QuestionPageRes;
|
||||||
import com.mcwl.communityCenter.domain.dto.QuestionReplyDto;
|
import com.mcwl.communityCenter.domain.dto.QuestionReplyRes;
|
||||||
import com.mcwl.communityCenter.domain.dto.QuestionRes;
|
import com.mcwl.communityCenter.domain.dto.QuestionRes;
|
||||||
import com.mcwl.communityCenter.domain.vo.QuestionVo;
|
import com.mcwl.communityCenter.domain.vo.QuestionVo;
|
||||||
import com.mcwl.communityCenter.service.QuestionService;
|
import com.mcwl.communityCenter.service.QuestionService;
|
||||||
import io.swagger.annotations.Api;
|
import com.mcwl.system.service.ISysUserService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提问
|
* 提问
|
||||||
*/
|
*/
|
||||||
@Api(tags = "提问")
|
@Api(tags = "社区提问")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("question")
|
@RequestMapping("question")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@ -31,52 +35,92 @@ public class QuestionController {
|
||||||
|
|
||||||
private final QuestionService questionService;
|
private final QuestionService questionService;
|
||||||
|
|
||||||
|
private final ISysUserService sysUserService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提问
|
* 提问
|
||||||
*/
|
*/
|
||||||
@PostMapping("addQuestion")
|
@PostMapping("addQuestion")
|
||||||
@ApiOperation(value = "提问")
|
@ApiOperation(value = "提问")
|
||||||
public AjaxResult addQuestion(@RequestBody QuestionRes questionRes) {
|
public R<Object> addQuestion(@RequestBody @Valid QuestionRes questionRes) {
|
||||||
|
|
||||||
questionService.addQuestion(questionRes);
|
// 提问类型
|
||||||
|
Integer type = questionRes.getType();
|
||||||
|
|
||||||
return AjaxResult.success();
|
// 付费金额
|
||||||
|
Double amount = questionRes.getAmount();
|
||||||
|
|
||||||
|
// 类型为1时,付费金额不能为空
|
||||||
|
if (Objects.equals(type, 1) && Objects.isNull(amount)) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"付费金额不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 付费类型为1时,判断钱包余额是否充足
|
||||||
|
if (Objects.equals(type, 1)) {
|
||||||
|
if (amount < 10) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"付费金额不能小于10");
|
||||||
|
}
|
||||||
|
if (amount > 1000) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"付费金额不能大于1000");
|
||||||
|
}
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||||
|
Double wallet = sysUser.getWallet();
|
||||||
|
if (wallet < amount) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"钱包余额不足");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
questionRes.setAmount(0.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return questionService.addQuestion(questionRes);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取未回复问题列表
|
* 获取提问列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("listUnReplied")
|
@PostMapping("list")
|
||||||
public TableDataInfo listUnReplied(QuestionPageRes questionPageRes) {
|
@ApiOperation(value = "获取提问列表")
|
||||||
|
public TableDataInfo list(@RequestBody @Valid QuestionPageRes questionPageRes) {
|
||||||
|
|
||||||
return questionService.listUnReplied(questionPageRes);
|
return questionService.list(questionPageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取提问图片列表
|
||||||
|
*/
|
||||||
|
@PostMapping("listImage")
|
||||||
|
@ApiOperation(value = "获取提问图片列表")
|
||||||
|
public TableDataInfo listImage(@RequestBody @Valid QuestionPageRes questionPageRes) {
|
||||||
|
|
||||||
|
return questionService.listImage(questionPageRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取问题详情
|
* 获取问题详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("detail")
|
@PostMapping("detail")
|
||||||
public AjaxResult getQuestionDetail(@NotNull(message = "id不能为空") Long id) {
|
@ApiOperation(value = "获取问题详情")
|
||||||
QuestionVo questionVo = questionService.getDetail(id);
|
public R<QuestionVo> getQuestionDetail(@RequestBody @Valid QuestionDetailRes questionDetailRes) {
|
||||||
|
QuestionVo questionVo = questionService.getDetail(questionDetailRes);
|
||||||
if (Objects.isNull(questionVo)) {
|
if (Objects.isNull(questionVo)) {
|
||||||
return AjaxResult.error("获取详情失败");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取详情失败");
|
||||||
}
|
}
|
||||||
return AjaxResult.success(questionVo);
|
return R.ok(questionVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* 回复
|
// * 回复
|
||||||
*/
|
// */
|
||||||
@PostMapping("reply")
|
// @PostMapping("reply")
|
||||||
public AjaxResult reply(QuestionReplyDto questionReplyDto) {
|
// @ApiOperation(value = "回复")
|
||||||
|
// public AjaxResult reply(@RequestBody @Valid QuestionReplyRes questionReplyRes) {
|
||||||
questionService.reply(questionReplyDto);
|
//
|
||||||
|
// return questionService.reply(questionReplyRes);
|
||||||
return AjaxResult.success();
|
//
|
||||||
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,94 @@
|
||||||
|
package com.mcwl.web.controller.memberCenter;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.memberCenter.domain.Benefit;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.AddBenefitDto;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.EditBenefitDto;
|
||||||
|
import com.mcwl.memberCenter.domain.vo.BenefitVo;
|
||||||
|
import com.mcwl.memberCenter.enums.MemberBenefitTypeEnum;
|
||||||
|
import com.mcwl.memberCenter.service.BenefitService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 权益
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("benefit")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
|
public class BenefitController {
|
||||||
|
|
||||||
|
private final BenefitService benefitService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权益列表
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:benefit:list')")
|
||||||
|
@ApiOperation(value = "权益列表")
|
||||||
|
@GetMapping("list")
|
||||||
|
public R<List<BenefitVo>> list() {
|
||||||
|
|
||||||
|
return R.ok(benefitService.benefitList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加权益
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:benefit:add')")
|
||||||
|
@ApiOperation(value = "添加权益")
|
||||||
|
@PostMapping("add")
|
||||||
|
public R<Object> add(@RequestBody @Valid AddBenefitDto addBenefitDto) {
|
||||||
|
|
||||||
|
benefitService.addBenefit(addBenefitDto);
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据权益名称id查询权益
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "根据权益名称id查询权益")
|
||||||
|
@GetMapping("getBenefitByBenefitId")
|
||||||
|
public R<List<Benefit>> getBenefitByBenefitId(@NotNull(message = "权益名称id不能为空") Long benefitNameId) {
|
||||||
|
List<Benefit> benefitList = benefitService.lambdaQuery()
|
||||||
|
.eq(Benefit::getBenefitNameId, benefitNameId)
|
||||||
|
.list();
|
||||||
|
return R.ok(benefitList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改权益
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:benefit:edit')")
|
||||||
|
@ApiOperation(value = "修改权益")
|
||||||
|
@PostMapping("update")
|
||||||
|
public R<Object> update(@RequestBody @Valid EditBenefitDto editBenefitDto) {
|
||||||
|
|
||||||
|
Benefit benefit = BeanUtil.copyProperties(editBenefitDto, Benefit.class);
|
||||||
|
benefitService.updateById(benefit);
|
||||||
|
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:benefit:remove')")
|
||||||
|
@ApiOperation(value = "删除权益")
|
||||||
|
@GetMapping("delete")
|
||||||
|
public R<Object> delete(@NotNull(message = "id不能为空") Long id) {
|
||||||
|
benefitService.removeById(id);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
package com.mcwl.web.controller.memberCenter;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.memberCenter.domain.Benefit;
|
||||||
|
import com.mcwl.memberCenter.domain.BenefitName;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.AddBenefitDto;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.AddBenefitNameDto;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.EditBenefitDto;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.EditBenefitNameDto;
|
||||||
|
import com.mcwl.memberCenter.domain.vo.BenefitVo;
|
||||||
|
import com.mcwl.memberCenter.service.BenefitNameService;
|
||||||
|
import com.mcwl.memberCenter.service.BenefitService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 权益名称
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("benefitName")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
|
public class BenefitNameController {
|
||||||
|
|
||||||
|
private final BenefitNameService benefitNameService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 权益名称列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "权益名称列表")
|
||||||
|
@GetMapping("list")
|
||||||
|
public R<List<BenefitName>> list() {
|
||||||
|
List<BenefitName> list = benefitNameService.list();
|
||||||
|
return R.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "添加权益名称")
|
||||||
|
@PostMapping("add")
|
||||||
|
public R<Object> add(@RequestBody @Valid AddBenefitNameDto addBenefitDto) {
|
||||||
|
BenefitName benefitName = BeanUtil.toBean(addBenefitDto, BenefitName.class);
|
||||||
|
benefitNameService.save(benefitName);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "修改权益名称")
|
||||||
|
@PostMapping("update")
|
||||||
|
public R<Object> update(@RequestBody @Valid EditBenefitNameDto editBenefitNameDto) {
|
||||||
|
BenefitName benefitName = BeanUtil.toBean(editBenefitNameDto, BenefitName.class);
|
||||||
|
benefitNameService.updateById(benefitName);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除权益名称")
|
||||||
|
@GetMapping("delete")
|
||||||
|
public R<Object> delete(@Valid @NotNull(message = "id不能为空") Long id) {
|
||||||
|
benefitNameService.removeById(id);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,84 @@
|
||||||
|
package com.mcwl.web.controller.memberCenter;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.memberCenter.domain.MemberBenefit;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.MemberBenefitDto;
|
||||||
|
import com.mcwl.memberCenter.domain.vo.MemberBenefitVO;
|
||||||
|
import com.mcwl.memberCenter.service.MemberBenefitService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 会员权益关联
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("memberBenefit")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
|
public class MemberBenefitController {
|
||||||
|
|
||||||
|
private final MemberBenefitService memberBenefitService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取会员等级及权益列表
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:memberBenefit:list')")
|
||||||
|
@GetMapping("getMemberBenefitList")
|
||||||
|
@ApiOperation(value = "获取会员等级及权益列表")
|
||||||
|
public R<List<MemberBenefitVO>> getMemberBenefitList() {
|
||||||
|
|
||||||
|
return R.ok(memberBenefitService.getMemberBenefitList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询会员等级权益
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询会员权益")
|
||||||
|
@GetMapping("getMemberBenefit")
|
||||||
|
public R<MemberBenefitVO> getMemberBenefit(@Valid
|
||||||
|
@NotNull(message = "会员等级id不能为空")
|
||||||
|
@ApiParam(value = "会员等级id", required = true)
|
||||||
|
Long memberLevelId) {
|
||||||
|
|
||||||
|
return R.ok(memberBenefitService.getMemberBenefit(memberLevelId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加会员权益
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:memberBenefit:add')")
|
||||||
|
@ApiOperation(value = "会员绑定权益")
|
||||||
|
@PostMapping("addMemberBenefit")
|
||||||
|
public R<Object> addMemberBenefit(@RequestBody @Valid MemberBenefitDto memberBenefitDto) {
|
||||||
|
memberBenefitService.addMemberBenefit(memberBenefitDto);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:memberBenefit:edit')")
|
||||||
|
@ApiOperation(value = "修改会员权益")
|
||||||
|
@PostMapping("updateMemberBenefit")
|
||||||
|
public R<Object> updateMemberBenefit(@RequestBody @Valid MemberBenefit memberBenefit) {
|
||||||
|
|
||||||
|
return R.ok(memberBenefitService.updateById(memberBenefit));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除会员权益")
|
||||||
|
@GetMapping("deleteMemberBenefit")
|
||||||
|
public R<Object> deleteMemberBenefit(@Valid @NotNull(message = "会员权益id不能为空") Long id) {
|
||||||
|
|
||||||
|
return R.ok(memberBenefitService.removeById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,31 +1,42 @@
|
||||||
package com.mcwl.web.controller.memberCenter;
|
package com.mcwl.web.controller.memberCenter;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.common.core.domain.entity.SysUser;
|
import com.mcwl.common.core.domain.entity.SysUser;
|
||||||
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.memberCenter.domain.MemberConsume;
|
import com.mcwl.memberCenter.domain.*;
|
||||||
import com.mcwl.memberCenter.domain.Member;
|
import com.mcwl.memberCenter.domain.vo.MemberConsumeVO;
|
||||||
import com.mcwl.memberCenter.domain.MemberLevel;
|
import com.mcwl.memberCenter.domain.vo.MemberVo;
|
||||||
import com.mcwl.memberCenter.service.MemberBenefitService;
|
import com.mcwl.memberCenter.domain.vo.RechargeRecordVO;
|
||||||
|
import com.mcwl.memberCenter.enums.PromotionEnum;
|
||||||
|
import com.mcwl.memberCenter.service.*;
|
||||||
import com.mcwl.memberCenter.domain.dto.RechargePointsDto;
|
import com.mcwl.memberCenter.domain.dto.RechargePointsDto;
|
||||||
import com.mcwl.memberCenter.domain.dto.UserMemberDto;
|
import com.mcwl.memberCenter.domain.dto.UserMemberDto;
|
||||||
import com.mcwl.memberCenter.service.MemberConsumeService;
|
|
||||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
|
||||||
import com.mcwl.memberCenter.service.MemberService;
|
|
||||||
import com.mcwl.system.service.ISysUserService;
|
import com.mcwl.system.service.ISysUserService;
|
||||||
import com.mcwl.memberCenter.domain.vo.PointsVO;
|
import com.mcwl.memberCenter.domain.vo.PointsVO;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.jboss.marshalling.SimpleDataInput;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Optional;
|
import java.util.*;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 会员中心
|
||||||
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("member")
|
@RequestMapping("member")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
public class MemberController {
|
public class MemberController {
|
||||||
|
|
||||||
private final MemberService memberService;
|
private final MemberService memberService;
|
||||||
|
@ -38,6 +49,8 @@ public class MemberController {
|
||||||
|
|
||||||
private final MemberLevelService memberLevelService;
|
private final MemberLevelService memberLevelService;
|
||||||
|
|
||||||
|
private final MemberPromotionService memberPromotionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建用户会员
|
* 创建用户会员
|
||||||
*
|
*
|
||||||
|
@ -45,7 +58,7 @@ public class MemberController {
|
||||||
* @return 用户会员
|
* @return 用户会员
|
||||||
*/
|
*/
|
||||||
@PostMapping("createMember")
|
@PostMapping("createMember")
|
||||||
public AjaxResult createMemberCenter(@RequestBody @Valid UserMemberDto userMemberDto) {
|
public R<Member> createMemberCenter(@RequestBody @Valid UserMemberDto userMemberDto) {
|
||||||
Long userId = userMemberDto.getUserId();
|
Long userId = userMemberDto.getUserId();
|
||||||
Long memberLevelId = userMemberDto.getMemberLevelId();
|
Long memberLevelId = userMemberDto.getMemberLevelId();
|
||||||
String paymentMethod = userMemberDto.getPaymentMethod();
|
String paymentMethod = userMemberDto.getPaymentMethod();
|
||||||
|
@ -53,49 +66,54 @@ public class MemberController {
|
||||||
|
|
||||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||||
if (!Optional.ofNullable(sysUser).isPresent()) {
|
if (!Optional.ofNullable(sysUser).isPresent()) {
|
||||||
return AjaxResult.warn("用户不存在");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "用户不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
||||||
if (!Optional.ofNullable(memberLevel).isPresent()) {
|
if (!Optional.ofNullable(memberLevel).isPresent()) {
|
||||||
return AjaxResult.warn("会员等级不存在");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "会员等级不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
Member member = memberService.createUserMember(userId, memberLevelId, paymentMethod, promotionId);
|
Member member = memberService.createUserMember(userId, memberLevelId, paymentMethod, promotionId);
|
||||||
if (!Optional.ofNullable(member).isPresent()) {
|
if (!Optional.ofNullable(member).isPresent()) {
|
||||||
return AjaxResult.warn("创建会员失败");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "创建会员失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
return AjaxResult.success(member);
|
return R.ok(member);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取积分余额和历史记录
|
* 获取用户有效会员的会员
|
||||||
*
|
|
||||||
* @return 积分余额和历史记录
|
|
||||||
*/
|
*/
|
||||||
@GetMapping("getPoints")
|
@ApiOperation(value = "获取用户有效会员的会员")
|
||||||
public AjaxResult getPoints() {
|
@GetMapping("getValidMemberById")
|
||||||
Long userId = SecurityUtils.getUserId();
|
public R<List<MemberVo>> getUseUserMember(@Valid @NotNull(message = "用户id不能为空") Long userId) {
|
||||||
|
|
||||||
Member member = memberService.getUseUserMemberByUserId(userId);
|
return R.ok(memberService.getValidMemberById(userId));
|
||||||
if (!Optional.ofNullable(member).isPresent()) {
|
|
||||||
return AjaxResult.warn("用户未开通会员");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PointsVO pointsVO = new PointsVO();
|
|
||||||
|
|
||||||
// 会员消费记录
|
/**
|
||||||
List<MemberConsume> memberConsumeList = memberConsumeService
|
* 获取积分消费记录
|
||||||
.lambdaQuery()
|
*
|
||||||
.eq(MemberConsume::getUserId, userId)
|
* @return 获取积分消费记录
|
||||||
.list();
|
*/
|
||||||
|
@PostMapping("getConsumePoints")
|
||||||
|
@ApiOperation(value = "获取积分消费记录")
|
||||||
|
public TableDataInfo getConsumePoints(@Valid @RequestBody PageDomain pageDomain) {
|
||||||
|
|
||||||
pointsVO.setPoints(member.getPoints());
|
return memberConsumeService.getConsumePoints(pageDomain);
|
||||||
pointsVO.setMemberConsumeList(memberConsumeList);
|
}
|
||||||
|
|
||||||
return AjaxResult.success(pointsVO);
|
/**
|
||||||
|
* 获取积分充值记录
|
||||||
|
*/
|
||||||
|
@PostMapping("getRechargePoints")
|
||||||
|
@ApiOperation(value = "获取积分充值记录")
|
||||||
|
public TableDataInfo getRechargePoints(@Valid @RequestBody PageDomain pageDomain) {
|
||||||
|
|
||||||
|
return memberService.getRechargePoints(pageDomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,25 +121,24 @@ public class MemberController {
|
||||||
* 会员积分充值
|
* 会员积分充值
|
||||||
*/
|
*/
|
||||||
@PostMapping("rechargePoints")
|
@PostMapping("rechargePoints")
|
||||||
public AjaxResult rechargePoints(@RequestBody @Valid RechargePointsDto rechargePointsDto) {
|
@ApiOperation(value = "会员积分充值")
|
||||||
|
public R<Object> rechargePoints(@RequestBody @Valid RechargePointsDto rechargePointsDto) {
|
||||||
Long userId = rechargePointsDto.getUserId();
|
Long userId = rechargePointsDto.getUserId();
|
||||||
Double amount = rechargePointsDto.getAmount();
|
Double amount = rechargePointsDto.getAmount();
|
||||||
|
|
||||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||||
if (!Optional.ofNullable(sysUser).isPresent()) {
|
if (!Optional.ofNullable(sysUser).isPresent()) {
|
||||||
return AjaxResult.warn("用户不存在");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "用户不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
Member member = memberService.rechargePoints(userId, amount * 100);
|
Member member = memberService.rechargePoints(userId, amount * 100);
|
||||||
|
|
||||||
// 返回充值积分
|
// 返回充值积分
|
||||||
if (!Optional.ofNullable(member).isPresent()) {
|
if (!Optional.ofNullable(member).isPresent()) {
|
||||||
return AjaxResult.warn("充值积分失败");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "充值积分失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
rechargePointsDto.setPoints(member.getPoints());
|
return R.ok();
|
||||||
|
|
||||||
return AjaxResult.success(rechargePointsDto);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -129,14 +146,15 @@ public class MemberController {
|
||||||
* 消费积分
|
* 消费积分
|
||||||
*/
|
*/
|
||||||
@GetMapping("consumePoints/{consumePoints}")
|
@GetMapping("consumePoints/{consumePoints}")
|
||||||
public AjaxResult consumePoints(@PathVariable Double consumePoints) {
|
@ApiOperation(value = "消费积分")
|
||||||
|
public R<Object> consumePoints(@PathVariable Double consumePoints) {
|
||||||
|
|
||||||
if (consumePoints == null || consumePoints <= 0) {
|
if (consumePoints == null || consumePoints <= 0) {
|
||||||
return AjaxResult.warn("消费积分不能为空或小于0");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "消费积分不能为空或小于0");
|
||||||
}
|
}
|
||||||
|
|
||||||
memberService.consumePoints(consumePoints);
|
memberService.consumePoints(consumePoints);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,24 +163,48 @@ public class MemberController {
|
||||||
* 根据会员等级和活动计算支付金额
|
* 根据会员等级和活动计算支付金额
|
||||||
*/
|
*/
|
||||||
@GetMapping("calculatePayment")
|
@GetMapping("calculatePayment")
|
||||||
public AjaxResult calculatePayment(@NotNull(message = "请选择会员") Long memberLevelId, @RequestParam(required = false) Long promotionId) {
|
@ApiOperation(value = "根据会员等级和活动计算支付金额")
|
||||||
|
public R<Double> calculatePayment(@Valid @NotNull(message = "请选择会员") Long memberLevelId, @RequestParam(required = false) Long promotionId) {
|
||||||
|
|
||||||
|
// 获取当前用户
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
MemberPromotion memberPromotion = memberPromotionService.lambdaQuery()
|
||||||
|
.eq(MemberPromotion::getUserId, userId)
|
||||||
|
.eq(Objects.nonNull(promotionId), MemberPromotion::getPromotionId, promotionId)
|
||||||
|
.eq(MemberPromotion::getStatus, PromotionEnum.PARTICIPATE)
|
||||||
|
.one();
|
||||||
|
|
||||||
|
if (Objects.nonNull(promotionId) && Objects.isNull(memberPromotion)) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "未参与活动或已过期");
|
||||||
|
}
|
||||||
|
|
||||||
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
||||||
Double unitPrice = memberLevel.getUnitPrice();
|
Double unitPrice = memberLevel.getUnitPrice();
|
||||||
unitPrice = memberService.calculatePayment(unitPrice, promotionId);
|
unitPrice = memberService.calculatePayment(unitPrice, promotionId);
|
||||||
return AjaxResult.success(unitPrice);
|
return R.ok(unitPrice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否是会员
|
* 是否是会员
|
||||||
*/
|
*/
|
||||||
@GetMapping("isMember")
|
@GetMapping("isMember")
|
||||||
public AjaxResult isMember() {
|
@ApiOperation(value = "是否是会员")
|
||||||
|
public R<Map<String, String>> isMember() {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
Member member = memberService.getUseUserMemberByUserId(userId);
|
Member member = memberService.getUseUserMemberByUserId(userId);
|
||||||
if (Optional.ofNullable(member).isPresent()) {
|
if (Optional.ofNullable(member).isPresent()) {
|
||||||
return AjaxResult.success(true);
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date startDate = member.getStartDate();
|
||||||
|
Date endDate = member.getEndDate();
|
||||||
|
map.put("result", "1");
|
||||||
|
map.put("startDate", sdf.format(startDate));
|
||||||
|
map.put("endDate", sdf.format(endDate));
|
||||||
|
return R.ok(map);
|
||||||
}
|
}
|
||||||
return AjaxResult.success(false);
|
map.put("result", "0");
|
||||||
|
|
||||||
|
return R.ok(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,63 +1,109 @@
|
||||||
package com.mcwl.web.controller.memberCenter;
|
package com.mcwl.web.controller.memberCenter;
|
||||||
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.mcwl.memberCenter.domain.MemberBenefit;
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.memberCenter.domain.MemberLevel;
|
import com.mcwl.memberCenter.domain.MemberLevel;
|
||||||
import com.mcwl.memberCenter.service.MemberBenefitService;
|
import com.mcwl.memberCenter.domain.dto.AddMemberLevelDto;
|
||||||
|
import com.mcwl.memberCenter.domain.dto.EditMemberLevelDto;
|
||||||
|
import com.mcwl.memberCenter.domain.vo.MemberLevelVo;
|
||||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
import com.mcwl.memberCenter.service.MemberLevelService;
|
||||||
import com.mcwl.memberCenter.domain.vo.MemberBenefitVO;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 会员等级
|
||||||
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("memberLevel")
|
@RequestMapping("memberLevel")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
public class MemberLevelController {
|
public class MemberLevelController {
|
||||||
|
|
||||||
private final MemberLevelService memberLevelService;
|
private final MemberLevelService memberLevelService;
|
||||||
|
|
||||||
private final MemberBenefitService memberBenefitService;
|
|
||||||
|
/**
|
||||||
|
* 添加会员等级
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:memberLevel:add')")
|
||||||
|
@PostMapping("addMemberLevel")
|
||||||
|
@ApiOperation(value = "添加会员等级")
|
||||||
|
public R<Object> add(@RequestBody @Valid AddMemberLevelDto addMemberLevelDto) {
|
||||||
|
MemberLevel memberLevel = BeanUtil.copyProperties(addMemberLevelDto, MemberLevel.class);
|
||||||
|
memberLevelService.save(memberLevel);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取会员等级列表
|
* 获取会员等级列表
|
||||||
*
|
*
|
||||||
* @return 会员等级列表
|
* @return 会员等级列表
|
||||||
*/
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:memberLevel:list')")
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public AjaxResult list() {
|
@ApiOperation(value = "获取会员等级列表")
|
||||||
|
public R<List<MemberLevelVo>> list() {
|
||||||
|
|
||||||
List<MemberLevel> memberLevelList = memberLevelService.list();
|
List<MemberLevel> memberLevelList = memberLevelService.list();
|
||||||
|
List<MemberLevelVo> memberLevelListVo = new ArrayList<>();
|
||||||
|
for (MemberLevel memberLevel : memberLevelList) {
|
||||||
|
MemberLevelVo memberLevelVo = BeanUtil.copyProperties(memberLevel, MemberLevelVo.class);
|
||||||
|
memberLevelVo.setSubscriptionPeriod(memberLevel.getSubscriptionPeriod().getValue());
|
||||||
|
memberLevelListVo.add(memberLevelVo);
|
||||||
|
}
|
||||||
|
|
||||||
return AjaxResult.success(memberLevelList);
|
return R.ok(memberLevelListVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取会员等级
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:memberLevel:query')")
|
||||||
|
@GetMapping("getMemberLevel")
|
||||||
|
@ApiOperation(value = "获取会员等级")
|
||||||
|
public R<MemberLevelVo> getMemberLevel(@Valid
|
||||||
|
@NotNull(message = "会员等级id不能为空")
|
||||||
|
@ApiParam(value = "会员等级id", required = true)
|
||||||
|
Long id) {
|
||||||
|
MemberLevel memberLevel = memberLevelService.getById(id);
|
||||||
|
MemberLevelVo memberLevelVo = BeanUtil.copyProperties(memberLevel, MemberLevelVo.class);
|
||||||
|
memberLevelVo.setSubscriptionPeriod(memberLevel.getSubscriptionPeriod().getValue());
|
||||||
|
return R.ok(memberLevelVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取会员等级及权益列表
|
* 修改会员等级
|
||||||
*/
|
*/
|
||||||
@GetMapping("getMemberBenefitList")
|
// @PreAuthorize("@ss.hasPermi('system:memberLevel:edit')")
|
||||||
public AjaxResult getMemberBenefitList() {
|
@PostMapping("updateMemberLevel")
|
||||||
|
@ApiOperation(value = "修改会员等级")
|
||||||
List<MemberBenefitVO> memberBenefitVOList = new ArrayList<>();
|
public R<Object> update(@RequestBody @Valid EditMemberLevelDto editMemberLevelDto) {
|
||||||
|
memberLevelService.updateById(BeanUtil.copyProperties(editMemberLevelDto, MemberLevel.class));
|
||||||
List<MemberLevel> memberLevelList = memberLevelService.list();
|
return R.ok();
|
||||||
for (MemberLevel memberLevel : memberLevelList) {
|
|
||||||
MemberBenefitVO memberBenefitVO = new MemberBenefitVO();
|
|
||||||
memberBenefitVO.setMemberLevel(memberLevel);
|
|
||||||
// 获取会员等级对应的权益
|
|
||||||
List<MemberBenefit> memberBenefitList = memberBenefitService.lambdaQuery()
|
|
||||||
.eq(MemberBenefit::getMemberLevelId, memberLevel.getId())
|
|
||||||
.list();
|
|
||||||
memberBenefitVO.setMemberBenefitList(memberBenefitList);
|
|
||||||
memberBenefitVOList.add(memberBenefitVO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return AjaxResult.success(memberBenefitVOList);
|
/**
|
||||||
|
* 删除会员等级
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:memberLevel:remove')")
|
||||||
|
@GetMapping("deleteMemberLevel")
|
||||||
|
@ApiOperation(value = "删除会员等级")
|
||||||
|
public R<Object> delete(@Valid
|
||||||
|
@NotNull(message = "会员等级id不能为空")
|
||||||
|
@ApiParam(value = "会员等级id", required = true)
|
||||||
|
Long id) {
|
||||||
|
memberLevelService.removeById(id);
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,11 @@ package com.mcwl.web.controller.memberCenter;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.memberCenter.domain.Member;
|
import com.mcwl.memberCenter.domain.Member;
|
||||||
import com.mcwl.memberCenter.domain.MemberPromotion;
|
import com.mcwl.memberCenter.domain.MemberPromotion;
|
||||||
|
@ -14,10 +18,15 @@ import com.mcwl.memberCenter.enums.PromotionEnum;
|
||||||
import com.mcwl.memberCenter.service.MemberPromotionService;
|
import com.mcwl.memberCenter.service.MemberPromotionService;
|
||||||
import com.mcwl.memberCenter.service.MemberService;
|
import com.mcwl.memberCenter.service.MemberService;
|
||||||
import com.mcwl.memberCenter.service.PromotionService;
|
import com.mcwl.memberCenter.service.PromotionService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
@ -29,25 +38,26 @@ import java.util.Optional;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("promotion")
|
@RequestMapping("promotion")
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "会员中心")
|
||||||
public class PromotionController {
|
public class PromotionController {
|
||||||
|
|
||||||
private final PromotionService promotionService;
|
private final PromotionService promotionService;
|
||||||
|
|
||||||
private final MemberPromotionService memberPromotionService;
|
private final MemberPromotionService memberPromotionService;
|
||||||
|
|
||||||
private final MemberService memberService;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建活动
|
* 创建活动
|
||||||
*/
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:promotion:add')")
|
||||||
@PostMapping("createPromotion")
|
@PostMapping("createPromotion")
|
||||||
public AjaxResult createPromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
@ApiOperation(value = "创建活动")
|
||||||
|
public R<Object> createPromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
||||||
|
|
||||||
Date startTime = promotionDto.getStartTime();
|
Date startTime = promotionDto.getStartTime();
|
||||||
Date endTime = promotionDto.getEndTime();
|
Date endTime = promotionDto.getEndTime();
|
||||||
if (startTime.after(endTime)) {
|
if (startTime.after(endTime)) {
|
||||||
return AjaxResult.warn("活动开始时间不能大于结束时间");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"活动开始时间不能大于结束时间");
|
||||||
}
|
}
|
||||||
Promotion promotion = new Promotion();
|
Promotion promotion = new Promotion();
|
||||||
|
|
||||||
|
@ -55,80 +65,64 @@ public class PromotionController {
|
||||||
|
|
||||||
promotionService.save(promotion);
|
promotionService.save(promotion);
|
||||||
|
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 活动列表
|
* 活动列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("promotionList")
|
@PostMapping("promotionList")
|
||||||
public AjaxResult promotionList() {
|
@ApiOperation(value = "活动列表")
|
||||||
List<Promotion> promotionList = promotionService.lambdaQuery()
|
public TableDataInfo getPromotionList(@Valid @RequestBody PageDomain pageDomain) {
|
||||||
.gt(Promotion::getEndTime, new Date())
|
|
||||||
.list();
|
return promotionService.getPromotionList(pageDomain);
|
||||||
return AjaxResult.success(promotionList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前用户参与的活动
|
* 获取当前用户参与的活动
|
||||||
*/
|
*/
|
||||||
@GetMapping("myPromotionList")
|
@PostMapping("myPromotionList")
|
||||||
public AjaxResult myPromotionList() {
|
@ApiOperation(value = "获取当前用户参与的活动")
|
||||||
// 获取当前用户
|
public TableDataInfo myPromotionList(@Valid @RequestBody PageDomain pageDomain) {
|
||||||
Long userId = SecurityUtils.getUserId();
|
|
||||||
List<MemberPromotion> memberPromotionList = memberPromotionService.lambdaQuery()
|
return promotionService.getMyPromotionList(pageDomain);
|
||||||
.eq(MemberPromotion::getUserId, userId)
|
|
||||||
.list();
|
|
||||||
return AjaxResult.success(memberPromotionList);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参与活动
|
* 参与活动
|
||||||
*/
|
*/
|
||||||
@PostMapping("joinPromotion")
|
@GetMapping("joinPromotion")
|
||||||
public AjaxResult joinPromotion(@RequestBody @Valid JoinPromotionDto joinPromotionDto) {
|
@ApiOperation(value = "参与活动")
|
||||||
// 用户id
|
public R<Object> joinPromotion(@Valid
|
||||||
Long userId = joinPromotionDto.getUserId();
|
@NotNull(message = "活动ID不能为空")
|
||||||
// 活动id
|
@ApiParam("活动ID")
|
||||||
Long promotionId = joinPromotionDto.getPromotionId();
|
Long promotionId) {
|
||||||
// 按活动id查询活动信息
|
|
||||||
Promotion promotion = promotionService.getById(promotionId);
|
|
||||||
|
|
||||||
if (!Optional.ofNullable(promotion).isPresent()) {
|
return promotionService.joinPromotion(promotionId);
|
||||||
return AjaxResult.warn("活动不存在");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (promotion.getStartTime().after(new Date())) {
|
/**
|
||||||
return AjaxResult.warn("活动未开始");
|
* 修改活动
|
||||||
}
|
*/
|
||||||
|
// @PostMapping("updatePromotion")
|
||||||
// 活动是否过期
|
// @ApiOperation(value = "修改活动")
|
||||||
if (promotion.getEndTime().before(new Date())) {
|
// public R<Object> updatePromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
||||||
return AjaxResult.warn("活动已过期");
|
//
|
||||||
}
|
// return promotionService.updatePromotion(promotionDto);
|
||||||
|
|
||||||
// 获取当前用户是否参与过该活动
|
|
||||||
if (isJoinPromotion(userId, promotionId)) {
|
|
||||||
return AjaxResult.warn("您已参与过该活动");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 是否在活动期间内订阅或续订会员
|
|
||||||
// if (!isSubscribe(userId, promotion)) {
|
|
||||||
// return AjaxResult.warn("请在活动期间内订阅或续期会员后参加该活动");
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Member member = memberService.getUseUserMemberByUserId(userId);
|
/**
|
||||||
|
* 删除活动
|
||||||
String memberLevelIds = promotion.getMemberLevelIds();
|
*/
|
||||||
if (!memberLevelIds.contains(member.getMemberLevelId().toString())) {
|
@GetMapping("deletePromotion")
|
||||||
return AjaxResult.warn("无法参与该活动,请查看活动条件");
|
@ApiOperation(value = "删除活动")
|
||||||
}
|
public R<Object> deletePromotion(@Valid
|
||||||
MemberPromotion memberPromotion = getMemberPromotion(userId, promotionId);
|
@NotNull(message = "活动ID不能为空")
|
||||||
memberPromotionService.save(memberPromotion);
|
@ApiParam("活动ID")
|
||||||
|
Long promotionId) {
|
||||||
|
promotionService.removeById(promotionId);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
// private boolean isSubscribe(Long userId, Promotion promotion) {
|
// private boolean isSubscribe(Long userId, Promotion promotion) {
|
||||||
|
@ -145,26 +139,5 @@ public class PromotionController {
|
||||||
// return true;
|
// return true;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private boolean isJoinPromotion(Long userId, Long promotionId) {
|
|
||||||
MemberPromotion memberPromotion = memberPromotionService.lambdaQuery()
|
|
||||||
.eq(MemberPromotion::getUserId, userId)
|
|
||||||
.eq(MemberPromotion::getPromotionId, promotionId)
|
|
||||||
.one();
|
|
||||||
return memberPromotion != null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static MemberPromotion getMemberPromotion(Long userId, Long promotionId) {
|
|
||||||
MemberPromotion memberPromotion = new MemberPromotion();
|
|
||||||
memberPromotion.setUserId(userId);
|
|
||||||
memberPromotion.setPromotionId(promotionId);
|
|
||||||
memberPromotion.setStatus(PromotionEnum.PARTICIPATE);
|
|
||||||
memberPromotion.setParticipationTime(new Date());
|
|
||||||
memberPromotion.setCreateBy(SecurityUtils.getUsername());
|
|
||||||
memberPromotion.setCreateTime(new Date());
|
|
||||||
memberPromotion.setUpdateBy(SecurityUtils.getUsername());
|
|
||||||
memberPromotion.setUpdateTime(new Date());
|
|
||||||
return memberPromotion;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,90 @@
|
||||||
|
package com.mcwl.web.controller.myInvitation;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
|
import com.mcwl.myInvitation.domain.CommissionRatio;
|
||||||
|
import com.mcwl.myInvitation.domain.Invitation;
|
||||||
|
import com.mcwl.myInvitation.domain.dto.EarningsDisplayDto;
|
||||||
|
import com.mcwl.myInvitation.domain.vo.CommissionRatioVo;
|
||||||
|
import com.mcwl.myInvitation.domain.vo.EarningsDisplayVO;
|
||||||
|
import com.mcwl.myInvitation.service.CommissionRatioService;
|
||||||
|
import com.mcwl.myInvitation.service.InvitationService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.format.annotation.NumberFormat;
|
||||||
|
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.RestController;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提成比例
|
||||||
|
*/
|
||||||
|
@RestController()
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping("/commissionRatio")
|
||||||
|
@Api(tags = "我的邀请")
|
||||||
|
public class CommissionRatioController {
|
||||||
|
|
||||||
|
private final CommissionRatioService commissionRatioService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提成列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@ApiOperation(value = "提成列表")
|
||||||
|
public R<List<CommissionRatioVo>> list() {
|
||||||
|
List<CommissionRatioVo> list = commissionRatioService.ratioList();
|
||||||
|
return R.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提成详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
@ApiOperation(value = "提成详情")
|
||||||
|
public R<CommissionRatioVo> detail(@Valid @NotNull(message = "提成比例id不能为空") Long id) {
|
||||||
|
CommissionRatioVo detail = commissionRatioService.detail(id);
|
||||||
|
if (detail == null) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"提成比例不存在");
|
||||||
|
}
|
||||||
|
return R.ok(detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改提成
|
||||||
|
*/
|
||||||
|
@GetMapping("/update")
|
||||||
|
@ApiOperation(value = "修改提成")
|
||||||
|
public R<CommissionRatioVo> update(@Valid
|
||||||
|
@NotNull(message = "提成比例id不能为空")
|
||||||
|
Long id,
|
||||||
|
@Valid
|
||||||
|
@NotNull(message = "提成比例不能为空")
|
||||||
|
@NumberFormat
|
||||||
|
Double ratio) {
|
||||||
|
|
||||||
|
if (ratio < 0 || ratio > 1) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"提成比例必须在0-1之间");
|
||||||
|
}
|
||||||
|
|
||||||
|
CommissionRatioVo detail = commissionRatioService.updateRatio(id, ratio);
|
||||||
|
if (detail == null) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"提成比例不存在");
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok(detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,30 +0,0 @@
|
||||||
package com.mcwl.web.controller.myInvitation;
|
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import com.mcwl.myInvitation.domain.Consume;
|
|
||||||
import com.mcwl.myInvitation.service.ConsumeService;
|
|
||||||
import com.mcwl.myInvitation.domain.dto.ConsumeDto;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消费记录
|
|
||||||
*/
|
|
||||||
@RestController()
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@RequestMapping("/consume")
|
|
||||||
public class ConsumeController {
|
|
||||||
|
|
||||||
private final ConsumeService consumeService;
|
|
||||||
|
|
||||||
@PostMapping
|
|
||||||
public void consume(@RequestBody ConsumeDto consumeDto) {
|
|
||||||
|
|
||||||
Consume consume = new Consume();
|
|
||||||
BeanUtil.copyProperties(consumeDto, consume);
|
|
||||||
consumeService.saveConsume(consume);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,73 +1,87 @@
|
||||||
package com.mcwl.web.controller.myInvitation;
|
package com.mcwl.web.controller.myInvitation;
|
||||||
|
|
||||||
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.myInvitation.domain.Invitation;
|
import com.mcwl.myInvitation.domain.Invitation;
|
||||||
import com.mcwl.myInvitation.domain.dto.EarningsDisplayDto;
|
import com.mcwl.myInvitation.domain.dto.EarningsDisplayDto;
|
||||||
import com.mcwl.myInvitation.service.InvitationService;
|
import com.mcwl.myInvitation.service.InvitationService;
|
||||||
import com.mcwl.myInvitation.domain.vo.EarningsDisplayVO;
|
import com.mcwl.myInvitation.domain.vo.EarningsDisplayVO;
|
||||||
|
import com.mcwl.system.domain.dto.WithdrawalPageRes;
|
||||||
|
import com.mcwl.system.service.ISysUserPayAccountLogService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import javax.validation.Valid;
|
||||||
import java.util.Optional;
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
import static com.mcwl.common.core.domain.AjaxResult.success;
|
import static com.mcwl.common.core.domain.AjaxResult.success;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 邀请管理
|
* 我的邀请
|
||||||
*/
|
*/
|
||||||
@RestController()
|
@RestController()
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping("/invitation")
|
@RequestMapping("/invitation")
|
||||||
|
@Api(tags = "我的邀请")
|
||||||
public class InvitationController {
|
public class InvitationController {
|
||||||
|
|
||||||
private final InvitationService invitationService;
|
private final InvitationService invitationService;
|
||||||
|
|
||||||
|
private final ISysUserPayAccountLogService sysUserPayAccountLogService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取邀请码
|
* 获取邀请码
|
||||||
|
*
|
||||||
* @return 邀请码
|
* @return 邀请码
|
||||||
*/
|
*/
|
||||||
@GetMapping("/getInvitationCode")
|
@GetMapping("/getInvitationCode")
|
||||||
public AjaxResult getInvitationCode() {
|
@ApiOperation(value = "获取邀请码")
|
||||||
|
public R<String> getInvitationCode() {
|
||||||
// 获取当前用户
|
// 获取当前用户
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
String invitationCode = invitationService.getInvitationCode(userId);
|
String invitationCode = invitationService.getInvitationCode(userId);
|
||||||
if (StringUtils.isEmpty(invitationCode)) {
|
if (StringUtils.isEmpty(invitationCode)) {
|
||||||
return AjaxResult.warn("获取邀请码失败");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取邀请码失败");
|
||||||
}
|
}
|
||||||
return success("操作成功", invitationCode);
|
return R.ok("操作成功", invitationCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取邀请列表
|
* 获取邀请列表
|
||||||
|
*
|
||||||
* @param userId 用户id
|
* @param userId 用户id
|
||||||
* @return 邀请列表
|
* @return 邀请列表
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@GetMapping("/list/{userId}")
|
// @GetMapping("/list")
|
||||||
public AjaxResult list(@PathVariable Long userId) {
|
// @ApiOperation(value = "获取邀请列表")
|
||||||
List<Invitation> list = invitationService.lambdaQuery()
|
// public R<List<Invitation>> list(@Valid
|
||||||
.eq(Invitation::getUserId, userId)
|
// @NotNull(message = "用户id不能为空")
|
||||||
.list();
|
// @ApiParam("用户id") Long userId) {
|
||||||
return success(list);
|
// List<Invitation> list = invitationService.lambdaQuery()
|
||||||
}
|
// .eq(Invitation::getUserId, userId)
|
||||||
|
// .list();
|
||||||
|
// return R.ok(list);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 邀请人收益展示
|
* 邀请人收益展示
|
||||||
*/
|
*/
|
||||||
@GetMapping("earningsDisplay")
|
@GetMapping("earningsDisplay")
|
||||||
public AjaxResult earningsDisplay() {
|
@ApiOperation(value = "邀请人收益展示")
|
||||||
|
public R<EarningsDisplayVO> earningsDisplay() {
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
|
||||||
EarningsDisplayVO earningsDisplayVO = new EarningsDisplayVO();
|
EarningsDisplayVO earningsDisplayVO = new EarningsDisplayVO();
|
||||||
|
@ -78,16 +92,39 @@ public class InvitationController {
|
||||||
// 获取我的团员
|
// 获取我的团员
|
||||||
List<EarningsDisplayDto> earningsDisplay = invitationService.getEarningsDisplay(userId);
|
List<EarningsDisplayDto> earningsDisplay = invitationService.getEarningsDisplay(userId);
|
||||||
if (earningsDisplay == null || earningsDisplay.isEmpty()) {
|
if (earningsDisplay == null || earningsDisplay.isEmpty()) {
|
||||||
return AjaxResult.warn("暂无收益");
|
return R.ok(new EarningsDisplayVO(totalAmount, Collections.emptyList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
earningsDisplayVO.setTotalAmount(totalAmount);
|
earningsDisplayVO.setTotalAmount(totalAmount);
|
||||||
earningsDisplayVO.setEarningsDisplayList(earningsDisplay);
|
earningsDisplayVO.setEarningsDisplayList(earningsDisplay);
|
||||||
|
|
||||||
return success(earningsDisplayVO);
|
return R.ok(earningsDisplayVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 累计收入金额
|
||||||
|
*/
|
||||||
|
@GetMapping("totalAmount")
|
||||||
|
@ApiOperation(value = "累计收入金额")
|
||||||
|
public R<Double> totalAmount() {
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
Double totalAmount = invitationService.getTotalAmount(userId);
|
||||||
|
if (Objects.isNull(totalAmount)) {
|
||||||
|
totalAmount = 0.0;
|
||||||
|
}
|
||||||
|
return R.ok(totalAmount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现记录
|
||||||
|
*/
|
||||||
|
@PostMapping("withdrawalRecord")
|
||||||
|
@ApiOperation(value = "提现记录")
|
||||||
|
public TableDataInfo withdrawalRecord(@Valid @RequestBody WithdrawalPageRes withdrawalPageRes) {
|
||||||
|
|
||||||
|
return sysUserPayAccountLogService.getWithdrawalRecord(withdrawalPageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,294 @@
|
||||||
|
package com.mcwl.web.controller.pay.AliPay;
|
||||||
|
|
||||||
|
import cn.hutool.core.lang.UUID;
|
||||||
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||||
|
import com.alipay.api.domain.AlipayAccount;
|
||||||
|
import com.alipay.easysdk.factory.Factory;
|
||||||
|
import com.mcwl.common.annotation.Anonymous;
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.redis.RedisCache;
|
||||||
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
|
import com.mcwl.common.utils.ShareCodeUtils;
|
||||||
|
import com.mcwl.pay.config.AliConfig;
|
||||||
|
import com.mcwl.pay.domain.OrderTrade;
|
||||||
|
import com.mcwl.pay.domain.OrderTradeDto;
|
||||||
|
import com.mcwl.pay.domain.vo.PayVo;
|
||||||
|
import com.mcwl.pay.service.AliPayService;
|
||||||
|
import com.mcwl.pay.service.OrderTradeService;
|
||||||
|
import com.mcwl.system.domain.SysUserPayAccount;
|
||||||
|
import com.mcwl.system.service.ISysUserPayAccountService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.Min;
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Pattern;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:ChenYan
|
||||||
|
* @Project:McWl
|
||||||
|
* @Package:com.mcwl.web.controller.pay
|
||||||
|
* @Filename:OrderTradeController
|
||||||
|
* @Description 支付模块
|
||||||
|
* @Date:2025/1/3 14:46
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/ali/pay")
|
||||||
|
@Validated
|
||||||
|
@Api(tags = "支付模块")
|
||||||
|
public class AliPayController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private OrderTradeService orderTradeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserPayAccountService sysUserPayAccountService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AliPayService aliPayService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private AliConfig aliConfig;
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
@Value("${mall.mgt.aliPayConfig.bindUrl}")
|
||||||
|
private String bindUrl;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授权二维码
|
||||||
|
*
|
||||||
|
* @param response 响应
|
||||||
|
* @throws Exception 抛出异常
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "支付宝绑定")
|
||||||
|
@GetMapping("/generateQrCode")
|
||||||
|
@ResponseBody
|
||||||
|
public R<String> generateQrCode(HttpServletResponse response) throws Exception {
|
||||||
|
String scope = "auth_user"; // 需要获取用户信息
|
||||||
|
String appId = aliConfig.getAppId();
|
||||||
|
String state = ShareCodeUtils.idToCode(SecurityUtils.getUserId()); // 防止CSRF攻击
|
||||||
|
|
||||||
|
String encodedRedirectUri = URLEncoder.encode(bindUrl, "UTF-8");
|
||||||
|
String authUrl = String.format(aliConfig.getOauthUrl(),appId, scope, encodedRedirectUri, state);
|
||||||
|
|
||||||
|
// QrCodeUtil.generate(authUrl, 300, 300, "png", response.getOutputStream());
|
||||||
|
return R.ok(authUrl, "成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付宝绑定状态查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/queryBindStatus")
|
||||||
|
@ApiOperation(value = "支付宝绑定状态查询")
|
||||||
|
@ResponseBody
|
||||||
|
public R<Object> queryTradeStatus() throws Exception {
|
||||||
|
|
||||||
|
return aliPayService.queryBindStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 授权回调
|
||||||
|
*
|
||||||
|
* @param authCode 授权码
|
||||||
|
*/
|
||||||
|
@GetMapping("/callback")
|
||||||
|
public String callback(@RequestParam("auth_code") String authCode, String state) throws FileNotFoundException {
|
||||||
|
|
||||||
|
System.out.println("authCode = " + authCode);
|
||||||
|
String result = aliPayService.bindingCallback(authCode, state);
|
||||||
|
if ("success".equals(result)) {
|
||||||
|
return "binding-success";
|
||||||
|
} else {
|
||||||
|
return "binding-fail";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 账户余额查询
|
||||||
|
// */
|
||||||
|
// @GetMapping("/balance")
|
||||||
|
// @ResponseBody
|
||||||
|
// public AjaxResult balance() throws AlipayApiException {
|
||||||
|
// String balance = aliPayService.balance();
|
||||||
|
// return AjaxResult.success(balance);
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付接口
|
||||||
|
*
|
||||||
|
* @param orderTradeDto 订单实体
|
||||||
|
* @param response 响应
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/doPay")
|
||||||
|
@ApiOperation(value = "支付宝支付")
|
||||||
|
@ResponseBody
|
||||||
|
public R<PayVo> doPay(@Valid
|
||||||
|
@RequestBody
|
||||||
|
OrderTradeDto orderTradeDto,
|
||||||
|
HttpServletResponse response) throws Exception {
|
||||||
|
PayVo payVo = null;
|
||||||
|
|
||||||
|
String type = orderTradeDto.getType();
|
||||||
|
|
||||||
|
if ("member".equalsIgnoreCase(type)) {
|
||||||
|
if (!Optional.ofNullable(orderTradeDto.getProductId()).isPresent()) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "商品id不能为空");
|
||||||
|
}
|
||||||
|
payVo = aliPayService.memberPay(orderTradeDto);
|
||||||
|
// QrCodeUtil.generate(payVo.getUrl(), 300, 300, "png", response.getOutputStream());
|
||||||
|
} else if ("points".equalsIgnoreCase(type)) {
|
||||||
|
payVo = aliPayService.pointsPay(orderTradeDto.getAmount());
|
||||||
|
// QrCodeUtil.generate(payVo.getUrl(), 300, 300, "png", response.getOutputStream());
|
||||||
|
} else if ("wallet".equalsIgnoreCase(type)) {
|
||||||
|
// 充值金额只能是整数
|
||||||
|
if (orderTradeDto.getAmount() % 1 != 0) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "充值金额只能是整数");
|
||||||
|
}
|
||||||
|
payVo = aliPayService.walletPay(orderTradeDto.getAmount());
|
||||||
|
// QrCodeUtil.generate(payVo.getUrl(), 300, 300, "png", response.getOutputStream());
|
||||||
|
} else {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "订单类型错误");
|
||||||
|
}
|
||||||
|
|
||||||
|
return R.ok(payVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提现接口
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@GetMapping("/fetch")
|
||||||
|
@ResponseBody
|
||||||
|
@ApiOperation(value = "提现")
|
||||||
|
public R<String> fetch(@Valid
|
||||||
|
@NotNull(message = "提现金额不能为空")
|
||||||
|
@Pattern(regexp = "^(0|(?!0\\d)[1-9]\\d*)(\\.\\d{2})?$", message = "金额格式错误(必须保留两位小数)")
|
||||||
|
String amount) throws Exception {
|
||||||
|
|
||||||
|
SysUserPayAccount sysUserPayAccount = sysUserPayAccountService.lambdaQuery()
|
||||||
|
.eq(SysUserPayAccount::getUserId, SecurityUtils.getUserId())
|
||||||
|
.eq(SysUserPayAccount::getType, 0)
|
||||||
|
.one();
|
||||||
|
|
||||||
|
if (Objects.isNull(sysUserPayAccount)) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "请先绑定支付宝");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (Double.parseDouble(amount) < 0.1) {
|
||||||
|
return R.fail(HttpStatus.SHOW_ERROR_MSG, "提现金额最小为0.1");
|
||||||
|
}
|
||||||
|
|
||||||
|
return aliPayService.fetch(amount);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 支付回调接口
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@PostMapping("/notify") // 注意这里必须是POST接口
|
||||||
|
@ResponseBody
|
||||||
|
public String payNotify(HttpServletRequest request) throws Exception {
|
||||||
|
|
||||||
|
|
||||||
|
if (request.getParameter("trade_status").equals("TRADE_SUCCESS")) {
|
||||||
|
System.out.println("=========支付宝异步回调========");
|
||||||
|
|
||||||
|
Map<String, String> params = new HashMap<>();
|
||||||
|
Map<String, String[]> requestParams = request.getParameterMap();
|
||||||
|
for (String name : requestParams.keySet()) {
|
||||||
|
params.put(name, request.getParameter(name));
|
||||||
|
// System.out.println(name + " = " + request.getParameter(name));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 支付宝验签
|
||||||
|
if (Factory.Payment.Common().verifyNotify(params)) {
|
||||||
|
// System.out.println("交易名称: " + params.get("subject"));
|
||||||
|
// System.out.println("交易状态: " + params.get("trade_status"));
|
||||||
|
// System.out.println("支付宝交易凭证号: " + params.get("trade_no"));
|
||||||
|
// System.out.println("商户订单号: " + params.get("out_trade_no"));
|
||||||
|
// System.out.println("交易金额: " + params.get("total_amount"));
|
||||||
|
// System.out.println("买家在支付宝唯一id: " + params.get("buyer_id"));
|
||||||
|
// System.out.println("买家付款时间: " + params.get("gmt_payment"));
|
||||||
|
// System.out.println("买家付款金额: " + params.get("buyer_pay_amount"));
|
||||||
|
// 验签通过
|
||||||
|
|
||||||
|
String code = params.get("out_trade_no"); // 商户订单号
|
||||||
|
OrderTrade orderTrade = orderTradeService.lambdaQuery()
|
||||||
|
.eq(OrderTrade::getCode, code)
|
||||||
|
.one();
|
||||||
|
if (Objects.isNull(orderTrade)) {
|
||||||
|
return "failure";
|
||||||
|
}
|
||||||
|
// 获取订单后缀
|
||||||
|
String suffix = code.substring(code.lastIndexOf("_") + 1);
|
||||||
|
|
||||||
|
orderTradeService.orderHandler(orderTrade, suffix, params);
|
||||||
|
|
||||||
|
// 更新订单状态
|
||||||
|
// if (!StringUtils.isEmpty(orderTradeJson)) {
|
||||||
|
// OrderTrade orderTrade = JSONUtil.toBean(orderTradeJson, OrderTrade.class);
|
||||||
|
// // 支付宝交易凭证号
|
||||||
|
// orderTrade.setPaymentMethod(params.get("trade_no"));
|
||||||
|
// orderTrade.setTransactionId(1);
|
||||||
|
// orderTrade.setOrderTime(DateUtils.parseDate(params.get("gmt_payment")));
|
||||||
|
// orderTrade.setOrderStatus(3);
|
||||||
|
// orderTrade.setPayStatus(2);
|
||||||
|
// String totalAmountStr = params.get("total_amount");
|
||||||
|
// if (totalAmountStr != null && !totalAmountStr.isEmpty()) {
|
||||||
|
// BigDecimal totalAmount = new BigDecimal(totalAmountStr);
|
||||||
|
// orderTrade.setTotalAmount(totalAmount.intValue());
|
||||||
|
// }
|
||||||
|
// String buyerPayAmountStr = params.get("buyer_pay_amount");
|
||||||
|
// if (buyerPayAmountStr != null && !buyerPayAmountStr.isEmpty()) {
|
||||||
|
// BigDecimal buyerPayAmount = new BigDecimal(buyerPayAmountStr);
|
||||||
|
// orderTrade.setPaymentAmount(buyerPayAmount.intValue());
|
||||||
|
// }
|
||||||
|
// orderTradeService.save(orderTrade);
|
||||||
|
// }
|
||||||
|
} else {
|
||||||
|
// 验签失败
|
||||||
|
System.out.println("验签失败");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 验签失败
|
||||||
|
System.out.println("验签失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -1,288 +0,0 @@
|
||||||
package com.mcwl.web.controller.pay.AliPay;
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import cn.hutool.core.lang.UUID;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.alipay.api.AlipayApiException;
|
|
||||||
import com.alipay.api.AlipayClient;
|
|
||||||
import com.alipay.api.AlipayConfig;
|
|
||||||
import com.alipay.api.DefaultAlipayClient;
|
|
||||||
import com.alipay.api.diagnosis.DiagnosisUtils;
|
|
||||||
import com.alipay.api.domain.AlipayFundAccountQueryModel;
|
|
||||||
import com.alipay.api.domain.AlipayFundTransUniTransferModel;
|
|
||||||
import com.alipay.api.domain.Participant;
|
|
||||||
import com.alipay.api.request.AlipayFundAccountQueryRequest;
|
|
||||||
import com.alipay.api.request.AlipayFundTransUniTransferRequest;
|
|
||||||
import com.alipay.api.response.AlipayFundAccountQueryResponse;
|
|
||||||
import com.alipay.api.response.AlipayFundTransUniTransferResponse;
|
|
||||||
import com.alipay.easysdk.factory.Factory;
|
|
||||||
import com.alipay.easysdk.kernel.Config;
|
|
||||||
import com.alipay.easysdk.payment.facetoface.models.AlipayTradePrecreateResponse;
|
|
||||||
import com.mcwl.common.core.redis.RedisCache;
|
|
||||||
import com.mcwl.common.exception.ServiceException;
|
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
|
||||||
import com.mcwl.memberCenter.domain.MemberLevel;
|
|
||||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
|
||||||
import com.mcwl.pay.config.AliConfig;
|
|
||||||
import com.mcwl.pay.domain.OrderTrade;
|
|
||||||
import com.mcwl.pay.domain.OrderTradeDto;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付宝支付
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@Slf4j
|
|
||||||
public class AliPayIntegration {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RedisCache redisCache;
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private MemberLevelService memberLevelService;
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private AliConfig aliConfig;
|
|
||||||
|
|
||||||
|
|
||||||
public AliPayIntegration(Config config) {
|
|
||||||
Factory.setOptions(config);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 调用支付宝预下订单接口
|
|
||||||
*
|
|
||||||
* @param orderTradeDto 订单实体
|
|
||||||
* @return 二维码url
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
// public String orderPay(OrderTradeDto orderTradeDto) throws Exception {
|
|
||||||
// Integer productId = orderTradeDto.getProductId();
|
|
||||||
// if (!Optional.ofNullable(productId).isPresent()) {
|
|
||||||
// throw new ServiceException("mallProductId不能为空");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// MallProduct mallProduct = mallProductService.getById(productId);
|
|
||||||
// if (!Optional.ofNullable(mallProduct).isPresent()) {
|
|
||||||
// throw new ServiceException("mallProduct不存在");
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // 设置orderTrade信息
|
|
||||||
// OrderTrade tradeEntity = new OrderTrade();
|
|
||||||
// BeanUtil.copyProperties(orderTradeDto, tradeEntity);
|
|
||||||
// tradeEntity.setCode(UUID.randomUUID().toString(true).substring(0, 30));
|
|
||||||
// tradeEntity.setUserId(SecurityUtils.getUserId());
|
|
||||||
// tradeEntity.setUserName(SecurityUtils.getUsername());
|
|
||||||
// tradeEntity.setProductName(mallProduct.getProductName());
|
|
||||||
//
|
|
||||||
// //调用支付宝的接口
|
|
||||||
// AlipayTradePrecreateResponse payResponse = Factory.Payment.FaceToFace()
|
|
||||||
// .preCreate(mallProduct.getProductName(),
|
|
||||||
// tradeEntity.getCode() + "_product",
|
|
||||||
// orderTradeDto.getPaymentAmount().toString());
|
|
||||||
// // 缓存到redis
|
|
||||||
// redisCache.setCacheObject(tradeEntity.getCode() + "_product", JSONUtil.toJsonStr(tradeEntity), 3, TimeUnit.MINUTES);
|
|
||||||
//// AlipayTradePrecreateResponse payResponse = Factory.Payment.FaceToFace().preCreate("订单主题:Mac笔记本", "LS123qwe123", "19999");
|
|
||||||
// //参照官方文档响应示例,解析返回结果
|
|
||||||
// String httpBodyStr = payResponse.getHttpBody();
|
|
||||||
// JSONObject jsonObject = JSONObject.parseObject(httpBodyStr);
|
|
||||||
// return jsonObject.getJSONObject("alipay_trade_precreate_response").get("qr_code").toString();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 调用支付宝预下订单接口
|
|
||||||
*
|
|
||||||
* @param orderTradeDto 订单实体
|
|
||||||
* @return 二维码url
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public String memberPay(OrderTradeDto orderTradeDto) throws Exception {
|
|
||||||
|
|
||||||
// 会员等级id
|
|
||||||
Integer productId = orderTradeDto.getProductId();
|
|
||||||
|
|
||||||
if (!Optional.ofNullable(productId).isPresent()) {
|
|
||||||
throw new ServiceException("memberLevelId不能为空");
|
|
||||||
}
|
|
||||||
|
|
||||||
MemberLevel memberLevel = memberLevelService.getById(productId);
|
|
||||||
|
|
||||||
if (!Optional.ofNullable(memberLevel).isPresent()) {
|
|
||||||
throw new ServiceException("memberLevel不存在");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 设置orderTrade信息
|
|
||||||
OrderTrade tradeEntity = new OrderTrade();
|
|
||||||
BeanUtil.copyProperties(orderTradeDto, tradeEntity);
|
|
||||||
tradeEntity.setCode(UUID.randomUUID().toString(true).substring(0, 30));
|
|
||||||
tradeEntity.setUserId(SecurityUtils.getUserId());
|
|
||||||
tradeEntity.setUserName(SecurityUtils.getUsername());
|
|
||||||
tradeEntity.setProductName(memberLevel.getMemberName());
|
|
||||||
|
|
||||||
//调用支付宝的接口
|
|
||||||
AlipayTradePrecreateResponse payResponse = Factory.Payment.FaceToFace()
|
|
||||||
// 设置过期时
|
|
||||||
.preCreate(memberLevel.getMemberName(),
|
|
||||||
tradeEntity.getCode() + "_member",
|
|
||||||
orderTradeDto.getPaymentAmount().toString());
|
|
||||||
// 缓存到redis
|
|
||||||
redisCache.setCacheObject(tradeEntity.getCode() + "_member", JSONUtil.toJsonStr(tradeEntity), 3, TimeUnit.MINUTES);
|
|
||||||
redisCache.setCacheObject(tradeEntity.getCode() + "_member" + "_promotionId", orderTradeDto.getPromotionId(), 3, TimeUnit.MINUTES);
|
|
||||||
// AlipayTradePrecreateResponse payResponse = Factory.Payment.FaceToFace().preCreate("订单主题:Mac笔记本", "LS123qwe123", "19999");
|
|
||||||
//参照官方文档响应示例,解析返回结果
|
|
||||||
String httpBodyStr = payResponse.getHttpBody();
|
|
||||||
JSONObject jsonObject = JSONObject.parseObject(httpBodyStr);
|
|
||||||
return jsonObject.getJSONObject("alipay_trade_precreate_response").get("qr_code").toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 调用支付宝预下订单接口
|
|
||||||
*
|
|
||||||
* @param paymentAmount 充值金额
|
|
||||||
* @return 二维码url
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public String pointsPay(Double paymentAmount) throws Exception {
|
|
||||||
// 设置orderTrade信息
|
|
||||||
OrderTrade tradeEntity = new OrderTrade();
|
|
||||||
tradeEntity.setCode(UUID.randomUUID().toString(true).substring(0, 30));
|
|
||||||
tradeEntity.setUserId(SecurityUtils.getUserId());
|
|
||||||
tradeEntity.setProductId(-1);
|
|
||||||
tradeEntity.setProductName("积分充值");
|
|
||||||
tradeEntity.setUserName(SecurityUtils.getUsername());
|
|
||||||
tradeEntity.setPaymentAmount(paymentAmount.intValue());
|
|
||||||
|
|
||||||
//调用支付宝的接口
|
|
||||||
AlipayTradePrecreateResponse payResponse = Factory.Payment.FaceToFace()
|
|
||||||
.preCreate(tradeEntity.getProductName(),
|
|
||||||
tradeEntity.getCode() + "_points",
|
|
||||||
tradeEntity.getPaymentAmount().toString());
|
|
||||||
// 缓存到redis
|
|
||||||
redisCache.setCacheObject(tradeEntity.getCode() + "_points", JSONUtil.toJsonStr(tradeEntity), 3, TimeUnit.MINUTES);
|
|
||||||
//参照官方文档响应示例,解析返回结果
|
|
||||||
String httpBodyStr = payResponse.getHttpBody();
|
|
||||||
JSONObject jsonObject = JSONObject.parseObject(httpBodyStr);
|
|
||||||
return jsonObject.getJSONObject("alipay_trade_precreate_response").get("qr_code").toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 支付宝转账方法
|
|
||||||
* @param outBizNo 外部业务单号
|
|
||||||
* @param payerUserId 付款方用户ID
|
|
||||||
* @param payeeUserId 收款方用户ID
|
|
||||||
* @param amount 转账金额
|
|
||||||
* @return 返回支付宝转账响应的内容
|
|
||||||
*/
|
|
||||||
public String transfer(String outBizNo, String payerUserId, String payeeUserId, String amount) throws AlipayApiException {
|
|
||||||
|
|
||||||
// 初始化SDK
|
|
||||||
AlipayClient alipayClient = new DefaultAlipayClient(getAlipayConfig());
|
|
||||||
|
|
||||||
// 构造请求参数以调用接口
|
|
||||||
AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest();
|
|
||||||
AlipayFundTransUniTransferModel model = new AlipayFundTransUniTransferModel();
|
|
||||||
|
|
||||||
// 设置商家侧唯一订单号
|
|
||||||
model.setOutBizNo(outBizNo);
|
|
||||||
|
|
||||||
// 设置订单总金额
|
|
||||||
model.setTransAmount(amount);
|
|
||||||
|
|
||||||
// 设置描述特定的业务场景
|
|
||||||
model.setBizScene("DIRECT_TRANSFER");
|
|
||||||
|
|
||||||
// 设置业务产品码
|
|
||||||
model.setProductCode("TRANS_ACCOUNT_NO_PWD");
|
|
||||||
|
|
||||||
// 设置转账业务的标题
|
|
||||||
model.setOrderTitle("测试");
|
|
||||||
|
|
||||||
// 设置收款方信息
|
|
||||||
Participant payeeInfo = new Participant();
|
|
||||||
payeeInfo.setCertType("IDENTITY_CARD");
|
|
||||||
payeeInfo.setCertNo("1201152******72917");
|
|
||||||
payeeInfo.setIdentity("2088123412341234");
|
|
||||||
payeeInfo.setName("黄龙国际有限公司");
|
|
||||||
payeeInfo.setIdentityType("ALIPAY_USER_ID");
|
|
||||||
model.setPayeeInfo(payeeInfo);
|
|
||||||
|
|
||||||
// 设置业务备注
|
|
||||||
model.setRemark("201905代发");
|
|
||||||
|
|
||||||
// 设置转账业务请求的扩展参数
|
|
||||||
model.setBusinessParams("{\"payer_show_name_use_alias\":\"true\"}");
|
|
||||||
|
|
||||||
request.setBizModel(model);
|
|
||||||
AlipayFundTransUniTransferResponse response = alipayClient.certificateExecute(request);
|
|
||||||
System.out.println(response.getBody());
|
|
||||||
|
|
||||||
if (response.isSuccess()) {
|
|
||||||
System.out.println("调用成功");
|
|
||||||
} else {
|
|
||||||
System.out.println("调用失败");
|
|
||||||
// sdk版本是"4.38.0.ALL"及以上,可以参考下面的示例获取诊断链接
|
|
||||||
String diagnosisUrl = DiagnosisUtils.getDiagnosisUrl(response);
|
|
||||||
System.out.println(diagnosisUrl);
|
|
||||||
}
|
|
||||||
return response.getBody();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查看余额
|
|
||||||
*/
|
|
||||||
public void balance() throws AlipayApiException {
|
|
||||||
// 初始化SDK
|
|
||||||
AlipayClient alipayClient = new DefaultAlipayClient(getAlipayConfig());
|
|
||||||
|
|
||||||
// 构造请求参数以调用接口
|
|
||||||
AlipayFundAccountQueryRequest request = new AlipayFundAccountQueryRequest();
|
|
||||||
AlipayFundAccountQueryModel model = new AlipayFundAccountQueryModel();
|
|
||||||
|
|
||||||
// uid参数未来计划废弃,存量商户可继续使用,新商户请使用openid。请根据应用-开发配置-openid配置选择支持的字段。
|
|
||||||
// model.setAlipayUserId("2088301409188095");
|
|
||||||
|
|
||||||
// 设置支付宝openId
|
|
||||||
model.setAlipayOpenId("061P6NAblcWDWJoDRxSVvOYz-ufp-3wQaA4E_szQyMFTXse");
|
|
||||||
|
|
||||||
// 设置查询的账号类型
|
|
||||||
model.setAccountType("ACCTRANS_ACCOUNT");
|
|
||||||
|
|
||||||
request.setBizModel(model);
|
|
||||||
AlipayFundAccountQueryResponse response = alipayClient.execute(request);
|
|
||||||
System.out.println(response.getBody());
|
|
||||||
|
|
||||||
if (response.isSuccess()) {
|
|
||||||
System.out.println("调用成功");
|
|
||||||
} else {
|
|
||||||
System.out.println("调用失败");
|
|
||||||
// sdk版本是"4.38.0.ALL"及以上,可以参考下面的示例获取诊断链接
|
|
||||||
// String diagnosisUrl = DiagnosisUtils.getDiagnosisUrl(response);
|
|
||||||
// System.out.println(diagnosisUrl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private AlipayConfig getAlipayConfig() {
|
|
||||||
String privateKey = aliConfig.getPrivateKey();
|
|
||||||
String alipayPublicKey = aliConfig.getPublicKey();
|
|
||||||
AlipayConfig alipayConfig = new AlipayConfig();
|
|
||||||
alipayConfig.setServerUrl(aliConfig.getGatewayUrl());
|
|
||||||
alipayConfig.setAppId(aliConfig.getAppId());
|
|
||||||
alipayConfig.setPrivateKey(privateKey);
|
|
||||||
alipayConfig.setFormat("json");
|
|
||||||
alipayConfig.setAlipayPublicKey(alipayPublicKey);
|
|
||||||
alipayConfig.setCharset("UTF-8");
|
|
||||||
alipayConfig.setSignType("RSA2");
|
|
||||||
return alipayConfig;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.mcwl.web.controller.pay.AliPay;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品购买记录
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/3/28
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Api(tags = "商品购买记录")
|
||||||
|
@RequestMapping("/modelRechargeRecord")
|
||||||
|
@RestController
|
||||||
|
public class ModelPurchaseRecordController {
|
||||||
|
|
||||||
|
}
|
|
@ -1,29 +1,31 @@
|
||||||
package com.mcwl.web.controller.pay.AliPay;
|
package com.mcwl.web.controller.pay.AliPay;
|
||||||
|
|
||||||
import cn.hutool.core.lang.UUID;
|
|
||||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.alipay.easysdk.factory.Factory;
|
import com.alipay.easysdk.factory.Factory;
|
||||||
import com.alipay.easysdk.kernel.Config;
|
import com.alipay.easysdk.kernel.Config;
|
||||||
|
import com.alipay.easysdk.payment.common.models.AlipayTradeCancelResponse;
|
||||||
|
import com.alipay.easysdk.payment.common.models.AlipayTradeCloseResponse;
|
||||||
import com.alipay.easysdk.payment.common.models.AlipayTradeQueryResponse;
|
import com.alipay.easysdk.payment.common.models.AlipayTradeQueryResponse;
|
||||||
import com.mcwl.common.JSONUtils;
|
import com.mcwl.common.JSONUtils;
|
||||||
import com.mcwl.common.annotation.Anonymous;
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.common.core.redis.RedisCache;
|
import com.mcwl.common.core.redis.RedisCache;
|
||||||
import com.mcwl.common.domain.IdsParam;
|
import com.mcwl.common.domain.IdsParam;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
import com.mcwl.pay.domain.OrderTrade;
|
import com.mcwl.pay.domain.OrderTrade;
|
||||||
import com.mcwl.pay.domain.OrderTradeDto;
|
import com.mcwl.pay.service.AliPayService;
|
||||||
import com.mcwl.pay.service.OrderTradeService;
|
import com.mcwl.pay.service.OrderTradeService;
|
||||||
|
import com.mcwl.resource.domain.dto.ProductRes;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.validation.Valid;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.validation.constraints.NotBlank;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -37,8 +39,9 @@ import java.util.Map;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/web/pay")
|
@RequestMapping("/order")
|
||||||
@Validated
|
@Validated
|
||||||
|
@Api(tags = "订单模块")
|
||||||
public class OrderTradeController extends BaseController {
|
public class OrderTradeController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -48,16 +51,28 @@ public class OrderTradeController extends BaseController {
|
||||||
private OrderTradeService orderTradeService;
|
private OrderTradeService orderTradeService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private AliPayIntegration aliPayIntegration;
|
private AliPayService aliPayService;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisCache redisCache;
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购买产品
|
||||||
|
*/
|
||||||
|
@PostMapping("/buy")
|
||||||
|
@ApiOperation(value = "购买产品")
|
||||||
|
public R<Object> buy(@Valid @RequestBody ProductRes productRes) throws Exception {
|
||||||
|
orderTradeService.productHandler(productRes);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询列表
|
* 查询列表
|
||||||
*/
|
*/
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
|
@ApiOperation(value = "查询订单列表")
|
||||||
public TableDataInfo list(OrderTrade orderTrade) {
|
public TableDataInfo list(OrderTrade orderTrade) {
|
||||||
startPage();
|
startPage();
|
||||||
List<OrderTrade> list = orderTradeService.selectMallProductList(orderTrade);
|
List<OrderTrade> list = orderTradeService.selectMallProductList(orderTrade);
|
||||||
|
@ -68,178 +83,81 @@ public class OrderTradeController extends BaseController {
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public AjaxResult add(@RequestBody OrderTrade orderTrade) {
|
@ApiOperation(value = "新增订单")
|
||||||
|
public R<Object> add(@RequestBody OrderTrade orderTrade) {
|
||||||
// 获取当前用户
|
// 获取当前用户
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
if (userId == null) {
|
if (userId == null) {
|
||||||
return AjaxResult.warn("用户未登录");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"用户未登录");
|
||||||
}
|
}
|
||||||
orderTrade.setUserId(userId);
|
orderTrade.setUserId(userId);
|
||||||
orderTrade.setCreateBy(getUsername());
|
return R.ok(orderTradeService.insertMallProduct(orderTrade));
|
||||||
return toAjax(orderTradeService.insertMallProduct(orderTrade));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
@PostMapping("/upda")
|
@PostMapping("/update")
|
||||||
public AjaxResult upda(@RequestBody OrderTrade orderTrade) {
|
@ApiOperation(value = "修改订单")
|
||||||
|
public R<Object> update(@RequestBody OrderTrade orderTrade) {
|
||||||
// 获取当前用户
|
// 获取当前用户
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
if (userId == null) {
|
if (userId == null) {
|
||||||
return AjaxResult.warn("用户未登录");
|
return R.fail(HttpStatus.SHOW_ERROR_MSG,"用户未登录");
|
||||||
}
|
}
|
||||||
orderTrade.setUserId(userId);
|
orderTrade.setUserId(userId);
|
||||||
orderTrade.setUpdateBy(getUsername());
|
orderTradeService.updateMallProduct(orderTrade);
|
||||||
return toAjax(orderTradeService.updateMallProduct(orderTrade));
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult remove(@RequestBody IdsParam ids) {
|
@ApiOperation(value = "删除订单")
|
||||||
|
public R<Object> remove(@RequestBody IdsParam ids) {
|
||||||
orderTradeService.deleteMallProductByIds(ids);
|
orderTradeService.deleteMallProductByIds(ids);
|
||||||
return success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付接口
|
* 查询交易状态
|
||||||
*
|
|
||||||
* @param orderTradeDto 订单实体
|
|
||||||
* @param response 响应
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
*/
|
||||||
@Anonymous
|
|
||||||
@PostMapping("/doPay")
|
|
||||||
public void doPay(@RequestBody OrderTradeDto orderTradeDto, HttpServletResponse response) throws Exception {
|
|
||||||
String qrUrl = null;
|
|
||||||
|
|
||||||
String type = orderTradeDto.getType();
|
|
||||||
|
|
||||||
if ("member".equalsIgnoreCase(type)) {
|
|
||||||
qrUrl = aliPayIntegration.memberPay(orderTradeDto);
|
|
||||||
} else if ("points".equalsIgnoreCase(type)) {
|
|
||||||
qrUrl = aliPayIntegration.pointsPay(orderTradeDto.getPaymentAmount());
|
|
||||||
}
|
|
||||||
|
|
||||||
QrCodeUtil.generate(qrUrl, 300, 300, "png", response.getOutputStream());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("/queryTradeStatus")
|
@GetMapping("/queryTradeStatus")
|
||||||
public Object queryTradeStatus(@RequestParam String outTradeNo) throws Exception {
|
@ApiOperation(value = "查询交易状态")
|
||||||
Factory.setOptions(config);
|
public R<Object> queryTradeStatus(@Valid @NotBlank(message = "订单号不能为空") String outTradeNo) throws Exception {
|
||||||
AlipayTradeQueryResponse query = Factory.Payment.Common().query(outTradeNo);
|
return aliPayService.queryTradeStatus(outTradeNo);
|
||||||
Map<String, Object> map = JSONUtils.jsonToMap(query.getHttpBody());
|
|
||||||
|
|
||||||
// 返回交易结果, 是否交易成功需要根据该对象中的 trade_status 来确定
|
|
||||||
// trade_status 的枚举值如下, 请见 https://opendocs.alipay.com/apis/api_1/alipay.trade.query
|
|
||||||
// WAIT_BUYER_PAY(交易创建,等待买家付款)
|
|
||||||
// TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)
|
|
||||||
// TRADE_SUCCESS(交易支付成功)
|
|
||||||
// TRADE_FINISHED(交易结束,不可退款)
|
|
||||||
// 当 trade_status 等于 TRADE_SUCCESS 或 TRADE_FINISHED 时, 表示支付成功
|
|
||||||
return map.get("alipay_trade_query_response");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查看余额
|
|
||||||
*/
|
|
||||||
@GetMapping("/balance")
|
|
||||||
public void balance() throws Exception {
|
|
||||||
aliPayIntegration.balance();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 提现接口
|
|
||||||
*/
|
|
||||||
@Anonymous
|
|
||||||
@PostMapping("/withdraw")
|
|
||||||
public void withdraw(@RequestBody OrderTradeDto orderTradeDto, HttpServletResponse response) throws Exception {
|
|
||||||
String outBizNo = UUID.fastUUID().toString(true);
|
|
||||||
String payerUserId = "2088102167258880";
|
|
||||||
String payeeUserId = "2088102167258880";
|
|
||||||
String amount = "100";
|
|
||||||
aliPayIntegration.transfer(outBizNo, payerUserId, payeeUserId, amount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付回调接口
|
* 撤销交易
|
||||||
*
|
|
||||||
* @param request
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
*/
|
||||||
@Anonymous
|
// @GetMapping("/cancelTrade")
|
||||||
@PostMapping("/notify") // 注意这里必须是POST接口
|
// public AjaxResult cancelTrade(String outTradeNo) throws Exception {
|
||||||
public String payNotify(HttpServletRequest request) throws Exception {
|
// // 关闭交易
|
||||||
|
// AlipayTradeCancelResponse cancel = Factory.Payment.Common().cancel(outTradeNo);
|
||||||
|
// if (cancel.getCode().equals("10000")) {
|
||||||
if (request.getParameter("trade_status").equals("TRADE_SUCCESS")) {
|
// return AjaxResult.success("关闭成功");
|
||||||
System.out.println("=========支付宝异步回调========");
|
|
||||||
|
|
||||||
Map<String, String> params = new HashMap<>();
|
|
||||||
Map<String, String[]> requestParams = request.getParameterMap();
|
|
||||||
for (String name : requestParams.keySet()) {
|
|
||||||
params.put(name, request.getParameter(name));
|
|
||||||
// System.out.println(name + " = " + request.getParameter(name));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 支付宝验签
|
|
||||||
if (Factory.Payment.Common().verifyNotify(params)) {
|
|
||||||
// System.out.println("交易名称: " + params.get("subject"));
|
|
||||||
// System.out.println("交易状态: " + params.get("trade_status"));
|
|
||||||
// System.out.println("支付宝交易凭证号: " + params.get("trade_no"));
|
|
||||||
// System.out.println("商户订单号: " + params.get("out_trade_no"));
|
|
||||||
// System.out.println("交易金额: " + params.get("total_amount"));
|
|
||||||
// System.out.println("买家在支付宝唯一id: " + params.get("buyer_id"));
|
|
||||||
// System.out.println("买家付款时间: " + params.get("gmt_payment"));
|
|
||||||
// System.out.println("买家付款金额: " + params.get("buyer_pay_amount"));
|
|
||||||
// 验签通过
|
|
||||||
|
|
||||||
String code = params.get("out_trade_no"); // 商户订单号
|
|
||||||
// 获取订单后缀
|
|
||||||
String suffix = code.substring(code.lastIndexOf("_") + 1);
|
|
||||||
String orderTradeJson = redisCache.getCacheObject(code);
|
|
||||||
OrderTrade orderTrade = JSONUtil.toBean(orderTradeJson, OrderTrade.class);
|
|
||||||
|
|
||||||
orderTradeService.orderHandler(orderTrade, suffix, params);
|
|
||||||
|
|
||||||
// 更新订单状态
|
|
||||||
// if (!StringUtils.isEmpty(orderTradeJson)) {
|
|
||||||
// OrderTrade orderTrade = JSONUtil.toBean(orderTradeJson, OrderTrade.class);
|
|
||||||
// // 支付宝交易凭证号
|
|
||||||
// orderTrade.setPaymentMethod(params.get("trade_no"));
|
|
||||||
// orderTrade.setTransactionId(1);
|
|
||||||
// orderTrade.setOrderTime(DateUtils.parseDate(params.get("gmt_payment")));
|
|
||||||
// orderTrade.setOrderStatus(3);
|
|
||||||
// orderTrade.setPayStatus(2);
|
|
||||||
// String totalAmountStr = params.get("total_amount");
|
|
||||||
// if (totalAmountStr != null && !totalAmountStr.isEmpty()) {
|
|
||||||
// BigDecimal totalAmount = new BigDecimal(totalAmountStr);
|
|
||||||
// orderTrade.setTotalAmount(totalAmount.intValue());
|
|
||||||
// }
|
// }
|
||||||
// String buyerPayAmountStr = params.get("buyer_pay_amount");
|
// return AjaxResult.error("关闭失败");
|
||||||
// if (buyerPayAmountStr != null && !buyerPayAmountStr.isEmpty()) {
|
|
||||||
// BigDecimal buyerPayAmount = new BigDecimal(buyerPayAmountStr);
|
|
||||||
// orderTrade.setPaymentAmount(buyerPayAmount.intValue());
|
|
||||||
// }
|
// }
|
||||||
// orderTradeService.save(orderTrade);
|
|
||||||
|
/**
|
||||||
|
* 关闭交易
|
||||||
|
*/
|
||||||
|
// @GetMapping("/closeTrade")
|
||||||
|
// public AjaxResult closeTrade(String outTradeNo) throws Exception {
|
||||||
|
// // 关闭交易
|
||||||
|
// AlipayTradeCloseResponse close = Factory.Payment.Common().close(outTradeNo);
|
||||||
|
// if (close.getCode().equals("10000")) {
|
||||||
|
// return AjaxResult.success("关闭成功");
|
||||||
|
// }
|
||||||
|
// return AjaxResult.error("关闭失败");
|
||||||
// }
|
// }
|
||||||
} else {
|
|
||||||
// 验签失败
|
|
||||||
System.out.println("验签失败");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 验签失败
|
|
||||||
System.out.println("验签失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
return "success";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,175 @@
|
||||||
|
package com.mcwl.web.controller.personalCenter;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.domain.entity.SysUser;
|
||||||
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
|
import com.mcwl.memberCenter.domain.Member;
|
||||||
|
import com.mcwl.memberCenter.domain.MemberConsume;
|
||||||
|
import com.mcwl.memberCenter.domain.vo.MemberConsumeVO;
|
||||||
|
import com.mcwl.memberCenter.domain.vo.RechargeRecordVO;
|
||||||
|
import com.mcwl.memberCenter.service.MemberService;
|
||||||
|
import com.mcwl.myInvitation.service.CommissionService;
|
||||||
|
import com.mcwl.myInvitation.service.ConsumeService;
|
||||||
|
import com.mcwl.pay.service.OrderTradeService;
|
||||||
|
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||||
|
import com.mcwl.resource.service.*;
|
||||||
|
import com.mcwl.system.service.ISysUserService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
@Api(tags = "个人中心")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("personalCenter")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PersonalCenterController {
|
||||||
|
|
||||||
|
private final ModelService modelService;
|
||||||
|
|
||||||
|
private final ModelLikeService modelLikeService;
|
||||||
|
|
||||||
|
private final ModelImageService modelImageService;
|
||||||
|
|
||||||
|
private final WorkFlowService workFlowService;
|
||||||
|
|
||||||
|
private final WorkFlowLikeService workFlowLikeService;
|
||||||
|
|
||||||
|
private final ModelImageLikeService modelImageLikeService;
|
||||||
|
|
||||||
|
private final ISysUserService sysUserService;
|
||||||
|
|
||||||
|
private final MemberService memberService;
|
||||||
|
|
||||||
|
private final OrderTradeService orderTradeService;
|
||||||
|
|
||||||
|
private final ConsumeService consumeService;
|
||||||
|
|
||||||
|
private final CommissionService commissionService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的发布-模型列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "我的发布-模型列表")
|
||||||
|
@PostMapping("/selectByUserIdModel")
|
||||||
|
public TableDataInfo selectByUserIdModel(@RequestBody ModelImagePageRes imagePageRes) {
|
||||||
|
|
||||||
|
return modelService.listByPage(imagePageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的发布-工作流列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "我的发布-工作流列表")
|
||||||
|
@PostMapping("/selectByUserIdWorkFlow")
|
||||||
|
public TableDataInfo selectByUserIdWorkFlow(@RequestBody ModelImagePageRes imagePageRes) {
|
||||||
|
|
||||||
|
return workFlowService.listByPage(imagePageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的发布-图片列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "我的发布-图片列表")
|
||||||
|
@PostMapping("/selectByUserIdImage")
|
||||||
|
public TableDataInfo selectByUserIdImage(@RequestBody ModelImagePageRes imagePageRes) {
|
||||||
|
|
||||||
|
return modelImageService.listByPage(imagePageRes);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的点赞-模型列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "我的点赞-模型列表")
|
||||||
|
@PostMapping("/likeModel")
|
||||||
|
public TableDataInfo likeModel(@Valid @RequestBody PageDomain pageDomain) {
|
||||||
|
return modelLikeService.listByPage(pageDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的点赞-工作流列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "我的点赞-工作流列表")
|
||||||
|
@PostMapping("/likeWorkFlow")
|
||||||
|
public TableDataInfo likeWorkFlow(@Valid @RequestBody PageDomain pageDomain) {
|
||||||
|
return workFlowLikeService.listByPage(pageDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 我的点赞-图片列表
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "我的点赞-图片列表")
|
||||||
|
@PostMapping("/likeImage")
|
||||||
|
public TableDataInfo likeImage(@Valid @RequestBody PageDomain pageDomain) {
|
||||||
|
return modelImageLikeService.listByPage(pageDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取积分和金币
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取积分和金币")
|
||||||
|
@PostMapping("/getPointAndWallet")
|
||||||
|
public R<Map<String, Double>> getPointAndWallet() {
|
||||||
|
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
|
||||||
|
Map<String, Double> map = new HashMap<>();
|
||||||
|
|
||||||
|
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||||
|
|
||||||
|
Member member = memberService.getUseUserMemberByUserId(userId);
|
||||||
|
|
||||||
|
double points = sysUser.getFreePoints();
|
||||||
|
|
||||||
|
if (Objects.nonNull(member)) {
|
||||||
|
points = points + member.getPoints();
|
||||||
|
}
|
||||||
|
|
||||||
|
map.put("point", points);
|
||||||
|
map.put("wallet", sysUser.getWallet());
|
||||||
|
|
||||||
|
return R.ok(map);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取金币消费记录
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取金币消费记录")
|
||||||
|
@PostMapping("/getWalletRecord")
|
||||||
|
public TableDataInfo getWalletRecord(@Valid @RequestBody PageDomain pageDomain) {
|
||||||
|
return consumeService.getWalletRecord(pageDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取金币收入记录
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取金币收入记录")
|
||||||
|
@PostMapping("/getWalletIncomeRecord")
|
||||||
|
public TableDataInfo getWalletIncomeRecord(@Valid @RequestBody PageDomain pageDomain) {
|
||||||
|
|
||||||
|
return commissionService.getWalletIncomeRecord(pageDomain);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取金币充值记录
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取金币充值记录")
|
||||||
|
@PostMapping("/getRecord")
|
||||||
|
public TableDataInfo getRecord(@Valid @RequestBody PageDomain pageDomain) {
|
||||||
|
return orderTradeService.getRecord(pageDomain, "金币充值");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.mcwl.web.controller.platformData;
|
||||||
|
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.pay.domain.vo.IncomeVo;
|
||||||
|
import com.mcwl.pay.domain.vo.TrendVo;
|
||||||
|
import com.mcwl.pay.service.OrderTradeService;
|
||||||
|
import com.mcwl.system.domain.vo.UserDataVo;
|
||||||
|
import com.mcwl.system.service.ISysUserService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@Api(tags = "平台数据统计")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("platformData")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PlatformData {
|
||||||
|
|
||||||
|
private final OrderTradeService orderTradeService;
|
||||||
|
|
||||||
|
private final ISysUserService sysUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 平台收益
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "平台收益")
|
||||||
|
@GetMapping("getIncome")
|
||||||
|
public R<IncomeVo> getIncome() {
|
||||||
|
|
||||||
|
return R.ok(orderTradeService.getIncome());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收益趋势
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "收益趋势")
|
||||||
|
@GetMapping("getTrend")
|
||||||
|
public R<TrendVo> getTrend() {
|
||||||
|
|
||||||
|
return R.ok(orderTradeService.getTrend());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户数据
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "用户数据")
|
||||||
|
@GetMapping("getUserData")
|
||||||
|
public R<UserDataVo> getUserData() {
|
||||||
|
|
||||||
|
return R.ok(sysUserService.getUserData());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
/**
|
/**支付宝配置
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
* @Project:McWl
|
* @Project:McWl
|
||||||
* @Package:com.mcwl.common.config
|
* @Package:com.mcwl.common.config
|
||||||
|
|
|
@ -31,4 +31,45 @@ public class CodeMQConfig {
|
||||||
return new Queue(QueueConstants.MEMBER_BILLING_QUEUE, true);
|
return new Queue(QueueConstants.MEMBER_BILLING_QUEUE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Queue modelLikeQueue() {
|
||||||
|
return new Queue(QueueConstants.MODEL_LIKE_QUEUE, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Queue modelCommentLikeQueue() {
|
||||||
|
return new Queue(QueueConstants.MODEL_COMMENT_LIKE_QUEUE, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Queue imageLikeQueue() {
|
||||||
|
return new Queue(QueueConstants.IMAGE_LIKE_QUEUE, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Queue imageCommentLikeQueue() {
|
||||||
|
return new Queue(QueueConstants.IMAGE_COMMENT_LIKE_QUEUE, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Queue workFlowLikeQueue() {
|
||||||
|
return new Queue(QueueConstants.WORK_FLOW_LIKE_QUEUE, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Queue workFlowCommentLikeQueue() {
|
||||||
|
return new Queue(QueueConstants.WORK_FLOW_COMMENT_LIKE_QUEUE, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public Queue sysMsgQueue() {
|
||||||
|
return new Queue(QueueConstants.SYS_MSG_QUEUE, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.resource.domain.Collect;
|
||||||
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
|
import com.mcwl.resource.service.impl.CollectServiceImpl;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 收藏
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/3/5
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "收藏")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/collect")
|
||||||
|
public class CollectController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CollectServiceImpl collectService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加收藏
|
||||||
|
* @param collect
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "添加收藏")
|
||||||
|
@PostMapping("/addCollect")
|
||||||
|
public R addCollect(@RequestBody Collect collect){
|
||||||
|
|
||||||
|
return collectService.addCollect(collect);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询收藏列表
|
||||||
|
* @param pageVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询收藏列表")
|
||||||
|
@PostMapping("/selectCollect")
|
||||||
|
public R selectCollect(@RequestBody PageVo pageVo){
|
||||||
|
|
||||||
|
|
||||||
|
return collectService.selectCollect(pageVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,88 @@
|
||||||
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.resource.domain.DownloadRecord;
|
||||||
|
import com.mcwl.resource.domain.request.RequestDownload;
|
||||||
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
|
import com.mcwl.resource.service.impl.DownloadRecordServiceImpl;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件下载记录
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/3/6
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "文件下载记录")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/downloadRecord")
|
||||||
|
public class DownloadRecordController {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DownloadRecordServiceImpl downloadRecordService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增下载记录
|
||||||
|
* @param downloadRecord
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增下载记录")
|
||||||
|
@PostMapping("/addDownloadRecord")
|
||||||
|
public R addDownloadRecord(@RequestBody DownloadRecord downloadRecord){
|
||||||
|
|
||||||
|
return downloadRecordService.addDownloadRecord(downloadRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询下载记录
|
||||||
|
* @param pageVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "下载记录")
|
||||||
|
@PostMapping("/selectDownloadRecord")
|
||||||
|
public R selectDownloadRecord(@RequestBody PageVo pageVo){
|
||||||
|
|
||||||
|
return downloadRecordService.selectDownloadRecord(pageVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改下载状态
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改下载状态")
|
||||||
|
@PostMapping("/updateDownloadRecord")
|
||||||
|
public R updateDownloadRecord(@RequestBody DownloadRecord downloadRecord){
|
||||||
|
|
||||||
|
return downloadRecordService.updateDownloadRecord(downloadRecord);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除下载记录
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "批量删除下载记录")
|
||||||
|
@GetMapping("/deleteDownloadRecord")
|
||||||
|
public R deleteDownloadRecord(@RequestParam String ids){
|
||||||
|
|
||||||
|
return downloadRecordService.deleteDownloadRecord(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "根据文件名查询详情")
|
||||||
|
@PostMapping("/selectFileByName")
|
||||||
|
public R selectByFileName(@RequestBody RequestDownload requestDownload){
|
||||||
|
|
||||||
|
return downloadRecordService.selectByFileName(requestDownload);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,295 @@
|
||||||
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.utils.obs.ObsUtils;
|
||||||
|
import com.mcwl.resource.domain.request.RequestFile;
|
||||||
|
import com.mcwl.resource.domain.vo.FileVo;
|
||||||
|
import com.mcwl.resource.service.impl.FileServiceImpl;
|
||||||
|
import com.mcwl.web.controller.common.OssUtil;
|
||||||
|
import com.obs.services.ObsClient;
|
||||||
|
import com.obs.services.model.*;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import java.io.*;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文件/图片
|
||||||
|
*
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/2/10
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "上传文件")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/file")
|
||||||
|
public class FileController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private FileServiceImpl fileService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ObsUtils obsUtils;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ObsClient obsClient;
|
||||||
|
|
||||||
|
@Value("${huawei.obs.bucketName}")
|
||||||
|
private String bucketName;
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* 图片
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("上传图片")
|
||||||
|
@PostMapping("/imgUpload")
|
||||||
|
public AjaxResult imgUpload(@RequestParam MultipartFile file) {
|
||||||
|
|
||||||
|
String s = OssUtil.uploadMultipartFile(file);
|
||||||
|
String fileName = file.getOriginalFilename();
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
map.put("fileName", fileName);
|
||||||
|
map.put("url", s);
|
||||||
|
return AjaxResult.success(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* 上传文件
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("上传文件")
|
||||||
|
@PostMapping("/fileUpload")
|
||||||
|
public AjaxResult fileUpload(@RequestParam MultipartFile file) {
|
||||||
|
|
||||||
|
log.info("开始上传文件...");
|
||||||
|
Map<String, String> map = obsUtils.uploadFile(file);
|
||||||
|
|
||||||
|
return AjaxResult.success(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* zip
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "zip")
|
||||||
|
@PostMapping("/zipUrlFile")
|
||||||
|
public AjaxResult zipUrlFile(@RequestParam MultipartFile file) {
|
||||||
|
String s = OssUtil.uploadMultipartFile(file);
|
||||||
|
return AjaxResult.success(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* 下载zip
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "zip")
|
||||||
|
@PostMapping("/zipUrl")
|
||||||
|
public AjaxResult zipUrl(@RequestParam MultipartFile file) {
|
||||||
|
String s = OssUtil.uploadMultipartFile(file);
|
||||||
|
return AjaxResult.success(s);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据文件名查找是否存在
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/selectFileName")
|
||||||
|
@ApiOperation(value = "根据文件名查找是否存在并返回秘钥")
|
||||||
|
public AjaxResult selectFileName(@RequestBody FileVo fileVo){
|
||||||
|
|
||||||
|
return fileService.selectFileName(fileVo.getName(), fileVo.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/selectFile")
|
||||||
|
@ApiOperation(value = "根据文件名查找是否存在")
|
||||||
|
public AjaxResult selectFile(@RequestBody FileVo fileVo){
|
||||||
|
|
||||||
|
return fileService.selectFile(fileVo.getName(), fileVo.getType());
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/download")
|
||||||
|
@ApiOperation(value = "读取文件内容")
|
||||||
|
public AjaxResult download(@RequestParam String name) throws IOException {
|
||||||
|
|
||||||
|
obsUtils.download(name);
|
||||||
|
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动上传任务
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "启动上传任务")
|
||||||
|
@GetMapping("/getUploadId")
|
||||||
|
public R getUploadId(@RequestParam("objectKey")String objectKey) {
|
||||||
|
InitiateMultipartUploadRequest request = new InitiateMultipartUploadRequest(bucketName, objectKey);
|
||||||
|
ObjectMetadata metadata = new ObjectMetadata();
|
||||||
|
metadata.addUserMetadata("property", "property-value");
|
||||||
|
metadata.setContentType("text/plain");
|
||||||
|
request.setMetadata(metadata);
|
||||||
|
InitiateMultipartUploadResult result = obsClient.initiateMultipartUpload(request);
|
||||||
|
String uploadId = result.getUploadId();
|
||||||
|
return R.ok(uploadId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分片上传
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "分片上传")
|
||||||
|
@PostMapping("/chunk")
|
||||||
|
public R splitFileUpload(
|
||||||
|
@RequestParam("objectKey")String objectKey,
|
||||||
|
@RequestParam("file") MultipartFile file,
|
||||||
|
@RequestParam("chunk") int chunk,
|
||||||
|
@RequestParam("uploadId") String uploadId) throws Exception {
|
||||||
|
|
||||||
|
long startTime = System.currentTimeMillis(); // 记录开始时间
|
||||||
|
try {
|
||||||
|
File file1 = multipartFileToFile(file);
|
||||||
|
Map<String, String> map = uploadChunk(uploadId, file1, chunk, objectKey);
|
||||||
|
log.info("上传的文件大小: {}", file.getSize());
|
||||||
|
return R.ok(map);
|
||||||
|
} finally {
|
||||||
|
long duration = System.currentTimeMillis() - startTime; // 计算耗时
|
||||||
|
log.info("方法 splitFileUpload 执行耗时: {} ms", duration);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 合并上传
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "合并上传")
|
||||||
|
@PostMapping("/completeUpload")
|
||||||
|
public R completeUpload(
|
||||||
|
@RequestParam("objectKey")String objectKey,
|
||||||
|
@RequestParam("uploadId") String uploadId,
|
||||||
|
@RequestBody List<Map<String,String>> mapList
|
||||||
|
) {
|
||||||
|
List<PartEtag> partEtags = new ArrayList<>();
|
||||||
|
for(Map<String,String> map: mapList ){
|
||||||
|
PartEtag part1 = new PartEtag();
|
||||||
|
part1.setPartNumber(Integer.valueOf(map.get("partNumber")));
|
||||||
|
part1.seteTag(map.get("etag"));
|
||||||
|
partEtags.add(part1);
|
||||||
|
}
|
||||||
|
CompleteMultipartUploadRequest request = new CompleteMultipartUploadRequest(
|
||||||
|
bucketName, objectKey, uploadId, partEtags);
|
||||||
|
CompleteMultipartUploadResult result = obsClient.completeMultipartUpload(request);
|
||||||
|
|
||||||
|
return R.ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消任务上传
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "取消任务上传")
|
||||||
|
@GetMapping("/cancelUpload")
|
||||||
|
public R cancelUpload(
|
||||||
|
@RequestParam("objectKey")String objectKey,
|
||||||
|
@RequestParam("uploadId") String uploadId
|
||||||
|
){
|
||||||
|
AbortMultipartUploadRequest request = new AbortMultipartUploadRequest(bucketName, objectKey, uploadId);
|
||||||
|
obsClient.abortMultipartUpload(request);
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String,String> uploadChunk(String uploadId, File file,int chunk, String objectKey){
|
||||||
|
// Endpoint以北京四为例,其他地区请按实际情况填写。
|
||||||
|
Map<String,String> map = new HashMap<>();
|
||||||
|
UploadPartRequest request = new UploadPartRequest(bucketName, objectKey);
|
||||||
|
request.setUploadId(uploadId);
|
||||||
|
request.setPartNumber(chunk);
|
||||||
|
request.setFile(file);
|
||||||
|
request.setPartSize(5 * 1024 * 1024L);
|
||||||
|
UploadPartResult result = obsClient.uploadPart(request);
|
||||||
|
map.put("etag",result.getEtag());
|
||||||
|
map.put("partNumber",String.valueOf(result.getPartNumber()));
|
||||||
|
log.info("分段上传完成:{}",chunk);
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* MultipartFile 转 File
|
||||||
|
*
|
||||||
|
* @param file
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static File multipartFileToFile(MultipartFile file) throws Exception {
|
||||||
|
|
||||||
|
File toFile = null;
|
||||||
|
if (file.equals("") || file.getSize() <= 0) {
|
||||||
|
file = null;
|
||||||
|
} else {
|
||||||
|
InputStream ins = null;
|
||||||
|
ins = file.getInputStream();
|
||||||
|
toFile = new File(file.getOriginalFilename());
|
||||||
|
inputStreamToFile(ins, toFile);
|
||||||
|
ins.close();
|
||||||
|
}
|
||||||
|
return toFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取流文件
|
||||||
|
private static void inputStreamToFile(InputStream ins, File file) {
|
||||||
|
try {
|
||||||
|
OutputStream os = new FileOutputStream(file);
|
||||||
|
int bytesRead = 0;
|
||||||
|
byte[] buffer = new byte[8192];
|
||||||
|
while ((bytesRead = ins.read(buffer, 0, 8192)) != -1) {
|
||||||
|
os.write(buffer, 0, bytesRead);
|
||||||
|
}
|
||||||
|
os.close();
|
||||||
|
ins.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验文件内容时候重复
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "校验文件hash是否重复")
|
||||||
|
@GetMapping("/selectHash")
|
||||||
|
public R selectHash(String hashCode,Integer type){
|
||||||
|
|
||||||
|
return fileService.selectHash(hashCode,type);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/updateFileData")
|
||||||
|
public R updateFileData(@RequestBody RequestFile requestFile){
|
||||||
|
|
||||||
|
log.info("加密后获取到的数据:{}",requestFile);
|
||||||
|
return fileService.updateFileData(requestFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,105 @@
|
||||||
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
|
import com.mcwl.web.controller.common.OssUtil;
|
||||||
|
import org.springframework.mock.web.MockMultipartFile;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.CipherInputStream;
|
||||||
|
import javax.crypto.CipherOutputStream;
|
||||||
|
import javax.crypto.SecretKey;
|
||||||
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.security.AlgorithmParameters;
|
||||||
|
import java.util.Base64;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加解密文件工具类
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/1/25
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class FileEncryptDecryptUtil {
|
||||||
|
|
||||||
|
private static final String ALGORITHM = "AES/CBC/PKCS5Padding";
|
||||||
|
private static final String TRANSFORMATION = "AES";
|
||||||
|
private static final String KEY = "iamkeyeeddzasdfs"; // 实际应用中应使用更安全的密钥生成方式
|
||||||
|
private static byte[] SAVED_IV; // 静态变量存储IV,确保解密时可访问
|
||||||
|
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
// 示例:加密文件
|
||||||
|
encryptFile("D:\\ASE\\encryption\\测试文件1.txt", "D:\\ASE\\decode\\加密测试文件1.txt");
|
||||||
|
//// 解密文件
|
||||||
|
decryptFile("C:\\Users\\Dzb\\Desktop\\a.enc", "D:\\\\ASE\\\\encryption\\\\解密测试文件2.txt");
|
||||||
|
uploadEncryptedFileToOSS("D:\\ASE\\encryption\\测试文件1.txt", "encrypted-test-file1.enc");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void encryptFile(String sourcePath, String encryptedPath) throws Exception {
|
||||||
|
Cipher cipher = initCipher(Cipher.ENCRYPT_MODE);
|
||||||
|
try (FileInputStream fis = new FileInputStream(sourcePath);
|
||||||
|
FileOutputStream fos = new FileOutputStream(encryptedPath);
|
||||||
|
CipherOutputStream cos = new CipherOutputStream(fos, cipher)) {
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int read;
|
||||||
|
while ((read = fis.read(buffer)) != -1) {
|
||||||
|
cos.write(buffer, 0, read);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("加密完成");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void decryptFile(String encryptedPath, String decryptedPath) throws Exception {
|
||||||
|
Cipher cipher = initCipher(Cipher.DECRYPT_MODE);
|
||||||
|
try (FileInputStream fis = new FileInputStream(encryptedPath);
|
||||||
|
CipherInputStream cis = new CipherInputStream(fis, cipher);
|
||||||
|
FileOutputStream fos = new FileOutputStream(decryptedPath)) {
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int read;
|
||||||
|
while ((read = cis.read(buffer)) != -1) {
|
||||||
|
fos.write(buffer, 0, read);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("解密完成");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Cipher initCipher(int mode) throws Exception {
|
||||||
|
Cipher cipher = Cipher.getInstance(ALGORITHM);
|
||||||
|
SecretKey secretKey = new SecretKeySpec(KEY.getBytes(), TRANSFORMATION);
|
||||||
|
if (mode == Cipher.ENCRYPT_MODE && SAVED_IV == null) {
|
||||||
|
cipher.init(mode, secretKey);
|
||||||
|
AlgorithmParameters params = cipher.getParameters();
|
||||||
|
SAVED_IV = params.getParameterSpec(IvParameterSpec.class).getIV();
|
||||||
|
System.out.println("Generated IV: " + Base64.getEncoder().encodeToString(SAVED_IV));
|
||||||
|
} else {
|
||||||
|
cipher.init(mode, secretKey, new IvParameterSpec(SAVED_IV));
|
||||||
|
}
|
||||||
|
return cipher;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void uploadEncryptedFileToOSS(String sourcePath, String ossFileName) throws Exception {
|
||||||
|
Cipher cipher = initCipher(Cipher.ENCRYPT_MODE);
|
||||||
|
|
||||||
|
// 使用ByteArrayOutputStream代替FileOutputStream
|
||||||
|
ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||||
|
try (FileInputStream fis = new FileInputStream(sourcePath);
|
||||||
|
CipherInputStream cis = new CipherInputStream(fis, cipher)) {
|
||||||
|
byte[] buffer = new byte[1024];
|
||||||
|
int read;
|
||||||
|
while ((read = cis.read(buffer)) != -1) {
|
||||||
|
bos.write(buffer, 0, read);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("加密完成");
|
||||||
|
|
||||||
|
// 将加密后的字节数组转换为MultipartFile
|
||||||
|
MockMultipartFile multipartFile = new MockMultipartFile(ossFileName, ossFileName, "application/octet-stream", bos.toByteArray());
|
||||||
|
// 调用上传方法
|
||||||
|
String s = OssUtil.uploadMultipartFile(multipartFile);
|
||||||
|
System.out.println("文件已上传至: " + s);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,29 +1,42 @@
|
||||||
package com.mcwl.web.controller.resource;
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.mcwl.common.annotation.Anonymous;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.common.core.page.PageDomain;
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
import com.mcwl.common.utils.SecurityUtils;
|
||||||
|
import com.mcwl.myInvitation.domain.Consume;
|
||||||
|
import com.mcwl.myInvitation.service.ConsumeService;
|
||||||
|
import com.mcwl.pay.domain.ModelPurchaseRecord;
|
||||||
|
import com.mcwl.pay.mapper.ModelPurchaseRecordMapper;
|
||||||
import com.mcwl.resource.domain.ModelProduct;
|
import com.mcwl.resource.domain.ModelProduct;
|
||||||
|
import com.mcwl.resource.domain.ModelVersion;
|
||||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||||
import com.mcwl.resource.domain.request.RequestModel;
|
import com.mcwl.resource.domain.request.RequestModel;
|
||||||
import com.mcwl.resource.service.ModelImageService;
|
import com.mcwl.resource.domain.response.ResponseModelProduct;
|
||||||
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
|
import com.mcwl.resource.mapper.ModelVersionMapper;
|
||||||
import com.mcwl.resource.service.ModelService;
|
import com.mcwl.resource.service.ModelService;
|
||||||
import com.mcwl.resource.service.WorkFlowService;
|
import com.mcwl.system.service.impl.SysUserServiceImpl;
|
||||||
import com.mcwl.web.controller.common.OssUtil;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
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.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模型
|
* 模型
|
||||||
|
*
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
* @Project:McWl
|
* @Project:McWl
|
||||||
* @Package:com.mcwl.web.controller.resource
|
* @Package:com.mcwl.web.controller.resource
|
||||||
|
@ -36,59 +49,20 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
@RequestMapping("/model")
|
@RequestMapping("/model")
|
||||||
public class MallProductController extends BaseController {
|
public class MallProductController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ModelPurchaseRecordMapper modelPurchaseRecordMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ModelService modelService;
|
private ModelService modelService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ModelImageService modelImageService;
|
private ModelVersionMapper modelVersionMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WorkFlowService workFlowService;
|
private SysUserServiceImpl sysUserService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
/***
|
private ConsumeService consumeService;
|
||||||
*
|
|
||||||
* 图片
|
|
||||||
* @param file
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiModelProperty("图片")
|
|
||||||
@Anonymous
|
|
||||||
@PostMapping("/file")
|
|
||||||
public AjaxResult Malifile(@RequestParam MultipartFile file) {
|
|
||||||
|
|
||||||
String s = OssUtil.uploadMultipartFile(file);
|
|
||||||
return AjaxResult.success(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
|
||||||
*
|
|
||||||
* zip
|
|
||||||
* @param file
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "zip")
|
|
||||||
@PostMapping("/zipUrlFile")
|
|
||||||
public AjaxResult zipUrlFile(@RequestParam MultipartFile file) {
|
|
||||||
String s = OssUtil.uploadMultipartFile(file);
|
|
||||||
return AjaxResult.success(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
|
||||||
*
|
|
||||||
* 下载zip
|
|
||||||
* @param file
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "zip")
|
|
||||||
@PostMapping("/zipUrl")
|
|
||||||
public AjaxResult zipUrl(@RequestParam MultipartFile file) {
|
|
||||||
String s = OssUtil.uploadMultipartFile(file);
|
|
||||||
return AjaxResult.success(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -103,31 +77,69 @@ public class MallProductController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "模型详情")
|
@ApiOperation(value = "模型详情")
|
||||||
@PostMapping("finbyid")
|
@GetMapping("finbyid")
|
||||||
public AjaxResult finbyid(@RequestBody ModelProduct modelVersion) {
|
public AjaxResult finbyid(@Valid @NotNull(message = "模型id不能为空") @RequestParam Long id) {
|
||||||
ModelProduct modelVersion1 = modelService.getById(modelVersion.getId());
|
|
||||||
return AjaxResult.success(modelVersion1);
|
RequestModel requestModel = new RequestModel();
|
||||||
|
|
||||||
|
ModelProduct modelVersion1 = modelService.getById(id);
|
||||||
|
Set<Long> productIdSet = consumeService.lambdaQuery()
|
||||||
|
.eq(Consume::getUserId, SecurityUtils.getUserId())
|
||||||
|
.eq(Consume::getType, 0)
|
||||||
|
.list()
|
||||||
|
.parallelStream()
|
||||||
|
.map(Consume::getProductId)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
|
Optional.ofNullable(modelVersion1)
|
||||||
|
.filter(m -> productIdSet.contains(m.getId()))
|
||||||
|
.ifPresent(m -> m.setIsBuy(1));
|
||||||
|
|
||||||
|
LambdaQueryWrapper<ModelVersion> modelVersionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
modelVersionLambdaQueryWrapper.eq(ModelVersion::getModelId, id);
|
||||||
|
modelVersionLambdaQueryWrapper.eq(ModelVersion::getDelFlag, "0");
|
||||||
|
List<ModelVersion> modelVersions = modelVersionMapper.selectList(modelVersionLambdaQueryWrapper);
|
||||||
|
|
||||||
|
requestModel.setModelProduct(modelVersion1);
|
||||||
|
requestModel.setModelVersionList(modelVersions);
|
||||||
|
return AjaxResult.success(requestModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "添加模型")
|
@ApiOperation(value = "添加模型")
|
||||||
@PostMapping("/insert")
|
@PostMapping("/insert")
|
||||||
public AjaxResult addupdateModel(@RequestBody RequestModel requestModel) {
|
public R<String> addupdateModel(@RequestBody RequestModel requestModel) {
|
||||||
ModelProduct modelProduct = requestModel.getModelProduct();
|
ModelProduct modelProduct = requestModel.getModelProduct();
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
modelProduct.setUserId(userId);
|
modelProduct.setUserId(userId);
|
||||||
modelProduct.setCreateBy(getUsername());
|
|
||||||
return modelService.addModel(requestModel);
|
return modelService.addModel(requestModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "修改模型")
|
@ApiOperation(value = "修改模型")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public AjaxResult updateModel(@RequestBody RequestModel requestModel) {
|
public AjaxResult updateModel(@RequestBody RequestModel requestModel) {
|
||||||
|
|
||||||
|
|
||||||
|
// for (ModelVersion modelVersion : requestModel.getModelVersionList()) {
|
||||||
|
//
|
||||||
|
// //校验名字
|
||||||
|
// ModelVersion modelVersion1 = modelVersionMapper.selectByFileName(modelVersion.getFileName());
|
||||||
|
// if (modelVersion1 != null) {
|
||||||
|
//
|
||||||
|
// return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"文件名字重复");
|
||||||
|
// }
|
||||||
|
// //校验hash
|
||||||
|
// ModelVersion modelVersion2 = modelVersionMapper.selectByHash(modelVersion.getFileHash());
|
||||||
|
// if (modelVersion2 != null){
|
||||||
|
//
|
||||||
|
// return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"文件内容重复");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
ModelProduct modelProduct = requestModel.getModelProduct();
|
ModelProduct modelProduct = requestModel.getModelProduct();
|
||||||
|
|
||||||
Long userId = SecurityUtils.getUserId();
|
Long userId = SecurityUtils.getUserId();
|
||||||
modelProduct.setUserId(userId);
|
modelProduct.setUserId(userId);
|
||||||
modelProduct.setUpdateBy(getUsername());
|
|
||||||
modelService.updaModel(requestModel);
|
modelService.updaModel(requestModel);
|
||||||
|
|
||||||
return AjaxResult.success("修改成功");
|
return AjaxResult.success("修改成功");
|
||||||
|
@ -135,88 +147,97 @@ public class MallProductController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "删除模型")
|
@ApiOperation(value = "删除模型")
|
||||||
@PostMapping("delete")
|
@GetMapping("delete")
|
||||||
public AjaxResult delete(@RequestBody ModelProduct modelVersion) {
|
public AjaxResult delete(@Valid @NotNull(message = "模型id不能为空") @RequestParam Long id) {
|
||||||
modelService.removeById(modelVersion.getId());
|
modelService.removeById(id);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询模型详情
|
* 查询模型详情
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询模型详情")
|
@ApiOperation(value = "查询模型详情")
|
||||||
@GetMapping("/selectModelById")
|
@GetMapping("/selectModelById")
|
||||||
public AjaxResult selectModelById(@RequestParam Long id){
|
public R<ModelProduct> selectModelById(@Valid @NotNull(message = "模型id不能为空") @RequestParam Long id) {
|
||||||
|
|
||||||
return modelService.selectModelById(id);
|
R<ModelProduct> modelProductR = modelService.selectModelById(id);
|
||||||
|
ModelProduct data = modelProductR.getData();
|
||||||
|
if (Objects.nonNull(data)) {
|
||||||
|
LambdaQueryWrapper<ModelPurchaseRecord> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(ModelPurchaseRecord::getUserId, SecurityUtils.getUserId())
|
||||||
|
.eq(ModelPurchaseRecord::getProductId, id)
|
||||||
|
.eq(ModelPurchaseRecord::getProductType, 0);
|
||||||
|
ModelPurchaseRecord modelPurchaseRecord = modelPurchaseRecordMapper.selectOne(wrapper);
|
||||||
|
data.setIsBuy(1);
|
||||||
|
if (Objects.isNull(modelPurchaseRecord)) {
|
||||||
|
data.setIsBuy(0);
|
||||||
|
}
|
||||||
|
modelProductR.setData(data);
|
||||||
|
}
|
||||||
|
return modelProductR;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置模型置顶状态
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param isTop
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "设置模型置顶状态")
|
||||||
|
@GetMapping("/{id}/top")
|
||||||
|
public AjaxResult setModelTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||||
|
modelService.setModelTop(id, isTop);
|
||||||
|
return AjaxResult.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取置顶的模型列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取置顶的模型列表")
|
||||||
|
@GetMapping
|
||||||
|
public R<List<ModelProduct>> fetchModelsSortedByTopStatus() {
|
||||||
|
List<ModelProduct> models = modelService.fetchModelsSortedByTopStatus();
|
||||||
|
return R.ok(models);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 我的发布-模型
|
* 模型广场
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "我的发布-模型")
|
@ApiOperation(value = "模型广场列表")
|
||||||
@PostMapping("/selectByUserIdModel")
|
@PostMapping("/modelSquare")
|
||||||
public TableDataInfo selectByUserIdModel(@RequestBody ModelImagePageRes imagePageRes) {
|
public R modelSquare(@RequestBody PageVo pageVo) {
|
||||||
|
PageInfo<ResponseModelProduct> modelProductPage = modelService.modelSquare(pageVo);
|
||||||
return modelService.listByPage(imagePageRes);
|
return R.ok(modelProductPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 我的发布-工作流
|
* 校验模型名字是否唯一
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "我的发布-工作流")
|
@ApiOperation(value = "校验模型名字是否唯一")
|
||||||
@PostMapping("/selectByUserIdWorkFlow")
|
@GetMapping("/selectModelByName")
|
||||||
public TableDataInfo selectByUserIdWorkFlow(@RequestBody ModelImagePageRes imagePageRes) {
|
public R selectModelByName(@RequestParam String name) {
|
||||||
|
|
||||||
return workFlowService.listByPage(imagePageRes);
|
return modelService.selectModelByName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@ApiOperation(value = "个人中心更改背景")
|
||||||
* 我的发布-图片
|
@GetMapping("/updateBackgroundImg")
|
||||||
*/
|
public R updateBackgroundImg(@RequestParam Long id, String path) {
|
||||||
@ApiOperation(value = "我的发布-图片")
|
|
||||||
@PostMapping("/selectByUserIdImage")
|
|
||||||
public TableDataInfo selectByUserIdImage(@RequestBody ModelImagePageRes imagePageRes) {
|
|
||||||
|
|
||||||
return modelImageService.listByPage(imagePageRes);
|
sysUserService.updateBackgroundImg(id, path);
|
||||||
|
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞-模型
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "点赞-模型")
|
|
||||||
@PostMapping("/likeModel")
|
|
||||||
public TableDataInfo likeModel(@RequestBody PageDomain pageDomain) {
|
|
||||||
ModelImagePageRes imagePageRes = new ModelImagePageRes();
|
|
||||||
BeanUtil.copyProperties(pageDomain, imagePageRes);
|
|
||||||
imagePageRes.setUserId(SecurityUtils.getUserId());
|
|
||||||
return modelService.listByPage(imagePageRes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞-工作流
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "点赞-工作流")
|
|
||||||
@PostMapping("/likeWorkFlow")
|
|
||||||
public TableDataInfo likeWorkFlow(@RequestBody PageDomain pageDomain) {
|
|
||||||
ModelImagePageRes imagePageRes = new ModelImagePageRes();
|
|
||||||
BeanUtil.copyProperties(pageDomain, imagePageRes);
|
|
||||||
imagePageRes.setUserId(SecurityUtils.getUserId());
|
|
||||||
return workFlowService.listByPage(imagePageRes);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 点赞-图片
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "点赞-图片")
|
|
||||||
@PostMapping("/likeImage")
|
|
||||||
public TableDataInfo likeImage(@RequestBody PageDomain pageDomain) {
|
|
||||||
ModelImagePageRes imagePageRes = new ModelImagePageRes();
|
|
||||||
BeanUtil.copyProperties(pageDomain, imagePageRes);
|
|
||||||
imagePageRes.setUserId(SecurityUtils.getUserId());
|
|
||||||
return modelImageService.listByPage(imagePageRes);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,20 +2,25 @@ package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import com.mcwl.common.annotation.RepeatSubmit;
|
import com.mcwl.common.annotation.RepeatSubmit;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.resource.domain.ModelComment;
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.resource.domain.dto.ModelCommentRes;
|
||||||
import com.mcwl.resource.domain.vo.ModelCommentVo;
|
import com.mcwl.resource.domain.vo.ModelCommentVo;
|
||||||
import com.mcwl.resource.service.ModelCommentLikeService;
|
import com.mcwl.resource.service.ModelCommentLikeService;
|
||||||
import com.mcwl.resource.service.ModelCommentService;
|
import com.mcwl.resource.service.ModelCommentService;
|
||||||
import com.mcwl.resource.service.ModelLikeService;
|
import com.mcwl.resource.service.ModelLikeService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**模型评论
|
/**
|
||||||
|
* 模型评论
|
||||||
|
*
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
* @Project:McWl
|
* @Project:McWl
|
||||||
* @Package:com.mcwl.web.controller.resource
|
* @Package:com.mcwl.web.controller.resource
|
||||||
|
@ -36,16 +41,18 @@ public class ModelCommentController {
|
||||||
private ModelCommentLikeService modelCommentLikeService;
|
private ModelCommentLikeService modelCommentLikeService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模型点赞/取消
|
* 模型点赞/取消
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "模型点赞/取消")
|
@ApiOperation(value = "模型点赞/取消")
|
||||||
@RepeatSubmit
|
@RepeatSubmit
|
||||||
@GetMapping("/modelLike/{modelId}")
|
@GetMapping("/modelLike")
|
||||||
public AjaxResult like(@PathVariable Long imageId) {
|
public R<Object> like(@Valid
|
||||||
modelLikeService.like(imageId);
|
@NotNull(message = "模型id不能为空")
|
||||||
return AjaxResult.success();
|
@ApiParam(value = "模型id", required = true)
|
||||||
|
Long modelId) {
|
||||||
|
modelLikeService.like(modelId);
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,9 +61,9 @@ public class ModelCommentController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "模型评论发布")
|
@ApiOperation(value = "模型评论发布")
|
||||||
@PostMapping("/comment")
|
@PostMapping("/comment")
|
||||||
public AjaxResult comment(@RequestBody ModelComment modelComment) {
|
public R<Object> comment(@Valid @RequestBody ModelCommentRes modelCommentRes) {
|
||||||
modelCommentService.comment(modelComment);
|
modelCommentService.comment(modelCommentRes);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,22 +71,32 @@ public class ModelCommentController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "模型评论点赞/取消")
|
@ApiOperation(value = "模型评论点赞/取消")
|
||||||
@RepeatSubmit
|
@RepeatSubmit
|
||||||
@GetMapping("/commentLike/{commentId}")
|
@GetMapping("/commentLike")
|
||||||
public AjaxResult commentLike(@PathVariable Long commentId) {
|
public R<Object> commentLike(@Valid
|
||||||
|
@NotNull(message = "评论id不能为空")
|
||||||
|
@ApiParam(value = "评论id", required = true)
|
||||||
|
Long commentId) {
|
||||||
modelCommentLikeService.like(commentId);
|
modelCommentLikeService.like(commentId);
|
||||||
return AjaxResult.error();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取模型评论
|
* 获取模型评论
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取模型评论")
|
@ApiOperation(value = "获取模型评论")
|
||||||
@GetMapping("/comment/{modelId}")
|
@GetMapping("/getComment")
|
||||||
public AjaxResult getComment(@PathVariable @NotNull(message = "模型id不能为空") Long modelId) {
|
@Valid
|
||||||
List<ModelCommentVo> modelCommentList = modelCommentService.getComment(modelId);
|
public R<List<ModelCommentVo>> getComment(@Valid
|
||||||
return AjaxResult.success(modelCommentList);
|
@NotNull(message = "模型id不能为空")
|
||||||
|
@ApiParam(value = "模型id", required = true)
|
||||||
|
Long modelId,
|
||||||
|
@Valid
|
||||||
|
@NotNull(message = "排序方式不能为空")
|
||||||
|
@ApiParam(value = "排序方式 0最热 1最新", required = true)
|
||||||
|
Integer sortType) {
|
||||||
|
List<ModelCommentVo> modelCommentList = modelCommentService.getComment(modelId, sortType);
|
||||||
|
return R.ok(modelCommentList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -87,11 +104,26 @@ public class ModelCommentController {
|
||||||
* 删除模型评论
|
* 删除模型评论
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除模型评论")
|
@ApiOperation(value = "删除模型评论")
|
||||||
@GetMapping("/commentDelete/{commentId}")
|
@GetMapping("/commentDelete")
|
||||||
public AjaxResult commentDelete(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
public R<Object> commentDelete(@Valid
|
||||||
|
@NotNull(message = "评论id不能为空")
|
||||||
|
@ApiParam(value = "评论id", required = true)
|
||||||
|
Long commentId) {
|
||||||
modelCommentService.removeById(commentId);
|
modelCommentService.removeById(commentId);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模型评论数量
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取模型评论数量")
|
||||||
|
@GetMapping("/commentCount")
|
||||||
|
public R<Integer> getCommentCount(@Valid
|
||||||
|
@NotNull(message = "模型id不能为空")
|
||||||
|
@ApiParam(value = "模型id", required = true)
|
||||||
|
Long modelId) {
|
||||||
|
Integer commentCount = modelCommentService.getCommentCount(modelId);
|
||||||
|
return R.ok(commentCount);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import com.mcwl.common.annotation.RepeatSubmit;
|
import com.mcwl.common.annotation.RepeatSubmit;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.resource.domain.dto.ModelImageCommentRes;
|
import com.mcwl.resource.domain.dto.ModelImageCommentRes;
|
||||||
import com.mcwl.resource.domain.vo.ModelImageCommentVo;
|
import com.mcwl.resource.domain.vo.ModelImageCommentVo;
|
||||||
import com.mcwl.resource.service.ModelImageCommentLikeService;
|
import com.mcwl.resource.service.ModelImageCommentLikeService;
|
||||||
|
@ -9,14 +10,16 @@ import com.mcwl.resource.service.ModelImageCommentService;
|
||||||
import com.mcwl.resource.service.ModelImageService;
|
import com.mcwl.resource.service.ModelImageService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片
|
* 图片评论
|
||||||
*/
|
*/
|
||||||
@Api(tags = "图片评论")
|
@Api(tags = "图片评论")
|
||||||
@RestController
|
@RestController
|
||||||
|
@ -36,40 +39,66 @@ public class ModelImageCommentController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "图片评论发布")
|
@ApiOperation(value = "图片评论发布")
|
||||||
@PostMapping("/comment")
|
@PostMapping("/comment")
|
||||||
public AjaxResult comment(@RequestBody ModelImageCommentRes modelImageCommentRes) {
|
public R<Object> comment(@Valid @RequestBody ModelImageCommentRes modelImageCommentRes) {
|
||||||
modelImageService.comment(modelImageCommentRes);
|
modelImageCommentService.comment(modelImageCommentRes);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片评论点赞/取消
|
* 图片评论点赞/取消
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "图片评论点赞/取消")
|
@ApiOperation(value = "图片评论点赞/取消")
|
||||||
@RepeatSubmit
|
@RepeatSubmit(interval = 1000)
|
||||||
@GetMapping("/commentLike/{commentId}")
|
@GetMapping("/commentLike")
|
||||||
public AjaxResult commentLike(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
public R<Object> commentLike(@Valid
|
||||||
|
@NotNull(message = "评论id不能为空")
|
||||||
|
@ApiParam(value = "评论id", required = true)
|
||||||
|
Long commentId) {
|
||||||
modelImageCommentLikeService.like(commentId);
|
modelImageCommentLikeService.like(commentId);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除图片评论
|
* 删除图片评论
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除图片评论")
|
@ApiOperation(value = "删除图片评论")
|
||||||
@GetMapping("/commentDelete/{commentId}")
|
@GetMapping("/commentDelete")
|
||||||
public AjaxResult commentDelete(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
public R<Object> commentDelete(@Valid
|
||||||
|
@NotNull(message = "评论id不能为空")
|
||||||
|
@ApiParam(value = "评论id", required = true) Long commentId) {
|
||||||
modelImageCommentService.removeById(commentId);
|
modelImageCommentService.removeById(commentId);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取图片评论
|
* 获取图片评论
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取图片评论")
|
@ApiOperation(value = "获取图片评论")
|
||||||
@GetMapping("/comment/{imageId}")
|
@GetMapping("/getComment")
|
||||||
public AjaxResult getComment(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) {
|
@Valid
|
||||||
List<ModelImageCommentVo> modelImageCommentVoList = modelImageService.getComment(imageId);
|
public R<List<ModelImageCommentVo>> getComment(@Valid
|
||||||
return AjaxResult.success(modelImageCommentVoList);
|
@NotNull(message = "图片id不能为空")
|
||||||
|
@ApiParam(value = "评论id", required = true)
|
||||||
|
Long imageId,
|
||||||
|
@Valid
|
||||||
|
@NotNull(message = "排序方式不能为空")
|
||||||
|
@ApiParam(value = "排序方式 0最热 1最新", required = true)
|
||||||
|
Integer sortType) {
|
||||||
|
List<ModelImageCommentVo> modelImageCommentVoList = modelImageCommentService.getComment(imageId, sortType);
|
||||||
|
return R.ok(modelImageCommentVoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取图片评论数量
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取图片评论数量")
|
||||||
|
@GetMapping("/commentCount")
|
||||||
|
public R<Integer> getCommentCount(@Valid
|
||||||
|
@NotNull(message = "图片id不能为空")
|
||||||
|
@ApiParam(value = "图片id", required = true)
|
||||||
|
Long imageId) {
|
||||||
|
Integer commentCount = modelImageCommentService.getCommentCount(imageId);
|
||||||
|
return R.ok(commentCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
package com.mcwl.web.controller.resource;
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.mcwl.common.annotation.RepeatSubmit;
|
import com.mcwl.common.annotation.RepeatSubmit;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.common.core.domain.entity.SysUser;
|
|
||||||
import com.mcwl.common.core.page.PageDomain;
|
import com.mcwl.common.core.page.PageDomain;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.common.utils.SecurityUtils;
|
|
||||||
import com.mcwl.resource.domain.ModelImage;
|
import com.mcwl.resource.domain.ModelImage;
|
||||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||||
import com.mcwl.resource.domain.dto.ModelImageRes;
|
import com.mcwl.resource.domain.dto.ModelImageRes;
|
||||||
|
import com.mcwl.resource.domain.response.ResponseModelImage;
|
||||||
import com.mcwl.resource.domain.vo.ModelImageVo;
|
import com.mcwl.resource.domain.vo.ModelImageVo;
|
||||||
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
import com.mcwl.resource.service.ModelImageLikeService;
|
import com.mcwl.resource.service.ModelImageLikeService;
|
||||||
import com.mcwl.resource.service.ModelImageService;
|
import com.mcwl.resource.service.ModelImageService;
|
||||||
import com.mcwl.system.service.ISysUserService;
|
import com.mcwl.system.service.ISysUserService;
|
||||||
|
@ -19,8 +20,9 @@ import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.Objects;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片
|
* 图片
|
||||||
|
@ -43,7 +45,9 @@ public class ModelImageController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "图片列表")
|
@ApiOperation(value = "图片列表")
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public TableDataInfo list(@RequestBody PageDomain pageDomain) {
|
public TableDataInfo list(@RequestBody
|
||||||
|
@Valid
|
||||||
|
PageDomain pageDomain) {
|
||||||
ModelImagePageRes imagePageRes = new ModelImagePageRes();
|
ModelImagePageRes imagePageRes = new ModelImagePageRes();
|
||||||
BeanUtil.copyProperties(pageDomain, imagePageRes);
|
BeanUtil.copyProperties(pageDomain, imagePageRes);
|
||||||
return modelImageService.listByPage(imagePageRes);
|
return modelImageService.listByPage(imagePageRes);
|
||||||
|
@ -53,20 +57,20 @@ public class ModelImageController {
|
||||||
* 图片详情
|
* 图片详情
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "图片详情")
|
@ApiOperation(value = "图片详情")
|
||||||
@GetMapping("/detail/{imageId}")
|
@GetMapping("/detail")
|
||||||
public AjaxResult detail(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) {
|
public R<ModelImageVo> detail(@Valid @NotNull(message = "图片id不能为空") Long id) {
|
||||||
ModelImageVo modelImageVo = modelImageService.getDetail(imageId);
|
ModelImageVo modelImageVo = modelImageService.getDetail(id);
|
||||||
return AjaxResult.success(modelImageVo);
|
return R.ok(modelImageVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 图片删除
|
* 图片删除
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "图片删除")
|
@ApiOperation(value = "图片删除")
|
||||||
@GetMapping("/delete/{imageId}")
|
@GetMapping("/delete")
|
||||||
public AjaxResult delete(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) {
|
public R<Object> delete(@Valid @NotNull(message = "图片id不能为空") Long id) {
|
||||||
modelImageService.removeById(imageId);
|
modelImageService.removeById(id);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -74,9 +78,9 @@ public class ModelImageController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "图片修改")
|
@ApiOperation(value = "图片修改")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public AjaxResult update(@RequestBody ModelImageRes modelImageRes) {
|
public R<Object> update(@Valid @RequestBody ModelImageRes modelImageRes) {
|
||||||
modelImageService.updateById(modelImageRes);
|
modelImageService.updateById(modelImageRes);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,9 +89,9 @@ public class ModelImageController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "图片发布")
|
@ApiOperation(value = "图片发布")
|
||||||
@PostMapping("/publish")
|
@PostMapping("/publish")
|
||||||
public AjaxResult publish(@RequestBody ModelImageRes modelImageRes) {
|
public R<Object> publish(@Valid @RequestBody ModelImageRes modelImageRes) {
|
||||||
modelImageService.publish(modelImageRes);
|
|
||||||
return AjaxResult.success();
|
return modelImageService.publish(modelImageRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -95,12 +99,50 @@ public class ModelImageController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "图片点赞/取消")
|
@ApiOperation(value = "图片点赞/取消")
|
||||||
@RepeatSubmit
|
@RepeatSubmit
|
||||||
@GetMapping("/imageLike/{imageId}")
|
@GetMapping("/imageLike")
|
||||||
public AjaxResult like(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) {
|
public R<Object> like(@Valid @NotNull(message = "图片id不能为空") Long id) {
|
||||||
modelImageLikeService.like(imageId);
|
modelImageLikeService.like(id);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置图片置顶
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param isTop
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "设置图片置顶状态")
|
||||||
|
@GetMapping("/{id}/top")
|
||||||
|
public R<Object> setModelImageTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||||
|
modelImageLikeService.setModelImageTop(id, isTop);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取置顶的图片列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取置顶的图片列表")
|
||||||
|
@GetMapping
|
||||||
|
public R<List<ModelImage>> fetchModelImagesSortedByTopStatus() {
|
||||||
|
List<ModelImage> models = modelImageLikeService.fetchModelImageSortedByTopStatus();
|
||||||
|
return R.ok(models);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 作品灵感
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "作品灵感")
|
||||||
|
@GetMapping("/imageList")
|
||||||
|
public R<PageInfo<ResponseModelImage>> imageList(PageVo pageVo) {
|
||||||
|
PageInfo<ResponseModelImage> models = modelImageLikeService.imageList(pageVo);
|
||||||
|
return R.ok(models);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,15 @@
|
||||||
package com.mcwl.web.controller.resource;
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Dict;
|
|
||||||
import com.mcwl.common.constant.DictConstants;
|
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.resource.domain.ModelProduct;
|
|
||||||
import com.mcwl.resource.domain.ModelVersion;
|
import com.mcwl.resource.domain.ModelVersion;
|
||||||
import com.mcwl.resource.service.ModelVersionService;
|
import com.mcwl.resource.service.ModelVersionService;
|
||||||
import com.mcwl.system.init.DictInit;
|
|
||||||
import com.mcwl.web.controller.common.OssUtil;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
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.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/** 模型版本
|
/** 模型版本
|
||||||
|
@ -37,56 +29,17 @@ public class ModelVersionController extends BaseController {
|
||||||
private ModelVersionService modelVersionService;
|
private ModelVersionService modelVersionService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
/***
|
* 详情页 版本列表
|
||||||
*
|
* @param modelId
|
||||||
* 图片
|
|
||||||
* @param file
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "图片")
|
@GetMapping("/selectByModelId")
|
||||||
@PostMapping("/file")
|
public R<List<ModelVersion>> selectByModelId(@RequestParam Long modelId){
|
||||||
public AjaxResult Malifile(@RequestParam MultipartFile file){
|
|
||||||
|
|
||||||
String s = OssUtil.uploadMultipartFile(file);
|
return modelVersionService.selectByModelId(modelId);
|
||||||
return AjaxResult.success(s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
|
||||||
*
|
|
||||||
* zip
|
|
||||||
* @param file
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "zip")
|
|
||||||
@PostMapping("/zipUrlFile")
|
|
||||||
public AjaxResult zipUrlFile(@RequestParam MultipartFile file){
|
|
||||||
String s = OssUtil.uploadMultipartFile(file);
|
|
||||||
return AjaxResult.success(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
|
||||||
*
|
|
||||||
* 下载zip
|
|
||||||
* @param file
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "下载zip")
|
|
||||||
@PostMapping("/zipUrl")
|
|
||||||
public AjaxResult zipUrl(@RequestParam MultipartFile file){
|
|
||||||
String s = OssUtil.uploadMultipartFile(file);
|
|
||||||
return AjaxResult.success(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "模型版本列表")
|
@ApiOperation(value = "模型版本列表")
|
||||||
@PostMapping("list")
|
@PostMapping("list")
|
||||||
public TableDataInfo list(@RequestBody ModelVersion modelVersion)
|
public TableDataInfo list(@RequestBody ModelVersion modelVersion)
|
||||||
|
@ -98,53 +51,55 @@ public class ModelVersionController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "模型版本详情")
|
@ApiOperation(value = "模型版本详情")
|
||||||
@PostMapping("finbyid")
|
@GetMapping("finbyid")
|
||||||
public AjaxResult finbyid(@RequestBody ModelVersion modelVersion)
|
public R<List<ModelVersion>> finbyid(@RequestParam Long id)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
ModelVersion modelVersion1 = modelVersionService.getById(modelVersion.getId());
|
List<ModelVersion> modelVersionList = modelVersionService.finbyid(id);
|
||||||
|
|
||||||
ArrayList<String> arrayList = new ArrayList<>();
|
return R.ok(modelVersionList);
|
||||||
|
|
||||||
//获取
|
|
||||||
String[] split = modelVersion1.getHigh().split(",");
|
|
||||||
|
|
||||||
for (String s : split) {
|
|
||||||
arrayList.add(DictInit.getDictValue(DictConstants.DICT_TYPE_MODEL_VERSION_HIGH,s));
|
|
||||||
}
|
|
||||||
|
|
||||||
return AjaxResult.success(modelVersion1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "模型版本添加")
|
@ApiOperation(value = "模型版本添加")
|
||||||
@PostMapping("insert")
|
@PostMapping("insert")
|
||||||
public AjaxResult insert(@RequestBody ModelVersion modelVersion)
|
public R<Object> insert(@RequestBody ModelVersion modelVersion)
|
||||||
{
|
{
|
||||||
modelVersionService.save(modelVersion);
|
modelVersionService.save(modelVersion);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "模型版本修改")
|
@ApiOperation(value = "模型版本修改")
|
||||||
@PostMapping("update")
|
@PostMapping("update")
|
||||||
public AjaxResult update(@RequestBody ModelVersion modelVersion)
|
public R<Object> update(@RequestBody ModelVersion modelVersion)
|
||||||
{
|
{
|
||||||
modelVersionService.updateById(modelVersion);
|
modelVersionService.updateById(modelVersion);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "模型版本删除")
|
@ApiOperation(value = "模型版本删除")
|
||||||
@PostMapping("delete")
|
@PostMapping("delete")
|
||||||
public AjaxResult delete(@RequestBody ModelVersion modelVersion)
|
public R<Object> delete(@RequestBody ModelVersion modelVersion)
|
||||||
{
|
{
|
||||||
modelVersionService.removeById(modelVersion.getId());
|
modelVersionService.removeById(modelVersion.getId());
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载模型文件
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "下载模型文件")
|
||||||
|
@GetMapping("/modelFileDownload")
|
||||||
|
public R modelFileDownload(@RequestParam Long id){
|
||||||
|
|
||||||
|
return modelVersionService.modelFileDownload(id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,85 @@
|
||||||
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.resource.domain.Report;
|
||||||
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
|
import com.mcwl.resource.service.ReportService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报功能
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/1/18
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Api(tags = "举报")
|
||||||
|
@RequestMapping("/report")
|
||||||
|
@RestController
|
||||||
|
public class ReportController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ReportService reportService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增举报内容
|
||||||
|
* @param report
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新增举报内容")
|
||||||
|
@PostMapping("/addReport")
|
||||||
|
public R<Object> addReport(@RequestBody Report report){
|
||||||
|
|
||||||
|
reportService.addReport(report);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询举报列表
|
||||||
|
* @param pageVo
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询举报列表")
|
||||||
|
@PostMapping("/selectReport")
|
||||||
|
public R<Page<Report>> selectReport(@RequestBody PageVo pageVo){
|
||||||
|
|
||||||
|
|
||||||
|
return reportService.selectReport(pageVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除举报
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "删除举报")
|
||||||
|
@GetMapping("/deleteReport")
|
||||||
|
public R<Object> deleteReport(@RequestParam Long id){
|
||||||
|
|
||||||
|
reportService.deleteReport(id);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改举报状态
|
||||||
|
* @param productId
|
||||||
|
* @param type
|
||||||
|
* @param status
|
||||||
|
* @param text
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "修改状态")
|
||||||
|
@GetMapping("/updateStatus")
|
||||||
|
public R<Object> updateStatus(@RequestParam Long productId,Integer type,Integer status,String text){
|
||||||
|
|
||||||
|
reportService.updateStatus(productId, type,status,text);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,129 @@
|
||||||
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.resource.domain.dto.SysAdviceDto;
|
||||||
|
import com.mcwl.resource.domain.vo.AdviceVo;
|
||||||
|
import com.mcwl.resource.domain.vo.AttentionAdviceVo;
|
||||||
|
import com.mcwl.resource.domain.vo.CommentAdviceVo;
|
||||||
|
import com.mcwl.resource.domain.vo.LikeAdviceVo;
|
||||||
|
import com.mcwl.resource.service.ISysAdviceService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息通知
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("advice")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Api(tags = "消息通知")
|
||||||
|
public class SysAdviceController {
|
||||||
|
|
||||||
|
private final ISysAdviceService sysAdviceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送系统消息
|
||||||
|
*
|
||||||
|
@NotNull(message = "消息内容不能为空")
|
||||||
|
@ApiParam(value = "消息内容", required = true)
|
||||||
|
String adviceContent
|
||||||
|
*/
|
||||||
|
// @PreAuthorize("@ss.hasPermi('system:advice:add')")
|
||||||
|
@PostMapping("sendSysMsg")
|
||||||
|
@ApiOperation(value = "添加系统消息")
|
||||||
|
public R<String> sendSysMsg(@Valid @RequestBody SysAdviceDto sysAdviceDto) {
|
||||||
|
sysAdviceService.sendSysMsg(sysAdviceDto);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 已读
|
||||||
|
*/
|
||||||
|
@GetMapping("read")
|
||||||
|
@ApiOperation(value = "已读")
|
||||||
|
public R<String> read(@Valid
|
||||||
|
@NotNull(message = "消息id不能为空")
|
||||||
|
@ApiParam(value = "消息id", required = true)
|
||||||
|
Long adviceId) {
|
||||||
|
sysAdviceService.read(adviceId);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一键已读
|
||||||
|
*/
|
||||||
|
@GetMapping("readAll")
|
||||||
|
@ApiOperation(value = "一键已读")
|
||||||
|
public R<String> readAll() {
|
||||||
|
sysAdviceService.readAll();
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取所有通知
|
||||||
|
*/
|
||||||
|
@GetMapping("getAllMsg")
|
||||||
|
@ApiOperation(value = "获取所有通知")
|
||||||
|
public R<List<AdviceVo>> getAllMsg() {
|
||||||
|
List<AdviceVo> adviceVo = sysAdviceService.getAllMsg();
|
||||||
|
return R.ok(adviceVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取官方通知
|
||||||
|
*/
|
||||||
|
@GetMapping("getOfficialMsg")
|
||||||
|
@ApiOperation(value = "获取官方通知")
|
||||||
|
public R<List<AdviceVo>> getOfficialMsg() {
|
||||||
|
List<AdviceVo> adviceVo = sysAdviceService.getOfficialMsg();
|
||||||
|
return R.ok(adviceVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取评论通知
|
||||||
|
*/
|
||||||
|
@GetMapping("getCommentMsg")
|
||||||
|
@ApiOperation(value = "获取评论通知")
|
||||||
|
public R<List<CommentAdviceVo>> getCommentMsg(@Valid
|
||||||
|
@NotNull(message = "类型不能为空")
|
||||||
|
@ApiParam(value = "类型 0模型 1工作流 2图片 3全部", required = true)
|
||||||
|
Integer productType) {
|
||||||
|
List<CommentAdviceVo> adviceVo = sysAdviceService.getCommentMsg(productType);
|
||||||
|
return R.ok(adviceVo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取点赞通知
|
||||||
|
*/
|
||||||
|
@GetMapping("getLikeMsg")
|
||||||
|
@ApiOperation(value = "获取点赞通知")
|
||||||
|
public R<List<LikeAdviceVo>> getLikeMsg(@Valid
|
||||||
|
@NotNull(message = "类型不能为空")
|
||||||
|
@ApiParam(value = "类型 0模型 1工作流 2图片 3评论 4全部", required = true)
|
||||||
|
Integer productType) {
|
||||||
|
List<LikeAdviceVo> likeAdviceVoList = sysAdviceService.getLikeMsg(productType);
|
||||||
|
return R.ok(likeAdviceVoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取关注通知
|
||||||
|
*/
|
||||||
|
@GetMapping("getAttentionMsg")
|
||||||
|
@ApiOperation(value = "获取关注通知")
|
||||||
|
public R<List<AttentionAdviceVo>> getAttentionMsg() {
|
||||||
|
List<AttentionAdviceVo> attentionAdviceVoList = sysAdviceService.getAttentionMsg();
|
||||||
|
return R.ok(attentionAdviceVoList);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,16 +1,16 @@
|
||||||
package com.mcwl.web.controller.resource;
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.mcwl.common.annotation.RepeatSubmit;
|
import com.mcwl.common.annotation.RepeatSubmit;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.common.core.domain.entity.SysUser;
|
||||||
import com.mcwl.resource.domain.SysUserInfo;
|
import com.mcwl.resource.domain.SysUserInfo;
|
||||||
import com.mcwl.resource.service.impl.SysUserAttentionServiceImpl;
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
|
import com.mcwl.resource.service.SysUserAttentionService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
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.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关注
|
* 关注
|
||||||
|
@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
public class SysUserAttentionController {
|
public class SysUserAttentionController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserAttentionServiceImpl sysUserAttentionService;
|
private SysUserAttentionService sysUserAttentionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加/取消关注
|
* 添加/取消关注
|
||||||
|
@ -34,7 +34,7 @@ public class SysUserAttentionController {
|
||||||
@ApiOperation(value = "添加/取消关注")
|
@ApiOperation(value = "添加/取消关注")
|
||||||
@RepeatSubmit
|
@RepeatSubmit
|
||||||
@GetMapping("/addAttention")
|
@GetMapping("/addAttention")
|
||||||
public AjaxResult addAttention(@RequestParam Long userId) {
|
public R addAttention(@RequestParam Long userId) {
|
||||||
|
|
||||||
return sysUserAttentionService.addAttention(userId);
|
return sysUserAttentionService.addAttention(userId);
|
||||||
|
|
||||||
|
@ -47,11 +47,11 @@ public class SysUserAttentionController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询是否关注用户")
|
@ApiOperation(value = "查询是否关注用户")
|
||||||
@GetMapping("/selectAttention")
|
@GetMapping("/selectAttention")
|
||||||
public AjaxResult selectAttention(@RequestParam Long userId) {
|
public R<Boolean> selectAttention(@RequestParam Long userId) {
|
||||||
|
|
||||||
Boolean aBoolean = sysUserAttentionService.selectAttention(userId);
|
Boolean aBoolean = sysUserAttentionService.selectAttention(userId);
|
||||||
|
|
||||||
return AjaxResult.success(aBoolean);
|
return R.ok(aBoolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,10 +60,38 @@ public class SysUserAttentionController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询个人粉丝,关注,下载量,喜欢")
|
@ApiOperation(value = "查询个人粉丝,关注,下载量,喜欢")
|
||||||
@GetMapping("/selectUserInfo")
|
@GetMapping("/selectUserInfo")
|
||||||
public AjaxResult selectUserInfo(){
|
public R<SysUserInfo> selectUserInfo(Long userId){
|
||||||
|
|
||||||
SysUserInfo sysUserInfo = sysUserAttentionService.selectUserInfo();
|
SysUserInfo sysUserInfo = sysUserAttentionService.selectUserInfo(userId);
|
||||||
|
|
||||||
return AjaxResult.success(sysUserInfo);
|
return R.ok(sysUserInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看关注列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询关注列表")
|
||||||
|
@PostMapping("/selectAttentionList")
|
||||||
|
public R<PageInfo<SysUser>> selectAttentionList(@RequestBody PageVo pageVo){
|
||||||
|
|
||||||
|
PageInfo<SysUser> sysUserList = sysUserAttentionService.selectAttentionPage(pageVo);
|
||||||
|
|
||||||
|
return R.ok(sysUserList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看关注列表
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "查询粉丝列表")
|
||||||
|
@PostMapping("/selectToAttention")
|
||||||
|
public R<PageInfo<SysUser>> selectToAttention(@RequestBody PageVo pageVo){
|
||||||
|
|
||||||
|
PageInfo<SysUser> sysUserList = sysUserAttentionService.selectToAttentionPage(pageVo);
|
||||||
|
|
||||||
|
return R.ok(sysUserList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mcwl.web.controller.resource;
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.common.core.page.TableDataInfo;
|
import com.mcwl.common.core.page.TableDataInfo;
|
||||||
import com.mcwl.resource.domain.ToActivity;
|
import com.mcwl.resource.domain.ToActivity;
|
||||||
import com.mcwl.resource.service.ToActivityService;
|
import com.mcwl.resource.service.ToActivityService;
|
||||||
|
@ -25,7 +25,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Api(tags = "活动")
|
@Api(tags = "活动")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("ToActivity")
|
@RequestMapping("/ToActivity")
|
||||||
public class ToActivityController extends BaseController {
|
public class ToActivityController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ToActivityService toActivityService;
|
private ToActivityService toActivityService;
|
||||||
|
@ -37,7 +37,7 @@ public class ToActivityController extends BaseController {
|
||||||
@PostMapping("/list")
|
@PostMapping("/list")
|
||||||
public TableDataInfo list(@RequestBody ToActivity toActivity)
|
public TableDataInfo list(@RequestBody ToActivity toActivity)
|
||||||
{
|
{
|
||||||
startPage();
|
|
||||||
List<ToActivity> list = toActivityService.selectToActivityList(toActivity);
|
List<ToActivity> list = toActivityService.selectToActivityList(toActivity);
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
@ -46,41 +46,45 @@ public class ToActivityController extends BaseController {
|
||||||
|
|
||||||
@ApiOperation(value = "活动详情")
|
@ApiOperation(value = "活动详情")
|
||||||
@PostMapping("finById")
|
@PostMapping("finById")
|
||||||
public AjaxResult finById(@RequestBody ToActivity toActivity)
|
public R<ToActivity> finById(@RequestBody ToActivity toActivity)
|
||||||
{
|
{
|
||||||
return AjaxResult.success(toActivityService.getById(toActivity));
|
return R.ok(toActivityService.getById(toActivity.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "活动添加")
|
@ApiOperation(value = "活动添加")
|
||||||
@PostMapping("add")
|
@PostMapping("add")
|
||||||
public AjaxResult add(@RequestBody ToActivity toActivity)
|
public R<Object> add(@RequestBody ToActivity toActivity)
|
||||||
{
|
{
|
||||||
return AjaxResult.success(toActivityService.save(toActivity));
|
toActivityService.save(toActivity);
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "活动修改")
|
@ApiOperation(value = "活动修改")
|
||||||
@PostMapping("update")
|
@PostMapping("update")
|
||||||
public AjaxResult update(@RequestBody ToActivity toActivity)
|
public R<Object> update(@RequestBody ToActivity toActivity)
|
||||||
{
|
{
|
||||||
return AjaxResult.success(toActivityService.updateById(toActivity));
|
toActivityService.updateById(toActivity);
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "活动删除")
|
@ApiOperation(value = "活动删除")
|
||||||
@PostMapping("delete")
|
@PostMapping("delete")
|
||||||
public AjaxResult delete(@RequestBody ToActivity toActivity)
|
public R<Object> delete(@RequestBody ToActivity toActivity)
|
||||||
{
|
{
|
||||||
return AjaxResult.success(toActivityService.removeById(toActivity));
|
toActivityService.removeById(toActivity);
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "活动批量删除")
|
@ApiOperation(value = "活动批量删除")
|
||||||
@PostMapping("deleteByIds")
|
@PostMapping("deleteByIds")
|
||||||
public AjaxResult deleteByIds(@RequestBody List<ToActivity> toActivity)
|
public R<Object> deleteByIds(@RequestBody List<ToActivity> toActivity)
|
||||||
{
|
{
|
||||||
return AjaxResult.success(toActivityService.removeByIds(toActivity));
|
toActivityService.removeByIds(toActivity);
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,25 @@
|
||||||
package com.mcwl.web.controller.resource;
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
import com.mcwl.resource.domain.WorkFlowComment;
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.resource.domain.dto.WorkFlowCommentRes;
|
||||||
import com.mcwl.resource.domain.vo.WorkFlowCommentVo;
|
import com.mcwl.resource.domain.vo.WorkFlowCommentVo;
|
||||||
import com.mcwl.resource.service.WorkFlowCommentLikeService;
|
import com.mcwl.resource.service.WorkFlowCommentLikeService;
|
||||||
import com.mcwl.resource.service.WorkFlowCommentService;
|
import com.mcwl.resource.service.WorkFlowCommentService;
|
||||||
import com.mcwl.resource.service.WorkFlowLikeService;
|
import com.mcwl.resource.service.WorkFlowLikeService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.validation.Valid;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流评论
|
* 工作流评论
|
||||||
|
*
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
* @Project:McWl
|
* @Project:McWl
|
||||||
* @Package:com.mcwl.web.controller.resource
|
* @Package:com.mcwl.web.controller.resource
|
||||||
|
@ -36,15 +40,17 @@ public class WorkFlowCommentController {
|
||||||
private WorkFlowCommentLikeService workFlowCommentLikeService;
|
private WorkFlowCommentLikeService workFlowCommentLikeService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流点赞/取消
|
* 工作流点赞/取消
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "工作流点赞/取消")
|
@ApiOperation(value = "工作流点赞/取消")
|
||||||
@GetMapping("/like/{workFlowId}")
|
@GetMapping("/like")
|
||||||
public AjaxResult like(@PathVariable Long workFlowId) {
|
public R<Object> like(@Valid
|
||||||
|
@NotNull(message = "模型id不能为空")
|
||||||
|
@ApiParam(value = "模型id", required = true)
|
||||||
|
Long workFlowId) {
|
||||||
workFlowLikeService.like(workFlowId);
|
workFlowLikeService.like(workFlowId);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,31 +59,42 @@ public class WorkFlowCommentController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "工作流评论发布")
|
@ApiOperation(value = "工作流评论发布")
|
||||||
@PostMapping("/comment")
|
@PostMapping("/comment")
|
||||||
public AjaxResult comment(@RequestBody WorkFlowComment modelComment) {
|
public R<Object> comment(@Valid
|
||||||
workFlowCommentService.comment(modelComment);
|
@RequestBody
|
||||||
return AjaxResult.success();
|
WorkFlowCommentRes workFlowCommentRes) {
|
||||||
|
workFlowCommentService.comment(workFlowCommentRes);
|
||||||
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流评论点赞/取消
|
* 工作流评论点赞/取消
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "工作流评论点赞/取消")
|
@ApiOperation(value = "工作流评论点赞/取消")
|
||||||
@GetMapping("/commentLike/{commentId}")
|
@GetMapping("/commentLike")
|
||||||
public AjaxResult commentLike(@PathVariable Long commentId) {
|
public R<Object> commentLike(@Valid
|
||||||
|
@NotNull(message = "评论id不能为空")
|
||||||
|
@ApiParam(value = "评论id", required = true)
|
||||||
|
Long commentId) {
|
||||||
workFlowCommentLikeService.like(commentId);
|
workFlowCommentLikeService.like(commentId);
|
||||||
return AjaxResult.error();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取工作流评论
|
* 获取工作流评论
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取工作流评论")
|
@ApiOperation(value = "获取工作流评论")
|
||||||
@GetMapping("/comment/{modelId}")
|
@GetMapping("/getComment")
|
||||||
public AjaxResult getComment(@PathVariable @NotNull(message = "模型id不能为空") Long modelId) {
|
public R<List<WorkFlowCommentVo>> getComment(@Valid
|
||||||
List<WorkFlowCommentVo> modelCommentList = workFlowCommentService.getComment(modelId);
|
@NotNull(message = "模型id不能为空")
|
||||||
return AjaxResult.success(modelCommentList);
|
@ApiParam(value = "模型id", required = true)
|
||||||
|
Long commentId,
|
||||||
|
@Valid
|
||||||
|
@NotNull(message = "排序方式不能为空")
|
||||||
|
@ApiParam(value = "排序方式 0最热 1最新", required = true)
|
||||||
|
Integer sortType) {
|
||||||
|
List<WorkFlowCommentVo> modelCommentList = workFlowCommentService.getComment(commentId, sortType);
|
||||||
|
return R.ok(modelCommentList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,11 +102,26 @@ public class WorkFlowCommentController {
|
||||||
* 删除工作流评论
|
* 删除工作流评论
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除工作流评论")
|
@ApiOperation(value = "删除工作流评论")
|
||||||
@GetMapping("/commentDelete/{commentId}")
|
@GetMapping("/commentDelete")
|
||||||
public AjaxResult commentDelete(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
public R<Object> commentDelete(@Valid
|
||||||
|
@NotNull(message = "评论id不能为空")
|
||||||
|
@ApiParam(value = "评论id", required = true)
|
||||||
|
Long commentId) {
|
||||||
workFlowCommentService.removeById(commentId);
|
workFlowCommentService.removeById(commentId);
|
||||||
return AjaxResult.success();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工作流评论数量
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取工作流评论数量")
|
||||||
|
@GetMapping("/commentCount")
|
||||||
|
public R<Integer> getCommentCount(@Valid
|
||||||
|
@NotNull(message = "工作流id不能为空")
|
||||||
|
@ApiParam(value = "工作流id", required = true)
|
||||||
|
Long workFlowId) {
|
||||||
|
Integer commentCount = workFlowCommentService.getCommentCount(workFlowId);
|
||||||
|
return R.ok(commentCount);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,30 @@
|
||||||
package com.mcwl.web.controller.resource;
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.mcwl.common.core.controller.BaseController;
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.R;
|
||||||
|
import com.mcwl.resource.domain.WorkFlow;
|
||||||
|
import com.mcwl.resource.domain.dto.AddRequestWorkFlow;
|
||||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||||
|
import com.mcwl.resource.domain.response.ResponseWorkFlow;
|
||||||
import com.mcwl.resource.domain.vo.PageVo;
|
import com.mcwl.resource.domain.vo.PageVo;
|
||||||
import com.mcwl.resource.service.impl.WorkFlowServiceImpl;
|
import com.mcwl.resource.mapper.WorkFlowVersionMapper;
|
||||||
import com.mcwl.web.controller.common.OssUtil;
|
import com.mcwl.resource.service.WorkFlowService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流
|
* 工作流
|
||||||
|
*
|
||||||
* @Author:ChenYan
|
* @Author:ChenYan
|
||||||
* @Project:McWl
|
* @Project:McWl
|
||||||
* @Package:com.mcwl.web.controller.resource
|
* @Package:com.mcwl.web.controller.resource
|
||||||
|
@ -29,96 +39,110 @@ public class WorkFlowController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WorkFlowServiceImpl workFlowService;
|
private WorkFlowService workFlowService;
|
||||||
|
|
||||||
/***
|
@Autowired
|
||||||
* 图片
|
private WorkFlowVersionMapper workFlowVersionMapper;
|
||||||
* @param file
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "图片")
|
|
||||||
@PostMapping("/file")
|
|
||||||
public AjaxResult Malifile(@RequestParam MultipartFile file){
|
|
||||||
|
|
||||||
String s = OssUtil.uploadMultipartFile(file);
|
|
||||||
return AjaxResult.success(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/***
|
/**
|
||||||
|
* 设置工作流的置顶状态
|
||||||
*
|
*
|
||||||
* zip
|
* @param id
|
||||||
* @param file
|
* @param isTop
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "zip")
|
@ApiOperation(value = "设置工作流的置顶状态")
|
||||||
@PostMapping("/zipUrlFile")
|
@GetMapping("/{id}/top")
|
||||||
public AjaxResult zipUrlFile(@RequestParam MultipartFile file){
|
public R<Object> setWorkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||||
String s = OssUtil.uploadMultipartFile(file);
|
|
||||||
return AjaxResult.success(s);
|
workFlowService.setworkFlowTop(id, isTop);
|
||||||
|
return R.ok();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***
|
/**
|
||||||
|
* 获取所有工作流,按照置顶状态排序
|
||||||
*
|
*
|
||||||
* 下载zip
|
|
||||||
* @param file
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "下载zip")
|
@ApiOperation(value = "获取置顶的模型列表")
|
||||||
@PostMapping("/zipUrl")
|
@GetMapping
|
||||||
public AjaxResult zipUrl(@RequestParam MultipartFile file){
|
public R<List<WorkFlow>> fetchWorkFlowSortedByTopStatus() {
|
||||||
String s = OssUtil.uploadMultipartFile(file);
|
List<WorkFlow> models = workFlowService.fetchWorkFlowSortedByTopStatus();
|
||||||
return AjaxResult.success(s);
|
return R.ok(models);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加工作流
|
* 添加工作流
|
||||||
* @param requestWorkFlow
|
*
|
||||||
|
* @param addRequestWorkFlow
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "添加工作流")
|
@ApiOperation(value = "添加工作流")
|
||||||
@PostMapping("/addWorkFlow")
|
@PostMapping("/addWorkFlow")
|
||||||
public AjaxResult addWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
public R<Object> addWorkFlow(@Validated @RequestBody AddRequestWorkFlow addRequestWorkFlow) {
|
||||||
|
|
||||||
return workFlowService.addWorkFlow(requestWorkFlow);
|
return workFlowService.addWorkFlow(addRequestWorkFlow);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改工作流
|
* 修改工作流
|
||||||
|
*
|
||||||
* @param requestWorkFlow
|
* @param requestWorkFlow
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "修改工作流")
|
@ApiOperation(value = "修改工作流")
|
||||||
@PostMapping("/updateWorkFlow")
|
@PostMapping("/updateWorkFlow")
|
||||||
public AjaxResult updateWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
public R<Object> updateWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow) {
|
||||||
|
|
||||||
|
|
||||||
|
// for (WorkFlowVersion workFlowVersion : requestWorkFlow.getWorkFlowVersionList()) {
|
||||||
|
//
|
||||||
|
// //校验名字
|
||||||
|
// WorkFlowVersion workFlowVersion1 = workFlowVersionMapper.selectByFileName(workFlowVersion.getFileName());
|
||||||
|
// if (workFlowVersion1 != null) {
|
||||||
|
//
|
||||||
|
// return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件名字重复");
|
||||||
|
// }
|
||||||
|
// //校验hash
|
||||||
|
// WorkFlowVersion workFlowVersion2 = workFlowVersionMapper.selectByHash(workFlowVersion.getFileHash());
|
||||||
|
// if (workFlowVersion2 != null){
|
||||||
|
//
|
||||||
|
// return R.fail(HttpStatus.SHOW_ERROR_MSG,"文件内容重复");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
workFlowService.updateWorkFlow(requestWorkFlow);
|
workFlowService.updateWorkFlow(requestWorkFlow);
|
||||||
|
|
||||||
return AjaxResult.success("修改成功");
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除工作流
|
* 删除工作流
|
||||||
|
*
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除工作流")
|
@ApiOperation(value = "删除工作流")
|
||||||
@GetMapping("/deleteWorkFlow")
|
@GetMapping("/deleteWorkFlow")
|
||||||
public AjaxResult deleteWorkFlow(@RequestParam Long id){
|
public R<Object> deleteWorkFlow(@RequestParam @Valid @NotNull(message = "工作流id不能为空") Long id) {
|
||||||
|
|
||||||
workFlowService.deleteWorkFlow(id);
|
workFlowService.deleteWorkFlow(id);
|
||||||
return AjaxResult.success("删除成功");
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询工作流列表
|
* 查询工作流列表
|
||||||
|
*
|
||||||
* @param pageVo
|
* @param pageVo
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询工作流列表")
|
@ApiOperation(value = "查询工作流列表")
|
||||||
@PostMapping("/selectWorkFlow")
|
@PostMapping("/selectWorkFlow")
|
||||||
public AjaxResult selectWorkFlow(@RequestBody PageVo pageVo){
|
public R<Page<WorkFlow>> selectWorkFlow(@RequestBody PageVo pageVo) {
|
||||||
|
|
||||||
return workFlowService.selectWorkFlow(pageVo);
|
return workFlowService.selectWorkFlow(pageVo);
|
||||||
}
|
}
|
||||||
|
@ -131,9 +155,52 @@ public class WorkFlowController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询工作流详情")
|
@ApiOperation(value = "查询工作流详情")
|
||||||
@GetMapping("/selectWorkFlowById")
|
@GetMapping("/selectWorkFlowById")
|
||||||
public AjaxResult selectWorkFlowById(@RequestParam Long id){
|
public R<WorkFlow> selectWorkFlowById(@RequestParam @Valid @NotNull(message = "工作流id不能为空") Long id) {
|
||||||
|
|
||||||
return workFlowService.selectWorkFlowById(id);
|
return workFlowService.selectWorkFlowById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验名字是否重复
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "校验名字是否重复")
|
||||||
|
@GetMapping("/selectWorkFlowByName")
|
||||||
|
public R<Long> selectWorkFlowByName(@RequestParam String name) {
|
||||||
|
|
||||||
|
Long sign = workFlowService.selectWorkFlowByName(name);
|
||||||
|
return R.ok(sign);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回显接口
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "工作流回显接口")
|
||||||
|
@GetMapping("/selectWorkFlowVersionById")
|
||||||
|
public R<RequestWorkFlow> selectWorkFlowVersionById(@RequestParam @Valid @NotNull(message = "图片id不能为空") Long id) {
|
||||||
|
|
||||||
|
return workFlowService.selectWorkFlowVersionById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作流列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "工作流列表")
|
||||||
|
@PostMapping("/workFlowList")
|
||||||
|
public R<PageInfo<ResponseWorkFlow>> workFlowList(@RequestBody PageVo pageVo) {
|
||||||
|
|
||||||
|
PageInfo<ResponseWorkFlow> responseWorkFlowPageInfo = workFlowService.workFlowList(pageVo);
|
||||||
|
return R.ok(responseWorkFlowPageInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
package com.mcwl.web.controller.resource;
|
package com.mcwl.web.controller.resource;
|
||||||
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.R;
|
||||||
import com.mcwl.resource.service.impl.WorkFlowVersionServiceImpl;
|
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||||
|
import com.mcwl.resource.service.WorkFlowVersionService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -10,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工作流版本
|
* 工作流版本
|
||||||
*
|
*
|
||||||
|
@ -23,7 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
public class WorkFlowVersionController {
|
public class WorkFlowVersionController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private WorkFlowVersionServiceImpl workFlowVersionService;
|
private WorkFlowVersionService workFlowVersionService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询工作流下的所有版本信息
|
* 查询工作流下的所有版本信息
|
||||||
|
@ -33,9 +36,21 @@ public class WorkFlowVersionController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询工作流下的所有版本信息")
|
@ApiOperation(value = "查询工作流下的所有版本信息")
|
||||||
@GetMapping("/selectVersionByWorkId")
|
@GetMapping("/selectVersionByWorkId")
|
||||||
public AjaxResult selectVersionByWorkId(@RequestParam Long workId) {
|
public R<List<WorkFlowVersion>> selectVersionByWorkId(@RequestParam Long workId) {
|
||||||
|
|
||||||
return workFlowVersionService.selectVersionByWorkId(workId);
|
return workFlowVersionService.selectVersionByWorkId(workId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载工作流
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("下载工作流")
|
||||||
|
@GetMapping("/workFlowFileDownload")
|
||||||
|
public R workFlowFileDownload(@RequestParam Long id){
|
||||||
|
|
||||||
|
return workFlowVersionService.workFlowFileDownload(id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.mcwl.web.controller.system;
|
||||||
|
|
||||||
|
import com.mcwl.common.core.controller.BaseController;
|
||||||
|
import com.mcwl.system.domain.Policy;
|
||||||
|
import com.mcwl.system.service.PolicyService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:ChenYan
|
||||||
|
* @Project:mcwl-ai
|
||||||
|
* @Package:com.mcwl.web.controller.system
|
||||||
|
* @Filename:PerController
|
||||||
|
* @Description TODO
|
||||||
|
* @Date:2025/2/14 10:11
|
||||||
|
*/
|
||||||
|
@Api(tags = "隐私政策/用户协议")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("Policy")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PerController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private PolicyService policyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取指定类型的政策内容
|
||||||
|
*
|
||||||
|
* @param type 政策类型
|
||||||
|
* @return 政策内容
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取指定类型的政策内容")
|
||||||
|
@GetMapping("/{type}")
|
||||||
|
public ResponseEntity<?> getPolicy(@PathVariable("type") String type) {
|
||||||
|
Policy policy = policyService.getPolicyByType(type);
|
||||||
|
if (policy == null) {
|
||||||
|
return new ResponseEntity<>("Policy not found", HttpStatus.NOT_FOUND);
|
||||||
|
}
|
||||||
|
return new ResponseEntity<>(policy.getContent(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 更新指定类型的政策内容
|
||||||
|
*
|
||||||
|
* @param type 政策类型
|
||||||
|
* @param content 政策内容
|
||||||
|
* @return 更新结果
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "更新指定类型的政策内容")
|
||||||
|
@PutMapping("/{type}")
|
||||||
|
public ResponseEntity<?> updatePolicy(@PathVariable("type") String type, @RequestBody String content) {
|
||||||
|
try {
|
||||||
|
policyService.updatePolicyContent(type, content);
|
||||||
|
return new ResponseEntity<>("Policy updated successfully", HttpStatus.OK);
|
||||||
|
} catch (RuntimeException e) {
|
||||||
|
return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,57 +0,0 @@
|
||||||
package com.mcwl.web.controller.system;
|
|
||||||
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
|
||||||
import com.mcwl.system.domain.vo.AdviceVo;
|
|
||||||
import com.mcwl.system.service.ISysAdviceService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("system/advice")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class SysAdviceController {
|
|
||||||
|
|
||||||
private final ISysAdviceService sysAdviceService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据当前用户获取新消息提醒
|
|
||||||
*/
|
|
||||||
@GetMapping("getUserNewMsg")
|
|
||||||
public AjaxResult getUserNewMsg() {
|
|
||||||
List<AdviceVo> adviceVo = sysAdviceService.getUserNewMsg();
|
|
||||||
return AjaxResult.success(adviceVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据当前用户获取系统公告
|
|
||||||
*/
|
|
||||||
@GetMapping("getUserSystemNotice")
|
|
||||||
public AjaxResult getUserSystemNotice() {
|
|
||||||
List<AdviceVo> adviceVo = sysAdviceService.getUserSystemNotice();
|
|
||||||
return AjaxResult.success(adviceVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据当前用户获取所有消息
|
|
||||||
*/
|
|
||||||
@GetMapping("getUserAllMsg")
|
|
||||||
public AjaxResult getUserAllMsg() {
|
|
||||||
List<AdviceVo> adviceVo = sysAdviceService.getUserAllMsg();
|
|
||||||
return AjaxResult.success(adviceVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取所有消息
|
|
||||||
*/
|
|
||||||
@GetMapping("getAllMsg")
|
|
||||||
public AjaxResult getAllMsg() {
|
|
||||||
List<AdviceVo> adviceVo = sysAdviceService.getAllMsg();
|
|
||||||
return AjaxResult.success(adviceVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -3,6 +3,7 @@ package com.mcwl.web.controller.system;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.mcwl.common.annotation.Anonymous;
|
import com.mcwl.common.annotation.Anonymous;
|
||||||
import com.mcwl.common.constant.Constants;
|
import com.mcwl.common.constant.Constants;
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
import com.mcwl.common.constant.QueueConstants;
|
import com.mcwl.common.constant.QueueConstants;
|
||||||
import com.mcwl.common.constant.RedisConstants;
|
import com.mcwl.common.constant.RedisConstants;
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
import com.mcwl.common.core.domain.AjaxResult;
|
||||||
|
@ -60,13 +61,13 @@ public class SysLoginController
|
||||||
public AjaxResult code(@RequestParam String phone){
|
public AjaxResult code(@RequestParam String phone){
|
||||||
|
|
||||||
if (StringUtils.isEmpty(phone)){
|
if (StringUtils.isEmpty(phone)){
|
||||||
return AjaxResult.error("请输入手机号");
|
return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"请输入手机号");
|
||||||
}
|
}
|
||||||
|
|
||||||
//校验验证码是否存在
|
//校验验证码是否存在
|
||||||
if (redisCache.hasKey(RedisConstants.CODE_PHONE+phone)){
|
if (redisCache.hasKey(RedisConstants.CODE_PHONE+phone)){
|
||||||
|
|
||||||
return AjaxResult.error("请勿重复发送");
|
return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"请勿重复发送");
|
||||||
}
|
}
|
||||||
|
|
||||||
//生成验证码
|
//生成验证码
|
||||||
|
|
|
@ -15,6 +15,7 @@ import com.mcwl.system.service.ISysDeptService;
|
||||||
import com.mcwl.system.service.ISysPostService;
|
import com.mcwl.system.service.ISysPostService;
|
||||||
import com.mcwl.system.service.ISysRoleService;
|
import com.mcwl.system.service.ISysRoleService;
|
||||||
import com.mcwl.system.service.ISysUserService;
|
import com.mcwl.system.service.ISysUserService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
@ -261,9 +262,13 @@ public class SysUserController extends BaseController
|
||||||
* 查询个人信息
|
* 查询个人信息
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
@ApiOperation(value = "个人中心查询个人数据")
|
||||||
@GetMapping("/selectUserById")
|
@GetMapping("/selectUserById")
|
||||||
public AjaxResult selectUserById(){
|
public AjaxResult selectUserById(@RequestParam(name = "id", required = false) Long id){
|
||||||
SysUser sysUser = userService.selectUserInfoById(SecurityUtils.getUserId());
|
if (id == null){
|
||||||
|
id = SecurityUtils.getUserId();
|
||||||
|
}
|
||||||
|
SysUser sysUser = userService.selectUserInfoById(id);
|
||||||
return success(sysUser);
|
return success(sysUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,8 +280,8 @@ public class SysUserController extends BaseController
|
||||||
@PostMapping("/updateUserInfo")
|
@PostMapping("/updateUserInfo")
|
||||||
public AjaxResult updateUserInfo(@RequestBody SysUser sysUser){
|
public AjaxResult updateUserInfo(@RequestBody SysUser sysUser){
|
||||||
|
|
||||||
userService.updateUserInfo(sysUser);
|
|
||||||
return AjaxResult.success("修改成功");
|
return userService.updateUserInfo(sysUser);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -109,16 +109,19 @@ public class WXController {
|
||||||
String openid = redisTemplate.opsForValue().get(verifyKey);
|
String openid = redisTemplate.opsForValue().get(verifyKey);
|
||||||
ajax.put("status", 0);
|
ajax.put("status", 0);
|
||||||
System.out.println("openid:{}" + openid);
|
System.out.println("openid:{}" + openid);
|
||||||
|
|
||||||
if (!StringUtils.isEmpty(openid)) {
|
if (!StringUtils.isEmpty(openid)) {
|
||||||
|
String openid1 = openid.substring(1, openid.length() - 1);
|
||||||
redisTemplate.delete(verifyKey);
|
redisTemplate.delete(verifyKey);
|
||||||
SysUser user = iSysUserThirdAccountService.selectUserByOpenId(openid);
|
SysUser user = iSysUserThirdAccountService.selectUserByOpenId(openid1);
|
||||||
System.out.println("用户:{}" + user);
|
System.out.println("用户:{}" + user);
|
||||||
if (user.getUserId() == null) {
|
if (user.getUserId() == null) {
|
||||||
|
|
||||||
iSysUserService.addUser(openid,CacheConstants.WE_CHAT,null);
|
iSysUserService.addUser(openid1,CacheConstants.WE_CHAT,null);
|
||||||
user = iSysUserThirdAccountService.selectUserByOpenId(openid);
|
user = iSysUserThirdAccountService.selectUserByOpenId(openid1);
|
||||||
}
|
}
|
||||||
LoginUser loginUser = new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
LoginUser loginUser = new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||||
|
log.info("生成token的数据user:{}",user);
|
||||||
// 生成token
|
// 生成token
|
||||||
String token = tokenService.createToken(loginUser);
|
String token = tokenService.createToken(loginUser);
|
||||||
ajax.put("token", token);
|
ajax.put("token", token);
|
||||||
|
|
|
@ -4,6 +4,8 @@ import java.util.ArrayList;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
|
@ -0,0 +1,176 @@
|
||||||
|
# 数据源配置
|
||||||
|
spring:
|
||||||
|
#mq
|
||||||
|
rabbitmq:
|
||||||
|
host: 113.45.190.154
|
||||||
|
port: 5672
|
||||||
|
username: guest
|
||||||
|
password: guest
|
||||||
|
virtualHost: /
|
||||||
|
listener:
|
||||||
|
simple:
|
||||||
|
prefetch: 1 # 每次之能获取一条
|
||||||
|
acknowledge-mode: manual # 设置消费端手动ack确认
|
||||||
|
retry:
|
||||||
|
enabled: true # 是否支持重试
|
||||||
|
# 生产者配置
|
||||||
|
publisher-confirm-type: correlated #确认消息已发送到交换机(Exchange)
|
||||||
|
publisher-returns: true #确认消息已发送到队列(Queue)
|
||||||
|
|
||||||
|
datasource:
|
||||||
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
driverClassName: com.mysql.cj.jdbc.Driver
|
||||||
|
druid:
|
||||||
|
# 主库数据源
|
||||||
|
master:
|
||||||
|
url: jdbc:mysql://113.45.190.154:3306/mcwl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
|
username: root
|
||||||
|
password: ybl123456@
|
||||||
|
# 从库数据源
|
||||||
|
slave:
|
||||||
|
# 从数据源开关/默认关闭
|
||||||
|
enabled: false
|
||||||
|
url:
|
||||||
|
username:
|
||||||
|
password:
|
||||||
|
# 初始连接数
|
||||||
|
initialSize: 5
|
||||||
|
# 最小连接池数量
|
||||||
|
minIdle: 10
|
||||||
|
# 最大连接池数量
|
||||||
|
maxActive: 20
|
||||||
|
# 配置获取连接等待超时的时间
|
||||||
|
maxWait: 60000
|
||||||
|
# 配置连接超时时间
|
||||||
|
connectTimeout: 30000
|
||||||
|
# 配置网络超时时间
|
||||||
|
socketTimeout: 60000
|
||||||
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||||
|
timeBetweenEvictionRunsMillis: 60000
|
||||||
|
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||||
|
minEvictableIdleTimeMillis: 300000
|
||||||
|
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||||
|
maxEvictableIdleTimeMillis: 900000
|
||||||
|
# 配置检测连接是否有效
|
||||||
|
validationQuery: SELECT 1 FROM DUAL
|
||||||
|
testWhileIdle: true
|
||||||
|
testOnBorrow: false
|
||||||
|
testOnReturn: false
|
||||||
|
webStatFilter:
|
||||||
|
enabled: true
|
||||||
|
statViewServlet:
|
||||||
|
enabled: true
|
||||||
|
# 设置白名单,不填则允许所有访问
|
||||||
|
allow:
|
||||||
|
url-pattern: /druid/*
|
||||||
|
# 控制台管理用户名和密码
|
||||||
|
login-username: mcwl
|
||||||
|
login-password: 123456
|
||||||
|
filter:
|
||||||
|
stat:
|
||||||
|
enabled: true
|
||||||
|
# 慢SQL记录
|
||||||
|
log-slow-sql: true
|
||||||
|
slow-sql-millis: 1000
|
||||||
|
merge-sql: true
|
||||||
|
wall:
|
||||||
|
config:
|
||||||
|
multi-statement-allow: true
|
||||||
|
# redis 配置
|
||||||
|
redis:
|
||||||
|
# 地址 旧测试环境
|
||||||
|
# host: 113.45.9.111
|
||||||
|
host: 113.45.190.154
|
||||||
|
# 端口,默认为6379
|
||||||
|
port: 6379
|
||||||
|
# 数据库索引
|
||||||
|
database: 0
|
||||||
|
# 密码
|
||||||
|
password: MuYu_Cloud@Redis
|
||||||
|
# 连接超时时间
|
||||||
|
timeout: 20s
|
||||||
|
lettuce:
|
||||||
|
pool:
|
||||||
|
# 连接池中的最小空闲连接
|
||||||
|
min-idle: 5
|
||||||
|
# 连接池中的最大空闲连接
|
||||||
|
max-idle: 10
|
||||||
|
# 连接池的最大数据库连接数
|
||||||
|
max-active: 1000
|
||||||
|
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
|
max-wait: -1ms
|
||||||
|
|
||||||
|
|
||||||
|
# token配置
|
||||||
|
token:
|
||||||
|
# 令牌自定义标识
|
||||||
|
header: Authorization
|
||||||
|
# 令牌密钥
|
||||||
|
secret: abcdefghijklmnopqrstuvwxyz
|
||||||
|
# 令牌有效期(默认30分钟)
|
||||||
|
expireTime: 43200
|
||||||
|
|
||||||
|
# 公众号配置
|
||||||
|
wechat:
|
||||||
|
# 应用ID
|
||||||
|
appid: wx0a72f196ec9c3a70
|
||||||
|
# 应用密钥
|
||||||
|
secret: 11218568b79e2c5eb10459ef8c0374bd
|
||||||
|
|
||||||
|
# yml版(application.yml)
|
||||||
|
aliyun:
|
||||||
|
oss:
|
||||||
|
bucketName: ybl2112
|
||||||
|
endpoint: oss-cn-beijing.aliyuncs.com
|
||||||
|
accessKeyId: LTAI5tSHZZ8wHJRP8X4r9TXT
|
||||||
|
accessKeySecret: F82IVNx0IGJ3AnP6gSIfcyql1HCXIH
|
||||||
|
accessPre: https://ybl2112.oss-cn-beijing.aliyuncs.com/
|
||||||
|
|
||||||
|
## 沙箱环境
|
||||||
|
mall:
|
||||||
|
mgt:
|
||||||
|
aliPayConfig:
|
||||||
|
protocol: https
|
||||||
|
gatewayHost: openapi-sandbox.dl.alipaydev.com
|
||||||
|
signType: RSA2
|
||||||
|
# 沙箱应用id
|
||||||
|
appId: 9021000135682614
|
||||||
|
# 沙箱应用私钥
|
||||||
|
privateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCQxmQGcaiKjOhayWi+zNTvpp8B5YT8jFFkjLzrD+W+T2Dwf2GfFR4p95zsCJxYeoLWdghMPA6/GMFrLbuVFpaEjuTm4icqA9N8n5d3W0j7gh+wMjZoqyJclAIeb09ut7rY6mWzilA9kWmZnUG7MOWIU70RVRYrfJectCFw/odM9lG4XIVe13X2h+1ecTQyQzLWmnvKFCfo7dQjE7fIYiWfud1ZGUneNs3u73pNWMB6ThGTTCbs0atcgM3fYOg3q7fTxIu9VcaUCJiJ/kNbL9sVEyOrSyx2f2o6w06zdEaOiQFsuDeS8QPYGMg7pf42wAfqCO6hqxQiQT5vp1hvB0o1AgMBAAECggEAIhaEYLwMSispXo8D2cES9iaOU/z91hUX6Qv2Q4anuqqoEZh8nN91Db6etTjFz1NxURvTklelxTsH97t56n26DRY0MWTYgd0Kw9Iz8MeOpKGb4nnAM97vpUq4QQBGfLRIC2ENdzu+7vA5JBFR88hsky/cWaNmJ/EbJauIIDneE7GigMR2HF7kfzdZzOBN4ZEh/ef5NKeCnEieRJJhWRgrgNXVZ44Tqi67AM7ey9pyUtBe7fgzxXtrWXBN9yKaVxxSXm3KJXFQqA6mcilFVZaxMNlAySc4MPTW8lq0ozOCOCunoeIphNz/OVIxGu3/voXFXlBfOKqOkYMVZxMY6OrvtQKBgQD0nIlXK4VW72VaGpz9kxQkRNzJV/yqaqet1GOSlPM2l0RCRFOVVdnvbQdHGPe6+HxHL1dh5MP8T/aHoP+4UXkkQCc8moS2FZxJvFH2QTSZBcSSdGL7GMpROqs38J+XlJzrhNcB20lrW6D7yMeQa4YEcXwdbD8Er/YaIqODBWYYewKBgQCXg+16RLDArciwwhf0TBWZPor2iYFDdwU5UPu7CKOhU1MLfQhG85gGpXHjB6G8cMUi/ezxh/FEl+sWOZegpkPwL5/BQS9tNYWIaC4kipPF/a5Up4DMYUHVAuuPwNqqXpvgU+rGjCns0wtPRnjrkghLkc3oTSID7o7pzUwIk2whDwKBgAys3+EIfExY82OL5X6uVGjcuKQmTw11oWK8krxRw5iclgjpCXu/ix+BAtOIU634mlgF9/02oYE9k4TLrvSaJDDgsifNyfq1e/fGLmkYT+VuCxWbulVQn4s+AwlPCrYMGWWK6KlL9638fYcOjGjLaZJpXwkXRtyzUYlhKh/r87JpAoGBAIavRp2mi/xrPvgpQQPv0k9L8llfOCHRnjoqC+thrZsNp8eRmJcBmMVnskofEZ2iHQuS71pw/n58EQTLo0ayJbhPjVJL8K3CovXzrfjbmqqoa5xi3bJQTiXdF6rMw1QpD6Uk05E1LVuQ6v/IZFr7kBYlAQWb8z3NhQq+bPU+nyLvAoGAGpBbSM8gPzdWQqkHoos0icu3cj0GhN3MU7+1Eb/rsXyh/lk5wtZTEnHjwhdUOUtwVNjvrv7CzA7unhOoaM6YcE/Zpd4zt8pjqH1Mhds7UHf4Xg+A+J4G6meYnhSwfBpOub02ncsqfBlXE0qhFv6AvcMewWndyLb8EYaUUXTYkG0=
|
||||||
|
# 沙箱应用公钥证书
|
||||||
|
appCertPath: /opt/cert/dev/appPublicCert.crt
|
||||||
|
# 沙箱支付宝公钥证书路径
|
||||||
|
alipayCertPath: /opt/cert/dev/alipayPublicCert.crt
|
||||||
|
# 沙箱支付宝根证书路径
|
||||||
|
alipayRootCertPath: /opt/cert/dev/alipayRootCert.crt
|
||||||
|
# # 沙箱应用公钥证书
|
||||||
|
# appCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayPublicCert.crt
|
||||||
|
# # 沙箱支付宝公钥证书路径
|
||||||
|
# alipayCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayPublicCert.crt
|
||||||
|
# # 沙箱支付宝根证书路径
|
||||||
|
# alipayRootCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayRootCert.crt
|
||||||
|
notifyUrl: http://113.45.190.154:8080/ali/pay/notify
|
||||||
|
# 沙箱支付宝网关
|
||||||
|
gatewayUrl: https://openapi-sandbox.dl.alipaydev.com/gateway.do
|
||||||
|
# 绑定回调
|
||||||
|
bindUrl: http://113.45.190.154:8080/ali/pay/callback
|
||||||
|
# 参与方的标识类型,目前支持如下类型: 1、ALIPAY_USER_ID 支付宝的会员ID 2、ALIPAY_LOGON_ID:支付宝登录号,支持邮箱和手机号格式 3、ALIPAY_OPEN_ID:支付宝openid
|
||||||
|
identityType: ALIPAY_USER_ID
|
||||||
|
# 授权url
|
||||||
|
oauthUrl: https://openauth-sandbox.dl.alipaydev.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=%s&redirect_uri=%s&state=%s
|
||||||
|
|
||||||
|
huawei:
|
||||||
|
obs:
|
||||||
|
ak: NWXJ93POA9NCDVV1WQYJ
|
||||||
|
sk: 3aBuzYdUgSsxdNnycD2mESnVwtcyjAKPxqewE79N
|
||||||
|
bucketName: mcwl
|
||||||
|
upload:
|
||||||
|
endPoint: obs.cn-south-1.myhuaweicloud.com
|
||||||
|
|
||||||
|
|
||||||
|
#用户头像与背景
|
||||||
|
mcwl:
|
||||||
|
encryptUrl: http://113.45.190.154:9090/encryptAndUpload
|
||||||
|
user:
|
||||||
|
avatar: https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/10/7/53/3f5cc1d7-b062-4a22-9f7e-d442bc6dcf42.png
|
||||||
|
backgroundImg: https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/10/8/2/c8387681-8138-4a29-a1c9-4a143da34c5a.png
|
|
@ -2,7 +2,7 @@
|
||||||
spring:
|
spring:
|
||||||
#mq
|
#mq
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
host: 1.13.246.108
|
host: 113.45.9.111
|
||||||
port: 5672
|
port: 5672
|
||||||
username: guest
|
username: guest
|
||||||
password: guest
|
password: guest
|
||||||
|
@ -23,7 +23,7 @@ spring:
|
||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://1.13.246.108:3306/mcwl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://113.45.9.111:3306/mcwl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
password: ybl123456@
|
password: ybl123456@
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
|
@ -79,9 +79,9 @@ spring:
|
||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: 1.13.246.108
|
host: 113.45.9.111
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6370
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 0
|
database: 0
|
||||||
# 密码
|
# 密码
|
||||||
|
@ -91,20 +91,31 @@ spring:
|
||||||
lettuce:
|
lettuce:
|
||||||
pool:
|
pool:
|
||||||
# 连接池中的最小空闲连接
|
# 连接池中的最小空闲连接
|
||||||
min-idle: 0
|
min-idle: 5
|
||||||
# 连接池中的最大空闲连接
|
# 连接池中的最大空闲连接
|
||||||
max-idle: 8
|
max-idle: 10
|
||||||
# 连接池的最大数据库连接数
|
# 连接池的最大数据库连接数
|
||||||
max-active: 8
|
max-active: 1000
|
||||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||||
max-wait: -1ms
|
max-wait: -1ms
|
||||||
|
time-between-eviction-runs: 6000
|
||||||
|
|
||||||
|
|
||||||
|
# token配置
|
||||||
|
token:
|
||||||
|
# 令牌自定义标识
|
||||||
|
header: Authorization
|
||||||
|
# 令牌密钥
|
||||||
|
secret: abcdefghijklmnopqrstuvwxyz
|
||||||
|
# 令牌有效期(默认30分钟)
|
||||||
|
expireTime: 43200
|
||||||
|
|
||||||
# 公众号配置
|
# 公众号配置
|
||||||
wechat:
|
wechat:
|
||||||
# 应用ID
|
# 应用ID
|
||||||
appid: wx82d4c3c96f0ffa5b
|
appid: wx0a72f196ec9c3a70
|
||||||
# 应用密钥
|
# 应用密钥
|
||||||
secret: abbabcf1da711a3bbd95387ec83edcac
|
secret: 11218568b79e2c5eb10459ef8c0374bd
|
||||||
|
|
||||||
# yml版(application.yml)
|
# yml版(application.yml)
|
||||||
aliyun:
|
aliyun:
|
||||||
|
@ -115,17 +126,49 @@ aliyun:
|
||||||
accessKeySecret: F82IVNx0IGJ3AnP6gSIfcyql1HCXIH
|
accessKeySecret: F82IVNx0IGJ3AnP6gSIfcyql1HCXIH
|
||||||
accessPre: https://ybl2112.oss-cn-beijing.aliyuncs.com/
|
accessPre: https://ybl2112.oss-cn-beijing.aliyuncs.com/
|
||||||
|
|
||||||
|
# 线上环境
|
||||||
mall:
|
mall:
|
||||||
mgt:
|
mgt:
|
||||||
aliPayConfig:
|
aliPayConfig:
|
||||||
protocol: https
|
protocol: https
|
||||||
gatewayHost: openapi-sandbox.dl.alipaydev.com
|
gatewayHost: openapi-sandbox.dl.alipaydev.com
|
||||||
signType: RSA2
|
signType: RSA2
|
||||||
appId: 9021000135682614
|
# 线上应用id
|
||||||
privateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCQxmQGcaiKjOhayWi+zNTvpp8B5YT8jFFkjLzrD+W+T2Dwf2GfFR4p95zsCJxYeoLWdghMPA6/GMFrLbuVFpaEjuTm4icqA9N8n5d3W0j7gh+wMjZoqyJclAIeb09ut7rY6mWzilA9kWmZnUG7MOWIU70RVRYrfJectCFw/odM9lG4XIVe13X2h+1ecTQyQzLWmnvKFCfo7dQjE7fIYiWfud1ZGUneNs3u73pNWMB6ThGTTCbs0atcgM3fYOg3q7fTxIu9VcaUCJiJ/kNbL9sVEyOrSyx2f2o6w06zdEaOiQFsuDeS8QPYGMg7pf42wAfqCO6hqxQiQT5vp1hvB0o1AgMBAAECggEAIhaEYLwMSispXo8D2cES9iaOU/z91hUX6Qv2Q4anuqqoEZh8nN91Db6etTjFz1NxURvTklelxTsH97t56n26DRY0MWTYgd0Kw9Iz8MeOpKGb4nnAM97vpUq4QQBGfLRIC2ENdzu+7vA5JBFR88hsky/cWaNmJ/EbJauIIDneE7GigMR2HF7kfzdZzOBN4ZEh/ef5NKeCnEieRJJhWRgrgNXVZ44Tqi67AM7ey9pyUtBe7fgzxXtrWXBN9yKaVxxSXm3KJXFQqA6mcilFVZaxMNlAySc4MPTW8lq0ozOCOCunoeIphNz/OVIxGu3/voXFXlBfOKqOkYMVZxMY6OrvtQKBgQD0nIlXK4VW72VaGpz9kxQkRNzJV/yqaqet1GOSlPM2l0RCRFOVVdnvbQdHGPe6+HxHL1dh5MP8T/aHoP+4UXkkQCc8moS2FZxJvFH2QTSZBcSSdGL7GMpROqs38J+XlJzrhNcB20lrW6D7yMeQa4YEcXwdbD8Er/YaIqODBWYYewKBgQCXg+16RLDArciwwhf0TBWZPor2iYFDdwU5UPu7CKOhU1MLfQhG85gGpXHjB6G8cMUi/ezxh/FEl+sWOZegpkPwL5/BQS9tNYWIaC4kipPF/a5Up4DMYUHVAuuPwNqqXpvgU+rGjCns0wtPRnjrkghLkc3oTSID7o7pzUwIk2whDwKBgAys3+EIfExY82OL5X6uVGjcuKQmTw11oWK8krxRw5iclgjpCXu/ix+BAtOIU634mlgF9/02oYE9k4TLrvSaJDDgsifNyfq1e/fGLmkYT+VuCxWbulVQn4s+AwlPCrYMGWWK6KlL9638fYcOjGjLaZJpXwkXRtyzUYlhKh/r87JpAoGBAIavRp2mi/xrPvgpQQPv0k9L8llfOCHRnjoqC+thrZsNp8eRmJcBmMVnskofEZ2iHQuS71pw/n58EQTLo0ayJbhPjVJL8K3CovXzrfjbmqqoa5xi3bJQTiXdF6rMw1QpD6Uk05E1LVuQ6v/IZFr7kBYlAQWb8z3NhQq+bPU+nyLvAoGAGpBbSM8gPzdWQqkHoos0icu3cj0GhN3MU7+1Eb/rsXyh/lk5wtZTEnHjwhdUOUtwVNjvrv7CzA7unhOoaM6YcE/Zpd4zt8pjqH1Mhds7UHf4Xg+A+J4G6meYnhSwfBpOub02ncsqfBlXE0qhFv6AvcMewWndyLb8EYaUUXTYkG0=
|
appId: 2021005119630093
|
||||||
publicKey: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApHkjwHnoUnZuqbas+ZputyWIfU2WKBFKd+wFwlCZytpQhVA16CGAMCGpgjxUPpqbmOtPy74y0wxmDHB9IaYOVsVmi2SAl1IqfxwUSIllbdvbjBvZFAIQlPa8U/zHJPgdGNHDt/Bwqp5uB0OkcGLB9PYyAXBEKiu6zdTsiZloUrPwgnBRJ0iNHYiWo/oOYD9KfopLA+D1nQjqq8m3ShZe46ecMo6ZCHtQI/HtgL/EGga5KY2zOUi0Wwviu8w79RjjzfdsDkzu5VnBdaSru4awDyiF9nAF+uPgA4ZOdLKkpoEANwuIorDW8tT69Gwh+mYx9sDJMxJf7XOekdPbymomiwIDAQAB
|
# 线上应用私钥
|
||||||
notifyUrl: https://253d7236.r27.cpolar.top/web/pay/notify
|
privateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCQuhRU5iHoabfzJS40A+moMKzb5rmi5XbL59K98CW65Oq/rnzQnj6sCYggIXOLCLKUykZ1XIVa+4V7bGFkMDF0236ncPumnVY/tfCSebLyKl+up1mGeH4mAR6ily7nXAhRnXL+A0015bpCa5FCg2ReN68MEmquB/mHfeLqJfRupwzDWnIWxYSKkFCJ0i47KTFYhM93LHHQ8GrZNNaeiJ6q59MruQI83z0HCxN/DzK4Z2rBWGilwPuYcSEa0STPXYhz8XMXUX/Mlp7dd5zyWeNaxkNRWlhKHvhLVPGvteaEcchs476DIWLCRVXEC1372wMKNrKblzRp7Wi5+l+W14k5AgMBAAECggEAHahkPjmivTPc5FC8NSCQI01GPxH6/Ky1OXfaMd4ifTgn+vvQzBeBlFOnt53jRZyUq/T/l1FMaqacZfyBwLw3hlDslXeLuksHv6qTEBEsYH/ad7oHmIzcnQEhvAPrMrIjakYvqGoYynC3SKEudUjjqoMSthCYF+2+bsuXUpBQlNQLqcJ03U+YhfLswwVVujKvAujoLRqDAWeaa0k0y/1Ua4fr5GJq5M+P8TTBRgZlSK5A7Ee6yxMUncZ9W3lTqZtyG0OQLbz9gkr0c63KPisigaOx9eKlCPWFWUWo+zGvQMVijHDTeoJ3dqNmsPtiIE3rDt8anx4a1R7YK6MQ520hAQKBgQDPFMNl4fRmLSOLNShJm/0mBMoIjPmS3+tPBtCiG4oH9F8vYMJWDA1Im0FdgRa2HlCv6hpiVvvQt824RaUYa7XR6aefXKVEWddHvl3utnghMohjK8o8fTmIxADtU5Q2OlWmPdp1v7yDg8yE5P1GlY+AZ3oggxXOIRVtQrNeL7E3iQKBgQCy6nEaUQUCDDts4o7Pn+N402g3/T9Vz/5JtKmDI01EndK5l/yE8CdgGwdiwN1k3la/Nv8P5kaaX2qVcCGoOIQmMNGOxuNfkKCi+bJKdxmFOI4E3iVYT2H6x27QJwNB6bik1i6b2OWT7ckxeB6xMjefNp1u8Qif+vab60OQZSqoMQKBgESRF3Hwsz/xykcZvtFAuT2RcGQMacbcJcnw87v5ambf33SMkUx0iSF1ZttTFvYOa6ET3tCZBKBDe/Z7+QJxB68NstbtkjtjlAjJW8ji2jwDw20y3q/QtvA2Fih++CBMiHeXG3LJnd3eEiYevE5Wz0ExAhspzFqIUdPvtfyFxiQhAoGBAKgc+iGMN3RxIfVx/FbDGe6SVr8lSrnLMlj3VMBQD26GDVcupKwVLCp1uz7jkiQRdtk9R/UcnwK23WOFdVqnoCRygrXx0/wb3ZTFou2tc2Fmfqu8QML19E67zjfwMHNitYjNaAYwi6ewKvg8sjo1wWXs34k7GquYGNjw+w9Wv/pBAoGAUlVHfZ4RncAiiH/x3EDgqmmVikFpLoM2xXxM16nplrjdBE6IzkpgWb/x2ZI6JCMDyoV2kvF6owW2+QEQ81MrHQMtBRpAvd8nI03gXA5VF3uwp4UjfGpoIAGDBrqQv9DM8vx6C6VJNTT5esZWZSw/+PZ4D19l0/n7gICGx3ugw0Q=
|
||||||
gatewayUrl: https://openapi-sandbox.dl.alipaydev.com/gateway.do
|
# 线上应用公钥证书
|
||||||
|
appCertPath: /opt/cert/pro/appCertPublicKey_2021005119630093.crt
|
||||||
|
# 线上支付宝公钥证书路径
|
||||||
|
alipayCertPath: /opt/cert/pro/alipayCertPublicKey_RSA2.crt
|
||||||
|
# 线上支付宝根证书路径
|
||||||
|
alipayRootCertPath: /opt/cert/pro/alipayRootCert.crt
|
||||||
|
# # 沙箱应用公钥证书
|
||||||
|
# appCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayPublicCert.crt
|
||||||
|
# # 沙箱支付宝公钥证书路径
|
||||||
|
# alipayCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayPublicCert.crt
|
||||||
|
# # 沙箱支付宝根证书路径
|
||||||
|
# alipayRootCertPath: D:\workspace\mochuang\mcwl-ai\mcwl-admin\src\main\resources\cert\dev\alipayRootCert.crt
|
||||||
|
notifyUrl: http://113.45.9.111:8080/ali/pay/notify
|
||||||
|
# 线上支付宝网关
|
||||||
|
gatewayUrl: https://openapi.alipay.com/gateway.do
|
||||||
|
# 绑定回调
|
||||||
|
bindUrl: http://113.45.9.111:8080/ali/pay/callback
|
||||||
|
# 参与方的标识类型,目前支持如下类型: 1、ALIPAY_USER_ID 支付宝的会员ID 2、ALIPAY_LOGON_ID:支付宝登录号,支持邮箱和手机号格式 3、ALIPAY_OPEN_ID:支付宝openid
|
||||||
|
identityType: ALIPAY_OPEN_ID
|
||||||
|
# 授权url
|
||||||
|
oauthUrl: https://openauth.alipay.com/oauth2/publicAppAuthorize.htm?app_id=%s&scope=%s&redirect_uri=%s&state=%s
|
||||||
|
|
||||||
|
huawei:
|
||||||
|
obs:
|
||||||
|
ak: NWXJ93POA9NCDVV1WQYJ
|
||||||
|
sk: 3aBuzYdUgSsxdNnycD2mESnVwtcyjAKPxqewE79N
|
||||||
|
bucketName: mcwl
|
||||||
|
upload:
|
||||||
|
endPoint: obs.cn-south-1.myhuaweicloud.com
|
||||||
|
#用户头像与背景
|
||||||
|
mcwl:
|
||||||
|
encryptUrl: http://113.45.9.111:9090/encryptAndUpload
|
||||||
|
user:
|
||||||
|
avatar: https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/10/7/53/3f5cc1d7-b062-4a22-9f7e-d442bc6dcf42.png
|
||||||
|
backgroundImg: https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/10/8/2/c8387681-8138-4a29-a1c9-4a143da34c5a.png
|
||||||
|
|
|
@ -57,25 +57,15 @@ spring:
|
||||||
servlet:
|
servlet:
|
||||||
multipart:
|
multipart:
|
||||||
# 单个文件大小
|
# 单个文件大小
|
||||||
max-file-size: 10MB
|
max-file-size: 40GB
|
||||||
# 设置总上传的文件大小
|
# 设置总上传的文件大小
|
||||||
max-request-size: 20MB
|
max-request-size: 40GB
|
||||||
# 服务模块
|
# 服务模块
|
||||||
devtools:
|
devtools:
|
||||||
restart:
|
restart:
|
||||||
# 热部署开关
|
# 热部署开关
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
|
||||||
# token配置
|
|
||||||
token:
|
|
||||||
# 令牌自定义标识
|
|
||||||
header: Authorization
|
|
||||||
# 令牌密钥
|
|
||||||
secret: abcdefghijklmnopqrstuvwxyz
|
|
||||||
# 令牌有效期(默认30分钟)
|
|
||||||
expireTime: 1440
|
|
||||||
|
|
||||||
# MyBatis Plus配置
|
# MyBatis Plus配置
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
# 不支持多包, 如有需要可在注解配置 或 提升扫包等级
|
# 不支持多包, 如有需要可在注解配置 或 提升扫包等级
|
||||||
|
@ -94,7 +84,7 @@ mybatis-plus:
|
||||||
# NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射
|
# NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射
|
||||||
autoMappingBehavior: PARTIAL
|
autoMappingBehavior: PARTIAL
|
||||||
# MyBatis 自动映射时未知列或未知属性处理策
|
# MyBatis 自动映射时未知列或未知属性处理策
|
||||||
# NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息
|
# NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息.
|
||||||
autoMappingUnknownColumnBehavior: NONE
|
autoMappingUnknownColumnBehavior: NONE
|
||||||
# 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
|
# 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
|
||||||
# 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
|
# 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||||
|
@ -132,7 +122,7 @@ swagger:
|
||||||
# 是否开启swagger
|
# 是否开启swagger
|
||||||
enabled: true
|
enabled: true
|
||||||
# 请求前缀
|
# 请求前缀
|
||||||
pathMapping: /dev-api
|
pathMapping:
|
||||||
|
|
||||||
# 防止XSS攻击
|
# 防止XSS攻击
|
||||||
xss:
|
xss:
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDszCCApugAwIBAgIQICUCGGcg6L5kXzAfaOSi6zANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE
|
||||||
|
BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv
|
||||||
|
biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1
|
||||||
|
dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjUwMjE4MDIwNDM0WhcNMjYwMjE4MDIwNDM0WjCB
|
||||||
|
hDELMAkGA1UEBhMCQ04xHzAdBgNVBAoMFmRicGxmdTEyOTRAc2FuZGJveC5jb20xDzANBgNVBAsM
|
||||||
|
BkFsaXBheTFDMEEGA1UEAww65pSv5LuY5a6dKOS4reWbvSnnvZHnu5zmioDmnK/mnInpmZDlhazl
|
||||||
|
j7gtMjA4ODcyMTAzMjk3MTE0MzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKR5I8B5
|
||||||
|
6FJ2bqm2rPmabrcliH1NligRSnfsBcJQmcraUIVQNeghgDAhqYI8VD6am5jrT8u+MtMMZgxwfSGm
|
||||||
|
DlbFZotkgJdSKn8cFEiJZW3b24wb2RQCEJT2vFP8xyT4HRjRw7fwcKqebgdDpHBiwfT2MgFwRCor
|
||||||
|
us3U7ImZaFKz8IJwUSdIjR2IlqP6DmA/Sn6KSwPg9Z0I6qvJt0oWXuOnnDKOmQh7UCPx7YC/xBoG
|
||||||
|
uSmNszlItFsL4rvMO/UY4833bA5M7uVZwXWkq7uGsA8ohfZwBfrj4AOGTnSypKaBADcLiKKw1vLU
|
||||||
|
+vRsIfpmMfbAyTMSX+1znpHT28pqJosCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3
|
||||||
|
DQEBCwUAA4IBAQC36KH0fCX8t0y/GHRt83Xfr0uNfWlYTTY6fzqqgxlqhuU8yYbt9WmE2JHxuUmB
|
||||||
|
yznEbhCWXqRxpWRInXwhFaZoO7Qn/XJ3rcSJ1NsL3niR94gLcGyNEWyEN2U/L2bPJIXwZYqttW9G
|
||||||
|
41yONL+27ame+g5PvhjUCEb937zktI+zLdfb5uSyd4aAEPQ7F9Nl4Z2p97NlLBhpfcNq7SGhfLD0
|
||||||
|
85/vYGsbyef/ZrTV7IKHcgprhANE/yDY6/FUxYgCV/l4h2KMusX9Yj8V5W+9ncPo58XpfolyuZJK
|
||||||
|
yuVMv1q1h2AIKudxKcr2hK4/T91i/A7A8v4UD+8a3Q5T3Ad6cYw8
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDszCCApugAwIBAgIQIBkIGbgVxq210KxLJ+YA/TANBgkqhkiG9w0BAQsFADCBhDELMAkGA1UE
|
||||||
|
BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxJTAjBgNVBAsMHENlcnRpZmljYXRpb24gQXV0
|
||||||
|
aG9yaXR5IHRlc3QxNjA0BgNVBAMMLUFudCBGaW5hbmNpYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp
|
||||||
|
dHkgUjEgdGVzdDAeFw0xOTA4MTkxMTE2MDBaFw0yNDA4MDExMTE2MDBaMIGRMQswCQYDVQQGEwJD
|
||||||
|
TjEbMBkGA1UECgwSQW50IEZpbmFuY2lhbCB0ZXN0MSUwIwYDVQQLDBxDZXJ0aWZpY2F0aW9uIEF1
|
||||||
|
dGhvcml0eSB0ZXN0MT4wPAYDVQQDDDVBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y
|
||||||
|
aXR5IENsYXNzIDIgUjEgdGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMh4FKYO
|
||||||
|
ZyRQHD6eFbPKZeSAnrfjfU7xmS9Yoozuu+iuqZlb6Z0SPLUqqTZAFZejOcmr07ln/pwZxluqplxC
|
||||||
|
5+B48End4nclDMlT5HPrDr3W0frs6Xsa2ZNcyil/iKNB5MbGll8LRAxntsKvZZj6vUTMb705gYgm
|
||||||
|
VUMILwi/ZxKTQqBtkT/kQQ5y6nOZsj7XI5rYdz6qqOROrpvS/d7iypdHOMIM9Iz9DlL1mrCykbBi
|
||||||
|
t25y+gTeXmuisHUwqaRpwtCGK4BayCqxRGbNipe6W73EK9lBrrzNtTr9NaysesT/v+l25JHCL9tG
|
||||||
|
wpNr1oWFzk4IHVOg0ORiQ6SUgxZUTYcCAwEAAaMSMBAwDgYDVR0PAQH/BAQDAgTwMA0GCSqGSIb3
|
||||||
|
DQEBCwUAA4IBAQBWThEoIaQoBX2YeRY/I8gu6TYnFXtyuCljANnXnM38ft+ikhE5mMNgKmJYLHvT
|
||||||
|
yWWWgwHoSAWEuml7EGbE/2AK2h3k0MdfiWLzdmpPCRG/RJHk6UB1pMHPilI+c0MVu16OPpKbg5Vf
|
||||||
|
LTv7dsAB40AzKsvyYw88/Ezi1osTXo6QQwda7uefvudirtb8FcQM9R66cJxl3kt1FXbpYwheIm/p
|
||||||
|
j1mq64swCoIYu4NrsUYtn6CV542DTQMI5QdXkn+PzUUly8F6kDp+KpMNd0avfWNL5+O++z+F5Szy
|
||||||
|
1CPta1D7EQ/eYmMP+mOQ35oifWIoFCpN6qQVBS/Hob1J/UUyg7BW
|
||||||
|
-----END CERTIFICATE-----
|
|
@ -0,0 +1,88 @@
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIBszCCAVegAwIBAgIIaeL+wBcKxnswDAYIKoEcz1UBg3UFADAuMQswCQYDVQQG
|
||||||
|
EwJDTjEOMAwGA1UECgwFTlJDQUMxDzANBgNVBAMMBlJPT1RDQTAeFw0xMjA3MTQw
|
||||||
|
MzExNTlaFw00MjA3MDcwMzExNTlaMC4xCzAJBgNVBAYTAkNOMQ4wDAYDVQQKDAVO
|
||||||
|
UkNBQzEPMA0GA1UEAwwGUk9PVENBMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE
|
||||||
|
MPCca6pmgcchsTf2UnBeL9rtp4nw+itk1Kzrmbnqo05lUwkwlWK+4OIrtFdAqnRT
|
||||||
|
V7Q9v1htkv42TsIutzd126NdMFswHwYDVR0jBBgwFoAUTDKxl9kzG8SmBcHG5Yti
|
||||||
|
W/CXdlgwDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFEwysZfZ
|
||||||
|
MxvEpgXBxuWLYlvwl3ZYMAwGCCqBHM9VAYN1BQADSAAwRQIgG1bSLeOXp3oB8H7b
|
||||||
|
53W+CKOPl2PknmWEq/lMhtn25HkCIQDaHDgWxWFtnCrBjH16/W3Ezn7/U/Vjo5xI
|
||||||
|
pDoiVhsLwg==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIF0zCCA7ugAwIBAgIIH8+hjWpIDREwDQYJKoZIhvcNAQELBQAwejELMAkGA1UE
|
||||||
|
BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmlj
|
||||||
|
YXRpb24gQXV0aG9yaXR5MTEwLwYDVQQDDChBbnQgRmluYW5jaWFsIENlcnRpZmlj
|
||||||
|
YXRpb24gQXV0aG9yaXR5IFIxMB4XDTE4MDMyMTEzNDg0MFoXDTM4MDIyODEzNDg0
|
||||||
|
MFowejELMAkGA1UEBhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNV
|
||||||
|
BAsMF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5MTEwLwYDVQQDDChBbnQgRmluYW5j
|
||||||
|
aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFIxMIICIjANBgkqhkiG9w0BAQEF
|
||||||
|
AAOCAg8AMIICCgKCAgEAtytTRcBNuur5h8xuxnlKJetT65cHGemGi8oD+beHFPTk
|
||||||
|
rUTlFt9Xn7fAVGo6QSsPb9uGLpUFGEdGmbsQ2q9cV4P89qkH04VzIPwT7AywJdt2
|
||||||
|
xAvMs+MgHFJzOYfL1QkdOOVO7NwKxH8IvlQgFabWomWk2Ei9WfUyxFjVO1LVh0Bp
|
||||||
|
dRBeWLMkdudx0tl3+21t1apnReFNQ5nfX29xeSxIhesaMHDZFViO/DXDNW2BcTs6
|
||||||
|
vSWKyJ4YIIIzStumD8K1xMsoaZBMDxg4itjWFaKRgNuPiIn4kjDY3kC66Sl/6yTl
|
||||||
|
YUz8AybbEsICZzssdZh7jcNb1VRfk79lgAprm/Ktl+mgrU1gaMGP1OE25JCbqli1
|
||||||
|
Pbw/BpPynyP9+XulE+2mxFwTYhKAwpDIDKuYsFUXuo8t261pCovI1CXFzAQM2w7H
|
||||||
|
DtA2nOXSW6q0jGDJ5+WauH+K8ZSvA6x4sFo4u0KNCx0ROTBpLif6GTngqo3sj+98
|
||||||
|
SZiMNLFMQoQkjkdN5Q5g9N6CFZPVZ6QpO0JcIc7S1le/g9z5iBKnifrKxy0TQjtG
|
||||||
|
PsDwc8ubPnRm/F82RReCoyNyx63indpgFfhN7+KxUIQ9cOwwTvemmor0A+ZQamRe
|
||||||
|
9LMuiEfEaWUDK+6O0Gl8lO571uI5onYdN1VIgOmwFbe+D8TcuzVjIZ/zvHrAGUcC
|
||||||
|
AwEAAaNdMFswCwYDVR0PBAQDAgEGMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFF90
|
||||||
|
tATATwda6uWx2yKjh0GynOEBMB8GA1UdIwQYMBaAFF90tATATwda6uWx2yKjh0Gy
|
||||||
|
nOEBMA0GCSqGSIb3DQEBCwUAA4ICAQCVYaOtqOLIpsrEikE5lb+UARNSFJg6tpkf
|
||||||
|
tJ2U8QF/DejemEHx5IClQu6ajxjtu0Aie4/3UnIXop8nH/Q57l+Wyt9T7N2WPiNq
|
||||||
|
JSlYKYbJpPF8LXbuKYG3BTFTdOVFIeRe2NUyYh/xs6bXGr4WKTXb3qBmzR02FSy3
|
||||||
|
IODQw5Q6zpXj8prYqFHYsOvGCEc1CwJaSaYwRhTkFedJUxiyhyB5GQwoFfExCVHW
|
||||||
|
05ZFCAVYFldCJvUzfzrWubN6wX0DD2dwultgmldOn/W/n8at52mpPNvIdbZb2F41
|
||||||
|
T0YZeoWnCJrYXjq/32oc1cmifIHqySnyMnavi75DxPCdZsCOpSAT4j4lAQRGsfgI
|
||||||
|
kkLPGQieMfNNkMCKh7qjwdXAVtdqhf0RVtFILH3OyEodlk1HYXqX5iE5wlaKzDop
|
||||||
|
PKwf2Q3BErq1xChYGGVS+dEvyXc/2nIBlt7uLWKp4XFjqekKbaGaLJdjYP5b2s7N
|
||||||
|
1dM0MXQ/f8XoXKBkJNzEiM3hfsU6DOREgMc1DIsFKxfuMwX3EkVQM1If8ghb6x5Y
|
||||||
|
jXayv+NLbidOSzk4vl5QwngO/JYFMkoc6i9LNwEaEtR9PhnrdubxmrtM+RjfBm02
|
||||||
|
77q3dSWFESFQ4QxYWew4pHE0DpWbWy/iMIKQ6UZ5RLvB8GEcgt8ON7BBJeMc+Dyi
|
||||||
|
kT9qhqn+lw==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICiDCCAgygAwIBAgIIQX76UsB/30owDAYIKoZIzj0EAwMFADB6MQswCQYDVQQG
|
||||||
|
EwJDTjEWMBQGA1UECgwNQW50IEZpbmFuY2lhbDEgMB4GA1UECwwXQ2VydGlmaWNh
|
||||||
|
dGlvbiBBdXRob3JpdHkxMTAvBgNVBAMMKEFudCBGaW5hbmNpYWwgQ2VydGlmaWNh
|
||||||
|
dGlvbiBBdXRob3JpdHkgRTEwHhcNMTkwNDI4MTYyMDQ0WhcNNDkwNDIwMTYyMDQ0
|
||||||
|
WjB6MQswCQYDVQQGEwJDTjEWMBQGA1UECgwNQW50IEZpbmFuY2lhbDEgMB4GA1UE
|
||||||
|
CwwXQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxMTAvBgNVBAMMKEFudCBGaW5hbmNp
|
||||||
|
YWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRTEwdjAQBgcqhkjOPQIBBgUrgQQA
|
||||||
|
IgNiAASCCRa94QI0vR5Up9Yr9HEupz6hSoyjySYqo7v837KnmjveUIUNiuC9pWAU
|
||||||
|
WP3jwLX3HkzeiNdeg22a0IZPoSUCpasufiLAnfXh6NInLiWBrjLJXDSGaY7vaokt
|
||||||
|
rpZvAdmjXTBbMAsGA1UdDwQEAwIBBjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBRZ
|
||||||
|
4ZTgDpksHL2qcpkFkxD2zVd16TAfBgNVHSMEGDAWgBRZ4ZTgDpksHL2qcpkFkxD2
|
||||||
|
zVd16TAMBggqhkjOPQQDAwUAA2gAMGUCMQD4IoqT2hTUn0jt7oXLdMJ8q4vLp6sg
|
||||||
|
wHfPiOr9gxreb+e6Oidwd2LDnC4OUqCWiF8CMAzwKs4SnDJYcMLf2vpkbuVE4dTH
|
||||||
|
Rglz+HGcTLWsFs4KxLsq7MuU+vJTBUeDJeDjdA==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDxTCCAq2gAwIBAgIUEMdk6dVgOEIS2cCP0Q43P90Ps5YwDQYJKoZIhvcNAQEF
|
||||||
|
BQAwajELMAkGA1UEBhMCQ04xEzARBgNVBAoMCmlUcnVzQ2hpbmExHDAaBgNVBAsM
|
||||||
|
E0NoaW5hIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMMH2lUcnVzQ2hpbmEgQ2xhc3Mg
|
||||||
|
MiBSb290IENBIC0gRzMwHhcNMTMwNDE4MDkzNjU2WhcNMzMwNDE4MDkzNjU2WjBq
|
||||||
|
MQswCQYDVQQGEwJDTjETMBEGA1UECgwKaVRydXNDaGluYTEcMBoGA1UECwwTQ2hp
|
||||||
|
bmEgVHJ1c3QgTmV0d29yazEoMCYGA1UEAwwfaVRydXNDaGluYSBDbGFzcyAyIFJv
|
||||||
|
b3QgQ0EgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOPPShpV
|
||||||
|
nJbMqqCw6Bz1kehnoPst9pkr0V9idOwU2oyS47/HjJXk9Rd5a9xfwkPO88trUpz5
|
||||||
|
4GmmwspDXjVFu9L0eFaRuH3KMha1Ak01citbF7cQLJlS7XI+tpkTGHEY5pt3EsQg
|
||||||
|
wykfZl/A1jrnSkspMS997r2Gim54cwz+mTMgDRhZsKK/lbOeBPpWtcFizjXYCqhw
|
||||||
|
WktvQfZBYi6o4sHCshnOswi4yV1p+LuFcQ2ciYdWvULh1eZhLxHbGXyznYHi0dGN
|
||||||
|
z+I9H8aXxqAQfHVhbdHNzi77hCxFjOy+hHrGsyzjrd2swVQ2iUWP8BfEQqGLqM1g
|
||||||
|
KgWKYfcTGdbPB1MCAwEAAaNjMGEwHQYDVR0OBBYEFG/oAMxTVe7y0+408CTAK8hA
|
||||||
|
uTyRMB8GA1UdIwQYMBaAFG/oAMxTVe7y0+408CTAK8hAuTyRMA8GA1UdEwEB/wQF
|
||||||
|
MAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBLnUTfW7hp
|
||||||
|
emMbuUGCk7RBswzOT83bDM6824EkUnf+X0iKS95SUNGeeSWK2o/3ALJo5hi7GZr3
|
||||||
|
U8eLaWAcYizfO99UXMRBPw5PRR+gXGEronGUugLpxsjuynoLQu8GQAeysSXKbN1I
|
||||||
|
UugDo9u8igJORYA+5ms0s5sCUySqbQ2R5z/GoceyI9LdxIVa1RjVX8pYOj8JFwtn
|
||||||
|
DJN3ftSFvNMYwRuILKuqUYSHc2GPYiHVflDh5nDymCMOQFcFG3WsEuB+EYQPFgIU
|
||||||
|
1DHmdZcz7Llx8UOZXX2JupWCYzK1XhJb+r4hK5ncf/w8qGtYlmyJpxk3hr1TfUJX
|
||||||
|
Yf4Zr0fJsGuv
|
||||||
|
-----END CERTIFICATE-----
|
|
@ -0,0 +1,19 @@
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDmTCCAoGgAwIBAgIQICQEAub4U5TMozibHLcg8zANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE
|
||||||
|
BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv
|
||||||
|
biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1
|
||||||
|
dGhvcml0eSBDbGFzcyAyIFIxIHRlc3QwHhcNMjQwNDAyMDUzMjU2WhcNMjUwNDA3MDUzMjU2WjBr
|
||||||
|
MQswCQYDVQQGEwJDTjEfMB0GA1UECgwWZGJwbGZ1MTI5NEBzYW5kYm94LmNvbTEPMA0GA1UECwwG
|
||||||
|
QWxpcGF5MSowKAYDVQQDDCEyMDg4NzIxMDMyOTcxMTQzLTkwMjEwMDAxMzU2ODI2MTQwggEiMA0G
|
||||||
|
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCQxmQGcaiKjOhayWi+zNTvpp8B5YT8jFFkjLzrD+W+
|
||||||
|
T2Dwf2GfFR4p95zsCJxYeoLWdghMPA6/GMFrLbuVFpaEjuTm4icqA9N8n5d3W0j7gh+wMjZoqyJc
|
||||||
|
lAIeb09ut7rY6mWzilA9kWmZnUG7MOWIU70RVRYrfJectCFw/odM9lG4XIVe13X2h+1ecTQyQzLW
|
||||||
|
mnvKFCfo7dQjE7fIYiWfud1ZGUneNs3u73pNWMB6ThGTTCbs0atcgM3fYOg3q7fTxIu9VcaUCJiJ
|
||||||
|
/kNbL9sVEyOrSyx2f2o6w06zdEaOiQFsuDeS8QPYGMg7pf42wAfqCO6hqxQiQT5vp1hvB0o1AgMB
|
||||||
|
AAGjEjAQMA4GA1UdDwEB/wQEAwIE8DANBgkqhkiG9w0BAQsFAAOCAQEAZmMSaD7s3aervdACl0cN
|
||||||
|
YRcUHMGBA4DwzeLKaF0iqcsQxzJHBQRSGbAeQ9n5l1U5V0Pos92V7eqEJqtC52l6sK5T4YE6zAxf
|
||||||
|
49RKyo00qVFCbcGMHnRy0F/AkEhz+qhan1R3Dm7Ty6UtgAaeF6emD35EIKXziCvqS1nBt+nniYYB
|
||||||
|
0O2UntrJ3lYucuLun7TeYou/kPMTnZItzSmvCmG181e5IpSB3qGwBnIgkmB+Ge0kGIFAoV9+MucT
|
||||||
|
4YOffum8yC0oF7aMtTL9whm5gb+Udj+lBrHYYw8VPNpcvBmRlXEKEJLbWQrGtJi6+URReWqO52UP
|
||||||
|
fGHB0r4r575H4Y1QkA==
|
||||||
|
-----END CERTIFICATE-----
|
|
@ -0,0 +1,43 @@
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDnTCCAoWgAwIBAgIQICUCFPTaqv/ZUGkFjQNMjTANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE
|
||||||
|
BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0
|
||||||
|
aG9yaXR5MTkwNwYDVQQDDDBBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IENs
|
||||||
|
YXNzIDIgUjEwHhcNMjUwMjE0MDkxMDAxWhcNMzAwMjEzMDkxMDAxWjB+MQswCQYDVQQGEwJDTjEZ
|
||||||
|
MBcGA1UECgwQMjA4ODk0Mjk4OTQ4MjU3OTEPMA0GA1UECwwGQWxpcGF5MUMwQQYDVQQDDDrmlK/k
|
||||||
|
u5jlrp0o5Lit5Zu9Kee9kee7nOaKgOacr+aciemZkOWFrOWPuC0yMDg4OTQyOTg5NDgyNTc5MIIB
|
||||||
|
IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwa7R9uTM3VJpWZDWiNSUw23AoIlSZ4Y6lgaA
|
||||||
|
xuhKYmUx8P2yCHJ8xEyASRHUggrYoEvkbuLqHPpNPmJsMaqnbuP4uwfkxO9l/D2bnPRFd2e4eQhX
|
||||||
|
L7YHOLRWgHhMBfkMYMq9A8kJHDa9drVbxvp1zbvxakJvEuJ9TVCvHdpsTGbMxBn5PP7qTQYoQAQj
|
||||||
|
FYF6j6eLmrskFgqYGmDV2dbf/tFLaQZSuhut47pb3glvi7g0ECMy+S3v76pZk5+FP42EkBFFsLH1
|
||||||
|
lTREgO1PTSRAEiZkSGRLtmf3u6EMb42pE6EUF4pHHaACEQ3ZRuYK8Mo00A0FmwAoKil2MxkzAX5Z
|
||||||
|
KQIDAQABoxIwEDAOBgNVHQ8BAf8EBAMCA/gwDQYJKoZIhvcNAQELBQADggEBAGsnIGoHjk4+YUJJ
|
||||||
|
nLMggzUmAuKt1rHcUN+3SfsNmnGqwluy4cm4emxj2qwcTzEEQvrES33difh4Ubtf2XyS1MFLkxhG
|
||||||
|
WonCuEUjZqKgWz66gCG3l0l7HRy2VJaaaVlC49yJMOsuUNtAFjh+Pu5XVb7ff8Adf3YGNeFC4Tde
|
||||||
|
gkBgDO8RbPSfdc7bP0Fq+TPj5nMCu64KzBz4RP5da7Q/mSFI2PCvtEquhq/eeDezfHUAz2ehC/bA
|
||||||
|
dSRHytgzrGktk+BIPtEsoYG9zIHBNwA8JCr9Z5q2eauhYvIE1sJVO151Dph1u4LE1voQQ4qr4t6v
|
||||||
|
gU2IoL6w5LvdWDSQCIrPOa4=
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIE4jCCAsqgAwIBAgIIYsSr5bKAMl8wDQYJKoZIhvcNAQELBQAwejELMAkGA1UEBhMCQ04xFjAU
|
||||||
|
BgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5MTEw
|
||||||
|
LwYDVQQDDChBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFIxMB4XDTE4MDMy
|
||||||
|
MjE0MzQxNVoXDTM3MTEyNjE0MzQxNVowgYIxCzAJBgNVBAYTAkNOMRYwFAYDVQQKDA1BbnQgRmlu
|
||||||
|
YW5jaWFsMSAwHgYDVQQLDBdDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTE5MDcGA1UEAwwwQW50IEZp
|
||||||
|
bmFuY2lhbCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBDbGFzcyAyIFIxMIIBIjANBgkqhkiG9w0B
|
||||||
|
AQEFAAOCAQ8AMIIBCgKCAQEAsLMfYaoRoPRbmDcAfXPCmKf43pWRN5yTXa/KJWO0l+mrgQvs89bA
|
||||||
|
NEvbDUxlkGwycwtwi5DgBuBgVhLliXu+R9CYgr2dXs8D8Hx/gsggDcyGPLmVrDOnL+dyeauheARZ
|
||||||
|
fA3du60fwEwwbGcVIpIxPa/4n3IS/ElxQa6DNgqxh8J9Xwh7qMGl0JK9+bALuxf7B541Gr4p0WEN
|
||||||
|
G8fhgjBV4w4ut9eQLOoa1eddOUSZcy46Z7allwowwgt7b5VFfx/P1iKJ3LzBMgkCK7GZ2kiLrL7R
|
||||||
|
iqV+h482J7hkJD+ardoc6LnrHO/hIZymDxok+VH9fVeUdQa29IZKrIDVj65THQIDAQABo2MwYTAf
|
||||||
|
BgNVHSMEGDAWgBRfdLQEwE8HWurlsdsio4dBspzhATAdBgNVHQ4EFgQUSqHkYINtUSAtDPnS8Xoy
|
||||||
|
oP9p7qEwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADggIB
|
||||||
|
AIQ8TzFy4bVIVb8+WhHKCkKNPcJe2EZuIcqvRoi727lZTJOfYy/JzLtckyZYfEI8J0lasZ29wkTt
|
||||||
|
a1IjSo+a6XdhudU4ONVBrL70U8Kzntplw/6TBNbLFpp7taRALjUgbCOk4EoBMbeCL0GiYYsTS0mw
|
||||||
|
7xdySzmGQku4GTyqutIGPQwKxSj9iSFw1FCZqr4VP4tyXzMUgc52SzagA6i7AyLedd3tbS6lnR5B
|
||||||
|
L+W9Kx9hwT8L7WANAxQzv/jGldeuSLN8bsTxlOYlsdjmIGu/C9OWblPYGpjQQIRyvs4Cc/mNhrh+
|
||||||
|
14EQgwuemIIFDLOgcD+iISoN8CqegelNcJndFw1PDN6LkVoiHz9p7jzsge8RKay/QW6C03KNDpWZ
|
||||||
|
EUCgCUdfHfo8xKeR+LL1cfn24HKJmZt8L/aeRZwZ1jwePXFRVtiXELvgJuM/tJDIFj2KD337iV64
|
||||||
|
fWcKQ/ydDVGqfDZAdcU4hQdsrPWENwPTQPfVPq2NNLMyIH9+WKx9Ed6/WzeZmIy5ZWpX1TtTolo6
|
||||||
|
OJXQFeItMAjHxW/ZSZTok5IS3FuRhExturaInnzjYpx50a6kS34c5+c8hYq7sAtZ/CNLZmBnBCFD
|
||||||
|
aMQqT8xFZJ5uolUaSeXxg7JFY1QsYp5RKvj4SjFwCGKJ2+hPPe9UyyltxOidNtxjaknOCeBHytOr
|
||||||
|
-----END CERTIFICATE-----
|
|
@ -0,0 +1,88 @@
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIBszCCAVegAwIBAgIIaeL+wBcKxnswDAYIKoEcz1UBg3UFADAuMQswCQYDVQQG
|
||||||
|
EwJDTjEOMAwGA1UECgwFTlJDQUMxDzANBgNVBAMMBlJPT1RDQTAeFw0xMjA3MTQw
|
||||||
|
MzExNTlaFw00MjA3MDcwMzExNTlaMC4xCzAJBgNVBAYTAkNOMQ4wDAYDVQQKDAVO
|
||||||
|
UkNBQzEPMA0GA1UEAwwGUk9PVENBMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE
|
||||||
|
MPCca6pmgcchsTf2UnBeL9rtp4nw+itk1Kzrmbnqo05lUwkwlWK+4OIrtFdAqnRT
|
||||||
|
V7Q9v1htkv42TsIutzd126NdMFswHwYDVR0jBBgwFoAUTDKxl9kzG8SmBcHG5Yti
|
||||||
|
W/CXdlgwDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAQYwHQYDVR0OBBYEFEwysZfZ
|
||||||
|
MxvEpgXBxuWLYlvwl3ZYMAwGCCqBHM9VAYN1BQADSAAwRQIgG1bSLeOXp3oB8H7b
|
||||||
|
53W+CKOPl2PknmWEq/lMhtn25HkCIQDaHDgWxWFtnCrBjH16/W3Ezn7/U/Vjo5xI
|
||||||
|
pDoiVhsLwg==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIF0zCCA7ugAwIBAgIIH8+hjWpIDREwDQYJKoZIhvcNAQELBQAwejELMAkGA1UE
|
||||||
|
BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmlj
|
||||||
|
YXRpb24gQXV0aG9yaXR5MTEwLwYDVQQDDChBbnQgRmluYW5jaWFsIENlcnRpZmlj
|
||||||
|
YXRpb24gQXV0aG9yaXR5IFIxMB4XDTE4MDMyMTEzNDg0MFoXDTM4MDIyODEzNDg0
|
||||||
|
MFowejELMAkGA1UEBhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNV
|
||||||
|
BAsMF0NlcnRpZmljYXRpb24gQXV0aG9yaXR5MTEwLwYDVQQDDChBbnQgRmluYW5j
|
||||||
|
aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFIxMIICIjANBgkqhkiG9w0BAQEF
|
||||||
|
AAOCAg8AMIICCgKCAgEAtytTRcBNuur5h8xuxnlKJetT65cHGemGi8oD+beHFPTk
|
||||||
|
rUTlFt9Xn7fAVGo6QSsPb9uGLpUFGEdGmbsQ2q9cV4P89qkH04VzIPwT7AywJdt2
|
||||||
|
xAvMs+MgHFJzOYfL1QkdOOVO7NwKxH8IvlQgFabWomWk2Ei9WfUyxFjVO1LVh0Bp
|
||||||
|
dRBeWLMkdudx0tl3+21t1apnReFNQ5nfX29xeSxIhesaMHDZFViO/DXDNW2BcTs6
|
||||||
|
vSWKyJ4YIIIzStumD8K1xMsoaZBMDxg4itjWFaKRgNuPiIn4kjDY3kC66Sl/6yTl
|
||||||
|
YUz8AybbEsICZzssdZh7jcNb1VRfk79lgAprm/Ktl+mgrU1gaMGP1OE25JCbqli1
|
||||||
|
Pbw/BpPynyP9+XulE+2mxFwTYhKAwpDIDKuYsFUXuo8t261pCovI1CXFzAQM2w7H
|
||||||
|
DtA2nOXSW6q0jGDJ5+WauH+K8ZSvA6x4sFo4u0KNCx0ROTBpLif6GTngqo3sj+98
|
||||||
|
SZiMNLFMQoQkjkdN5Q5g9N6CFZPVZ6QpO0JcIc7S1le/g9z5iBKnifrKxy0TQjtG
|
||||||
|
PsDwc8ubPnRm/F82RReCoyNyx63indpgFfhN7+KxUIQ9cOwwTvemmor0A+ZQamRe
|
||||||
|
9LMuiEfEaWUDK+6O0Gl8lO571uI5onYdN1VIgOmwFbe+D8TcuzVjIZ/zvHrAGUcC
|
||||||
|
AwEAAaNdMFswCwYDVR0PBAQDAgEGMAwGA1UdEwQFMAMBAf8wHQYDVR0OBBYEFF90
|
||||||
|
tATATwda6uWx2yKjh0GynOEBMB8GA1UdIwQYMBaAFF90tATATwda6uWx2yKjh0Gy
|
||||||
|
nOEBMA0GCSqGSIb3DQEBCwUAA4ICAQCVYaOtqOLIpsrEikE5lb+UARNSFJg6tpkf
|
||||||
|
tJ2U8QF/DejemEHx5IClQu6ajxjtu0Aie4/3UnIXop8nH/Q57l+Wyt9T7N2WPiNq
|
||||||
|
JSlYKYbJpPF8LXbuKYG3BTFTdOVFIeRe2NUyYh/xs6bXGr4WKTXb3qBmzR02FSy3
|
||||||
|
IODQw5Q6zpXj8prYqFHYsOvGCEc1CwJaSaYwRhTkFedJUxiyhyB5GQwoFfExCVHW
|
||||||
|
05ZFCAVYFldCJvUzfzrWubN6wX0DD2dwultgmldOn/W/n8at52mpPNvIdbZb2F41
|
||||||
|
T0YZeoWnCJrYXjq/32oc1cmifIHqySnyMnavi75DxPCdZsCOpSAT4j4lAQRGsfgI
|
||||||
|
kkLPGQieMfNNkMCKh7qjwdXAVtdqhf0RVtFILH3OyEodlk1HYXqX5iE5wlaKzDop
|
||||||
|
PKwf2Q3BErq1xChYGGVS+dEvyXc/2nIBlt7uLWKp4XFjqekKbaGaLJdjYP5b2s7N
|
||||||
|
1dM0MXQ/f8XoXKBkJNzEiM3hfsU6DOREgMc1DIsFKxfuMwX3EkVQM1If8ghb6x5Y
|
||||||
|
jXayv+NLbidOSzk4vl5QwngO/JYFMkoc6i9LNwEaEtR9PhnrdubxmrtM+RjfBm02
|
||||||
|
77q3dSWFESFQ4QxYWew4pHE0DpWbWy/iMIKQ6UZ5RLvB8GEcgt8ON7BBJeMc+Dyi
|
||||||
|
kT9qhqn+lw==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIICiDCCAgygAwIBAgIIQX76UsB/30owDAYIKoZIzj0EAwMFADB6MQswCQYDVQQG
|
||||||
|
EwJDTjEWMBQGA1UECgwNQW50IEZpbmFuY2lhbDEgMB4GA1UECwwXQ2VydGlmaWNh
|
||||||
|
dGlvbiBBdXRob3JpdHkxMTAvBgNVBAMMKEFudCBGaW5hbmNpYWwgQ2VydGlmaWNh
|
||||||
|
dGlvbiBBdXRob3JpdHkgRTEwHhcNMTkwNDI4MTYyMDQ0WhcNNDkwNDIwMTYyMDQ0
|
||||||
|
WjB6MQswCQYDVQQGEwJDTjEWMBQGA1UECgwNQW50IEZpbmFuY2lhbDEgMB4GA1UE
|
||||||
|
CwwXQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxMTAvBgNVBAMMKEFudCBGaW5hbmNp
|
||||||
|
YWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRTEwdjAQBgcqhkjOPQIBBgUrgQQA
|
||||||
|
IgNiAASCCRa94QI0vR5Up9Yr9HEupz6hSoyjySYqo7v837KnmjveUIUNiuC9pWAU
|
||||||
|
WP3jwLX3HkzeiNdeg22a0IZPoSUCpasufiLAnfXh6NInLiWBrjLJXDSGaY7vaokt
|
||||||
|
rpZvAdmjXTBbMAsGA1UdDwQEAwIBBjAMBgNVHRMEBTADAQH/MB0GA1UdDgQWBBRZ
|
||||||
|
4ZTgDpksHL2qcpkFkxD2zVd16TAfBgNVHSMEGDAWgBRZ4ZTgDpksHL2qcpkFkxD2
|
||||||
|
zVd16TAMBggqhkjOPQQDAwUAA2gAMGUCMQD4IoqT2hTUn0jt7oXLdMJ8q4vLp6sg
|
||||||
|
wHfPiOr9gxreb+e6Oidwd2LDnC4OUqCWiF8CMAzwKs4SnDJYcMLf2vpkbuVE4dTH
|
||||||
|
Rglz+HGcTLWsFs4KxLsq7MuU+vJTBUeDJeDjdA==
|
||||||
|
-----END CERTIFICATE-----
|
||||||
|
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIDxTCCAq2gAwIBAgIUEMdk6dVgOEIS2cCP0Q43P90Ps5YwDQYJKoZIhvcNAQEF
|
||||||
|
BQAwajELMAkGA1UEBhMCQ04xEzARBgNVBAoMCmlUcnVzQ2hpbmExHDAaBgNVBAsM
|
||||||
|
E0NoaW5hIFRydXN0IE5ldHdvcmsxKDAmBgNVBAMMH2lUcnVzQ2hpbmEgQ2xhc3Mg
|
||||||
|
MiBSb290IENBIC0gRzMwHhcNMTMwNDE4MDkzNjU2WhcNMzMwNDE4MDkzNjU2WjBq
|
||||||
|
MQswCQYDVQQGEwJDTjETMBEGA1UECgwKaVRydXNDaGluYTEcMBoGA1UECwwTQ2hp
|
||||||
|
bmEgVHJ1c3QgTmV0d29yazEoMCYGA1UEAwwfaVRydXNDaGluYSBDbGFzcyAyIFJv
|
||||||
|
b3QgQ0EgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOPPShpV
|
||||||
|
nJbMqqCw6Bz1kehnoPst9pkr0V9idOwU2oyS47/HjJXk9Rd5a9xfwkPO88trUpz5
|
||||||
|
4GmmwspDXjVFu9L0eFaRuH3KMha1Ak01citbF7cQLJlS7XI+tpkTGHEY5pt3EsQg
|
||||||
|
wykfZl/A1jrnSkspMS997r2Gim54cwz+mTMgDRhZsKK/lbOeBPpWtcFizjXYCqhw
|
||||||
|
WktvQfZBYi6o4sHCshnOswi4yV1p+LuFcQ2ciYdWvULh1eZhLxHbGXyznYHi0dGN
|
||||||
|
z+I9H8aXxqAQfHVhbdHNzi77hCxFjOy+hHrGsyzjrd2swVQ2iUWP8BfEQqGLqM1g
|
||||||
|
KgWKYfcTGdbPB1MCAwEAAaNjMGEwHQYDVR0OBBYEFG/oAMxTVe7y0+408CTAK8hA
|
||||||
|
uTyRMB8GA1UdIwQYMBaAFG/oAMxTVe7y0+408CTAK8hAuTyRMA8GA1UdEwEB/wQF
|
||||||
|
MAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBLnUTfW7hp
|
||||||
|
emMbuUGCk7RBswzOT83bDM6824EkUnf+X0iKS95SUNGeeSWK2o/3ALJo5hi7GZr3
|
||||||
|
U8eLaWAcYizfO99UXMRBPw5PRR+gXGEronGUugLpxsjuynoLQu8GQAeysSXKbN1I
|
||||||
|
UugDo9u8igJORYA+5ms0s5sCUySqbQ2R5z/GoceyI9LdxIVa1RjVX8pYOj8JFwtn
|
||||||
|
DJN3ftSFvNMYwRuILKuqUYSHc2GPYiHVflDh5nDymCMOQFcFG3WsEuB+EYQPFgIU
|
||||||
|
1DHmdZcz7Llx8UOZXX2JupWCYzK1XhJb+r4hK5ncf/w8qGtYlmyJpxk3hr1TfUJX
|
||||||
|
Yf4Zr0fJsGuv
|
||||||
|
-----END CERTIFICATE-----
|
|
@ -0,0 +1,23 @@
|
||||||
|
-----BEGIN CERTIFICATE-----
|
||||||
|
MIIEgjCCA2qgAwIBAgIQICUCFE7HTf+7v9yXtoeyLjANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UE
|
||||||
|
BhMCQ04xFjAUBgNVBAoMDUFudCBGaW5hbmNpYWwxIDAeBgNVBAsMF0NlcnRpZmljYXRpb24gQXV0
|
||||||
|
aG9yaXR5MTkwNwYDVQQDDDBBbnQgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IENs
|
||||||
|
YXNzIDEgUjEwHhcNMjUwMjE0MDkxMDAwWhcNMzAwMjEzMDkxMDAwWjBKMQswCQYDVQQGEwJDTjEP
|
||||||
|
MA0GA1UECgwG5Ya35paMMQ8wDQYDVQQLDAZBbGlwYXkxGTAXBgNVBAMMEDIwODg5NDI5ODk0ODI1
|
||||||
|
NzkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCQuhRU5iHoabfzJS40A+moMKzb5rmi
|
||||||
|
5XbL59K98CW65Oq/rnzQnj6sCYggIXOLCLKUykZ1XIVa+4V7bGFkMDF0236ncPumnVY/tfCSebLy
|
||||||
|
Kl+up1mGeH4mAR6ily7nXAhRnXL+A0015bpCa5FCg2ReN68MEmquB/mHfeLqJfRupwzDWnIWxYSK
|
||||||
|
kFCJ0i47KTFYhM93LHHQ8GrZNNaeiJ6q59MruQI83z0HCxN/DzK4Z2rBWGilwPuYcSEa0STPXYhz
|
||||||
|
8XMXUX/Mlp7dd5zyWeNaxkNRWlhKHvhLVPGvteaEcchs476DIWLCRVXEC1372wMKNrKblzRp7Wi5
|
||||||
|
+l+W14k5AgMBAAGjggEpMIIBJTAfBgNVHSMEGDAWgBRxB+IEYRbk5fJl6zEPyeD0PJrVkTAdBgNV
|
||||||
|
HQ4EFgQUqfZMfgxmG9w6m5lXQSdoiPe0vagwQAYDVR0gBDkwNzA1BgdggRwBbgEBMCowKAYIKwYB
|
||||||
|
BQUHAgEWHGh0dHA6Ly9jYS5hbGlwYXkuY29tL2Nwcy5wZGYwDgYDVR0PAQH/BAQDAgbAMC8GA1Ud
|
||||||
|
HwQoMCYwJKAioCCGHmh0dHA6Ly9jYS5hbGlwYXkuY29tL2NybDk4LmNybDBgBggrBgEFBQcBAQRU
|
||||||
|
MFIwKAYIKwYBBQUHMAKGHGh0dHA6Ly9jYS5hbGlwYXkuY29tL2NhNi5jZXIwJgYIKwYBBQUHMAGG
|
||||||
|
Gmh0dHA6Ly9jYS5hbGlwYXkuY29tOjgzNDAvMA0GCSqGSIb3DQEBCwUAA4IBAQAmDOoavQGthLtz
|
||||||
|
WuW1e0g0K2WChYevFcnWWNILTJ0EsB01Ka0FagOo1T3ErGns+G9lbSj9g6DQZ5DVqLCGnl2ZRvBN
|
||||||
|
KwSnA/7Frllf7CebBaW5WWJ3VKWxP929izvywlPeQdmRELNGK4H/IZoW+nCDYjUgXLOLMgBnqmLY
|
||||||
|
wgug/g3iQ+yFSFuvSNE2J84FwPycWweDJ8zrj4aM9S/bjjWoE/Lfe/a86BIYV19A72Ozc/aTGnxP
|
||||||
|
W/D5txDrhO2wWeCzXd7TuBN1Hze5IX/hYeDqM3rjHuQcGcbFJOchqqR5fUEC/SU9MZ4j/KWND83l
|
||||||
|
Y28GbRbP5jxhgckHIKjfKh6b
|
||||||
|
-----END CERTIFICATE-----
|
|
@ -0,0 +1,6 @@
|
||||||
|
# 发件人(必须正确,否则发送失败)
|
||||||
|
from = 2119157836@qq.com
|
||||||
|
# 密码(注意,某些邮箱需要为SMTP服务单独设置授权码)
|
||||||
|
pass = wetaiadftmidejab
|
||||||
|
# 使用SSL安全连接
|
||||||
|
sslEnable = true
|
|
@ -0,0 +1,57 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<!-- 添加视口元标签,确保在移动设备上正确缩放 -->
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
|
||||||
|
<title>绑定失败</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
background-color: #f4f4f9;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
/* 防止在小屏幕上出现水平滚动条 */
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
text-align: center;
|
||||||
|
width: 90%;
|
||||||
|
max-width: 400px;
|
||||||
|
/* 为小屏幕设备减少内边距 */
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
color: #ff6b6b;
|
||||||
|
font-size: clamp(20px, 5vw, 24px);
|
||||||
|
/* 使用 clamp 函数动态调整字体大小 */
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
color: #555;
|
||||||
|
font-size: clamp(14px, 4vw, 16px);
|
||||||
|
/* 使用 clamp 函数动态调整字体大小 */
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
/* 当屏幕宽度小于 320px 时进一步调整样式 */
|
||||||
|
@media (max-width: 320px) {
|
||||||
|
.container {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<h1>支付宝账号绑定失败!</h1>
|
||||||
|
<p>请检查您的网络或稍后重试。</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,53 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<!-- 确保页面在移动设备上正确缩放 -->
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>绑定成功</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
background-color: #f4f4f9;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
height: 100vh;
|
||||||
|
margin: 0;
|
||||||
|
overflow-x: hidden;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
background-color: #ffffff;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
text-align: center;
|
||||||
|
width: 90%;
|
||||||
|
max-width: 400px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
color: #28a745;
|
||||||
|
font-size: clamp(20px, 5vw, 24px);
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
p {
|
||||||
|
color: #555;
|
||||||
|
font-size: clamp(14px, 4vw, 16px);
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
/* 小屏幕适配 */
|
||||||
|
@media (max-width: 320px) {
|
||||||
|
.container {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<h1>支付宝账号绑定成功!</h1>
|
||||||
|
<p>您可以返回用户中心继续操作。</p>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -1,26 +0,0 @@
|
||||||
package com.mcwl.memberCenter;
|
|
||||||
|
|
||||||
import com.mcwl.McWlApplication;
|
|
||||||
import com.mcwl.common.core.domain.AjaxResult;
|
|
||||||
import com.mcwl.memberCenter.consumer.EmptyPointsRemindConsumer;
|
|
||||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
|
||||||
import com.mcwl.memberCenter.service.MemberService;
|
|
||||||
import com.mcwl.memberCenter.task.UserMemberTask;
|
|
||||||
import com.mcwl.web.controller.memberCenter.MemberController;
|
|
||||||
import com.mcwl.web.controller.memberCenter.MemberLevelController;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
|
||||||
|
|
||||||
|
|
||||||
public class MemberCenterTest {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void aaa() {
|
|
||||||
String s = "1,2,3,4,";
|
|
||||||
System.out.println(s.split(","));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -30,6 +30,12 @@
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.sun.mail</groupId>
|
||||||
|
<artifactId>javax.mail</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Jackson -->
|
<!-- Jackson -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
@ -369,7 +375,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
<artifactId>httpclient</artifactId>
|
<artifactId>httpclient</artifactId>
|
||||||
<version>4.2.1</version>
|
<version>4.5.13</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
@ -382,7 +388,46 @@
|
||||||
<version>2.6</version>
|
<version>2.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Spring Test Dependency for MockMultipartFile -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-test</artifactId>
|
||||||
|
<version>5.3.25</version> <!-- 请确保与 spring-web 使用相同的主要版本 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- obs文件存储 3.23.5 3.19.7 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.huaweicloud</groupId>
|
||||||
|
<artifactId>esdk-obs-java</artifactId>
|
||||||
|
<version>3.19.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- WebSocket支持 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- <!– 微信公众号扫码登录需要 –>-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.github.binarywang</groupId>-->
|
||||||
|
<!-- <artifactId>weixin-java-mp</artifactId>-->
|
||||||
|
<!-- <version>4.4.0</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- <!– 微信公众号扫码登录需要 –>-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.github.binarywang</groupId>-->
|
||||||
|
<!-- <artifactId>wx-java-mp-spring-boot-starter</artifactId>-->
|
||||||
|
<!-- <version>4.4.0</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>huawei-public</id>
|
||||||
|
<url>https://repo.huaweicloud.com/repository/maven/</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -22,7 +22,7 @@ public @interface RepeatSubmit
|
||||||
/**
|
/**
|
||||||
* 间隔时间(ms),小于此时间视为重复提交
|
* 间隔时间(ms),小于此时间视为重复提交
|
||||||
*/
|
*/
|
||||||
public int interval() default 5000;
|
public int interval() default 1000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提示消息
|
* 提示消息
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.mcwl.common.config;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class JacksonConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public ObjectMapper objectMapper() {
|
||||||
|
return new ObjectMapper()
|
||||||
|
.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
|
||||||
|
.setSerializationInclusion(JsonInclude.Include.NON_NULL);
|
||||||
|
}
|
||||||
|
}
|
|
@ -52,5 +52,19 @@ public class CacheConstants
|
||||||
*/
|
*/
|
||||||
public static final String WE_CHAT = "we_chat";
|
public static final String WE_CHAT = "we_chat";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验身份证次数
|
||||||
|
*/
|
||||||
public static final String ID_CARD_COUNT = "id_card_count:";
|
public static final String ID_CARD_COUNT = "id_card_count:";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型
|
||||||
|
*/
|
||||||
|
public static final String MODEL = "model";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作流
|
||||||
|
*/
|
||||||
|
public static final String WORK_FLOW = "work_flow";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
package com.mcwl.common.constant;
|
package com.mcwl.common.constant;
|
||||||
|
|
||||||
import java.util.Locale;
|
|
||||||
import io.jsonwebtoken.Claims;
|
import io.jsonwebtoken.Claims;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用常量信息
|
* 通用常量信息
|
||||||
*
|
*
|
||||||
|
@ -10,6 +11,17 @@ import io.jsonwebtoken.Claims;
|
||||||
*/
|
*/
|
||||||
public class Constants
|
public class Constants
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作流
|
||||||
|
*/
|
||||||
|
public static final String WORKFLOW = "workflow";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型
|
||||||
|
*/
|
||||||
|
public static final String MODEL = "model";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UTF-8 字符集
|
* UTF-8 字符集
|
||||||
*/
|
*/
|
||||||
|
@ -163,7 +175,12 @@ public class Constants
|
||||||
/**
|
/**
|
||||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||||
*/
|
*/
|
||||||
public static final String[] JOB_WHITELIST_STR = { "com.mcwl.quartz.task" };
|
public static final String[] JOB_WHITELIST_STR = {
|
||||||
|
"com.mcwl.quartz.task",
|
||||||
|
"com.mcwl.memberCenter.task",
|
||||||
|
"com.mcwl.pay.task",
|
||||||
|
"com.mcwl.communityCenter.task"
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务违规的字符
|
* 定时任务违规的字符
|
||||||
|
|
|
@ -56,4 +56,24 @@ public class DictConstants {
|
||||||
*/
|
*/
|
||||||
public static final String IMAGE_LABEL = "image_label";
|
public static final String IMAGE_LABEL = "image_label";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工作流内容类别
|
||||||
|
*/
|
||||||
|
public static final String WORK_FLOW_TYPE_CHILD = "work_flow_type_child";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型类型
|
||||||
|
*/
|
||||||
|
public static final String MODEL_TYPE = "model_type";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 举报类型
|
||||||
|
*/
|
||||||
|
public static final String REPORT_LABEL = "report_label";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 版本-基础模型
|
||||||
|
*/
|
||||||
|
public static final String MODE_VERSION_TYPE = "mode_version_type";
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,4 +91,9 @@ public class HttpStatus
|
||||||
* 系统警告消息
|
* 系统警告消息
|
||||||
*/
|
*/
|
||||||
public static final int WARN = 601;
|
public static final int WARN = 601;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一展示错误信息
|
||||||
|
*/
|
||||||
|
public static final int SHOW_ERROR_MSG = 12202;
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,26 @@ public class QueueConstants {
|
||||||
// 会员账单队列
|
// 会员账单队列
|
||||||
public static final String MEMBER_BILLING_QUEUE = "memberBillingQueue";
|
public static final String MEMBER_BILLING_QUEUE = "memberBillingQueue";
|
||||||
|
|
||||||
|
// 模型点赞队列
|
||||||
|
public static final String MODEL_LIKE_QUEUE = "modelLikeQueue";
|
||||||
|
|
||||||
|
// 模型评论点赞队列
|
||||||
|
public static final String MODEL_COMMENT_LIKE_QUEUE = "modelCommentLikeQueue";
|
||||||
|
|
||||||
|
// 图片点赞队列
|
||||||
|
public static final String IMAGE_LIKE_QUEUE = "imageLikeQueue";
|
||||||
|
|
||||||
|
// 图片评论点赞队列
|
||||||
|
public static final String IMAGE_COMMENT_LIKE_QUEUE = "imageCommentLikeQueue";
|
||||||
|
|
||||||
|
// 工作流点赞队列
|
||||||
|
public static final String WORK_FLOW_LIKE_QUEUE = "workFlowLikeQueue";
|
||||||
|
|
||||||
|
// 工作流评论点赞队列
|
||||||
|
public static final String WORK_FLOW_COMMENT_LIKE_QUEUE = "workFlowCommentLikeQueue";
|
||||||
|
|
||||||
|
// 系统消息队列
|
||||||
|
public static final String SYS_MSG_QUEUE = "sysMsgQueue";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,16 @@
|
||||||
package com.mcwl.common.core.domain;
|
package com.mcwl.common.core.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import lombok.Builder;
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Entity基类
|
* Entity基类
|
||||||
|
@ -33,7 +32,7 @@ public class BaseEntity implements Serializable
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
||||||
/** 创建时间 */
|
/** 创建时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
@TableField(fill = FieldFill.INSERT)
|
@TableField(fill = FieldFill.INSERT)
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
@ -42,7 +41,7 @@ public class BaseEntity implements Serializable
|
||||||
private String updateBy;
|
private String updateBy;
|
||||||
|
|
||||||
/** 更新时间 */
|
/** 更新时间 */
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
@TableField(fill = FieldFill.UPDATE)
|
@TableField(fill = FieldFill.UPDATE)
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,15 @@ package com.mcwl.common.core.domain;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import com.mcwl.common.constant.HttpStatus;
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 响应信息主体
|
* 响应信息主体
|
||||||
*
|
*
|
||||||
* @author mcwl
|
* @author mcwl
|
||||||
*/
|
*/
|
||||||
|
@ApiModel(value = "响应结果")
|
||||||
public class R<T> implements Serializable
|
public class R<T> implements Serializable
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ -18,10 +21,13 @@ public class R<T> implements Serializable
|
||||||
/** 失败 */
|
/** 失败 */
|
||||||
public static final int FAIL = HttpStatus.ERROR;
|
public static final int FAIL = HttpStatus.ERROR;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态码")
|
||||||
private int code;
|
private int code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "提示信息")
|
||||||
private String msg;
|
private String msg;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "数据对象")
|
||||||
private T data;
|
private T data;
|
||||||
|
|
||||||
public static <T> R<T> ok()
|
public static <T> R<T> ok()
|
||||||
|
|
|
@ -53,6 +53,10 @@ public class SysDictData extends BaseEntity
|
||||||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父级ID标志
|
||||||
|
*/
|
||||||
|
@Excel(name = "父级ID标志")
|
||||||
private Integer partId;
|
private Integer partId;
|
||||||
|
|
||||||
public Integer getPartId() {
|
public Integer getPartId() {
|
||||||
|
|
|
@ -115,12 +115,44 @@ public class SysUser extends BaseEntity
|
||||||
*/
|
*/
|
||||||
private Double freePoints;
|
private Double freePoints;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 钱包-金币
|
||||||
|
*/
|
||||||
|
private Double wallet;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否关注
|
||||||
|
*/
|
||||||
|
private Boolean isAttention;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 背景地址
|
||||||
|
*/
|
||||||
|
private String backgroundImg;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邀请码
|
||||||
|
*/
|
||||||
|
private String invitationCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邀请人名字
|
||||||
|
*/
|
||||||
|
private String invitationName;
|
||||||
|
|
||||||
public SysUser()
|
public SysUser()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getBackgroundImg() {
|
||||||
|
return backgroundImg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBackgroundImg(String backgroundImg) {
|
||||||
|
this.backgroundImg = backgroundImg;
|
||||||
|
}
|
||||||
|
|
||||||
public SysUser(Long userId)
|
public SysUser(Long userId)
|
||||||
{
|
{
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
|
@ -168,6 +200,7 @@ public class SysUser extends BaseEntity
|
||||||
this.nickName = nickName;
|
this.nickName = nickName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Xss(message = "用户账号不能包含脚本字符")
|
@Xss(message = "用户账号不能包含脚本字符")
|
||||||
@NotBlank(message = "用户账号不能为空")
|
@NotBlank(message = "用户账号不能为空")
|
||||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||||
|
@ -193,6 +226,14 @@ public class SysUser extends BaseEntity
|
||||||
this.email = email;
|
this.email = email;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getInviterUserId() {
|
||||||
|
return inviterUserId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInviterUserId(Long inviterUserId) {
|
||||||
|
this.inviterUserId = inviterUserId;
|
||||||
|
}
|
||||||
|
|
||||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||||
public String getPhonenumber()
|
public String getPhonenumber()
|
||||||
{
|
{
|
||||||
|
@ -348,13 +389,7 @@ public class SysUser extends BaseEntity
|
||||||
this.brief = brief;
|
this.brief = brief;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getInviterUserId() {
|
|
||||||
return inviterUserId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInviterUserId(Long inviterUserId) {
|
|
||||||
this.inviterUserId = inviterUserId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Double getFreePoints() {
|
public Double getFreePoints() {
|
||||||
return freePoints;
|
return freePoints;
|
||||||
|
@ -364,6 +399,30 @@ public class SysUser extends BaseEntity
|
||||||
this.freePoints = freePoints;
|
this.freePoints = freePoints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Double getWallet() {
|
||||||
|
return wallet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWallet(Double wallet) {
|
||||||
|
this.wallet = wallet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getAttention() {
|
||||||
|
return isAttention;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAttention(Boolean attention) {
|
||||||
|
isAttention = attention;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getInvitationCode() {
|
||||||
|
return invitationCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInvitationCode(String invitationCode) {
|
||||||
|
this.invitationCode = invitationCode;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "SysUser{" +
|
return "SysUser{" +
|
||||||
|
@ -390,6 +449,19 @@ public class SysUser extends BaseEntity
|
||||||
", idCard='" + idCard + '\'' +
|
", idCard='" + idCard + '\'' +
|
||||||
", inviterUserId=" + inviterUserId +
|
", inviterUserId=" + inviterUserId +
|
||||||
", freePoints=" + freePoints +
|
", freePoints=" + freePoints +
|
||||||
|
", wallet=" + wallet +
|
||||||
|
", isAttention=" + isAttention +
|
||||||
|
", backgroundImg='" + backgroundImg + '\'' +
|
||||||
|
", invitationCode='" + invitationCode + '\'' +
|
||||||
|
", invitationName='" + invitationName + '\'' +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getInvitationName() {
|
||||||
|
return invitationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInvitationName(String invitationName) {
|
||||||
|
this.invitationName = invitationName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ public class PageDomain
|
||||||
private String orderByColumn;
|
private String orderByColumn;
|
||||||
|
|
||||||
/** 排序的方向desc或者asc */
|
/** 排序的方向desc或者asc */
|
||||||
@ApiModelProperty(value = "排序的方向desc或者asc", example = "asc")
|
@ApiModelProperty(hidden = true)
|
||||||
private String isAsc = "asc";
|
private String isAsc = "asc";
|
||||||
|
|
||||||
/** 分页参数合理化 */
|
/** 分页参数合理化 */
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
package com.mcwl.common.domain;
|
package com.mcwl.common.domain;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ApiModel(description = "id集合")
|
||||||
public class IdsParam {
|
public class IdsParam {
|
||||||
|
@ApiModelProperty(value = "id集合")
|
||||||
private List<Long> ids;
|
private List<Long> ids;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.mcwl.common.enums;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author:ChenYan
|
||||||
|
* @Project:McWl
|
||||||
|
* @Package:com.mcwl.pay.domain
|
||||||
|
* @Filename:PaymentStatus
|
||||||
|
* @Description TODO
|
||||||
|
* @Date:2025/1/3 17:24
|
||||||
|
*/
|
||||||
|
|
||||||
|
public enum PaymentStatus {
|
||||||
|
|
||||||
|
PENDING("待支付"),
|
||||||
|
COMPLETED("已支付"),
|
||||||
|
FAILED("支付失败"),
|
||||||
|
REFUNDED("已退款");
|
||||||
|
|
||||||
|
private final String description;
|
||||||
|
|
||||||
|
PaymentStatus(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return name() + "(" + description + ")";
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,7 +12,9 @@ public enum ResultCode {
|
||||||
|
|
||||||
SUCCESS(200),//成功
|
SUCCESS(200),//成功
|
||||||
|
|
||||||
FAIL(400),//失败
|
FAIL(400),//
|
||||||
|
|
||||||
|
FAIL_MSG(12202),//失败
|
||||||
|
|
||||||
FAIL_SIGN_IN(401),//登录失败
|
FAIL_SIGN_IN(401),//登录失败
|
||||||
|
|
||||||
|
|
|
@ -20,14 +20,27 @@ public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void insertFill(MetaObject metaObject) {
|
public void insertFill(MetaObject metaObject) {
|
||||||
this.strictInsertFill(metaObject, "createBy", String.class, SecurityUtils.getUsername());
|
try {
|
||||||
|
this.strictInsertFill(metaObject, "createBy", String.class, SecurityUtils.getLoginUser().getUser().getNickName());
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.strictInsertFill(metaObject, "createBy", String.class, "");
|
||||||
|
}
|
||||||
|
|
||||||
this.strictInsertFill(metaObject, "createTime", Date.class, new Date());
|
this.strictInsertFill(metaObject, "createTime", Date.class, new Date());
|
||||||
|
try {
|
||||||
this.strictInsertFill(metaObject, "tenantId", Long.class, SecurityUtils.getUserId());
|
this.strictInsertFill(metaObject, "tenantId", Long.class, SecurityUtils.getUserId());
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.strictInsertFill(metaObject, "tenantId", Long.class, -1L);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateFill(MetaObject metaObject) {
|
public void updateFill(MetaObject metaObject) {
|
||||||
this.setFieldValByName("updateBy", SecurityUtils.getUsername(), metaObject);
|
try {
|
||||||
|
this.setFieldValByName("updateBy", SecurityUtils.getLoginUser().getUser().getNickName(), metaObject);
|
||||||
|
} catch (Exception e) {
|
||||||
|
this.setFieldValByName("updateBy", "", metaObject);
|
||||||
|
}
|
||||||
this.setFieldValByName("updateTime", new Date(), metaObject);
|
this.setFieldValByName("updateTime", new Date(), metaObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,53 +0,0 @@
|
||||||
///*
|
|
||||||
// * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
|
||||||
// *
|
|
||||||
// * https://www.mall4j.com/
|
|
||||||
// *
|
|
||||||
// * 未经允许,不可做商业用途!
|
|
||||||
// *
|
|
||||||
// * 版权所有,侵权必究!
|
|
||||||
// */
|
|
||||||
//package com.mcwl.common.i18n;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
|
||||||
//import org.springframework.context.i18n.LocaleContextHolder;
|
|
||||||
//import org.springframework.core.annotation.Order;
|
|
||||||
//import org.springframework.stereotype.Component;
|
|
||||||
//
|
|
||||||
//import javax.servlet.*;
|
|
||||||
//import javax.servlet.http.HttpServletRequest;
|
|
||||||
//import javax.servlet.http.HttpServletResponse;
|
|
||||||
//import java.io.IOException;
|
|
||||||
//import java.util.Locale;
|
|
||||||
//import java.util.Objects;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * RequestContextFilter 会传入默认的Locale,优先级(-105) 要比RequestContextFilter优先级高
|
|
||||||
// * @author LGH
|
|
||||||
// */
|
|
||||||
//@Slf4j
|
|
||||||
//@Component
|
|
||||||
//@Order(-104)
|
|
||||||
//public class YamiLocaleChangeFilter implements Filter {
|
|
||||||
//
|
|
||||||
// public static String ZH_CN = "zh_CN";
|
|
||||||
// public static String ZH_CN_L = "zh_cn";
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
|
|
||||||
// HttpServletRequest request = (HttpServletRequest) servletRequest;
|
|
||||||
// HttpServletResponse response = (HttpServletResponse) servletResponse;
|
|
||||||
//
|
|
||||||
// String newLocale = request.getHeader("locale");
|
|
||||||
// if(Objects.equals(newLocale,ZH_CN)||Objects.equals(newLocale,ZH_CN_L)){
|
|
||||||
// newLocale = "zh";
|
|
||||||
// }
|
|
||||||
// if (newLocale != null) {
|
|
||||||
// String lowerLocale = newLocale.toLowerCase();
|
|
||||||
// LocaleContextHolder.setLocale(new Locale(lowerLocale));
|
|
||||||
// }
|
|
||||||
// filterChain.doFilter(request, response);
|
|
||||||
// }
|
|
||||||
//}
|
|
|
@ -1,58 +0,0 @@
|
||||||
///*
|
|
||||||
// * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
|
|
||||||
// *
|
|
||||||
// * https://www.mall4j.com/
|
|
||||||
// *
|
|
||||||
// * 未经允许,不可做商业用途!
|
|
||||||
// *
|
|
||||||
// * 版权所有,侵权必究!
|
|
||||||
// */
|
|
||||||
//package com.mcwl.common.i18n;
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//import lombok.extern.slf4j.Slf4j;
|
|
||||||
//import org.springframework.stereotype.Component;
|
|
||||||
//import org.springframework.web.servlet.LocaleResolver;
|
|
||||||
//import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
|
|
||||||
//import org.springframework.web.servlet.support.RequestContextUtils;
|
|
||||||
//
|
|
||||||
//import javax.servlet.http.HttpServletRequest;
|
|
||||||
//import javax.servlet.http.HttpServletResponse;
|
|
||||||
//
|
|
||||||
///**
|
|
||||||
// * @author LGH
|
|
||||||
// */
|
|
||||||
//@Component("localeChangeInterceptor")
|
|
||||||
//@Slf4j
|
|
||||||
//public class YamiLocaleChangeInterceptor extends LocaleChangeInterceptor {
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) {
|
|
||||||
//
|
|
||||||
// String newLocale = request.getHeader(getParamName());
|
|
||||||
// if (newLocale != null) {
|
|
||||||
// LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request);
|
|
||||||
// if (localeResolver == null) {
|
|
||||||
// throw new IllegalStateException(
|
|
||||||
// "No LocaleResolver found: not in a DispatcherServlet request?");
|
|
||||||
// }
|
|
||||||
// try {
|
|
||||||
// localeResolver.setLocale(request, response, parseLocaleValue(newLocale));
|
|
||||||
// }
|
|
||||||
// catch (IllegalArgumentException ex) {
|
|
||||||
// if (isIgnoreInvalidLocale()) {
|
|
||||||
// if (logger.isDebugEnabled()) {
|
|
||||||
// logger.debug("Ignoring invalid locale value [" + newLocale + "]: " + ex.getMessage());
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// throw ex;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // Proceed in any case.
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
|
@ -1,23 +1,26 @@
|
||||||
package com.mcwl.common.utils;
|
package com.mcwl.common.utils;
|
||||||
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import org.springframework.security.core.Authentication;
|
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
||||||
import org.springframework.util.PatternMatchUtils;
|
|
||||||
import com.mcwl.common.constant.Constants;
|
import com.mcwl.common.constant.Constants;
|
||||||
import com.mcwl.common.constant.HttpStatus;
|
import com.mcwl.common.constant.HttpStatus;
|
||||||
import com.mcwl.common.core.domain.entity.SysRole;
|
import com.mcwl.common.core.domain.entity.SysRole;
|
||||||
import com.mcwl.common.core.domain.model.LoginUser;
|
import com.mcwl.common.core.domain.model.LoginUser;
|
||||||
import com.mcwl.common.exception.ServiceException;
|
import com.mcwl.common.exception.ServiceException;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
|
import org.springframework.util.PatternMatchUtils;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 安全服务工具类
|
* 安全服务工具类
|
||||||
*
|
*
|
||||||
* @author mcwl
|
* @author mcwl
|
||||||
*/
|
*/
|
||||||
|
@Slf4j
|
||||||
public class SecurityUtils
|
public class SecurityUtils
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -36,6 +39,19 @@ public class SecurityUtils
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Long getUserIdMax(){
|
||||||
|
|
||||||
|
Long userId;
|
||||||
|
try {
|
||||||
|
userId = SecurityUtils.getUserId();
|
||||||
|
}catch (Exception e){
|
||||||
|
userId = 0L;
|
||||||
|
}
|
||||||
|
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取部门ID
|
* 获取部门ID
|
||||||
**/
|
**/
|
||||||
|
|
|
@ -21,9 +21,9 @@ import java.net.URLEncoder;
|
||||||
public class BaiduCensor {
|
public class BaiduCensor {
|
||||||
|
|
||||||
//设置APPID/AK/SK
|
//设置APPID/AK/SK
|
||||||
public static final String APP_ID = "6273132";
|
public static final String APP_ID = "117094023";
|
||||||
public static final String API_KEY = "8cxN3yyAbQeKGhS0cHAVzlNN";
|
public static final String API_KEY = "bAfO5WLsaMoGTgznvYTIoxwA";
|
||||||
public static final String SECRET_KEY = "hubX4QXVGJbV9ccEVGv4Ifd2w80B71nD";
|
public static final String SECRET_KEY = "BU6PmWntW44IMRfotl3ySF6rTHLleVtT";
|
||||||
|
|
||||||
//图像审核
|
//图像审核
|
||||||
public static String ImageCnesor(String filePath) {
|
public static String ImageCnesor(String filePath) {
|
||||||
|
@ -113,14 +113,9 @@ public class BaiduCensor {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String s = BaiduCensor.TextCensor("我草你妈的");
|
String s = ImageCnesor("https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/MARCH/4/11/53/009ddedc-3102-4ec2-82d2-e69399ba51fa.jpg");
|
||||||
|
System.out.println(s);
|
||||||
String s1 = BaiduCensor.ImageCnesor("https://ybl2112.oss-cn-beijing.aliyuncs.com/2025/JANUARY/2/19/4/877e449c-3c0d-4630-a304-91ec110499f2.png");
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,26 +1,29 @@
|
||||||
package com.mcwl.common.utils.http;
|
package com.mcwl.common.utils.http;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import java.io.IOException;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import java.io.InputStream;
|
import com.mcwl.common.constant.Constants;
|
||||||
import java.io.InputStreamReader;
|
import com.mcwl.common.utils.StringUtils;
|
||||||
import java.io.PrintWriter;
|
import org.apache.http.HttpEntity;
|
||||||
|
import org.apache.http.client.methods.CloseableHttpResponse;
|
||||||
|
import org.apache.http.client.methods.HttpPost;
|
||||||
|
import org.apache.http.entity.StringEntity;
|
||||||
|
import org.apache.http.impl.client.CloseableHttpClient;
|
||||||
|
import org.apache.http.impl.client.HttpClients;
|
||||||
|
import org.apache.http.util.EntityUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.net.ssl.*;
|
||||||
|
import java.io.*;
|
||||||
import java.net.ConnectException;
|
import java.net.ConnectException;
|
||||||
import java.net.SocketTimeoutException;
|
import java.net.SocketTimeoutException;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.net.URLConnection;
|
import java.net.URLConnection;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.cert.X509Certificate;
|
import java.security.cert.X509Certificate;
|
||||||
import javax.net.ssl.HostnameVerifier;
|
import java.util.HashMap;
|
||||||
import javax.net.ssl.HttpsURLConnection;
|
import java.util.Map;
|
||||||
import javax.net.ssl.SSLContext;
|
|
||||||
import javax.net.ssl.SSLSession;
|
|
||||||
import javax.net.ssl.TrustManager;
|
|
||||||
import javax.net.ssl.X509TrustManager;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import com.mcwl.common.constant.Constants;
|
|
||||||
import com.mcwl.common.utils.StringUtils;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用http发送方法
|
* 通用http发送方法
|
||||||
|
@ -189,6 +192,65 @@ public class HttpUtils
|
||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String pythonPost(String url, HashMap<String,String> map){
|
||||||
|
|
||||||
|
//转换JSOn格式
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
String jsonPayload = "";
|
||||||
|
try {
|
||||||
|
jsonPayload = objectMapper.writeValueAsString(map);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
String s = HttpUtils.sendPost(url, jsonPayload);
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送 POST 请求
|
||||||
|
* @param requestUrl 请求地址
|
||||||
|
* @param params 请求参数
|
||||||
|
* @return 响应字符串
|
||||||
|
*/
|
||||||
|
public static String sendPost(String requestUrl, Map<String, String> params) {
|
||||||
|
// 创建 HttpClient 实例
|
||||||
|
try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
|
||||||
|
// 创建 HttpPost 实例
|
||||||
|
HttpPost httpPost = new HttpPost(requestUrl);
|
||||||
|
|
||||||
|
// 设置请求头
|
||||||
|
httpPost.setHeader("Content-Type", "application/json");
|
||||||
|
|
||||||
|
// 构建请求体
|
||||||
|
StringBuilder postData = new StringBuilder();
|
||||||
|
for (Map.Entry<String, String> param : params.entrySet()) {
|
||||||
|
if (postData.length() != 0) postData.append('&');
|
||||||
|
postData.append(java.net.URLEncoder.encode(param.getKey(), StandardCharsets.UTF_8.toString()));
|
||||||
|
postData.append('=');
|
||||||
|
postData.append(java.net.URLEncoder.encode(String.valueOf(param.getValue()), StandardCharsets.UTF_8.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置请求实体
|
||||||
|
StringEntity entity = new StringEntity(postData.toString(), StandardCharsets.UTF_8);
|
||||||
|
httpPost.setEntity(entity);
|
||||||
|
|
||||||
|
// 执行请求并获取响应
|
||||||
|
try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
|
||||||
|
HttpEntity responseEntity = response.getEntity();
|
||||||
|
if (responseEntity != null) {
|
||||||
|
return EntityUtils.toString(responseEntity, StandardCharsets.UTF_8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static String sendSSLPost(String url, String param)
|
public static String sendSSLPost(String url, String param)
|
||||||
{
|
{
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.mcwl.common.utils.obs;
|
||||||
|
|
||||||
|
import com.obs.services.ObsClient;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import javax.annotation.PreDestroy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* obs配置类
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/2/18
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class ObsConfig {
|
||||||
|
@Value("${huawei.obs.ak}")
|
||||||
|
private String ak;
|
||||||
|
@Value("${huawei.obs.sk}")
|
||||||
|
private String sk;
|
||||||
|
@Value("${huawei.obs.upload.endPoint}")
|
||||||
|
private String endPoint;
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public ObsClient getObsClient() {
|
||||||
|
ObsClient obsClient = new ObsClient(ak, sk, endPoint);
|
||||||
|
return obsClient;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,106 @@
|
||||||
|
package com.mcwl.common.utils.obs;
|
||||||
|
|
||||||
|
import com.obs.services.ObsClient;
|
||||||
|
import com.obs.services.model.ObsObject;
|
||||||
|
import com.obs.services.model.PutObjectResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.PreDestroy;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 华为云obs上传文件工具类
|
||||||
|
*
|
||||||
|
* @author DaiZibo
|
||||||
|
* @date 2025/2/18
|
||||||
|
* @apiNote
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class ObsUtils {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ObsClient obsClient;
|
||||||
|
|
||||||
|
@Value("${huawei.obs.bucketName}")
|
||||||
|
private String bucketName;
|
||||||
|
|
||||||
|
//上传文件,multipartFile就是你要的文件,
|
||||||
|
//objectKey就是文件名,如果桶中有文件夹的话,如往test文件上传test.txt文件,那么objectKey就是test/test.txt
|
||||||
|
public Map<String,String> uploadFile(MultipartFile multipartFile){
|
||||||
|
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
|
||||||
|
try {
|
||||||
|
InputStream inputStream = multipartFile.getInputStream();
|
||||||
|
String uuid = UUID.randomUUID().toString();
|
||||||
|
String ossDefaultPath = getOssDefaultPath(multipartFile.getOriginalFilename(),uuid);
|
||||||
|
PutObjectResult putObjectResult = obsClient.putObject(bucketName, ossDefaultPath, inputStream);
|
||||||
|
inputStream.close();
|
||||||
|
map.put("path",putObjectResult.getObjectUrl());
|
||||||
|
map.put("objectKey",putObjectResult.getObjectKey());
|
||||||
|
map.put("size",multipartFile.getSize()+"");
|
||||||
|
map.put("fileName",multipartFile.getOriginalFilename());
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteFile(String objectKey) throws Exception {
|
||||||
|
obsClient.deleteObject(bucketName, objectKey);
|
||||||
|
obsClient.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOssDefaultPath(String name,String uuid) {
|
||||||
|
LocalDateTime now = LocalDateTime.now();
|
||||||
|
String url =
|
||||||
|
now.getYear() + "/" +
|
||||||
|
now.getMonthValue() + "/" +
|
||||||
|
now.getDayOfMonth() + "/"
|
||||||
|
+ uuid + "/"
|
||||||
|
+ name;
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void download(String name) throws IOException {
|
||||||
|
|
||||||
|
ObsObject obsObject = obsClient.getObject(bucketName, name);
|
||||||
|
InputStream content = obsObject.getObjectContent();
|
||||||
|
if (content != null) {
|
||||||
|
BufferedReader reader = new BufferedReader(new InputStreamReader(content));
|
||||||
|
while (true) {
|
||||||
|
String line = reader.readLine();
|
||||||
|
if (line == null){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
System.out.println("\n" + line);
|
||||||
|
}
|
||||||
|
reader.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PreDestroy
|
||||||
|
public void cleanup() {
|
||||||
|
if (obsClient != null) {
|
||||||
|
try {
|
||||||
|
obsClient.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -31,6 +31,26 @@
|
||||||
<groupId>com.mcwl</groupId>
|
<groupId>com.mcwl</groupId>
|
||||||
<artifactId>mcwl-system</artifactId>
|
<artifactId>mcwl-system</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.alibaba/dashscope-sdk-java -->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.alibaba</groupId>-->
|
||||||
|
<!-- <artifactId>dashscope-sdk-java</artifactId>-->
|
||||||
|
<!-- <version>2.18.3</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>com.alibaba.cloud.ai</groupId>-->
|
||||||
|
<!-- <artifactId>spring-ai-alibaba-starter</artifactId>-->
|
||||||
|
<!-- <version>1.0.0-M5.1</version>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
<!-- <dependency>-->
|
||||||
|
<!-- <groupId>io.projectreactor.netty</groupId>-->
|
||||||
|
<!-- <artifactId>reactor-netty-http</artifactId>-->
|
||||||
|
<!-- <version>1.1.6</version> <!– 使用与你的 Spring Boot 版本兼容的版本 –>-->
|
||||||
|
<!-- </dependency>-->
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
//package com.mcwl.communityCenter.config;
|
||||||
|
//
|
||||||
|
//import com.mcwl.communityCenter.webSocket.ChatWebSocket;
|
||||||
|
//import com.mcwl.communityCenter.webSocket.HumanWebSocket;
|
||||||
|
//import org.springframework.context.annotation.Bean;
|
||||||
|
//import org.springframework.context.annotation.Configuration;
|
||||||
|
//import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||||
|
//import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
|
||||||
|
//import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
|
||||||
|
//
|
||||||
|
//@Configuration
|
||||||
|
//@EnableWebSocket
|
||||||
|
//public class WebSocketConfig implements WebSocketConfigurer {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
|
||||||
|
// registry.addHandler(chatWebSocket(), "/chat")
|
||||||
|
// .addHandler(humanWebSocket(), "/chat/human")
|
||||||
|
// .setAllowedOrigins("*");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Bean
|
||||||
|
// public ChatWebSocket chatWebSocket() {
|
||||||
|
// return new ChatWebSocket();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Bean
|
||||||
|
// public HumanWebSocket humanWebSocket() {
|
||||||
|
// return new HumanWebSocket();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue