Compare commits
No commits in common. "master" and "feature/knowledge-Planet" have entirely different histories.
master
...
feature/kn
|
@ -1,24 +0,0 @@
|
|||
# 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"]
|
|
@ -89,12 +89,6 @@
|
|||
<artifactId>mcwl-myInvitation</artifactId>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.mcwl</groupId>
|
||||
<artifactId>mcwl-communityCenter</artifactId>
|
||||
<version>3.8.8</version>
|
||||
</dependency>
|
||||
<!-- 公共模块-->
|
||||
<dependency>
|
||||
<groupId>com.mcwl</groupId>
|
||||
|
@ -134,51 +128,6 @@
|
|||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>4.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-green</artifactId>
|
||||
<version>3.6.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.fastjson2</groupId>
|
||||
<artifactId>fastjson2</artifactId>
|
||||
<version>2.0.9</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.aliyun.oss</groupId>-->
|
||||
<!-- <artifactId>aliyun-sdk-oss</artifactId>-->
|
||||
<!-- <version>2.8.3</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.10</version>
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.aliyun/imageaudit20191230 -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>imageaudit20191230</artifactId>
|
||||
<version>2.0.6</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.mcwl;
|
||||
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.mcwl.pay.config.AliConfig;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
import org.springframework.amqp.support.converter.MessageConverter;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
|
@ -15,7 +17,6 @@ import org.springframework.context.annotation.Bean;
|
|||
*
|
||||
* @author mcwl
|
||||
*/
|
||||
@EnableConfigurationProperties
|
||||
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
|
||||
public class McWlApplication
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.aliyun.oss.OSS;
|
|||
import com.aliyun.oss.OSSClientBuilder;
|
||||
import com.aliyun.oss.model.GetObjectRequest;
|
||||
import com.aliyun.oss.model.PutObjectRequest;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.*;
|
||||
|
@ -13,17 +14,15 @@ import java.util.UUID;
|
|||
/**
|
||||
* Oss服务调用
|
||||
*/
|
||||
@Log4j2
|
||||
public class OssUtil {
|
||||
|
||||
/**
|
||||
* Endpoint 存储对象概述 阿里云主账号AccessKey,accessKeySecret拥有所有API的访问权限 访问路径前缀 存储对象概述
|
||||
*/
|
||||
private static String endPoint = "oss-cn-beijing.aliyuncs.com";
|
||||
|
||||
private static String accessKeyId = "LTAI5tSHZZ8wHJRP8X4r9TXT";
|
||||
|
||||
private static String accessKeySecret = "F82IVNx0IGJ3AnP6gSIfcyql1HCXIH";
|
||||
|
||||
private static String accessPre = "https://ybl2112.oss-cn-beijing.aliyuncs.com/";
|
||||
|
||||
/**
|
||||
|
@ -39,6 +38,7 @@ public class OssUtil {
|
|||
endPoint,
|
||||
accessKeyId,
|
||||
accessKeySecret);
|
||||
log.info("oss服务连接成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -146,7 +146,7 @@ public class OssUtil {
|
|||
}
|
||||
|
||||
public static String getOssFilePath(String filePath){
|
||||
String fileSuf = filePath.substring(filePath.lastIndexOf(".") + 1);
|
||||
String fileSuf = filePath.substring(filePath.indexOf(".") + 1);
|
||||
return getOssDefaultPath() + UUID.randomUUID().toString() + "." + fileSuf;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
//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);
|
||||
// }
|
||||
//
|
||||
//
|
||||
//
|
||||
//}
|
|
@ -1,43 +0,0 @@
|
|||
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,138 +0,0 @@
|
|||
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.CommunityService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
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("community")
|
||||
@RequiredArgsConstructor
|
||||
public class CommunityController {
|
||||
|
||||
private final CommunityService communityService;
|
||||
|
||||
|
||||
/**
|
||||
* 社区列表
|
||||
*
|
||||
* @return 社区列表
|
||||
*/
|
||||
@ApiOperation(value = "社区列表")
|
||||
@PostMapping("list")
|
||||
public TableDataInfo getCommunityList(@RequestBody @Valid CommunityListPageRes communityListPageRes) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加社区
|
||||
*/
|
||||
@ApiOperation(value = "添加社区")
|
||||
@PostMapping("addCommunity")
|
||||
public R<Object> addCommunity(@RequestBody @Valid AddCommunityRes addCommunityRes) {
|
||||
communityService.addCommunity(addCommunityRes);
|
||||
return R.ok("社区添加成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 加入社区
|
||||
*/
|
||||
@ApiOperation(value = "加入社区")
|
||||
@PostMapping("join")
|
||||
public R<Object> joinCommunity(@RequestBody @Valid JoinCommunityRes joinCommunityRes) {
|
||||
|
||||
return communityService.joinCommunity(joinCommunityRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出社区
|
||||
*/
|
||||
@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);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
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();
|
||||
}
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
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,70 +0,0 @@
|
|||
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.R;
|
||||
import com.mcwl.common.utils.StringUtils;
|
||||
import com.mcwl.communityCenter.domain.Community;
|
||||
import com.mcwl.communityCenter.service.InviteService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 邀请
|
||||
*/
|
||||
@Api(tags = "社区邀请")
|
||||
@RestController
|
||||
@RequestMapping("invite")
|
||||
@RequiredArgsConstructor
|
||||
@Valid
|
||||
public class InviteController {
|
||||
|
||||
private final InviteService inviteService;
|
||||
|
||||
/**
|
||||
* 邀请码链接
|
||||
*/
|
||||
@ApiOperation(value = "邀请码链接")
|
||||
@GetMapping("inviteCode")
|
||||
public R<String> inviteCode(@NotNull(message = "社区不能为空")
|
||||
@ApiParam(value = "社区", required = true)
|
||||
Long communityId) {
|
||||
// 获取邀请码链接
|
||||
String inviteCode = inviteService.getInviteCode(communityId);
|
||||
if (StringUtils.isBlank(inviteCode)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取邀请码失败");
|
||||
}
|
||||
return R.ok(inviteCode);
|
||||
}
|
||||
|
||||
/**
|
||||
* 接受邀请
|
||||
*/
|
||||
@ApiOperation(value = "接受邀请")
|
||||
@GetMapping("acceptInvite")
|
||||
@Valid
|
||||
public R<Object> acceptInvite(@NotNull(message = "社区不能为空")
|
||||
@ApiParam(value = "社区", required = true)
|
||||
Long communityId,
|
||||
@NotBlank(message = "邀请码不能为空")
|
||||
@ApiParam(value = "邀请码", required = true)
|
||||
String inviteCode) {
|
||||
|
||||
return inviteService.acceptInvite(communityId, inviteCode);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,106 +0,0 @@
|
|||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
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,117 +0,0 @@
|
|||
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.R;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.communityCenter.domain.dto.*;
|
||||
import com.mcwl.communityCenter.domain.vo.PublishVo;
|
||||
import com.mcwl.communityCenter.service.PublishService;
|
||||
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("publish")
|
||||
@RequiredArgsConstructor
|
||||
public class PublishController {
|
||||
|
||||
private final PublishService publishService;
|
||||
|
||||
/**
|
||||
* 获取发布详情
|
||||
*/
|
||||
@ApiOperation(value = "获取发布详情")
|
||||
@PostMapping("detail")
|
||||
public R<PublishVo> getPublishDetail(@RequestBody @Valid PublishDetailRes publishDetailRes) {
|
||||
|
||||
PublishVo publishVo = publishService.getDetail(publishDetailRes);
|
||||
if (Objects.isNull(publishVo)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "获取详情失败");
|
||||
}
|
||||
return R.ok(publishVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*/
|
||||
@ApiOperation(value = "发布")
|
||||
@PostMapping("publish")
|
||||
public R<Object> publish(@RequestBody @Valid PublishRes publishRes) {
|
||||
return publishService.publish(publishRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取发布列表
|
||||
*/
|
||||
@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 = "删除")
|
||||
@GetMapping("remove")
|
||||
public R<Object> deletePublish(@NotNull(message = "id不能为空") @ApiParam(value = "id") @Valid Long 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();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
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();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
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,126 +0,0 @@
|
|||
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.R;
|
||||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
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.QuestionReplyRes;
|
||||
import com.mcwl.communityCenter.domain.dto.QuestionRes;
|
||||
import com.mcwl.communityCenter.domain.vo.QuestionVo;
|
||||
import com.mcwl.communityCenter.service.QuestionService;
|
||||
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 javax.validation.constraints.NotNull;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 提问
|
||||
*/
|
||||
@Api(tags = "社区提问")
|
||||
@RestController
|
||||
@RequestMapping("question")
|
||||
@RequiredArgsConstructor
|
||||
public class QuestionController {
|
||||
|
||||
|
||||
private final QuestionService questionService;
|
||||
|
||||
private final ISysUserService sysUserService;
|
||||
|
||||
/**
|
||||
* 提问
|
||||
*/
|
||||
@PostMapping("addQuestion")
|
||||
@ApiOperation(value = "提问")
|
||||
public R<Object> addQuestion(@RequestBody @Valid QuestionRes questionRes) {
|
||||
|
||||
// 提问类型
|
||||
Integer type = questionRes.getType();
|
||||
|
||||
// 付费金额
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取提问列表
|
||||
*/
|
||||
@PostMapping("list")
|
||||
@ApiOperation(value = "获取提问列表")
|
||||
public TableDataInfo list(@RequestBody @Valid QuestionPageRes questionPageRes) {
|
||||
|
||||
return questionService.list(questionPageRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取提问图片列表
|
||||
*/
|
||||
@PostMapping("listImage")
|
||||
@ApiOperation(value = "获取提问图片列表")
|
||||
public TableDataInfo listImage(@RequestBody @Valid QuestionPageRes questionPageRes) {
|
||||
|
||||
return questionService.listImage(questionPageRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取问题详情
|
||||
*/
|
||||
@PostMapping("detail")
|
||||
@ApiOperation(value = "获取问题详情")
|
||||
public R<QuestionVo> getQuestionDetail(@RequestBody @Valid QuestionDetailRes questionDetailRes) {
|
||||
QuestionVo questionVo = questionService.getDetail(questionDetailRes);
|
||||
if (Objects.isNull(questionVo)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取详情失败");
|
||||
}
|
||||
return R.ok(questionVo);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 回复
|
||||
// */
|
||||
// @PostMapping("reply")
|
||||
// @ApiOperation(value = "回复")
|
||||
// public AjaxResult reply(@RequestBody @Valid QuestionReplyRes questionReplyRes) {
|
||||
//
|
||||
// return questionService.reply(questionReplyRes);
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
}
|
|
@ -1,94 +0,0 @@
|
|||
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();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,69 +0,0 @@
|
|||
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();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,84 +0,0 @@
|
|||
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,42 +1,31 @@
|
|||
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.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.*;
|
||||
import com.mcwl.memberCenter.domain.vo.MemberConsumeVO;
|
||||
import com.mcwl.memberCenter.domain.vo.MemberVo;
|
||||
import com.mcwl.memberCenter.domain.vo.RechargeRecordVO;
|
||||
import com.mcwl.memberCenter.enums.PromotionEnum;
|
||||
import com.mcwl.memberCenter.service.*;
|
||||
import com.mcwl.memberCenter.domain.MemberConsume;
|
||||
import com.mcwl.memberCenter.domain.Member;
|
||||
import com.mcwl.memberCenter.domain.MemberLevel;
|
||||
import com.mcwl.memberCenter.service.MemberBenefitService;
|
||||
import com.mcwl.memberCenter.domain.dto.RechargePointsDto;
|
||||
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.memberCenter.domain.vo.PointsVO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jboss.marshalling.SimpleDataInput;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
/***
|
||||
* 会员中心
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("member")
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "会员中心")
|
||||
public class MemberController {
|
||||
|
||||
private final MemberService memberService;
|
||||
|
@ -49,8 +38,6 @@ public class MemberController {
|
|||
|
||||
private final MemberLevelService memberLevelService;
|
||||
|
||||
private final MemberPromotionService memberPromotionService;
|
||||
|
||||
/**
|
||||
* 创建用户会员
|
||||
*
|
||||
|
@ -58,7 +45,7 @@ public class MemberController {
|
|||
* @return 用户会员
|
||||
*/
|
||||
@PostMapping("createMember")
|
||||
public R<Member> createMemberCenter(@RequestBody @Valid UserMemberDto userMemberDto) {
|
||||
public AjaxResult createMemberCenter(@RequestBody @Valid UserMemberDto userMemberDto) {
|
||||
Long userId = userMemberDto.getUserId();
|
||||
Long memberLevelId = userMemberDto.getMemberLevelId();
|
||||
String paymentMethod = userMemberDto.getPaymentMethod();
|
||||
|
@ -66,54 +53,49 @@ public class MemberController {
|
|||
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
if (!Optional.ofNullable(sysUser).isPresent()) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "用户不存在");
|
||||
return AjaxResult.warn("用户不存在");
|
||||
}
|
||||
|
||||
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
||||
if (!Optional.ofNullable(memberLevel).isPresent()) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "会员等级不存在");
|
||||
return AjaxResult.warn("会员等级不存在");
|
||||
}
|
||||
|
||||
Member member = memberService.createUserMember(userId, memberLevelId, paymentMethod, promotionId);
|
||||
if (!Optional.ofNullable(member).isPresent()) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "创建会员失败");
|
||||
return AjaxResult.warn("创建会员失败");
|
||||
}
|
||||
|
||||
return R.ok(member);
|
||||
return AjaxResult.success(member);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户有效会员的会员
|
||||
*/
|
||||
@ApiOperation(value = "获取用户有效会员的会员")
|
||||
@GetMapping("getValidMemberById")
|
||||
public R<List<MemberVo>> getUseUserMember(@Valid @NotNull(message = "用户id不能为空") Long userId) {
|
||||
|
||||
return R.ok(memberService.getValidMemberById(userId));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取积分消费记录
|
||||
* 获取积分余额和历史记录
|
||||
*
|
||||
* @return 获取积分消费记录
|
||||
* @return 积分余额和历史记录
|
||||
*/
|
||||
@PostMapping("getConsumePoints")
|
||||
@ApiOperation(value = "获取积分消费记录")
|
||||
public TableDataInfo getConsumePoints(@Valid @RequestBody PageDomain pageDomain) {
|
||||
@GetMapping("getPoints")
|
||||
public AjaxResult getPoints() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
||||
return memberConsumeService.getConsumePoints(pageDomain);
|
||||
Member member = memberService.getUseUserMemberByUserId(userId);
|
||||
if (!Optional.ofNullable(member).isPresent()) {
|
||||
return AjaxResult.warn("用户未开通会员");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取积分充值记录
|
||||
*/
|
||||
@PostMapping("getRechargePoints")
|
||||
@ApiOperation(value = "获取积分充值记录")
|
||||
public TableDataInfo getRechargePoints(@Valid @RequestBody PageDomain pageDomain) {
|
||||
PointsVO pointsVO = new PointsVO();
|
||||
|
||||
return memberService.getRechargePoints(pageDomain);
|
||||
// 会员消费记录
|
||||
List<MemberConsume> memberConsumeList = memberConsumeService
|
||||
.lambdaQuery()
|
||||
.eq(MemberConsume::getUserId, userId)
|
||||
.list();
|
||||
|
||||
pointsVO.setPoints(member.getPoints());
|
||||
pointsVO.setMemberConsumeList(memberConsumeList);
|
||||
|
||||
return AjaxResult.success(pointsVO);
|
||||
}
|
||||
|
||||
|
||||
|
@ -121,24 +103,25 @@ public class MemberController {
|
|||
* 会员积分充值
|
||||
*/
|
||||
@PostMapping("rechargePoints")
|
||||
@ApiOperation(value = "会员积分充值")
|
||||
public R<Object> rechargePoints(@RequestBody @Valid RechargePointsDto rechargePointsDto) {
|
||||
public AjaxResult rechargePoints(@RequestBody @Valid RechargePointsDto rechargePointsDto) {
|
||||
Long userId = rechargePointsDto.getUserId();
|
||||
Double amount = rechargePointsDto.getAmount();
|
||||
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
if (!Optional.ofNullable(sysUser).isPresent()) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "用户不存在");
|
||||
return AjaxResult.warn("用户不存在");
|
||||
}
|
||||
|
||||
Member member = memberService.rechargePoints(userId, amount * 100);
|
||||
|
||||
// 返回充值积分
|
||||
if (!Optional.ofNullable(member).isPresent()) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "充值积分失败");
|
||||
return AjaxResult.warn("充值积分失败");
|
||||
}
|
||||
|
||||
return R.ok();
|
||||
rechargePointsDto.setPoints(member.getPoints());
|
||||
|
||||
return AjaxResult.success(rechargePointsDto);
|
||||
}
|
||||
|
||||
|
||||
|
@ -146,15 +129,14 @@ public class MemberController {
|
|||
* 消费积分
|
||||
*/
|
||||
@GetMapping("consumePoints/{consumePoints}")
|
||||
@ApiOperation(value = "消费积分")
|
||||
public R<Object> consumePoints(@PathVariable Double consumePoints) {
|
||||
public AjaxResult consumePoints(@PathVariable Double consumePoints) {
|
||||
|
||||
if (consumePoints == null || consumePoints <= 0) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG, "消费积分不能为空或小于0");
|
||||
return AjaxResult.warn("消费积分不能为空或小于0");
|
||||
}
|
||||
|
||||
memberService.consumePoints(consumePoints);
|
||||
return R.ok();
|
||||
return AjaxResult.success();
|
||||
|
||||
}
|
||||
|
||||
|
@ -163,48 +145,12 @@ public class MemberController {
|
|||
* 根据会员等级和活动计算支付金额
|
||||
*/
|
||||
@GetMapping("calculatePayment")
|
||||
@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, "未参与活动或已过期");
|
||||
}
|
||||
|
||||
public AjaxResult calculatePayment(@NotNull(message = "请选择会员") Long memberLevelId, @RequestParam(required = false) Long promotionId) {
|
||||
MemberLevel memberLevel = memberLevelService.getById(memberLevelId);
|
||||
Double unitPrice = memberLevel.getUnitPrice();
|
||||
unitPrice = memberService.calculatePayment(unitPrice, promotionId);
|
||||
return R.ok(unitPrice);
|
||||
return AjaxResult.success(unitPrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否是会员
|
||||
*/
|
||||
@GetMapping("isMember")
|
||||
@ApiOperation(value = "是否是会员")
|
||||
public R<Map<String, String>> isMember() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
Member member = memberService.getUseUserMemberByUserId(userId);
|
||||
if (Optional.ofNullable(member).isPresent()) {
|
||||
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);
|
||||
}
|
||||
map.put("result", "0");
|
||||
|
||||
return R.ok(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,109 +1,63 @@
|
|||
package com.mcwl.web.controller.memberCenter;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.memberCenter.domain.MemberBenefit;
|
||||
import com.mcwl.memberCenter.domain.MemberLevel;
|
||||
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.MemberBenefitService;
|
||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import com.mcwl.memberCenter.domain.vo.MemberBenefitVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
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.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/***
|
||||
* 会员等级
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("memberLevel")
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "会员中心")
|
||||
public class MemberLevelController {
|
||||
|
||||
private final MemberLevelService memberLevelService;
|
||||
|
||||
|
||||
/**
|
||||
* 添加会员等级
|
||||
*/
|
||||
// @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();
|
||||
}
|
||||
private final MemberBenefitService memberBenefitService;
|
||||
|
||||
/**
|
||||
* 获取会员等级列表
|
||||
*
|
||||
* @return 会员等级列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:memberLevel:list')")
|
||||
@GetMapping("list")
|
||||
@ApiOperation(value = "获取会员等级列表")
|
||||
public R<List<MemberLevelVo>> list() {
|
||||
public AjaxResult list() {
|
||||
|
||||
List<MemberLevel> memberLevelList = memberLevelService.list();
|
||||
|
||||
return AjaxResult.success(memberLevelList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取会员等级及权益列表
|
||||
*/
|
||||
@GetMapping("getMemberBenefitList")
|
||||
public AjaxResult getMemberBenefitList() {
|
||||
|
||||
List<MemberBenefitVO> memberBenefitVOList = new ArrayList<>();
|
||||
|
||||
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);
|
||||
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 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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改会员等级
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:memberLevel:edit')")
|
||||
@PostMapping("updateMemberLevel")
|
||||
@ApiOperation(value = "修改会员等级")
|
||||
public R<Object> update(@RequestBody @Valid EditMemberLevelDto editMemberLevelDto) {
|
||||
memberLevelService.updateById(BeanUtil.copyProperties(editMemberLevelDto, MemberLevel.class));
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除会员等级
|
||||
*/
|
||||
// @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();
|
||||
return AjaxResult.success(memberBenefitVOList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,11 +2,7 @@ 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.R;
|
||||
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.MemberPromotion;
|
||||
|
@ -18,15 +14,10 @@ import com.mcwl.memberCenter.enums.PromotionEnum;
|
|||
import com.mcwl.memberCenter.service.MemberPromotionService;
|
||||
import com.mcwl.memberCenter.service.MemberService;
|
||||
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 org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
@ -38,26 +29,25 @@ import java.util.Optional;
|
|||
@RestController
|
||||
@RequestMapping("promotion")
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "会员中心")
|
||||
public class PromotionController {
|
||||
|
||||
private final PromotionService promotionService;
|
||||
|
||||
private final MemberPromotionService memberPromotionService;
|
||||
|
||||
private final MemberService memberService;
|
||||
|
||||
|
||||
/**
|
||||
* 创建活动
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('system:promotion:add')")
|
||||
@PostMapping("createPromotion")
|
||||
@ApiOperation(value = "创建活动")
|
||||
public R<Object> createPromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
||||
public AjaxResult createPromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
||||
|
||||
Date startTime = promotionDto.getStartTime();
|
||||
Date endTime = promotionDto.getEndTime();
|
||||
if (startTime.after(endTime)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"活动开始时间不能大于结束时间");
|
||||
return AjaxResult.warn("活动开始时间不能大于结束时间");
|
||||
}
|
||||
Promotion promotion = new Promotion();
|
||||
|
||||
|
@ -65,64 +55,80 @@ public class PromotionController {
|
|||
|
||||
promotionService.save(promotion);
|
||||
|
||||
return R.ok();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 活动列表
|
||||
*/
|
||||
@PostMapping("promotionList")
|
||||
@ApiOperation(value = "活动列表")
|
||||
public TableDataInfo getPromotionList(@Valid @RequestBody PageDomain pageDomain) {
|
||||
|
||||
return promotionService.getPromotionList(pageDomain);
|
||||
@GetMapping("promotionList")
|
||||
public AjaxResult promotionList() {
|
||||
List<Promotion> promotionList = promotionService.lambdaQuery()
|
||||
.gt(Promotion::getEndTime, new Date())
|
||||
.list();
|
||||
return AjaxResult.success(promotionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户参与的活动
|
||||
*/
|
||||
@PostMapping("myPromotionList")
|
||||
@ApiOperation(value = "获取当前用户参与的活动")
|
||||
public TableDataInfo myPromotionList(@Valid @RequestBody PageDomain pageDomain) {
|
||||
|
||||
return promotionService.getMyPromotionList(pageDomain);
|
||||
@GetMapping("myPromotionList")
|
||||
public AjaxResult myPromotionList() {
|
||||
// 获取当前用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
List<MemberPromotion> memberPromotionList = memberPromotionService.lambdaQuery()
|
||||
.eq(MemberPromotion::getUserId, userId)
|
||||
.list();
|
||||
return AjaxResult.success(memberPromotionList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参与活动
|
||||
*/
|
||||
@GetMapping("joinPromotion")
|
||||
@ApiOperation(value = "参与活动")
|
||||
public R<Object> joinPromotion(@Valid
|
||||
@NotNull(message = "活动ID不能为空")
|
||||
@ApiParam("活动ID")
|
||||
Long promotionId) {
|
||||
@PostMapping("joinPromotion")
|
||||
public AjaxResult joinPromotion(@RequestBody @Valid JoinPromotionDto joinPromotionDto) {
|
||||
// 用户id
|
||||
Long userId = joinPromotionDto.getUserId();
|
||||
// 活动id
|
||||
Long promotionId = joinPromotionDto.getPromotionId();
|
||||
// 按活动id查询活动信息
|
||||
Promotion promotion = promotionService.getById(promotionId);
|
||||
|
||||
return promotionService.joinPromotion(promotionId);
|
||||
if (!Optional.ofNullable(promotion).isPresent()) {
|
||||
return AjaxResult.warn("活动不存在");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改活动
|
||||
*/
|
||||
// @PostMapping("updatePromotion")
|
||||
// @ApiOperation(value = "修改活动")
|
||||
// public R<Object> updatePromotion(@RequestBody @Valid PromotionDto promotionDto) {
|
||||
//
|
||||
// return promotionService.updatePromotion(promotionDto);
|
||||
if (promotion.getStartTime().after(new Date())) {
|
||||
return AjaxResult.warn("活动未开始");
|
||||
}
|
||||
|
||||
// 活动是否过期
|
||||
if (promotion.getEndTime().before(new Date())) {
|
||||
return AjaxResult.warn("活动已过期");
|
||||
}
|
||||
|
||||
// 获取当前用户是否参与过该活动
|
||||
if (isJoinPromotion(userId, promotionId)) {
|
||||
return AjaxResult.warn("您已参与过该活动");
|
||||
}
|
||||
|
||||
// 是否在活动期间内订阅或续订会员
|
||||
// if (!isSubscribe(userId, promotion)) {
|
||||
// return AjaxResult.warn("请在活动期间内订阅或续期会员后参加该活动");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 删除活动
|
||||
*/
|
||||
@GetMapping("deletePromotion")
|
||||
@ApiOperation(value = "删除活动")
|
||||
public R<Object> deletePromotion(@Valid
|
||||
@NotNull(message = "活动ID不能为空")
|
||||
@ApiParam("活动ID")
|
||||
Long promotionId) {
|
||||
promotionService.removeById(promotionId);
|
||||
return R.ok();
|
||||
Member member = memberService.getUseUserMemberByUserId(userId);
|
||||
|
||||
String memberLevelIds = promotion.getMemberLevelIds();
|
||||
if (!memberLevelIds.contains(member.getMemberLevelId().toString())) {
|
||||
return AjaxResult.warn("无法参与该活动,请查看活动条件");
|
||||
}
|
||||
MemberPromotion memberPromotion = getMemberPromotion(userId, promotionId);
|
||||
memberPromotionService.save(memberPromotion);
|
||||
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
// private boolean isSubscribe(Long userId, Promotion promotion) {
|
||||
|
@ -139,5 +145,26 @@ public class PromotionController {
|
|||
// 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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
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,87 +1,73 @@
|
|||
package com.mcwl.web.controller.myInvitation;
|
||||
|
||||
|
||||
import com.mcwl.common.constant.HttpStatus;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.myInvitation.domain.Invitation;
|
||||
import com.mcwl.myInvitation.domain.dto.EarningsDisplayDto;
|
||||
import com.mcwl.myInvitation.service.InvitationService;
|
||||
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 org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
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.*;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.mcwl.common.core.domain.AjaxResult.success;
|
||||
|
||||
|
||||
/**
|
||||
* 我的邀请
|
||||
* 邀请管理
|
||||
*/
|
||||
@RestController()
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/invitation")
|
||||
@Api(tags = "我的邀请")
|
||||
public class InvitationController {
|
||||
|
||||
private final InvitationService invitationService;
|
||||
|
||||
private final ISysUserPayAccountLogService sysUserPayAccountLogService;
|
||||
|
||||
|
||||
/**
|
||||
* 获取邀请码
|
||||
*
|
||||
* @return 邀请码
|
||||
*/
|
||||
@GetMapping("/getInvitationCode")
|
||||
@ApiOperation(value = "获取邀请码")
|
||||
public R<String> getInvitationCode() {
|
||||
public AjaxResult getInvitationCode() {
|
||||
// 获取当前用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
String invitationCode = invitationService.getInvitationCode(userId);
|
||||
if (StringUtils.isEmpty(invitationCode)) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"获取邀请码失败");
|
||||
return AjaxResult.warn("获取邀请码失败");
|
||||
}
|
||||
return R.ok("操作成功", invitationCode);
|
||||
return success("操作成功", invitationCode);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取邀请列表
|
||||
*
|
||||
* @param userId 用户id
|
||||
* @return 邀请列表
|
||||
*/
|
||||
|
||||
// @GetMapping("/list")
|
||||
// @ApiOperation(value = "获取邀请列表")
|
||||
// public R<List<Invitation>> list(@Valid
|
||||
// @NotNull(message = "用户id不能为空")
|
||||
// @ApiParam("用户id") Long userId) {
|
||||
// List<Invitation> list = invitationService.lambdaQuery()
|
||||
// .eq(Invitation::getUserId, userId)
|
||||
// .list();
|
||||
// return R.ok(list);
|
||||
// }
|
||||
@GetMapping("/list/{userId}")
|
||||
public AjaxResult list(@PathVariable Long userId) {
|
||||
List<Invitation> list = invitationService.lambdaQuery()
|
||||
.eq(Invitation::getUserId, userId)
|
||||
.list();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 邀请人收益展示
|
||||
*/
|
||||
@GetMapping("earningsDisplay")
|
||||
@ApiOperation(value = "邀请人收益展示")
|
||||
public R<EarningsDisplayVO> earningsDisplay() {
|
||||
public AjaxResult earningsDisplay() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
|
||||
EarningsDisplayVO earningsDisplayVO = new EarningsDisplayVO();
|
||||
|
@ -92,39 +78,16 @@ public class InvitationController {
|
|||
// 获取我的团员
|
||||
List<EarningsDisplayDto> earningsDisplay = invitationService.getEarningsDisplay(userId);
|
||||
if (earningsDisplay == null || earningsDisplay.isEmpty()) {
|
||||
return R.ok(new EarningsDisplayVO(totalAmount, Collections.emptyList()));
|
||||
return AjaxResult.warn("暂无收益");
|
||||
}
|
||||
|
||||
earningsDisplayVO.setTotalAmount(totalAmount);
|
||||
earningsDisplayVO.setEarningsDisplayList(earningsDisplay);
|
||||
|
||||
return R.ok(earningsDisplayVO);
|
||||
return success(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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,294 +0,0 @@
|
|||
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";
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,294 @@
|
|||
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.AlipayFundTransToaccountTransferModel;
|
||||
import com.alipay.api.domain.AlipayFundTransUniTransferModel;
|
||||
import com.alipay.api.domain.Participant;
|
||||
import com.alipay.api.request.AlipayFundAccountQueryRequest;
|
||||
import com.alipay.api.request.AlipayFundTransToaccountTransferRequest;
|
||||
import com.alipay.api.request.AlipayFundTransUniTransferRequest;
|
||||
import com.alipay.api.response.AlipayFundAccountQueryResponse;
|
||||
import com.alipay.api.response.AlipayFundTransToaccountTransferResponse;
|
||||
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.common.utils.StringUtils;
|
||||
import com.mcwl.memberCenter.domain.MemberLevel;
|
||||
import com.mcwl.memberCenter.service.MemberLevelService;
|
||||
import com.mcwl.memberCenter.service.MemberService;
|
||||
import com.mcwl.pay.config.AliConfig;
|
||||
import com.mcwl.pay.domain.OrderTrade;
|
||||
import com.mcwl.pay.domain.OrderTradeDto;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
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,33 +1,30 @@
|
|||
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.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.mcwl.common.JSONUtils;
|
||||
import com.mcwl.common.constant.HttpStatus;
|
||||
import com.mcwl.common.annotation.Anonymous;
|
||||
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.redis.RedisCache;
|
||||
import com.mcwl.common.domain.IdsParam;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import com.mcwl.pay.domain.OrderTrade;
|
||||
import com.mcwl.pay.service.AliPayService;
|
||||
import com.mcwl.pay.domain.OrderTradeDto;
|
||||
import com.mcwl.pay.service.OrderTradeService;
|
||||
import com.mcwl.resource.domain.dto.ProductRes;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alipay.easysdk.kernel.Config;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
|
@ -38,10 +35,10 @@ import java.util.Map;
|
|||
* @Date:2025/1/3 14:46
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/order")
|
||||
@RequestMapping("/web/pay")
|
||||
@Validated
|
||||
@Api(tags = "订单模块")
|
||||
public class OrderTradeController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
|
@ -51,28 +48,16 @@ public class OrderTradeController extends BaseController {
|
|||
private OrderTradeService orderTradeService;
|
||||
|
||||
@Autowired
|
||||
private AliPayService aliPayService;
|
||||
private AliPayIntegration aliPayIntegration;
|
||||
|
||||
|
||||
@Autowired
|
||||
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")
|
||||
@ApiOperation(value = "查询订单列表")
|
||||
public TableDataInfo list(OrderTrade orderTrade) {
|
||||
startPage();
|
||||
List<OrderTrade> list = orderTradeService.selectMallProductList(orderTrade);
|
||||
|
@ -83,81 +68,178 @@ public class OrderTradeController extends BaseController {
|
|||
* 新增
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
@ApiOperation(value = "新增订单")
|
||||
public R<Object> add(@RequestBody OrderTrade orderTrade) {
|
||||
public AjaxResult add(@RequestBody OrderTrade orderTrade) {
|
||||
// 获取当前用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if (userId == null) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"用户未登录");
|
||||
return AjaxResult.warn("用户未登录");
|
||||
}
|
||||
orderTrade.setUserId(userId);
|
||||
return R.ok(orderTradeService.insertMallProduct(orderTrade));
|
||||
orderTrade.setCreateBy(getUsername());
|
||||
return toAjax(orderTradeService.insertMallProduct(orderTrade));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperation(value = "修改订单")
|
||||
public R<Object> update(@RequestBody OrderTrade orderTrade) {
|
||||
@PostMapping("/upda")
|
||||
public AjaxResult upda(@RequestBody OrderTrade orderTrade) {
|
||||
// 获取当前用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if (userId == null) {
|
||||
return R.fail(HttpStatus.SHOW_ERROR_MSG,"用户未登录");
|
||||
return AjaxResult.warn("用户未登录");
|
||||
}
|
||||
orderTrade.setUserId(userId);
|
||||
orderTradeService.updateMallProduct(orderTrade);
|
||||
return R.ok();
|
||||
orderTrade.setUpdateBy(getUsername());
|
||||
return toAjax(orderTradeService.updateMallProduct(orderTrade));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
@PostMapping
|
||||
@ApiOperation(value = "删除订单")
|
||||
public R<Object> remove(@RequestBody IdsParam ids) {
|
||||
public AjaxResult remove(@RequestBody IdsParam ids) {
|
||||
orderTradeService.deleteMallProductByIds(ids);
|
||||
return R.ok();
|
||||
return success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询交易状态
|
||||
* 支付接口
|
||||
*
|
||||
* @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")
|
||||
@ApiOperation(value = "查询交易状态")
|
||||
public R<Object> queryTradeStatus(@Valid @NotBlank(message = "订单号不能为空") String outTradeNo) throws Exception {
|
||||
return aliPayService.queryTradeStatus(outTradeNo);
|
||||
public Object queryTradeStatus(@RequestParam String outTradeNo) throws Exception {
|
||||
Factory.setOptions(config);
|
||||
AlipayTradeQueryResponse query = Factory.Payment.Common().query(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
|
||||
*/
|
||||
// @GetMapping("/cancelTrade")
|
||||
// public AjaxResult cancelTrade(String outTradeNo) throws Exception {
|
||||
// // 关闭交易
|
||||
// AlipayTradeCancelResponse cancel = Factory.Payment.Common().cancel(outTradeNo);
|
||||
// if (cancel.getCode().equals("10000")) {
|
||||
// return AjaxResult.success("关闭成功");
|
||||
// }
|
||||
// return AjaxResult.error("关闭失败");
|
||||
// }
|
||||
@Anonymous
|
||||
@PostMapping("/notify") // 注意这里必须是POST接口
|
||||
public String payNotify(HttpServletRequest request) throws Exception {
|
||||
|
||||
/**
|
||||
* 关闭交易
|
||||
*/
|
||||
// @GetMapping("/closeTrade")
|
||||
// public AjaxResult closeTrade(String outTradeNo) throws Exception {
|
||||
// // 关闭交易
|
||||
// AlipayTradeCloseResponse close = Factory.Payment.Common().close(outTradeNo);
|
||||
// if (close.getCode().equals("10000")) {
|
||||
// return AjaxResult.success("关闭成功");
|
||||
log.info("已经进入回调接口");
|
||||
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"); // 商户订单号
|
||||
// 获取订单后缀
|
||||
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());
|
||||
// }
|
||||
// return AjaxResult.error("关闭失败");
|
||||
// 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,175 +0,0 @@
|
|||
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, "金币充值");
|
||||
}
|
||||
|
||||
}
|
|
@ -1,62 +0,0 @@
|
|||
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.Configuration;
|
||||
|
||||
/**支付宝配置
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.common.config
|
||||
|
|
|
@ -31,45 +31,4 @@ public class CodeMQConfig {
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,74 +1,24 @@
|
|||
package com.mcwl.web.controller.rabbitmq.consumer;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.mcwl.common.constant.QueueConstants;
|
||||
import com.mcwl.common.constant.RedisConstants;
|
||||
import com.mcwl.common.core.domain.model.PhoneLoginBody;
|
||||
import com.mcwl.common.core.redis.RedisCache;
|
||||
import com.mcwl.common.utils.uuid.TelSmsUtils;
|
||||
import com.rabbitmq.client.Channel;
|
||||
import org.springframework.amqp.core.Message;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* 手机号登录短信验证码消费者
|
||||
*
|
||||
* @author DaiZibo
|
||||
* @date 2024/12/30
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CodeConsumer {
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate<String, String> redisTemplate;
|
||||
|
||||
@RabbitListener(queues = QueueConstants.CODE_QUEUE)
|
||||
public void code(Message message, Channel channel, String msg) {
|
||||
|
||||
|
||||
if (msg == "") {
|
||||
return;
|
||||
}
|
||||
String messageId = message.getMessageProperties().getMessageId();
|
||||
try {
|
||||
Long add = redisTemplate.opsForSet().add(RedisConstants.CODE_UUID + messageId, "1");
|
||||
redisTemplate.expire(RedisConstants.CODE_UUID + messageId, 2, TimeUnit.MINUTES);
|
||||
if (add > 0) {
|
||||
PhoneLoginBody phoneLoginBody = JSON.parseObject(msg, PhoneLoginBody.class);
|
||||
|
||||
//发送短信服务
|
||||
// 构建 sendDataMap
|
||||
Map<String, String> sendDataMap = new HashMap<>();
|
||||
sendDataMap.put("code", phoneLoginBody.getCode());
|
||||
String s1 = TelSmsUtils.sendSms(phoneLoginBody.getPhone(), "SMS_478520014", sendDataMap);
|
||||
|
||||
|
||||
//手动确认
|
||||
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
||||
}else {
|
||||
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
//删除标记
|
||||
redisTemplate.delete(RedisConstants.CODE_UUID+messageId);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
public void code(String msg) {
|
||||
|
||||
log.info("消费者获取到的数据:{}", msg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,88 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,295 +0,0 @@
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,105 +0,0 @@
|
|||
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,41 +1,31 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.PageDomain;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
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.ModelVersion;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
import com.mcwl.resource.domain.request.RequestModel;
|
||||
import com.mcwl.resource.domain.response.ResponseModelProduct;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
import com.mcwl.resource.mapper.ModelVersionMapper;
|
||||
import com.mcwl.resource.domain.request.RequestWorkFlow;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
import com.mcwl.resource.service.ModelImageService;
|
||||
import com.mcwl.resource.service.ModelService;
|
||||
import com.mcwl.system.service.impl.SysUserServiceImpl;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.mcwl.resource.service.WorkFlowService;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
import com.mcwl.web.controller.common.OssUtil;
|
||||
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;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* 模型
|
||||
* 商品
|
||||
*
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
|
@ -44,31 +34,65 @@ import java.util.stream.Collectors;
|
|||
* @Description 商品
|
||||
* @Date:2024/12/31 10:48
|
||||
*/
|
||||
@Api(tags = "模型")
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/model")
|
||||
public class MallProductController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private ModelPurchaseRecordMapper modelPurchaseRecordMapper;
|
||||
|
||||
@Autowired
|
||||
private ModelService modelService;
|
||||
|
||||
@Autowired
|
||||
private ModelVersionMapper modelVersionMapper;
|
||||
private ModelImageService modelImageService;
|
||||
|
||||
@Autowired
|
||||
private SysUserServiceImpl sysUserService;
|
||||
private WorkFlowService workFlowService;
|
||||
|
||||
@Autowired
|
||||
private ConsumeService consumeService;
|
||||
|
||||
/***
|
||||
*
|
||||
* 图片
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/file")
|
||||
public AjaxResult Malifile(@RequestParam MultipartFile file) {
|
||||
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* zip
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/zipUrlFile")
|
||||
public AjaxResult zipUrlFile(@RequestParam MultipartFile file) {
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* 下载zip
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/zipUrl")
|
||||
public AjaxResult zipUrl(@RequestParam MultipartFile file) {
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 模型列表
|
||||
*/
|
||||
@ApiOperation(value = "模型列表")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody ModelImagePageRes imagePageRes) {
|
||||
|
||||
|
@ -76,168 +100,110 @@ public class MallProductController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "模型详情")
|
||||
@GetMapping("finbyid")
|
||||
public AjaxResult finbyid(@Valid @NotNull(message = "模型id不能为空") @RequestParam Long id) {
|
||||
|
||||
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);
|
||||
@PostMapping("finbyid")
|
||||
public AjaxResult finbyid(@RequestBody ModelProduct modelVersion) {
|
||||
ModelProduct modelVersion1 = modelService.getById(modelVersion.getId());
|
||||
return AjaxResult.success(modelVersion1);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "添加模型")
|
||||
@PostMapping("/insert")
|
||||
public R<String> addupdateModel(@RequestBody RequestModel requestModel) {
|
||||
public AjaxResult addupdateModel(@RequestBody RequestModel requestModel) {
|
||||
ModelProduct modelProduct = requestModel.getModelProduct();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
modelProduct.setUserId(userId);
|
||||
modelProduct.setCreateBy(getUsername());
|
||||
return modelService.addModel(requestModel);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "修改模型")
|
||||
@PostMapping("/update")
|
||||
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();
|
||||
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
modelProduct.setUserId(userId);
|
||||
modelProduct.setUpdateBy(getUsername());
|
||||
modelService.updaModel(requestModel);
|
||||
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "删除模型")
|
||||
@GetMapping("delete")
|
||||
public AjaxResult delete(@Valid @NotNull(message = "模型id不能为空") @RequestParam Long id) {
|
||||
modelService.removeById(id);
|
||||
@PostMapping("delete")
|
||||
public AjaxResult delete(@RequestBody ModelProduct modelVersion) {
|
||||
modelService.removeById(modelVersion.getId());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询模型详情
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询模型详情")
|
||||
@GetMapping("/selectModelById")
|
||||
public R<ModelProduct> selectModelById(@Valid @NotNull(message = "模型id不能为空") @RequestParam Long id) {
|
||||
public AjaxResult selectModelById(@RequestParam Long 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);
|
||||
return modelService.selectModelById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型广场
|
||||
* 我的发布-模型
|
||||
*/
|
||||
@ApiOperation(value = "模型广场列表")
|
||||
@PostMapping("/modelSquare")
|
||||
public R modelSquare(@RequestBody PageVo pageVo) {
|
||||
PageInfo<ResponseModelProduct> modelProductPage = modelService.modelSquare(pageVo);
|
||||
return R.ok(modelProductPage);
|
||||
@PostMapping("/selectByUserIdModel")
|
||||
public TableDataInfo selectByUserIdModel(@RequestBody ModelImagePageRes imagePageRes) {
|
||||
|
||||
return modelService.listByPage(imagePageRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验模型名字是否唯一
|
||||
*
|
||||
* @param name
|
||||
* @return
|
||||
* 我的发布-工作流
|
||||
*/
|
||||
@ApiOperation(value = "校验模型名字是否唯一")
|
||||
@GetMapping("/selectModelByName")
|
||||
public R selectModelByName(@RequestParam String name) {
|
||||
@PostMapping("/selectByUserIdWorkFlow")
|
||||
public TableDataInfo selectByUserIdWorkFlow(@RequestBody ModelImagePageRes imagePageRes) {
|
||||
|
||||
return modelService.selectModelByName(name);
|
||||
return workFlowService.listByPage(imagePageRes);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "个人中心更改背景")
|
||||
@GetMapping("/updateBackgroundImg")
|
||||
public R updateBackgroundImg(@RequestParam Long id, String path) {
|
||||
/**
|
||||
* 我的发布-图片
|
||||
*/
|
||||
@PostMapping("/selectByUserIdImage")
|
||||
public TableDataInfo selectByUserIdImage(@RequestBody ModelImagePageRes imagePageRes) {
|
||||
|
||||
sysUserService.updateBackgroundImg(id, path);
|
||||
|
||||
return R.ok();
|
||||
return modelImageService.listByPage(imagePageRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞-模型
|
||||
*/
|
||||
@PostMapping("/likeModel")
|
||||
public TableDataInfo likeModel(@RequestBody PageDomain pageDomain) {
|
||||
ModelImagePageRes imagePageRes = new ModelImagePageRes();
|
||||
BeanUtil.copyProperties(pageDomain, imagePageRes);
|
||||
imagePageRes.setUserId(SecurityUtils.getUserId());
|
||||
return modelService.listByPage(imagePageRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞-工作流
|
||||
*/
|
||||
@PostMapping("/likeWorkFlow")
|
||||
public TableDataInfo likeWorkFlow(@RequestBody PageDomain pageDomain) {
|
||||
ModelImagePageRes imagePageRes = new ModelImagePageRes();
|
||||
BeanUtil.copyProperties(pageDomain, imagePageRes);
|
||||
imagePageRes.setUserId(SecurityUtils.getUserId());
|
||||
return workFlowService.listByPage(imagePageRes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点赞-图片
|
||||
*/
|
||||
@PostMapping("/likeImage")
|
||||
public TableDataInfo likeImage(@RequestBody PageDomain pageDomain) {
|
||||
ModelImagePageRes imagePageRes = new ModelImagePageRes();
|
||||
BeanUtil.copyProperties(pageDomain, imagePageRes);
|
||||
imagePageRes.setUserId(SecurityUtils.getUserId());
|
||||
return modelImageService.listByPage(imagePageRes);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.mcwl.common.annotation.RepeatSubmit;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.ModelProduct;
|
||||
import com.mcwl.resource.domain.vo.MallProductVo;
|
||||
import com.mcwl.resource.service.MallProductLikeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* 点赞商品
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/2
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
@RequestMapping("/like")
|
||||
@RestController
|
||||
public class MallProductLikeController {
|
||||
|
||||
@Autowired
|
||||
private MallProductLikeService mallProductLikeService;
|
||||
|
||||
/**
|
||||
* 查询用户点赞作品列表
|
||||
* @param mallProductVo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/selectByUserLike")
|
||||
public AjaxResult selectByUserLike(@RequestBody MallProductVo mallProductVo){
|
||||
|
||||
Page<ModelProduct> mallProductPage = mallProductLikeService.selectByUserLike(mallProductVo);
|
||||
return AjaxResult.success(mallProductPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加/删除点赞商品
|
||||
* @param productId
|
||||
* @return
|
||||
*/
|
||||
@RepeatSubmit
|
||||
@GetMapping("/addLike")
|
||||
public AjaxResult addLike(@RequestParam Long productId){
|
||||
|
||||
return mallProductLikeService.addLike(productId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看作品是否点赞
|
||||
* @param productId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectLike")
|
||||
public AjaxResult selectLike(@RequestParam Long productId){
|
||||
Boolean aBoolean = mallProductLikeService.selectLike(productId);
|
||||
return AjaxResult.success(aBoolean);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -2,25 +2,18 @@ package com.mcwl.web.controller.resource;
|
|||
|
||||
import com.mcwl.common.annotation.RepeatSubmit;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.resource.domain.dto.ModelCommentRes;
|
||||
import com.mcwl.resource.domain.ModelComment;
|
||||
import com.mcwl.resource.domain.vo.ModelCommentVo;
|
||||
import com.mcwl.resource.service.ModelCommentLikeService;
|
||||
import com.mcwl.resource.service.ModelCommentService;
|
||||
import com.mcwl.resource.service.ModelLikeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模型评论
|
||||
*
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.web.controller.resource
|
||||
|
@ -28,7 +21,6 @@ import java.util.List;
|
|||
* @Description TODO
|
||||
* @Date:2025/1/12 11:36
|
||||
*/
|
||||
@Api(tags = "模型评论")
|
||||
@RequestMapping("/ModelComment")
|
||||
@RestController
|
||||
public class ModelCommentController {
|
||||
|
@ -41,89 +33,57 @@ public class ModelCommentController {
|
|||
private ModelCommentLikeService modelCommentLikeService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 模型点赞/取消
|
||||
*/
|
||||
@ApiOperation(value = "模型点赞/取消")
|
||||
@RepeatSubmit
|
||||
@GetMapping("/modelLike")
|
||||
public R<Object> like(@Valid
|
||||
@NotNull(message = "模型id不能为空")
|
||||
@ApiParam(value = "模型id", required = true)
|
||||
Long modelId) {
|
||||
modelLikeService.like(modelId);
|
||||
return R.ok();
|
||||
@GetMapping("/modelLike/{modelId}")
|
||||
public AjaxResult like(@PathVariable Long imageId) {
|
||||
modelLikeService.like(imageId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 模型评论发布
|
||||
*/
|
||||
@ApiOperation(value = "模型评论发布")
|
||||
@PostMapping("/comment")
|
||||
public R<Object> comment(@Valid @RequestBody ModelCommentRes modelCommentRes) {
|
||||
modelCommentService.comment(modelCommentRes);
|
||||
return R.ok();
|
||||
public AjaxResult comment(@RequestBody ModelComment modelComment) {
|
||||
modelCommentService.comment(modelComment);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型评论点赞/取消
|
||||
*/
|
||||
@ApiOperation(value = "模型评论点赞/取消")
|
||||
@RepeatSubmit
|
||||
@GetMapping("/commentLike")
|
||||
public R<Object> commentLike(@Valid
|
||||
@NotNull(message = "评论id不能为空")
|
||||
@ApiParam(value = "评论id", required = true)
|
||||
Long commentId) {
|
||||
@GetMapping("/commentLike/{commentId}")
|
||||
public AjaxResult commentLike(@PathVariable Long commentId) {
|
||||
modelCommentLikeService.like(commentId);
|
||||
return R.ok();
|
||||
return AjaxResult.error();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取模型评论
|
||||
*/
|
||||
@ApiOperation(value = "获取模型评论")
|
||||
@GetMapping("/getComment")
|
||||
@Valid
|
||||
public R<List<ModelCommentVo>> getComment(@Valid
|
||||
@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);
|
||||
@GetMapping("/comment/{modelId}")
|
||||
public AjaxResult getComment(@PathVariable @NotNull(message = "模型id不能为空") Long modelId) {
|
||||
List<ModelCommentVo> modelCommentList = modelCommentService.getComment(modelId);
|
||||
return AjaxResult.success(modelCommentList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除模型评论
|
||||
*/
|
||||
@ApiOperation(value = "删除模型评论")
|
||||
@GetMapping("/commentDelete")
|
||||
public R<Object> commentDelete(@Valid
|
||||
@NotNull(message = "评论id不能为空")
|
||||
@ApiParam(value = "评论id", required = true)
|
||||
Long commentId) {
|
||||
@GetMapping("/commentDelete/{commentId}")
|
||||
public AjaxResult commentDelete(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
||||
modelCommentService.removeById(commentId);
|
||||
return R.ok();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模型评论数量
|
||||
*/
|
||||
@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,26 +2,20 @@ package com.mcwl.web.controller.resource;
|
|||
|
||||
import com.mcwl.common.annotation.RepeatSubmit;
|
||||
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.vo.ModelImageCommentVo;
|
||||
import com.mcwl.resource.service.ModelImageCommentLikeService;
|
||||
import com.mcwl.resource.service.ModelImageCommentService;
|
||||
import com.mcwl.resource.service.ModelImageService;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 图片评论
|
||||
* 图片
|
||||
*/
|
||||
@Api(tags = "图片评论")
|
||||
@RestController
|
||||
@RequestMapping("/imageComment")
|
||||
@RequiredArgsConstructor
|
||||
|
@ -37,68 +31,38 @@ public class ModelImageCommentController {
|
|||
/**
|
||||
* 图片评论发布
|
||||
*/
|
||||
@ApiOperation(value = "图片评论发布")
|
||||
@PostMapping("/comment")
|
||||
public R<Object> comment(@Valid @RequestBody ModelImageCommentRes modelImageCommentRes) {
|
||||
modelImageCommentService.comment(modelImageCommentRes);
|
||||
return R.ok();
|
||||
public AjaxResult comment(@RequestBody ModelImageCommentRes modelImageCommentRes) {
|
||||
modelImageService.comment(modelImageCommentRes);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片评论点赞/取消
|
||||
*/
|
||||
@ApiOperation(value = "图片评论点赞/取消")
|
||||
@RepeatSubmit(interval = 1000)
|
||||
@GetMapping("/commentLike")
|
||||
public R<Object> commentLike(@Valid
|
||||
@NotNull(message = "评论id不能为空")
|
||||
@ApiParam(value = "评论id", required = true)
|
||||
Long commentId) {
|
||||
@RepeatSubmit
|
||||
@GetMapping("/commentLike/{commentId}")
|
||||
public AjaxResult commentLike(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
||||
modelImageCommentLikeService.like(commentId);
|
||||
return R.ok();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图片评论
|
||||
*/
|
||||
@ApiOperation(value = "删除图片评论")
|
||||
@GetMapping("/commentDelete")
|
||||
public R<Object> commentDelete(@Valid
|
||||
@NotNull(message = "评论id不能为空")
|
||||
@ApiParam(value = "评论id", required = true) Long commentId) {
|
||||
@GetMapping("/commentDelete/{commentId}")
|
||||
public AjaxResult commentDelete(@PathVariable @NotNull(message = "评论id不能为空") Long commentId) {
|
||||
modelImageCommentService.removeById(commentId);
|
||||
return R.ok();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图片评论
|
||||
*/
|
||||
@ApiOperation(value = "获取图片评论")
|
||||
@GetMapping("/getComment")
|
||||
@Valid
|
||||
public R<List<ModelImageCommentVo>> getComment(@Valid
|
||||
@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);
|
||||
@GetMapping("/comment/{imageId}")
|
||||
public AjaxResult getComment(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) {
|
||||
List<ModelImageCommentVo> modelImageCommentVoList = modelImageService.getComment(imageId);
|
||||
return AjaxResult.success(modelImageCommentVoList);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,33 +1,28 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.mcwl.common.annotation.RepeatSubmit;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
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.resource.domain.ModelImage;
|
||||
import com.mcwl.resource.domain.dto.ModelImagePageRes;
|
||||
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.PageVo;
|
||||
import com.mcwl.resource.service.ModelImageLikeService;
|
||||
import com.mcwl.resource.service.ModelImageService;
|
||||
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 javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@Api(tags = "图片")
|
||||
@RestController
|
||||
@RequestMapping("/image")
|
||||
@RequiredArgsConstructor
|
||||
|
@ -43,11 +38,8 @@ public class ModelImageController {
|
|||
/**
|
||||
* 图片列表
|
||||
*/
|
||||
@ApiOperation(value = "图片列表")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody
|
||||
@Valid
|
||||
PageDomain pageDomain) {
|
||||
public TableDataInfo list(@RequestBody PageDomain pageDomain) {
|
||||
ModelImagePageRes imagePageRes = new ModelImagePageRes();
|
||||
BeanUtil.copyProperties(pageDomain, imagePageRes);
|
||||
return modelImageService.listByPage(imagePageRes);
|
||||
|
@ -56,93 +48,50 @@ public class ModelImageController {
|
|||
/**
|
||||
* 图片详情
|
||||
*/
|
||||
@ApiOperation(value = "图片详情")
|
||||
@GetMapping("/detail")
|
||||
public R<ModelImageVo> detail(@Valid @NotNull(message = "图片id不能为空") Long id) {
|
||||
ModelImageVo modelImageVo = modelImageService.getDetail(id);
|
||||
return R.ok(modelImageVo);
|
||||
@GetMapping("/detail/{imageId}")
|
||||
public AjaxResult detail(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) {
|
||||
ModelImageVo modelImageVo = modelImageService.getDetail(imageId);
|
||||
return AjaxResult.success(modelImageVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片删除
|
||||
*/
|
||||
@ApiOperation(value = "图片删除")
|
||||
@GetMapping("/delete")
|
||||
public R<Object> delete(@Valid @NotNull(message = "图片id不能为空") Long id) {
|
||||
modelImageService.removeById(id);
|
||||
return R.ok();
|
||||
@GetMapping("/delete/{imageId}")
|
||||
public AjaxResult delete(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) {
|
||||
modelImageService.removeById(imageId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片修改
|
||||
*/
|
||||
@ApiOperation(value = "图片修改")
|
||||
@PostMapping("/update")
|
||||
public R<Object> update(@Valid @RequestBody ModelImageRes modelImageRes) {
|
||||
public AjaxResult update(@RequestBody ModelImageRes modelImageRes) {
|
||||
modelImageService.updateById(modelImageRes);
|
||||
return R.ok();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 图片发布
|
||||
*/
|
||||
@ApiOperation(value = "图片发布")
|
||||
@PostMapping("/publish")
|
||||
public R<Object> publish(@Valid @RequestBody ModelImageRes modelImageRes) {
|
||||
|
||||
return modelImageService.publish(modelImageRes);
|
||||
public AjaxResult publish(@RequestBody ModelImageRes modelImageRes) {
|
||||
modelImageService.publish(modelImageRes);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片点赞/取消
|
||||
*/
|
||||
@ApiOperation(value = "图片点赞/取消")
|
||||
@RepeatSubmit
|
||||
@GetMapping("/imageLike")
|
||||
public R<Object> like(@Valid @NotNull(message = "图片id不能为空") Long id) {
|
||||
modelImageLikeService.like(id);
|
||||
return R.ok();
|
||||
@GetMapping("/imageLike/{imageId}")
|
||||
public AjaxResult like(@PathVariable @NotNull(message = "图片id不能为空") Long imageId) {
|
||||
modelImageLikeService.like(imageId);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置图片置顶
|
||||
*
|
||||
* @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,14 +1,14 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import com.mcwl.common.core.controller.BaseController;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.resource.domain.ModelVersion;
|
||||
import com.mcwl.resource.service.ModelVersionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.mcwl.web.controller.common.OssUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -20,7 +20,6 @@ import java.util.List;
|
|||
* @Description TODO
|
||||
* @Date:2025/1/9 16:47
|
||||
*/
|
||||
@Api(tags = "模型版本")
|
||||
@RestController
|
||||
@RequestMapping("ModelVersion")
|
||||
public class ModelVersionController extends BaseController {
|
||||
|
@ -29,18 +28,53 @@ public class ModelVersionController extends BaseController {
|
|||
private ModelVersionService modelVersionService;
|
||||
|
||||
|
||||
/**
|
||||
* 详情页 版本列表
|
||||
* @param modelId
|
||||
|
||||
/***
|
||||
*
|
||||
* 图片
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectByModelId")
|
||||
public R<List<ModelVersion>> selectByModelId(@RequestParam Long modelId){
|
||||
@PostMapping("/file")
|
||||
public AjaxResult Malifile(@RequestParam MultipartFile file){
|
||||
|
||||
return modelVersionService.selectByModelId(modelId);
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "模型版本列表")
|
||||
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* zip
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/zipUrlFile")
|
||||
public AjaxResult zipUrlFile(@RequestParam MultipartFile file){
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/***
|
||||
*
|
||||
* 下载zip
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/zipUrl")
|
||||
public AjaxResult zipUrl(@RequestParam MultipartFile file){
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("list")
|
||||
public TableDataInfo list(@RequestBody ModelVersion modelVersion)
|
||||
{
|
||||
|
@ -50,56 +84,35 @@ public class ModelVersionController extends BaseController {
|
|||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "模型版本详情")
|
||||
@GetMapping("finbyid")
|
||||
public R<List<ModelVersion>> finbyid(@RequestParam Long id)
|
||||
@PostMapping("finbyid")
|
||||
public AjaxResult finbyid(@RequestBody ModelVersion modelVersion)
|
||||
{
|
||||
|
||||
|
||||
List<ModelVersion> modelVersionList = modelVersionService.finbyid(id);
|
||||
|
||||
return R.ok(modelVersionList);
|
||||
ModelVersion modelVersion1 = modelVersionService.getById(modelVersion.getId());
|
||||
return AjaxResult.success(modelVersion1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "模型版本添加")
|
||||
@PostMapping("insert")
|
||||
public R<Object> insert(@RequestBody ModelVersion modelVersion)
|
||||
public AjaxResult insert(@RequestBody ModelVersion modelVersion)
|
||||
{
|
||||
|
||||
modelVersionService.save(modelVersion);
|
||||
return R.ok();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "模型版本修改")
|
||||
@PostMapping("update")
|
||||
public R<Object> update(@RequestBody ModelVersion modelVersion)
|
||||
public AjaxResult update(@RequestBody ModelVersion modelVersion)
|
||||
{
|
||||
modelVersionService.updateById(modelVersion);
|
||||
return R.ok();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "模型版本删除")
|
||||
@PostMapping("delete")
|
||||
public R<Object> delete(@RequestBody ModelVersion modelVersion)
|
||||
public AjaxResult delete(@RequestBody ModelVersion modelVersion)
|
||||
{
|
||||
modelVersionService.removeById(modelVersion.getId());
|
||||
return R.ok();
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载模型文件
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "下载模型文件")
|
||||
@GetMapping("/modelFileDownload")
|
||||
public R modelFileDownload(@RequestParam Long id){
|
||||
|
||||
return modelVersionService.modelFileDownload(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,85 +0,0 @@
|
|||
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();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,129 +0,0 @@
|
|||
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,14 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.mcwl.common.annotation.RepeatSubmit;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.common.core.domain.entity.SysUser;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.domain.SysUserInfo;
|
||||
import com.mcwl.resource.domain.vo.PageVo;
|
||||
import com.mcwl.resource.service.SysUserAttentionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.mcwl.resource.service.impl.SysUserAttentionServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 关注
|
||||
|
@ -18,23 +16,22 @@ import org.springframework.web.bind.annotation.*;
|
|||
* @date 2025/1/3
|
||||
* @apiNote
|
||||
*/
|
||||
@Api(tags = "关注")
|
||||
|
||||
@RequestMapping("/attention")
|
||||
@RestController
|
||||
public class SysUserAttentionController {
|
||||
|
||||
@Autowired
|
||||
private SysUserAttentionService sysUserAttentionService;
|
||||
private SysUserAttentionServiceImpl sysUserAttentionService;
|
||||
|
||||
/**
|
||||
* 添加/取消关注
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加/取消关注")
|
||||
@RepeatSubmit
|
||||
@GetMapping("/addAttention")
|
||||
public R addAttention(@RequestParam Long userId) {
|
||||
public AjaxResult addAttention(@RequestParam Long userId) {
|
||||
|
||||
return sysUserAttentionService.addAttention(userId);
|
||||
|
||||
|
@ -45,53 +42,23 @@ public class SysUserAttentionController {
|
|||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询是否关注用户")
|
||||
@GetMapping("/selectAttention")
|
||||
public R<Boolean> selectAttention(@RequestParam Long userId) {
|
||||
public AjaxResult selectAttention(@RequestParam Long userId) {
|
||||
|
||||
Boolean aBoolean = sysUserAttentionService.selectAttention(userId);
|
||||
|
||||
return R.ok(aBoolean);
|
||||
return AjaxResult.success(aBoolean);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询个人粉丝,关注,下载量,喜欢
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询个人粉丝,关注,下载量,喜欢")
|
||||
@GetMapping("/selectUserInfo")
|
||||
public R<SysUserInfo> selectUserInfo(Long userId){
|
||||
public AjaxResult selectUserInfo(){
|
||||
|
||||
SysUserInfo sysUserInfo = sysUserAttentionService.selectUserInfo(userId);
|
||||
SysUserInfo sysUserInfo = sysUserAttentionService.selectUserInfo();
|
||||
|
||||
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);
|
||||
return AjaxResult.success(sysUserInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import com.mcwl.common.core.controller.BaseController;
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.common.core.page.TableDataInfo;
|
||||
import com.mcwl.resource.domain.ToActivity;
|
||||
import com.mcwl.resource.service.ToActivityService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
@ -15,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/**活动
|
||||
/**
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.web.controller.resource
|
||||
|
@ -23,9 +21,8 @@ import java.util.List;
|
|||
* @Description TODO
|
||||
* @Date:2025/1/9 17:59
|
||||
*/
|
||||
@Api(tags = "活动")
|
||||
@RestController
|
||||
@RequestMapping("/ToActivity")
|
||||
@RequestMapping("ToActivity")
|
||||
public class ToActivityController extends BaseController {
|
||||
@Autowired
|
||||
private ToActivityService toActivityService;
|
||||
|
@ -33,58 +30,48 @@ public class ToActivityController extends BaseController {
|
|||
/**
|
||||
* 查询活动列表
|
||||
*/
|
||||
@ApiOperation(value = "活动列表")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo list(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
|
||||
startPage();
|
||||
List<ToActivity> list = toActivityService.selectToActivityList(toActivity);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "活动详情")
|
||||
@PostMapping("finById")
|
||||
public R<ToActivity> finById(@RequestBody ToActivity toActivity)
|
||||
public AjaxResult finById(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
return R.ok(toActivityService.getById(toActivity.getId()));
|
||||
return AjaxResult.success(toActivityService.getById(toActivity));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "活动添加")
|
||||
@PostMapping("add")
|
||||
public R<Object> add(@RequestBody ToActivity toActivity)
|
||||
public AjaxResult add(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
toActivityService.save(toActivity);
|
||||
return R.ok();
|
||||
return AjaxResult.success(toActivityService.save(toActivity));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "活动修改")
|
||||
@PostMapping("update")
|
||||
public R<Object> update(@RequestBody ToActivity toActivity)
|
||||
public AjaxResult update(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
toActivityService.updateById(toActivity);
|
||||
return R.ok();
|
||||
return AjaxResult.success(toActivityService.updateById(toActivity));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "活动删除")
|
||||
@PostMapping("delete")
|
||||
public R<Object> delete(@RequestBody ToActivity toActivity)
|
||||
public AjaxResult delete(@RequestBody ToActivity toActivity)
|
||||
{
|
||||
toActivityService.removeById(toActivity);
|
||||
return R.ok();
|
||||
return AjaxResult.success(toActivityService.removeById(toActivity));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "活动批量删除")
|
||||
@PostMapping("deleteByIds")
|
||||
public R<Object> deleteByIds(@RequestBody List<ToActivity> toActivity)
|
||||
public AjaxResult deleteByIds(@RequestBody List<ToActivity> toActivity)
|
||||
{
|
||||
toActivityService.removeByIds(toActivity);
|
||||
return R.ok();
|
||||
return AjaxResult.success(toActivityService.removeByIds(toActivity));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,127 +0,0 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
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.service.WorkFlowCommentLikeService;
|
||||
import com.mcwl.resource.service.WorkFlowCommentService;
|
||||
import com.mcwl.resource.service.WorkFlowLikeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工作流评论
|
||||
*
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.web.controller.resource
|
||||
* @Filename:ModelCommentcontroller
|
||||
* @Description TODO
|
||||
* @Date:2025/1/12 11:36
|
||||
*/
|
||||
@Api(tags = "工作流评论")
|
||||
@RequestMapping("/WorkFlowComment")
|
||||
@RestController
|
||||
public class WorkFlowCommentController {
|
||||
|
||||
@Autowired
|
||||
private WorkFlowLikeService workFlowLikeService;
|
||||
@Autowired
|
||||
private WorkFlowCommentService workFlowCommentService;
|
||||
@Autowired
|
||||
private WorkFlowCommentLikeService workFlowCommentLikeService;
|
||||
|
||||
|
||||
/**
|
||||
* 工作流点赞/取消
|
||||
*/
|
||||
@ApiOperation(value = "工作流点赞/取消")
|
||||
@GetMapping("/like")
|
||||
public R<Object> like(@Valid
|
||||
@NotNull(message = "模型id不能为空")
|
||||
@ApiParam(value = "模型id", required = true)
|
||||
Long workFlowId) {
|
||||
workFlowLikeService.like(workFlowId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 工作流评论发布
|
||||
*/
|
||||
@ApiOperation(value = "工作流评论发布")
|
||||
@PostMapping("/comment")
|
||||
public R<Object> comment(@Valid
|
||||
@RequestBody
|
||||
WorkFlowCommentRes workFlowCommentRes) {
|
||||
workFlowCommentService.comment(workFlowCommentRes);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 工作流评论点赞/取消
|
||||
*/
|
||||
@ApiOperation(value = "工作流评论点赞/取消")
|
||||
@GetMapping("/commentLike")
|
||||
public R<Object> commentLike(@Valid
|
||||
@NotNull(message = "评论id不能为空")
|
||||
@ApiParam(value = "评论id", required = true)
|
||||
Long commentId) {
|
||||
workFlowCommentLikeService.like(commentId);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取工作流评论
|
||||
*/
|
||||
@ApiOperation(value = "获取工作流评论")
|
||||
@GetMapping("/getComment")
|
||||
public R<List<WorkFlowCommentVo>> getComment(@Valid
|
||||
@NotNull(message = "模型id不能为空")
|
||||
@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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除工作流评论
|
||||
*/
|
||||
@ApiOperation(value = "删除工作流评论")
|
||||
@GetMapping("/commentDelete")
|
||||
public R<Object> commentDelete(@Valid
|
||||
@NotNull(message = "评论id不能为空")
|
||||
@ApiParam(value = "评论id", required = true)
|
||||
Long commentId) {
|
||||
workFlowCommentService.removeById(commentId);
|
||||
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,30 +1,18 @@
|
|||
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.domain.R;
|
||||
import com.mcwl.resource.domain.WorkFlow;
|
||||
import com.mcwl.resource.domain.dto.AddRequestWorkFlow;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
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.mapper.WorkFlowVersionMapper;
|
||||
import com.mcwl.resource.service.WorkFlowService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.mcwl.resource.service.impl.WorkFlowServiceImpl;
|
||||
import com.mcwl.web.controller.common.OssUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
||||
/**
|
||||
* 工作流
|
||||
*
|
||||
* @Author:ChenYan
|
||||
* @Project:McWl
|
||||
* @Package:com.mcwl.web.controller.resource
|
||||
|
@ -32,117 +20,96 @@ import java.util.List;
|
|||
* @Description 商品
|
||||
* @Date:2024/12/31 10:48
|
||||
*/
|
||||
@Api(tags = "工作流")
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/WorkFlow")
|
||||
public class WorkFlowController extends BaseController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private WorkFlowService workFlowService;
|
||||
private WorkFlowServiceImpl workFlowService;
|
||||
|
||||
@Autowired
|
||||
private WorkFlowVersionMapper workFlowVersionMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 设置工作流的置顶状态
|
||||
*
|
||||
* @param id
|
||||
* @param isTop
|
||||
/***
|
||||
* 图片
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "设置工作流的置顶状态")
|
||||
@GetMapping("/{id}/top")
|
||||
public R<Object> setWorkFlowTop(@PathVariable Long id, @RequestParam boolean isTop) {
|
||||
@PostMapping("/file")
|
||||
public AjaxResult Malifile(@RequestParam MultipartFile file){
|
||||
|
||||
workFlowService.setworkFlowTop(id, isTop);
|
||||
return R.ok();
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
/***
|
||||
*
|
||||
* zip
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/zipUrlFile")
|
||||
public AjaxResult zipUrlFile(@RequestParam MultipartFile file){
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取所有工作流,按照置顶状态排序
|
||||
/***
|
||||
*
|
||||
* 下载zip
|
||||
* @param file
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "获取置顶的模型列表")
|
||||
@GetMapping
|
||||
public R<List<WorkFlow>> fetchWorkFlowSortedByTopStatus() {
|
||||
List<WorkFlow> models = workFlowService.fetchWorkFlowSortedByTopStatus();
|
||||
return R.ok(models);
|
||||
@PostMapping("/zipUrl")
|
||||
public AjaxResult zipUrl(@RequestParam MultipartFile file){
|
||||
String s = OssUtil.uploadMultipartFile(file);
|
||||
return AjaxResult.success(s);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加工作流
|
||||
*
|
||||
* @param addRequestWorkFlow
|
||||
* @param requestWorkFlow
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "添加工作流")
|
||||
@PostMapping("/addWorkFlow")
|
||||
public R<Object> addWorkFlow(@Validated @RequestBody AddRequestWorkFlow addRequestWorkFlow) {
|
||||
public AjaxResult addWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
||||
|
||||
return workFlowService.addWorkFlow(addRequestWorkFlow);
|
||||
return workFlowService.addWorkFlow(requestWorkFlow);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改工作流
|
||||
*
|
||||
* @param requestWorkFlow
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "修改工作流")
|
||||
@PostMapping("/updateWorkFlow")
|
||||
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,"文件内容重复");
|
||||
// }
|
||||
// }
|
||||
public AjaxResult updateWorkFlow(@RequestBody RequestWorkFlow requestWorkFlow){
|
||||
|
||||
workFlowService.updateWorkFlow(requestWorkFlow);
|
||||
|
||||
return R.ok();
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除工作流
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "删除工作流")
|
||||
@GetMapping("/deleteWorkFlow")
|
||||
public R<Object> deleteWorkFlow(@RequestParam @Valid @NotNull(message = "工作流id不能为空") Long id) {
|
||||
public AjaxResult deleteWorkFlow(@RequestParam Long id){
|
||||
|
||||
workFlowService.deleteWorkFlow(id);
|
||||
return R.ok();
|
||||
return AjaxResult.success("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询工作流列表
|
||||
*
|
||||
* @param pageVo
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询工作流列表")
|
||||
@PostMapping("/selectWorkFlow")
|
||||
public R<Page<WorkFlow>> selectWorkFlow(@RequestBody PageVo pageVo) {
|
||||
public AjaxResult selectWorkFlow(@RequestBody PageVo pageVo){
|
||||
|
||||
return workFlowService.selectWorkFlow(pageVo);
|
||||
}
|
||||
|
@ -153,54 +120,10 @@ public class WorkFlowController extends BaseController {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询工作流详情")
|
||||
@GetMapping("/selectWorkFlowById")
|
||||
public R<WorkFlow> selectWorkFlowById(@RequestParam @Valid @NotNull(message = "工作流id不能为空") Long id) {
|
||||
public AjaxResult selectWorkFlowById(@RequestParam Long 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,18 +1,13 @@
|
|||
package com.mcwl.web.controller.resource;
|
||||
|
||||
import com.mcwl.common.core.domain.R;
|
||||
import com.mcwl.resource.domain.WorkFlowVersion;
|
||||
import com.mcwl.resource.service.WorkFlowVersionService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
import com.mcwl.resource.service.impl.WorkFlowVersionServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 工作流版本
|
||||
*
|
||||
|
@ -20,13 +15,13 @@ import java.util.List;
|
|||
* @date 2025/1/14
|
||||
* @apiNote
|
||||
*/
|
||||
@Api(tags = "工作流版本")
|
||||
|
||||
@RequestMapping("/WorkFlowVersion")
|
||||
@RestController
|
||||
public class WorkFlowVersionController {
|
||||
|
||||
@Autowired
|
||||
private WorkFlowVersionService workFlowVersionService;
|
||||
private WorkFlowVersionServiceImpl workFlowVersionService;
|
||||
|
||||
/**
|
||||
* 查询工作流下的所有版本信息
|
||||
|
@ -34,23 +29,10 @@ public class WorkFlowVersionController {
|
|||
* @param workId
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "查询工作流下的所有版本信息")
|
||||
@GetMapping("/selectVersionByWorkId")
|
||||
public R<List<WorkFlowVersion>> selectVersionByWorkId(@RequestParam Long workId) {
|
||||
public AjaxResult selectVersionByWorkId(@RequestParam Long workId) {
|
||||
|
||||
return workFlowVersionService.selectVersionByWorkId(workId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载工作流
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("下载工作流")
|
||||
@GetMapping("/workFlowFileDownload")
|
||||
public R workFlowFileDownload(@RequestParam Long id){
|
||||
|
||||
return workFlowVersionService.workFlowFileDownload(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
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);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,9 +1,7 @@
|
|||
package com.mcwl.web.controller.system;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.mcwl.common.annotation.Anonymous;
|
||||
import com.mcwl.common.constant.Constants;
|
||||
import com.mcwl.common.constant.HttpStatus;
|
||||
import com.mcwl.common.constant.QueueConstants;
|
||||
import com.mcwl.common.constant.RedisConstants;
|
||||
import com.mcwl.common.core.domain.AjaxResult;
|
||||
|
@ -20,13 +18,15 @@ import com.mcwl.framework.web.service.SysLoginService;
|
|||
import com.mcwl.framework.web.service.SysPermissionService;
|
||||
import com.mcwl.framework.web.service.TokenService;
|
||||
import com.mcwl.system.service.ISysMenuService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
|
@ -34,6 +34,7 @@ import java.util.concurrent.TimeUnit;
|
|||
*
|
||||
* @author mcwl
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
public class SysLoginController
|
||||
{
|
||||
|
@ -61,31 +62,31 @@ public class SysLoginController
|
|||
public AjaxResult code(@RequestParam String phone){
|
||||
|
||||
if (StringUtils.isEmpty(phone)){
|
||||
return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"请输入手机号");
|
||||
return AjaxResult.error("请输入手机号");
|
||||
}
|
||||
|
||||
//校验验证码是否存在
|
||||
if (redisCache.hasKey(RedisConstants.CODE_PHONE+phone)){
|
||||
|
||||
return AjaxResult.error(HttpStatus.SHOW_ERROR_MSG,"请勿重复发送");
|
||||
return AjaxResult.error("请勿重复发送");
|
||||
}
|
||||
|
||||
//生成验证码
|
||||
String s = CodeUtils.generateCaptcha();
|
||||
|
||||
|
||||
log.info("获取到的验证码:{}",s);
|
||||
//存储redis
|
||||
redisCache.setCacheObject(RedisConstants.CODE_PHONE+phone,s,1, TimeUnit.MINUTES);
|
||||
|
||||
PhoneLoginBody phoneLoginBody = PhoneLoginBody.builder().code(s)
|
||||
.phone(phone).build();
|
||||
//发送短信服务
|
||||
// 构建 sendDataMap
|
||||
Map<String, String> sendDataMap = new HashMap<>();
|
||||
sendDataMap.put("code:", s);
|
||||
// TelSmsUtils.sendSms(phone,"SMS_460535072",sendDataMap);
|
||||
|
||||
rabbitTemplate.convertAndSend(QueueConstants.CODE_QUEUE, JSONObject.toJSONString(phoneLoginBody), message -> {
|
||||
message.getMessageProperties().setMessageId(UUID.randomUUID().toString().replace("-",""));
|
||||
return message;
|
||||
});
|
||||
rabbitTemplate.convertAndSend(QueueConstants.CODE_QUEUE,s);
|
||||
|
||||
return AjaxResult.success();
|
||||
return AjaxResult.success(s);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ import com.mcwl.system.service.ISysDeptService;
|
|||
import com.mcwl.system.service.ISysPostService;
|
||||
import com.mcwl.system.service.ISysRoleService;
|
||||
import com.mcwl.system.service.ISysUserService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
@ -48,15 +47,6 @@ public class SysUserController extends BaseController
|
|||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
/**
|
||||
* 获取id
|
||||
*/
|
||||
@GetMapping("/getUserId")
|
||||
public AjaxResult getSysUserId() {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
return AjaxResult.success(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
|
@ -262,13 +252,9 @@ public class SysUserController extends BaseController
|
|||
* 查询个人信息
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "个人中心查询个人数据")
|
||||
@GetMapping("/selectUserById")
|
||||
public AjaxResult selectUserById(@RequestParam(name = "id", required = false) Long id){
|
||||
if (id == null){
|
||||
id = SecurityUtils.getUserId();
|
||||
}
|
||||
SysUser sysUser = userService.selectUserInfoById(id);
|
||||
public AjaxResult selectUserById(){
|
||||
SysUser sysUser = userService.selectUserInfoById(SecurityUtils.getUserId());
|
||||
return success(sysUser);
|
||||
}
|
||||
|
||||
|
@ -280,8 +266,8 @@ public class SysUserController extends BaseController
|
|||
@PostMapping("/updateUserInfo")
|
||||
public AjaxResult updateUserInfo(@RequestBody SysUser sysUser){
|
||||
|
||||
|
||||
return userService.updateUserInfo(sysUser);
|
||||
userService.updateUserInfo(sysUser);
|
||||
return AjaxResult.success("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -109,19 +109,16 @@ public class WXController {
|
|||
String openid = redisTemplate.opsForValue().get(verifyKey);
|
||||
ajax.put("status", 0);
|
||||
System.out.println("openid:{}" + openid);
|
||||
|
||||
if (!StringUtils.isEmpty(openid)) {
|
||||
String openid1 = openid.substring(1, openid.length() - 1);
|
||||
redisTemplate.delete(verifyKey);
|
||||
SysUser user = iSysUserThirdAccountService.selectUserByOpenId(openid1);
|
||||
SysUser user = iSysUserThirdAccountService.selectUserByOpenId(openid);
|
||||
System.out.println("用户:{}" + user);
|
||||
if (user.getUserId() == null) {
|
||||
|
||||
iSysUserService.addUser(openid1,CacheConstants.WE_CHAT,null);
|
||||
user = iSysUserThirdAccountService.selectUserByOpenId(openid1);
|
||||
iSysUserService.addUser(openid,CacheConstants.WE_CHAT,null);
|
||||
user = iSysUserThirdAccountService.selectUserByOpenId(openid);
|
||||
}
|
||||
LoginUser loginUser = new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||
log.info("生成token的数据user:{}",user);
|
||||
// 生成token
|
||||
String token = tokenService.createToken(loginUser);
|
||||
ajax.put("token", token);
|
||||
|
|
|
@ -4,8 +4,6 @@ import java.util.ArrayList;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.mcwl.common.constant.HttpStatus;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
|
|
@ -1,176 +0,0 @@
|
|||
# 数据源配置
|
||||
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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
# 沙箱应用公钥证书
|
||||
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:
|
||||
#mq
|
||||
rabbitmq:
|
||||
host: 113.45.9.111
|
||||
host: 1.13.246.108
|
||||
port: 5672
|
||||
username: guest
|
||||
password: guest
|
||||
|
@ -23,7 +23,7 @@ spring:
|
|||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://113.45.9.111:3306/mcwl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://1.13.246.108:3306/mcwl?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: ybl123456@
|
||||
# 从库数据源
|
||||
|
@ -76,99 +76,11 @@ spring:
|
|||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 113.45.9.111
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password: MuYu_Cloud@Redis
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 5
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 10
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 1000
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
time-between-eviction-runs: 6000
|
||||
|
||||
|
||||
# token配置
|
||||
token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 43200
|
||||
|
||||
# 公众号配置
|
||||
wechat:
|
||||
# 应用ID
|
||||
appid: wx0a72f196ec9c3a70
|
||||
appid: wx82d4c3c96f0ffa5b
|
||||
# 应用密钥
|
||||
secret: 11218568b79e2c5eb10459ef8c0374bd
|
||||
secret: abbabcf1da711a3bbd95387ec83edcac
|
||||
|
||||
# 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: 2021005119630093
|
||||
# 线上应用私钥
|
||||
privateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCQuhRU5iHoabfzJS40A+moMKzb5rmi5XbL59K98CW65Oq/rnzQnj6sCYggIXOLCLKUykZ1XIVa+4V7bGFkMDF0236ncPumnVY/tfCSebLyKl+up1mGeH4mAR6ily7nXAhRnXL+A0015bpCa5FCg2ReN68MEmquB/mHfeLqJfRupwzDWnIWxYSKkFCJ0i47KTFYhM93LHHQ8GrZNNaeiJ6q59MruQI83z0HCxN/DzK4Z2rBWGilwPuYcSEa0STPXYhz8XMXUX/Mlp7dd5zyWeNaxkNRWlhKHvhLVPGvteaEcchs476DIWLCRVXEC1372wMKNrKblzRp7Wi5+l+W14k5AgMBAAECggEAHahkPjmivTPc5FC8NSCQI01GPxH6/Ky1OXfaMd4ifTgn+vvQzBeBlFOnt53jRZyUq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pAvd8nI03gXA5VF3uwp4UjfGpoIAGDBrqQv9DM8vx6C6VJNTT5esZWZSw/+PZ4D19l0/n7gICGx3ugw0Q=
|
||||
# 线上应用公钥证书
|
||||
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,14 +57,45 @@ spring:
|
|||
servlet:
|
||||
multipart:
|
||||
# 单个文件大小
|
||||
max-file-size: 40GB
|
||||
max-file-size: 10MB
|
||||
# 设置总上传的文件大小
|
||||
max-request-size: 40GB
|
||||
max-request-size: 20MB
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
# 热部署开关
|
||||
enabled: true
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
host: 1.13.246.108
|
||||
# 端口,默认为6379
|
||||
port: 6370
|
||||
# 数据库索引
|
||||
database: 0
|
||||
# 密码
|
||||
password: MuYu_Cloud@Redis
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
lettuce:
|
||||
pool:
|
||||
# 连接池中的最小空闲连接
|
||||
min-idle: 0
|
||||
# 连接池中的最大空闲连接
|
||||
max-idle: 8
|
||||
# 连接池的最大数据库连接数
|
||||
max-active: 8
|
||||
# #连接池最大阻塞等待时间(使用负值表示没有限制)
|
||||
max-wait: -1ms
|
||||
|
||||
# token配置
|
||||
token:
|
||||
# 令牌自定义标识
|
||||
header: Authorization
|
||||
# 令牌密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
# 令牌有效期(默认30分钟)
|
||||
expireTime: 1440
|
||||
|
||||
# MyBatis Plus配置
|
||||
mybatis-plus:
|
||||
|
@ -84,7 +115,7 @@ mybatis-plus:
|
|||
# NONE:不启用 PARTIAL:只对非嵌套 resultMap 自动映射 FULL:对所有 resultMap 自动映射
|
||||
autoMappingBehavior: PARTIAL
|
||||
# MyBatis 自动映射时未知列或未知属性处理策
|
||||
# NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息.
|
||||
# NONE:不做处理 WARNING:打印相关警告 FAILING:抛出异常和详细信息
|
||||
autoMappingUnknownColumnBehavior: NONE
|
||||
# 更详细的日志输出 会有性能损耗 org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
# 关闭日志记录 (可单纯使用 p6spy 分析) org.apache.ibatis.logging.nologging.NoLoggingImpl
|
||||
|
@ -122,7 +153,7 @@ swagger:
|
|||
# 是否开启swagger
|
||||
enabled: true
|
||||
# 请求前缀
|
||||
pathMapping:
|
||||
pathMapping: /dev-api
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
|
@ -132,5 +163,25 @@ xss:
|
|||
excludes: /system/notice
|
||||
# 匹配链接
|
||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||
knife4j:
|
||||
enable: true
|
||||
|
||||
# yml版(application.yml)
|
||||
aliyun:
|
||||
oss:
|
||||
bucketName: ybl2112
|
||||
endpoint: oss-cn-beijing.aliyuncs.com
|
||||
accessKeyId: LTAI5tSHZZ8wHJRP8X4r9TXT
|
||||
accessKeySecret: F82IVNx0IGJ3AnP6gSIfcyql1HCXIH
|
||||
policy : https://ybl2112.oss-cn-beijing.aliyuncs.com/
|
||||
|
||||
|
||||
mall:
|
||||
mgt:
|
||||
aliPayConfig:
|
||||
protocol: https
|
||||
gatewayHost: openapi-sandbox.dl.alipaydev.com
|
||||
signType: RSA2
|
||||
appId: 9021000135682614
|
||||
privateKey: MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCQxmQGcaiKjOhayWi+zNTvpp8B5YT8jFFkjLzrD+W+T2Dwf2GfFR4p95zsCJxYeoLWdghMPA6/GMFrLbuVFpaEjuTm4icqA9N8n5d3W0j7gh+wMjZoqyJclAIeb09ut7rY6mWzilA9kWmZnUG7MOWIU70RVRYrfJectCFw/odM9lG4XIVe13X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rZsNp8eRmJcBmMVnskofEZ2iHQuS71pw/n58EQTLo0ayJbhPjVJL8K3CovXzrfjbmqqoa5xi3bJQTiXdF6rMw1QpD6Uk05E1LVuQ6v/IZFr7kBYlAQWb8z3NhQq+bPU+nyLvAoGAGpBbSM8gPzdWQqkHoos0icu3cj0GhN3MU7+1Eb/rsXyh/lk5wtZTEnHjwhdUOUtwVNjvrv7CzA7unhOoaM6YcE/Zpd4zt8pjqH1Mhds7UHf4Xg+A+J4G6meYnhSwfBpOub02ncsqfBlXE0qhFv6AvcMewWndyLb8EYaUUXTYkG0=
|
||||
publicKey: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApHkjwHnoUnZuqbas+ZputyWIfU2WKBFKd+wFwlCZytpQhVA16CGAMCGpgjxUPpqbmOtPy74y0wxmDHB9IaYOVsVmi2SAl1IqfxwUSIllbdvbjBvZFAIQlPa8U/zHJPgdGNHDt/Bwqp5uB0OkcGLB9PYyAXBEKiu6zdTsiZloUrPwgnBRJ0iNHYiWo/oOYD9KfopLA+D1nQjqq8m3ShZe46ecMo6ZCHtQI/HtgL/EGga5KY2zOUi0Wwviu8w79RjjzfdsDkzu5VnBdaSru4awDyiF9nAF+uPgA4ZOdLKkpoEANwuIorDW8tT69Gwh+mYx9sDJMxJf7XOekdPbymomiwIDAQAB
|
||||
notifyUrl: https://253d7236.r27.cpolar.top/web/pay/notify
|
||||
gatewayUrl: https://openapi-sandbox.dl.alipaydev.com/gateway.do
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIDszCCApugAwIBAgIQICUCGGcg6L5kXzAfaOSi6zANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UE
|
||||
BhMCQ04xGzAZBgNVBAoMEkFudCBGaW5hbmNpYWwgdGVzdDElMCMGA1UECwwcQ2VydGlmaWNhdGlv
|
||||
biBBdXRob3JpdHkgdGVzdDE+MDwGA1UEAww1QW50IEZpbmFuY2lhb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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+2mxFwTYhKAwpDIDKuYsFUXuo8t261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QgQ0EgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOPPShpV
|
||||
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-----
|
|
@ -1,23 +0,0 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIEgjCCA2qgAw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Hmh0dHA6Ly9jYS5hbGlwYXkuY29tL2NybDk4LmNybDBgBggrBgEFBQcBAQRU
|
||||
MFIwKAYIKwYBBQUHMAKGHGh0dHA6Ly9jYS5hbGlwYXkuY29tL2NhNi5jZXIwJgYIKwYBBQUHMAGG
|
||||
Gmh0dHA6Ly9jYS5hbGlwYXkuY29tOjgzNDAvMA0GCSqGSIb3DQEBCwUAA4IBAQAmDOoavQGthLtz
|
||||
WuW1e0g0K2WChYevFcnWWNILTJ0EsB01Ka0FagOo1T3ErGns+G9lbSj9g6DQZ5DVqLCGnl2ZRvBN
|
||||
KwSnA/7Frllf7CebBaW5WWJ3VKWxP929izvywlPeQdmRELNGK4H/IZoW+nCDYjUgXLOLMgBnqmLY
|
||||
wgug/g3iQ+yFSFuvSNE2J84FwPycWweDJ8zrj4aM9S/bjjWoE/Lfe/a86BIYV19A72Ozc/aTGnxP
|
||||
W/D5txDrhO2wWeCzXd7TuBN1Hze5IX/hYeDqM3rjHuQcGcbFJOchqqR5fUEC/SU9MZ4j/KWND83l
|
||||
Y28GbRbP5jxhgckHIKjfKh6b
|
||||
-----END CERTIFICATE-----
|
|
@ -1,6 +0,0 @@
|
|||
# 发件人(必须正确,否则发送失败)
|
||||
from = 2119157836@qq.com
|
||||
# 密码(注意,某些邮箱需要为SMTP服务单独设置授权码)
|
||||
pass = wetaiadftmidejab
|
||||
# 使用SSL安全连接
|
||||
sslEnable = true
|
|
@ -1,57 +0,0 @@
|
|||
<!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>
|
|
@ -1,53 +0,0 @@
|
|||
<!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>
|
|
@ -0,0 +1,26 @@
|
|||
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(","));
|
||||
}
|
||||
|
||||
}
|
|
@ -18,30 +18,6 @@
|
|||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baidu.aip</groupId>
|
||||
<artifactId>java-sdk</artifactId>
|
||||
<version>4.12.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
<artifactId>javax.mail</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Jackson -->
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--OSS-->
|
||||
<dependency>
|
||||
<groupId>com.aliyun.oss</groupId>
|
||||
|
@ -184,12 +160,10 @@
|
|||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
|
@ -375,7 +349,7 @@
|
|||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.13</version>
|
||||
<version>4.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
|
@ -388,46 +362,7 @@
|
|||
<version>2.6</version>
|
||||
</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>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>huawei-public</id>
|
||||
<url>https://repo.huaweicloud.com/repository/maven/</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -22,7 +22,7 @@ public @interface RepeatSubmit
|
|||
/**
|
||||
* 间隔时间(ms),小于此时间视为重复提交
|
||||
*/
|
||||
public int interval() default 1000;
|
||||
public int interval() default 5000;
|
||||
|
||||
/**
|
||||
* 提示消息
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
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,19 +52,5 @@ public class CacheConstants
|
|||
*/
|
||||
public static final String WE_CHAT = "we_chat";
|
||||
|
||||
/**
|
||||
* 校验身份证次数
|
||||
*/
|
||||
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,7 @@
|
|||
package com.mcwl.common.constant;
|
||||
|
||||
import io.jsonwebtoken.Claims;
|
||||
|
||||
import java.util.Locale;
|
||||
import io.jsonwebtoken.Claims;
|
||||
|
||||
/**
|
||||
* 通用常量信息
|
||||
|
@ -11,17 +10,6 @@ import java.util.Locale;
|
|||
*/
|
||||
public class Constants
|
||||
{
|
||||
|
||||
/**
|
||||
* 工作流
|
||||
*/
|
||||
public static final String WORKFLOW = "workflow";
|
||||
|
||||
/**
|
||||
* 模型
|
||||
*/
|
||||
public static final String MODEL = "model";
|
||||
|
||||
/**
|
||||
* UTF-8 字符集
|
||||
*/
|
||||
|
@ -175,12 +163,7 @@ public class Constants
|
|||
/**
|
||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||
*/
|
||||
public static final String[] JOB_WHITELIST_STR = {
|
||||
"com.mcwl.quartz.task",
|
||||
"com.mcwl.memberCenter.task",
|
||||
"com.mcwl.pay.task",
|
||||
"com.mcwl.communityCenter.task"
|
||||
};
|
||||
public static final String[] JOB_WHITELIST_STR = { "com.mcwl.quartz.task" };
|
||||
|
||||
/**
|
||||
* 定时任务违规的字符
|
||||
|
|
|
@ -15,11 +15,6 @@ public class DictConstants {
|
|||
*/
|
||||
public static final String MALL_PRODUCT_STATUS = "mall_product_status";
|
||||
|
||||
/**
|
||||
* 高清修复
|
||||
*/
|
||||
public static final String DICT_TYPE_MODEL_VERSION_HIGH = "dict_type_model_version_high";
|
||||
|
||||
/**
|
||||
* 类型模型
|
||||
*/
|
||||
|
@ -56,24 +51,4 @@ public class DictConstants {
|
|||
*/
|
||||
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,9 +91,4 @@ public class HttpStatus
|
|||
* 系统警告消息
|
||||
*/
|
||||
public static final int WARN = 601;
|
||||
|
||||
/**
|
||||
* 统一展示错误信息
|
||||
*/
|
||||
public static final int SHOW_ERROR_MSG = 12202;
|
||||
}
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
||||
* www.hnapay.com
|
||||
*/
|
||||
|
||||
package com.mcwl.common.constant;
|
||||
|
||||
/**
|
||||
* 常量配置
|
||||
*/
|
||||
public class NcountKey {
|
||||
|
||||
public static String NCOUNT_URL = "https://ncount.hnapay.com/api/";
|
||||
|
||||
//新生签名使用的算法
|
||||
public static String ALGORITHM = "RSA";
|
||||
|
||||
//类型
|
||||
public static String SIGN_ALGORITHM = "SHA1withRSA";
|
||||
|
||||
//前置系统公钥
|
||||
/*public static String NCOUNT_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9vGvYjivDF5uPBNDXMtoAtjYQ2YPSsfareduDG6kHL/N3A05rFHA11Dbr+UON82Y4V0RFKAQeZFPWcTLjcy6ntZVI8XoYLpuVQBPsb0Ya+PwbzR8/TmUdUf91ru8APtJgqkULgPVrO1hhzZ1tQMznosNLTOqbknMnnMcwzB5yYwIDAQAB";*/
|
||||
|
||||
public static String NCOUNT_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9vGvYjivDF5uPBNDXMtoAtjYQ" +
|
||||
"2YPSsfareduDG6kHL/N3A05rFHA11Dbr+UON82Y4V0RFKAQeZFPWcTLjcy6ntZVI" +
|
||||
"8XoYLpuVQBPsb0Ya+PwbzR8/TmUdUf91ru8APtJgqkULgPVrO1hhzZ1tQMznosNL" +
|
||||
"TOqbknMnnMcwzB5yYwIDAQAB";
|
||||
|
||||
|
||||
// public static String MER_PRIVATE_KEY = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAOMNbm6VJwmOQh74\r\n" +
|
||||
// "DyhrKpX+qLKYeeW3sUoXmmstka5AeAVf3UjHCwuZQHviwwGxUIdi0r320aIUetb1\r\n" +
|
||||
// "gRPm4WDMz9FPsBs54hPhHxIBrt3mXEl9cP4S8YdlivQY7Hbf1WqxNhy5wEf0OpkZ\r\n" +
|
||||
// "JjS7wEU46JfKwbGuzcSVkgWi+iuTAgMBAAECgYBX9OAO3qDcxss+jAHzOnCo4pof\r\n" +
|
||||
// "dYnjP6HiffpIAsMoqbjU/CoRA2p398pPM60vfq0fhVz2UiMrkptzom96cjpkNpQ4\r\n" +
|
||||
// "4uztdoozxKmnHiIV1ttISLqMjfh4xkapxVkFJDcEn8ZTpiMmfjEHX0ao3xk1gprL\r\n" +
|
||||
// "vLMpRr1ar5vCqFEGIQJBAPgrGYpteTtjpZqskP9Pg9O7E4XuAgJ01Kqd7Mp8s3Ij\r\n" +
|
||||
// "1nPUmhG+GDDV6MTNDVUfvLWTTvc4MjU2xTQm+6cu2RcCQQDqN72gqLbaKAMULUCt\r\n" +
|
||||
// "vVST7eT53OBPMjbBi90JRqNPZrXuS+Wr7tw3zVb8j5p0w2qBotK7wEq9Pmjidlma\r\n" +
|
||||
// "JhblAkAT95vJeH9tmNnlNQdBk4s+yOmMOBcvTWkjBSvdKuVhRKLnlO6EiO/3Ve6x\r\n" +
|
||||
// "jvIIrFIJpf2PhJT9lReO16gdznYnAkEApvOCpNF+PXUF9Mzo7K8naabKb9yku28E\r\n" +
|
||||
// "nuPOc/05DbEd/7V0CiFiMhiZZ8AJDi/5bFyesBw6ajjhVIOeDQYXjQJARsJP8PDK\r\n" +
|
||||
// "8sEtHtXwOn2vKbx1lSpT9aX3uK/eB7zJLUMBcAsLsoHZC+YqjKjoSD4sGM6ukH0w\r\n" +
|
||||
// "zzlZdaTU3Ued3g==";
|
||||
|
||||
//测试环境商户私钥
|
||||
/*public static String MER_PRIVATE_KEY = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBAM2Ak5XX86FypU3t\n" +
|
||||
"DSXlDQp+eXgowPLjBoEt0ZfEfhUtLIrU8J4YzUiz9tUzI6o6mGafDltUasdyRtt3\n" +
|
||||
"+NdSQuFq7MhZyWwGUqle3ybGswYVkN8+LMADCQEOYphM4p0j/OGw7QYcL/ERHsUW\n" +
|
||||
"2MGPR6M/9xe0KURIDdeJC0ulxQ8TAgMBAAECgYEAqgTfldBl68PbSb5+60Q25uC+\n" +
|
||||
"hJBLGmiDwCp1Rng1zDVkrbQBIvvoE2d5Jui5cCQsZHLhwOP1t+8u+nKmuRaA51vB\n" +
|
||||
"sQ+F01SqYrmS/TV/iD5xjAteSXmTf76doP7FwrHuRQ391KcdIn+W0R7cv1tLBY5B\n" +
|
||||
"oRnAcAwWhQMiRWf+yPECQQD6TtJ7kETd5Rl3YryFMTvfW73oHxss87jz6/tUIPxF\n" +
|
||||
"rXYu+ywD4Ut1AWwtN6Td6kZhWOUhG2d4OUVYP0FtjjprAkEA0izql6EQB7SF8AE5\n" +
|
||||
"j8U7Weg8IqPk8b78neav8y1CpjSuwOaRxcS1Mk+W2/AXRvTRL2VUw+Az4boAz3MS\n" +
|
||||
"WnP3+QJBAJW6vtfhRgDCQciTjJfUCq+irmgC63upUzK+L7p0fNOlXrPd1ceAZmXY\n" +
|
||||
"cwBdb8a7lFw5E98JCIz3HU8bj6TcVn8CQQC3EfLBYsSwwXjNBnQaHAVHmfcPgU0B\n" +
|
||||
"mYc3DuKB4hGk7kytr+iXqHDgQt039FiCMOso6o28FEV8v+TGzgfVjCAZAkA9NWuj\n" +
|
||||
"VEHwFLZLtftLDQxGfJmWJGl4CipOjv6YpQEw0A2NBtUp5tuiJ09DNq5RaKJbfWUY\n" +
|
||||
"fQJkAZ0tsrXBWqgK";*/
|
||||
|
||||
public static String MER_PRIVATE_KEY = "MIICeAIBADANBgkqhkiG9w0BAQEFAASCAmIwggJeAgEAAoGBALAkYQn6emeoRsStWebayuyqMB91j27j+gMJO+YqdK1jVpgp4yh2pja9TxQvoLnd3mJcjyACYvW8imWjgtRDDJK4FOj1pYK+EgbX+32PpD8STDnbC93JertbexKk3NNQi5cur40qGEWRspJEPHZTvobZ+EhsJlH8b/oGG1VKORlXAgMBAAECgYA5qf82tBCEhNt+Ib4vzGroZaLRebwWMn4zpj88z6NY7A96SyQ5p/YsL3eHBTyZ/J+EFgcpFH7vMeUg9xGqibTAexqulCNTvOQBYNGra85yUsnob19sHR/YCx80HI5el8RD2mRL6kbmOnab5yi5O2fc8tl+DRJztKXU3YgNH+OhsQJBAPUENKWJJU/OloKYAvOceAy66ZzEKI/myt5x5jcmZTp7bc0wzsxQQ60TfTqfmpOqEd9cJWxggHvutzCBqPovOZkCQQC4CcaSKs3Z2E9/uPr92Z+DIv/5RHTkq66WstG5iM/5aoz7Hf7mP8xTgcjtKNPTcb+nC5IE6M41IuWnSAz8bCBvAkEAuR/FW3GFFIil5eRPDpuhhRTQn9cCQsABdhMe+3pyL77Elq2TAoJ+r82y59FhrMJqIJZx3DIJwhn6pZbCAs4duQJBAKTMrDIrflY660WWIbu7aqmFZ+6QrJQwYJC15DPeHU5daY1dGOqZ6qBEseYdD0Jis5okNEeNKUpPy5J2ZJqNQKUCQQDdyqJhwxjiQ7BtafYNEf/fmP5bkHSKhzOM6lIN8cLX6h535xHObHdOpmKgUg9mLHgJvlNQy+glh40AF2HdNcLS";
|
||||
|
||||
|
||||
public static String MER_ID = "300050402928";
|
||||
|
||||
/**
|
||||
* 支付宝的收款账户id
|
||||
*/
|
||||
public static String ZFB_MER_ID = "2405101553133642463";
|
||||
|
||||
//测试环境商户ID
|
||||
//public static String MER_ID = "110000030228";
|
||||
|
||||
}
|
|
@ -19,26 +19,6 @@ public class QueueConstants {
|
|||
// 会员账单队列
|
||||
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";
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -11,6 +11,4 @@ package com.mcwl.common.constant;
|
|||
public class RedisConstants {
|
||||
|
||||
public static final String CODE_PHONE = "code_phone:";
|
||||
|
||||
public static final String CODE_UUID = "code_uuid:";
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
package com.mcwl.common.core.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.Builder;
|
||||
|
||||
/**
|
||||
* Entity基类
|
||||
*
|
||||
|
@ -28,21 +28,17 @@ public class BaseEntity implements Serializable
|
|||
private String searchValue;
|
||||
|
||||
/** 创建者 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新者 */
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
// 删除标志(0代表存在 2代表删除)
|
||||
|
|
|
@ -2,15 +2,12 @@ package com.mcwl.common.core.domain;
|
|||
|
||||
import java.io.Serializable;
|
||||
import com.mcwl.common.constant.HttpStatus;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* 响应信息主体
|
||||
*
|
||||
* @author mcwl
|
||||
*/
|
||||
@ApiModel(value = "响应结果")
|
||||
public class R<T> implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
@ -21,13 +18,10 @@ public class R<T> implements Serializable
|
|||
/** 失败 */
|
||||
public static final int FAIL = HttpStatus.ERROR;
|
||||
|
||||
@ApiModelProperty(value = "状态码")
|
||||
private int code;
|
||||
|
||||
@ApiModelProperty(value = "提示信息")
|
||||
private String msg;
|
||||
|
||||
@ApiModelProperty(value = "数据对象")
|
||||
private T data;
|
||||
|
||||
public static <T> R<T> ok()
|
||||
|
|
|
@ -53,10 +53,6 @@ public class SysDictData extends BaseEntity
|
|||
@Excel(name = "状态", readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 父级ID标志
|
||||
*/
|
||||
@Excel(name = "父级ID标志")
|
||||
private Integer partId;
|
||||
|
||||
public Integer getPartId() {
|
||||
|
|
|
@ -115,44 +115,12 @@ public class SysUser extends BaseEntity
|
|||
*/
|
||||
private Double freePoints;
|
||||
|
||||
/**
|
||||
* 钱包-金币
|
||||
*/
|
||||
private Double wallet;
|
||||
|
||||
/**
|
||||
* 是否关注
|
||||
*/
|
||||
private Boolean isAttention;
|
||||
|
||||
/**
|
||||
* 背景地址
|
||||
*/
|
||||
private String backgroundImg;
|
||||
|
||||
/**
|
||||
* 邀请码
|
||||
*/
|
||||
private String invitationCode;
|
||||
|
||||
/**
|
||||
* 邀请人名字
|
||||
*/
|
||||
private String invitationName;
|
||||
|
||||
public SysUser()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public String getBackgroundImg() {
|
||||
return backgroundImg;
|
||||
}
|
||||
|
||||
public void setBackgroundImg(String backgroundImg) {
|
||||
this.backgroundImg = backgroundImg;
|
||||
}
|
||||
|
||||
public SysUser(Long userId)
|
||||
{
|
||||
this.userId = userId;
|
||||
|
@ -200,7 +168,6 @@ public class SysUser extends BaseEntity
|
|||
this.nickName = nickName;
|
||||
}
|
||||
|
||||
|
||||
@Xss(message = "用户账号不能包含脚本字符")
|
||||
@NotBlank(message = "用户账号不能为空")
|
||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||
|
@ -226,14 +193,6 @@ public class SysUser extends BaseEntity
|
|||
this.email = email;
|
||||
}
|
||||
|
||||
public Long getInviterUserId() {
|
||||
return inviterUserId;
|
||||
}
|
||||
|
||||
public void setInviterUserId(Long inviterUserId) {
|
||||
this.inviterUserId = inviterUserId;
|
||||
}
|
||||
|
||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||
public String getPhonenumber()
|
||||
{
|
||||
|
@ -389,7 +348,13 @@ public class SysUser extends BaseEntity
|
|||
this.brief = brief;
|
||||
}
|
||||
|
||||
public Long getInviterUserId() {
|
||||
return inviterUserId;
|
||||
}
|
||||
|
||||
public void setInviterUserId(Long inviterUserId) {
|
||||
this.inviterUserId = inviterUserId;
|
||||
}
|
||||
|
||||
public Double getFreePoints() {
|
||||
return freePoints;
|
||||
|
@ -399,30 +364,6 @@ public class SysUser extends BaseEntity
|
|||
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
|
||||
public String toString() {
|
||||
return "SysUser{" +
|
||||
|
@ -449,19 +390,6 @@ public class SysUser extends BaseEntity
|
|||
", idCard='" + idCard + '\'' +
|
||||
", inviterUserId=" + inviterUserId +
|
||||
", 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
package com.mcwl.common.core.page;
|
||||
|
||||
import com.mcwl.common.utils.StringUtils;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
|
@ -11,29 +9,23 @@ import javax.validation.constraints.NotNull;
|
|||
*
|
||||
* @author mcwl
|
||||
*/
|
||||
@ApiModel("分页数据")
|
||||
public class PageDomain
|
||||
{
|
||||
/** 当前记录起始索引 */
|
||||
@NotNull(message = "当前记录起始索引不能为空")
|
||||
@ApiModelProperty(value = "当前记录起始索引",required = true)
|
||||
private Integer pageNum;
|
||||
|
||||
/** 每页显示记录数 */
|
||||
@NotNull(message = "每页显示记录数不能为空")
|
||||
@ApiModelProperty(value = "每页显示记录数",required = true)
|
||||
private Integer pageSize;
|
||||
|
||||
/** 排序列 */
|
||||
@ApiModelProperty(value = "排序列")
|
||||
private String orderByColumn;
|
||||
|
||||
/** 排序的方向desc或者asc */
|
||||
@ApiModelProperty(hidden = true)
|
||||
private String isAsc = "asc";
|
||||
|
||||
/** 分页参数合理化 */
|
||||
@ApiModelProperty(hidden = true)
|
||||
private Boolean reasonable = true;
|
||||
|
||||
public String getOrderBy()
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.mcwl.common.core.page;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -11,25 +8,20 @@ import java.util.List;
|
|||
*
|
||||
* @author mcwl
|
||||
*/
|
||||
@ApiModel("表格分页数据对象")
|
||||
public class TableDataInfo implements Serializable
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 总记录数 */
|
||||
@ApiModelProperty(value = "总记录数")
|
||||
private long total;
|
||||
|
||||
/** 列表数据 */
|
||||
@ApiModelProperty(value = "列表数据")
|
||||
private List<?> rows;
|
||||
|
||||
/** 消息状态码 */
|
||||
@ApiModelProperty(value = "消息状态码")
|
||||
private int code;
|
||||
|
||||
/** 消息内容 */
|
||||
@ApiModelProperty(value = "消息内容")
|
||||
private String msg;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,14 +1,10 @@
|
|||
package com.mcwl.common.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel(description = "id集合")
|
||||
public class IdsParam {
|
||||
@ApiModelProperty(value = "id集合")
|
||||
private List<Long> ids;
|
||||
}
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
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,9 +12,7 @@ public enum ResultCode {
|
|||
|
||||
SUCCESS(200),//成功
|
||||
|
||||
FAIL(400),//
|
||||
|
||||
FAIL_MSG(12202),//失败
|
||||
FAIL(400),//失败
|
||||
|
||||
FAIL_SIGN_IN(401),//登录失败
|
||||
|
||||
|
|
|
@ -1,114 +0,0 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.mcwl.common.exception;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
/**
|
||||
* NCountDemoException
|
||||
*/
|
||||
public class NCountDemoException extends Exception {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -7121642511651992156L;
|
||||
|
||||
/**
|
||||
* 模块名,抛出异常的类
|
||||
*/
|
||||
@SuppressWarnings("rawtypes")
|
||||
protected Class errClass = null;
|
||||
|
||||
/**
|
||||
* 错误码
|
||||
*/
|
||||
protected String errCode = null;
|
||||
|
||||
/**
|
||||
* 错误描述信息
|
||||
*/
|
||||
protected String errMsg = null;
|
||||
|
||||
public NCountDemoException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public NCountDemoException(String errMsg) {
|
||||
super("no errMsg");
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
public NCountDemoException(String errMsg, Exception e) {
|
||||
super("no errMsg", e);
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
public NCountDemoException(String errCode, String errMsg) {
|
||||
super(errMsg);
|
||||
this.errCode = errCode;
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
public NCountDemoException(String errCode, String errMsg, Exception e) {
|
||||
super(errMsg, e);
|
||||
this.errCode = errCode;
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public NCountDemoException(String errCode, Class errClass) {
|
||||
super("no errMsg");
|
||||
this.errCode = errCode;
|
||||
this.errClass = errClass;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public NCountDemoException(String errCode, String errMsg, Class errClass) {
|
||||
super(errMsg);
|
||||
this.errCode = errCode;
|
||||
this.errMsg = errMsg;
|
||||
this.errClass = errClass;
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public NCountDemoException(String errCode, String errMsg, Class errClass, Exception e) {
|
||||
super(errMsg, e);
|
||||
this.errClass = errClass;
|
||||
this.errCode = errCode;
|
||||
this.errMsg = errMsg;
|
||||
}
|
||||
|
||||
public String printErrMsg() {
|
||||
StringBuffer msg = new StringBuffer("");
|
||||
if (StringUtils.isNotBlank(errCode)) {
|
||||
msg.append("Exception errCode is [").append(this.errCode).append("];\n");
|
||||
}
|
||||
|
||||
if (this.errClass != null) {
|
||||
msg.append("Exception Class is [").append(this.errClass.getName()).append("];\n");
|
||||
}
|
||||
|
||||
msg.append("Exception Message is [").append(this.errMsg).append("];\n");
|
||||
|
||||
// 打印错误异常堆栈
|
||||
if (getCause() != null) {
|
||||
getCause().printStackTrace();
|
||||
}
|
||||
|
||||
return msg.toString();
|
||||
}
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public Class getErrClass() {
|
||||
return errClass;
|
||||
}
|
||||
|
||||
public String getErrCode() {
|
||||
return errCode;
|
||||
}
|
||||
|
||||
public String getErrMsg() {
|
||||
return errMsg;
|
||||
}
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package com.mcwl.common.handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import com.mcwl.common.utils.SecurityUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* mybatis-plus 自动填充处理器
|
||||
*/
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||
|
||||
|
||||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
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());
|
||||
try {
|
||||
this.strictInsertFill(metaObject, "tenantId", Long.class, SecurityUtils.getUserId());
|
||||
} catch (Exception e) {
|
||||
this.strictInsertFill(metaObject, "tenantId", Long.class, -1L);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
try {
|
||||
this.setFieldValByName("updateBy", SecurityUtils.getLoginUser().getUser().getNickName(), metaObject);
|
||||
} catch (Exception e) {
|
||||
this.setFieldValByName("updateBy", "", metaObject);
|
||||
}
|
||||
this.setFieldValByName("updateTime", new Date(), metaObject);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
///*
|
||||
// * 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);
|
||||
// }
|
||||
//}
|
|
@ -0,0 +1,58 @@
|
|||
///*
|
||||
// * 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,69 +0,0 @@
|
|||
package com.mcwl.common.utils;
|
||||
|
||||
/**
|
||||
* Base64工具类
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/16
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
public class Base64Util {
|
||||
private static final char last2byte = (char) Integer.parseInt("00000011", 2);
|
||||
private static final char last4byte = (char) Integer.parseInt("00001111", 2);
|
||||
private static final char last6byte = (char) Integer.parseInt("00111111", 2);
|
||||
private static final char lead6byte = (char) Integer.parseInt("11111100", 2);
|
||||
private static final char lead4byte = (char) Integer.parseInt("11110000", 2);
|
||||
private static final char lead2byte = (char) Integer.parseInt("11000000", 2);
|
||||
private static final char[] encodeTable = new char[]{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'};
|
||||
|
||||
public Base64Util() {
|
||||
}
|
||||
|
||||
public static String encode(byte[] from) {
|
||||
StringBuilder to = new StringBuilder((int) ((double) from.length * 1.34D) + 3);
|
||||
int num = 0;
|
||||
char currentByte = 0;
|
||||
|
||||
int i;
|
||||
for (i = 0; i < from.length; ++i) {
|
||||
for (num %= 8; num < 8; num += 6) {
|
||||
switch (num) {
|
||||
case 0:
|
||||
currentByte = (char) (from[i] & lead6byte);
|
||||
currentByte = (char) (currentByte >>> 2);
|
||||
case 1:
|
||||
case 3:
|
||||
case 5:
|
||||
default:
|
||||
break;
|
||||
case 2:
|
||||
currentByte = (char) (from[i] & last6byte);
|
||||
break;
|
||||
case 4:
|
||||
currentByte = (char) (from[i] & last4byte);
|
||||
currentByte = (char) (currentByte << 2);
|
||||
if (i + 1 < from.length) {
|
||||
currentByte = (char) (currentByte | (from[i + 1] & lead2byte) >>> 6);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
currentByte = (char) (from[i] & last2byte);
|
||||
currentByte = (char) (currentByte << 4);
|
||||
if (i + 1 < from.length) {
|
||||
currentByte = (char) (currentByte | (from[i + 1] & lead4byte) >>> 4);
|
||||
}
|
||||
}
|
||||
|
||||
to.append(encodeTable[currentByte]);
|
||||
}
|
||||
}
|
||||
|
||||
if (to.length() % 4 != 0) {
|
||||
for (i = 4 - to.length() % 4; i > 0; --i) {
|
||||
to.append("=");
|
||||
}
|
||||
}
|
||||
|
||||
return to.toString();
|
||||
}
|
||||
}
|
|
@ -1,77 +0,0 @@
|
|||
package com.mcwl.common.utils;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
/**
|
||||
* 文件读取工具类
|
||||
* @author DaiZibo
|
||||
* @date 2025/1/16
|
||||
* @apiNote
|
||||
*/
|
||||
|
||||
public class FileUtil {
|
||||
|
||||
|
||||
/**
|
||||
* 读取文件内容,作为字符串返回
|
||||
*/
|
||||
public static String readFileAsString(String filePath) throws IOException {
|
||||
File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
throw new FileNotFoundException(filePath);
|
||||
}
|
||||
|
||||
if (file.length() > 1024 * 1024 * 1024) {
|
||||
throw new IOException("File is too large");
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder((int) (file.length()));
|
||||
// 创建字节输入流
|
||||
FileInputStream fis = new FileInputStream(filePath);
|
||||
// 创建一个长度为10240的Buffer
|
||||
byte[] bbuf = new byte[10240];
|
||||
// 用于保存实际读取的字节数
|
||||
int hasRead = 0;
|
||||
while ( (hasRead = fis.read(bbuf)) > 0 ) {
|
||||
sb.append(new String(bbuf, 0, hasRead));
|
||||
}
|
||||
fis.close();
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件路径读取byte[] 数组
|
||||
*/
|
||||
public static byte[] readFileByBytes(String filePath) throws IOException {
|
||||
File file = new File(filePath);
|
||||
if (!file.exists()) {
|
||||
throw new FileNotFoundException(filePath);
|
||||
} else {
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream((int) file.length());
|
||||
BufferedInputStream in = null;
|
||||
|
||||
try {
|
||||
in = new BufferedInputStream(new FileInputStream(file));
|
||||
short bufSize = 1024;
|
||||
byte[] buffer = new byte[bufSize];
|
||||
int len1;
|
||||
while (-1 != (len1 = in.read(buffer, 0, bufSize))) {
|
||||
bos.write(buffer, 0, len1);
|
||||
}
|
||||
|
||||
byte[] var7 = bos.toByteArray();
|
||||
return var7;
|
||||
} finally {
|
||||
try {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (IOException var14) {
|
||||
var14.printStackTrace();
|
||||
}
|
||||
|
||||
bos.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue