diff --git a/docker-compose.yml b/docker-compose.yml index 8325f62d..5b64e5f0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,10 @@ version: "3" services: aida_back: - container_name: stable-version-aida-back + container_name: prod-version-aida-back build: . volumes: # 日志目录映射 - ./log:/log ports: - - "10086:5567" + - "10010:5567" diff --git a/pom.xml b/pom.xml index 14913240..4186fc61 100644 --- a/pom.xml +++ b/pom.xml @@ -170,6 +170,30 @@ commons-pool2 + + org.apache.poi + poi + 5.2.1 + + + + org.apache.poi + poi-ooxml + 5.2.1 + + + + commons-io + commons-io + 2.11.0 + + + + org.apache.logging.log4j + log4j-api + 2.17.1 + + diff --git a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java index 208075fd..7f7428ad 100644 --- a/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java +++ b/src/main/java/com/ai/da/common/RabbitMQ/MQConfig.java @@ -16,8 +16,8 @@ import org.springframework.beans.factory.annotation.Value; public class MQConfig { public static final String GENERATE_EXCHANGE_FANOUT = "generate-exchange"; -// public static final String GENERATE_QUEUE = "generate-queue-prod"; - public static final String GENERATE_QUEUE = "generate-queue-test"; + public static final String GENERATE_QUEUE = "generate-queue-prod"; +// public static final String GENERATE_QUEUE = "generate-queue-test"; public MQConfig() { } diff --git a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java index 93ff24f6..79889833 100644 --- a/src/main/java/com/ai/da/common/config/MyTaskScheduler.java +++ b/src/main/java/com/ai/da/common/config/MyTaskScheduler.java @@ -2,13 +2,25 @@ package com.ai.da.common.config; import com.ai.da.common.utils.SendEmailUtil; import com.ai.da.mapper.AccountMapper; +import com.ai.da.mapper.TrialOrderMapper; import com.ai.da.mapper.entity.Account; +import com.ai.da.mapper.entity.TrialOrder; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import org.springframework.scheduling.annotation.EnableScheduling; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import javax.annotation.PostConstruct; import javax.annotation.Resource; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; import java.util.List; @Component @@ -17,6 +29,14 @@ public class MyTaskScheduler { @Resource private AccountMapper accountMapper; + @Resource + private TrialOrderMapper trialOrderMapper; + +// @PostConstruct +// public void executeWeeklyHeavyStockReport() { +// sendTrialOrderExcelToManagements(); +// } + // 定时任务,每十五天执行一次 // @Scheduled(cron = "0 0 0 ? * MON") @Scheduled(cron = "0 0 0 */15 * ?") @@ -53,4 +73,65 @@ public class MyTaskScheduler { } } } + @Scheduled(cron = "0 0 8 * * ?") + public void sendTrialOrderExcelToManagements() { + // 获取前一天日期 + LocalDate yesterday = LocalDate.now().minusDays(1); + + // 查询前一天的试用订单 + QueryWrapper qw = new QueryWrapper<>(); + qw.lambda().between(TrialOrder::getCreateTime, yesterday.atStartOfDay(), yesterday.atTime(23, 59, 59)); + List trialOrders = trialOrderMapper.selectList(qw); + + if (!trialOrders.isEmpty()) { + // 创建Excel工作簿 + try (Workbook workbook = new XSSFWorkbook()) { + // 创建工作表 + Sheet sheet = workbook.createSheet("Trial Orders"); + // 创建标题行 + Row headerRow = sheet.createRow(0); + headerRow.createCell(0).setCellValue("ID"); + headerRow.createCell(1).setCellValue("Title"); + headerRow.createCell(2).setCellValue("Surname"); + headerRow.createCell(3).setCellValue("Given Name"); + headerRow.createCell(4).setCellValue("Username"); + headerRow.createCell(5).setCellValue("Email"); + headerRow.createCell(6).setCellValue("Country"); + headerRow.createCell(7).setCellValue("Occupation"); + headerRow.createCell(8).setCellValue("Create Time"); + headerRow.createCell(9).setCellValue("Update Time"); + headerRow.createCell(10).setCellValue("Status"); + + // 填充数据 + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + int rowNum = 1; + for (TrialOrder trialOrder : trialOrders) { + Row row = sheet.createRow(rowNum++); + row.createCell(0).setCellValue(trialOrder.getId()); + row.createCell(1).setCellValue(trialOrder.getTitle()); + row.createCell(2).setCellValue(trialOrder.getSurname()); + row.createCell(3).setCellValue(trialOrder.getGivenName()); + row.createCell(4).setCellValue(trialOrder.getUserName()); + row.createCell(5).setCellValue(trialOrder.getEmail()); + row.createCell(6).setCellValue(trialOrder.getCountry()); + row.createCell(7).setCellValue(trialOrder.getOccupation()); + row.createCell(8).setCellValue(trialOrder.getCreateTime().format(formatter)); + row.createCell(9).setCellValue(trialOrder.getUpdateTime().format(formatter)); + row.createCell(10).setCellValue(trialOrder.getStatus()); + } + + // 保存Excel文件 + String fileName = "trialOrder-" + yesterday.format(DateTimeFormatter.ofPattern("yyyyMMdd")) + ".xlsx"; + try (FileOutputStream fileOut = new FileOutputStream(fileName)) { + workbook.write(fileOut); + SendEmailUtil.sendExcelEmail("1023316923@qq.com", null, Files.readAllBytes(Paths.get(fileName)), fileName); + SendEmailUtil.sendExcelEmail("calvinwong@aidlab.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); + SendEmailUtil.sendExcelEmail("kaicpang.pang@connect.polyu.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); + SendEmailUtil.sendExcelEmail("kimwong@code-create.com.hk", null, Files.readAllBytes(Paths.get(fileName)), fileName); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } } diff --git a/src/main/java/com/ai/da/common/utils/AsyncCallerUtil.java b/src/main/java/com/ai/da/common/utils/AsyncCallerUtil.java index 35039431..c864960c 100644 --- a/src/main/java/com/ai/da/common/utils/AsyncCallerUtil.java +++ b/src/main/java/com/ai/da/common/utils/AsyncCallerUtil.java @@ -58,7 +58,7 @@ public class AsyncCallerUtil { return null; } catch (InterruptedException | ExecutionException | BusinessException e) { // 处理异常 - log.error("发生错误 : " + e); + log.error("发生错误 : " + e, e); // 取消定时任务 assert timeoutTask != null; timeoutTask.cancel(true); diff --git a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java index 1fcba907..e9389317 100644 --- a/src/main/java/com/ai/da/common/utils/SendEmailUtil.java +++ b/src/main/java/com/ai/da/common/utils/SendEmailUtil.java @@ -9,12 +9,14 @@ import com.tencentcloudapi.common.exception.TencentCloudSDKException; import com.tencentcloudapi.common.profile.ClientProfile; import com.tencentcloudapi.common.profile.HttpProfile; import com.tencentcloudapi.ses.v20201002.SesClient; +import com.tencentcloudapi.ses.v20201002.models.Attachment; import com.tencentcloudapi.ses.v20201002.models.SendEmailRequest; import com.tencentcloudapi.ses.v20201002.models.SendEmailResponse; import com.tencentcloudapi.ses.v20201002.models.Template; import lombok.extern.slf4j.Slf4j; import org.springframework.util.StringUtils; +import java.util.Base64; import java.util.Date; /** @@ -130,7 +132,9 @@ public class SendEmailUtil { private final static Long YOUR_TRIAL_TEMPLATE_ID = 117214L; private final static Long APPROVAL_TEMPLATE_ID = 117215L; private final static Long NOTIFICATION_TEMPLATE_ID = 117216L; - public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType) { + private final static Long NOTIFICATION_CHINESE_TEMPLATE_ID = 122229L; + private final static Long TRIAL_ORDER_LIST_ID = 122273L; + public static void sendCustomEmail(String receiverAddress, String senderAddress, TrialOrder trialOrder, int emailType, String country) { try { // 实例化一个认证对象 Credential cred = new Credential(SECRET_ID, SECRET_KEy); @@ -162,7 +166,11 @@ public class SendEmailUtil { break; case 3: subject = "Approval Confirmation for AiDA System Trial Access"; - template.setTemplateID(NOTIFICATION_TEMPLATE_ID); + if (country.equals("China")) { + template.setTemplateID(NOTIFICATION_CHINESE_TEMPLATE_ID); + }else { + template.setTemplateID(NOTIFICATION_TEMPLATE_ID); + } template.setTemplateData(buildNotificationData(trialOrder)); break; default: @@ -180,6 +188,45 @@ public class SendEmailUtil { throw new BusinessException("failed.to.send.mail"); } } + + public static void sendExcelEmail(String receiverAddress, String senderAddress, byte[] fileContent, String fileName) { + try { + // 实例化一个认证对象 + Credential cred = new Credential(SECRET_ID, SECRET_KEy); + HttpProfile httpProfile = new HttpProfile(); + httpProfile.setEndpoint("ses.tencentcloudapi.com"); + ClientProfile clientProfile = new ClientProfile(); + clientProfile.setHttpProfile(httpProfile); + SesClient client = new SesClient(cred, "ap-hongkong", clientProfile); + SendEmailRequest req = new SendEmailRequest(); + if (StringUtils.isEmpty(senderAddress)) { + senderAddress = SEND_ADDRESS; + } + req.setFromEmailAddress(senderAddress); + req.setDestination(new String[]{receiverAddress}); + + // 根据邮件类型设置不同的主题和模板 + String subject = ""; + Template template = new Template(); + subject = "昨日试用订单数据"; + template.setTemplateID(TRIAL_ORDER_LIST_ID); + + req.setSubject(subject); + req.setTemplate(template); + + Attachment attachment = new Attachment(); + attachment.setFileName(fileName); // 设置附件文件名 + // 设置附件内容 + attachment.setContent(Base64.getEncoder().encodeToString(fileContent)); + req.setAttachments(new Attachment[] {attachment}); + // 发送邮件 + SendEmailResponse resp = client.SendEmail(req); + log.info("短信发送结果res###{}", SendEmailResponse.toJsonString(resp)); + } catch (TencentCloudSDKException e) { + log.info("邮件发送失败###{}", e.toString()); + throw new BusinessException("failed.to.send.mail"); + } + } private final static Long WILLBEEXPIRED_TEMPLATE_ID = 118178L; public static void sendWillBeExpiredEmail(Account account, String senderAddress) { try { diff --git a/src/main/java/com/ai/da/controller/ConvenientInquiryController.java b/src/main/java/com/ai/da/controller/ConvenientInquiryController.java new file mode 100644 index 00000000..bca619ce --- /dev/null +++ b/src/main/java/com/ai/da/controller/ConvenientInquiryController.java @@ -0,0 +1,54 @@ +package com.ai.da.controller; + + +import com.ai.da.common.context.UserContext; +import com.ai.da.common.response.Response; +import com.ai.da.mapper.DesignMapper; +import com.ai.da.mapper.TrialOrderMapper; +import com.ai.da.mapper.entity.TrialOrder; +import com.ai.da.model.dto.UserDesignStatisticDTO; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +@Api(tags = "便利查询") +@Slf4j +@RestController +@RequestMapping("/api/inquiry") +public class ConvenientInquiryController { + + @Resource + private TrialOrderMapper trialOrderMapper; + + @Resource + private DesignMapper designMapper; + + @ApiOperation("获取当前所有试用用户") + @GetMapping("/getTrial") + public Response> getTrial(){ + Long accountId = UserContext.getUserHolder().getId(); + if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L)){ + List trialOrders = trialOrderMapper.selectList(null); + return Response.success(trialOrders); + }else { + return Response.fail("Sorry, you don't have permission"); + } + } + + @ApiOperation("获取指定时间区间内所有用户design的使用情况") + @GetMapping("/getDesignStatistic") + public Response> getDesignStatistic(@RequestParam String startTime,@RequestParam String endTime){ + Long accountId = UserContext.getUserHolder().getId(); + if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L)){ + List designStatistic = designMapper.getDesignStatistic(startTime, endTime); + return Response.success(designStatistic); + }else { + return Response.fail("Sorry, you don't have permission"); + } + } + +} diff --git a/src/main/java/com/ai/da/controller/ThirdPartyController.java b/src/main/java/com/ai/da/controller/ThirdPartyController.java index 2572ed5b..7132d9b2 100644 --- a/src/main/java/com/ai/da/controller/ThirdPartyController.java +++ b/src/main/java/com/ai/da/controller/ThirdPartyController.java @@ -42,8 +42,8 @@ public class ThirdPartyController { @CrossOrigin @ApiOperation(value = "Add user information") @PostMapping("/addTrialUser") - public Response addTrialUser(@RequestBody AccountTrialDTO accountTrialDTO) { - return Response.success(accountService.addTrialUser(accountTrialDTO)); + public Response addTrialUser(@RequestBody AccountTrialDTO accountTrialDTO, HttpServletRequest request) { + return Response.success(accountService.addTrialUser(accountTrialDTO, request)); } @CrossOrigin diff --git a/src/main/java/com/ai/da/mapper/DesignMapper.java b/src/main/java/com/ai/da/mapper/DesignMapper.java index 31fc4a18..3c7c3de9 100644 --- a/src/main/java/com/ai/da/mapper/DesignMapper.java +++ b/src/main/java/com/ai/da/mapper/DesignMapper.java @@ -1,8 +1,10 @@ package com.ai.da.mapper; import com.ai.da.common.config.mybatis.plus.CommonMapper; -import com.ai.da.mapper.entity.Collection; import com.ai.da.mapper.entity.Design; +import com.ai.da.model.dto.UserDesignStatisticDTO; + +import java.util.List; /** * Mapper 接口 @@ -14,4 +16,6 @@ public interface DesignMapper extends CommonMapper { //返回插入数据后生成的主键 Long insertDesign(Design design); + + List getDesignStatistic(String startTime, String endTime); } diff --git a/src/main/java/com/ai/da/mapper/entity/TrialOrder.java b/src/main/java/com/ai/da/mapper/entity/TrialOrder.java index 904d1a75..72183c97 100644 --- a/src/main/java/com/ai/da/mapper/entity/TrialOrder.java +++ b/src/main/java/com/ai/da/mapper/entity/TrialOrder.java @@ -64,4 +64,5 @@ public class TrialOrder implements Serializable { */ private Integer status; private Integer isDeleted; + private String ip; } diff --git a/src/main/java/com/ai/da/model/dto/UserDesignStatisticDTO.java b/src/main/java/com/ai/da/model/dto/UserDesignStatisticDTO.java new file mode 100644 index 00000000..25bd7038 --- /dev/null +++ b/src/main/java/com/ai/da/model/dto/UserDesignStatisticDTO.java @@ -0,0 +1,17 @@ +package com.ai.da.model.dto; + +import lombok.Data; + +@Data +public class UserDesignStatisticDTO { + + private Long accountId; + + private Long useDesignTimes; + + private String userEmail; + + private String userName; + + private String isTrial; +} diff --git a/src/main/java/com/ai/da/python/PythonService.java b/src/main/java/com/ai/da/python/PythonService.java index 5a37b3b7..b4f8e847 100644 --- a/src/main/java/com/ai/da/python/PythonService.java +++ b/src/main/java/com/ai/da/python/PythonService.java @@ -2295,6 +2295,7 @@ public class PythonService { Boolean result = JSON.parseObject(JSON.toJSONString(response)).getBoolean("successful"); if (result && jsonObject.get("code").equals(200)) { + log.info("Generate##responseObject###{}", jsonObject); return setGenerateImageList(jsonObject.getJSONObject("data")); } log.info("generateSketchOrPrintPrint失败###{}", jsonObject); diff --git a/src/main/java/com/ai/da/service/AccountService.java b/src/main/java/com/ai/da/service/AccountService.java index 2b1f20f1..aa646554 100644 --- a/src/main/java/com/ai/da/service/AccountService.java +++ b/src/main/java/com/ai/da/service/AccountService.java @@ -102,7 +102,7 @@ public interface AccountService extends IService { Boolean completeGuidance(); - Boolean addTrialUser(AccountTrialDTO accountTrialDTO); + Boolean addTrialUser(AccountTrialDTO accountTrialDTO, HttpServletRequest request); IPage trialOrderList(TrialOrderDTO trialOrderDTO); diff --git a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java index 4c7507f5..592459d9 100644 --- a/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AccountServiceImpl.java @@ -9,9 +9,7 @@ import com.ai.da.common.response.ResultEnum; import com.ai.da.common.security.jwt.JWTTokenHelper; import com.ai.da.common.utils.*; import com.ai.da.mapper.AccountMapper; -import com.ai.da.mapper.LibraryMapper; import com.ai.da.mapper.TrialOrderMapper; -import com.ai.da.mapper.UserLikeGroupMapper; import com.ai.da.mapper.entity.Account; import com.ai.da.mapper.entity.AccountLoginLog; import com.ai.da.mapper.entity.TrialOrder; @@ -32,7 +30,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.checkerframework.checker.units.qual.A; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.Assert; @@ -289,8 +286,7 @@ public class AccountServiceImpl extends ServiceImpl impl private Account getOneByEmail(String email) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.lambda().eq(Account::getUserEmail, email); - queryWrapper.lambda().last("limit 1"); + queryWrapper.eq("BINARY user_email", email); List accountList = accountMapper.selectList(queryWrapper); if (CollectionUtil.isEmpty(accountList)) { throw new BusinessException("email.does.not.exist", ResultEnum.PROMPT.getCode()); @@ -298,6 +294,7 @@ public class AccountServiceImpl extends ServiceImpl impl return accountList.get(0); } + private Account getOneByUserName(String userName) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(Account::getUserName, userName); @@ -468,7 +465,20 @@ public class AccountServiceImpl extends ServiceImpl impl } @Override - public Boolean addTrialUser(AccountTrialDTO accountTrialDTO) { + public Boolean addTrialUser(AccountTrialDTO accountTrialDTO, HttpServletRequest request) { + // 获取用户申请试用IP + String ipAddress = RequestInfoUtil.getIpAddress(request); + // 先检测试用订单 + QueryWrapper trialOrderQueryWrapper = new QueryWrapper<>(); + trialOrderQueryWrapper.lambda().eq(TrialOrder::getIp, ipAddress); + trialOrderQueryWrapper.lambda().and(wrapper -> + wrapper.eq(TrialOrder::getEmail, accountTrialDTO.getEmail()) + .or() // OR + .like(TrialOrder::getUserName, accountTrialDTO.getUserName())); + List trialOrders = trialOrderMapper.selectList(trialOrderQueryWrapper); + if (CollectionUtil.isNotEmpty(trialOrders)) { + throw new BusinessException("You have submitted a trial application, please wait for approval."); + } // 先检测用户名和邮箱 QueryWrapper qw = new QueryWrapper<>(); qw.lambda().eq(Account::getUserEmail, accountTrialDTO.getEmail()) @@ -489,8 +499,11 @@ public class AccountServiceImpl extends ServiceImpl impl TrialOrder trialOrder = CopyUtil.copyObject(accountTrialDTO, TrialOrder.class); trialOrder.setCreateTime(LocalDateTime.now()); trialOrder.setStatus(0); + trialOrder.setIp(ipAddress); trialOrderMapper.insert(trialOrder); - SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,1); +// SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,1, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,1, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,1, trialOrder.getCountry()); // 判断当前的试用订单是否自动批准 if (AutoApproved.getStatus()) { // 改变试用订单状态,新增试用用户 @@ -518,8 +531,14 @@ public class AccountServiceImpl extends ServiceImpl impl accountMapper.insert(account); } // 发送邮件提醒用户试用用户已创建 - SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2); - SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3); +// SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2, trialOrder.getCountry()); + if (trialOrder.getCountry().equals("China")) { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + }else { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + } } return Boolean.TRUE; } @@ -566,8 +585,14 @@ public class AccountServiceImpl extends ServiceImpl impl accountMapper.insert(account); } // 发送邮件提醒用户试用用户已创建 - SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2); - SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3); +// SendEmailUtil.sendCustomEmail("1023316923@qq.com", null, trialOrder,2, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("calvinwong@aidlab.hk", null, trialOrder,2, trialOrder.getCountry()); +// SendEmailUtil.sendCustomEmail("kaicpang.pang@connect.polyu.hk", null, trialOrder,2, trialOrder.getCountry()); + if (trialOrder.getCountry().equals("China")) { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + }else { + SendEmailUtil.sendCustomEmail(account.getUserEmail(), null, trialOrder, 3, trialOrder.getCountry()); + } } return Boolean.TRUE; } diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 6a2b9d4d..af7d6688 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -15,7 +15,7 @@ spring.security.jwtTokenPrefix=Bearer- spring.security.jwtExpiration=8640000000 #spring security权限设置 认证了token还要认证权限 不然报错Full authentication is required to access this resource spring.security.ignorePaths=/,/favicon.ico,/doc.html,/webjars/**,/swagger-resources,/v2/api-docs,\ - /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/** + /api/account/**,/api/element/**,/api/python/**,/api/design/**,/api/history/**,/api/library/**,/api/third/party/**,/api/generate/**,/api/workspace/**,/api/classification/**,/api/inquiry/** spring.security.authApi=/auth/login diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index ec94939b..8550475d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,8 +1,8 @@ #����application-test�ļ�(���Ի���) -spring.profiles.active=test +#spring.profiles.active=test #����application-prod�ļ�(��������) -#spring.profiles.active=prod +spring.profiles.active=prod #����application-dev�ļ�(��������) #spring.profiles.active=dev diff --git a/src/main/resources/mapper/DesignMapper.xml b/src/main/resources/mapper/DesignMapper.xml index 4c4e029c..d5f589cd 100644 --- a/src/main/resources/mapper/DesignMapper.xml +++ b/src/main/resources/mapper/DesignMapper.xml @@ -25,5 +25,19 @@ #{switchCategory}, #{createDate}); + +