Compare commits

..

No commits in common. "main" and "develop" have entirely different histories.

117 changed files with 2024 additions and 202 deletions

3
.gitignore vendored
View File

@ -1,3 +0,0 @@
.idea/
target/
*.iml

18
.idea/compiler.xml Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="ElectronicMallApi" />
</profile>
</annotationProcessing>
</component>
<component name="JavacSettings">
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
<module name="ElectronicMallApi" options="-parameters" />
</option>
</component>
</project>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="dataSourceStorageLocal" created-in="IU-242.23339.11">
<data-source name="online" uuid="282d1d00-de84-4cec-a9da-44812048f8ef">
<database-info product="MySQL" version="5.7.44" jdbc-version="4.2" driver-name="Amazon Web Services (AWS) Advanced JDBC Wrapper" driver-version="Amazon Web Services (AWS) Advanced JDBC Wrapper 2.3.7 ( Revision: 7591851e8da4e1c705ba232a8bd07824a5cfd276 )" dbms="MYSQL" exact-version="5.7.44" exact-driver-version="2.3">
<extra-name-characters>#@</extra-name-characters>
<identifier-quote-string>`</identifier-quote-string>
<jdbc-catalog-is-schema>true</jdbc-catalog-is-schema>
</database-info>
<case-sensitivity plain-identifiers="exact" quoted-identifiers="exact" />
<secret-storage>master_key</secret-storage>
<user-name>myuser</user-name>
<schema-mapping>
<introspection-scope>
<node kind="schema" qname="@" />
</introspection-scope>
</schema-mapping>
</data-source>
</component>
</project>

17
.idea/dataSources.xml Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="online" uuid="282d1d00-de84-4cec-a9da-44812048f8ef">
<driver-ref>mysql_aurora.aws_wrapper</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>software.amazon.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:aws-wrapper:mysql://139.196.201.231:3306/mall</jdbc-url>
<jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.host.port" />
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
<property name="com.intellij.clouds.kubernetes.db.container.port" />
</jdbc-additional-properties>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
#n:mall
!<md> [0, 0, null, null, -2147483648, -2147483648]

6
.idea/encodings.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
</component>
</project>

View File

@ -0,0 +1,12 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="single_use.file_func_pack" />
</list>
</option>
</inspection_tool>
</profile>
</component>

25
.idea/jarRepositories.xml Normal file
View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="public" />
<option name="name" value="aliyun nexus" />
<option name="url" value="https://maven.aliyun.com/repository/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

12
.idea/misc.xml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_23" project-jdk-name="1.8 (2)" project-jdk-type="JavaSDK" />
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

205
.idea/workspace.xml Normal file
View File

@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="7bd2279f-84f2-4fb9-84b1-753ae61933b0" name="Changes" comment="测试">
<change afterPath="$PROJECT_DIR$/src/test/java/com/rabbiter/em/mapper/CartMapperTest.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/application.yml" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/application.yml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
<option value="JUnit4 Test Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectColorInfo">{
&quot;associatedIndex&quot;: 6
}</component>
<component name="ProjectId" id="2nNLuKarVkctJaOGUrGxBQXTXgf" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="2" id="Add" />
</component>
<component name="ProjectViewState">
<option name="compactDirectories" value="true" />
<option name="foldersAlwaysOnTop" value="false" />
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
<option name="sortByType" value="true" />
<option name="sortKey" value="BY_TYPE" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"JUnit.CartMapperTest.executor": "Run",
"JUnit.CartMapperTest.selectAll.executor": "Run",
"JUnit.CartMapperTest.selectByUserId.executor": "Run",
"RequestMappingsPanelOrder0": "0",
"RequestMappingsPanelOrder1": "1",
"RequestMappingsPanelWidth0": "75",
"RequestMappingsPanelWidth1": "75",
"RunOnceActivity.ShowReadmeOnStart": "true",
"Spring Boot.ElectronicMallApplication.executor": "Run",
"com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrary": "JUnit4",
"com.intellij.testIntegration.createTest.CreateTestDialog.defaultLibrarySuperClass.JUnit4": "",
"git-widget-placeholder": "main",
"kotlin-language-version-configured": "true",
"last_opened_file_path": "D:/ZXY/JAVA WorkFile/SpringDemo",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"project.structure.last.edited": "Project",
"project.structure.proportion": "0.15",
"project.structure.side.proportion": "0.0",
"settings.editor.selected.configurable": "preferences.keymap",
"vue.rearranger.settings.migration": "true"
},
"keyToStringList": {
"DatabaseDriversLRU": [
"mysql_aurora"
]
}
}]]></component>
<component name="RecentsManager">
<key name="CreateTestDialog.Recents.Supers">
<recent name="" />
</key>
<key name="CreateTestDialog.RecentsKey">
<recent name="com.rabbiter.em.mapper" />
</key>
</component>
<component name="RunManager" selected="JUnit.CartMapperTest.selectAll">
<configuration name="CartMapperTest" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="ElectronicMallApi" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.rabbiter.em.mapper.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.rabbiter.em.mapper" />
<option name="MAIN_CLASS_NAME" value="com.rabbiter.em.mapper.CartMapperTest" />
<option name="TEST_OBJECT" value="class" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="CartMapperTest.selectAll" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="ElectronicMallApi" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.rabbiter.em.mapper.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.rabbiter.em.mapper" />
<option name="MAIN_CLASS_NAME" value="com.rabbiter.em.mapper.CartMapperTest" />
<option name="METHOD_NAME" value="selectAll" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="CartMapperTest.selectByUserId" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="ElectronicMallApi" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.rabbiter.em.mapper.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<option name="PACKAGE_NAME" value="com.rabbiter.em.mapper" />
<option name="MAIN_CLASS_NAME" value="com.rabbiter.em.mapper.CartMapperTest" />
<option name="METHOD_NAME" value="selectByUserId" />
<option name="TEST_OBJECT" value="method" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="ElectronicMallApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" temporary="true" nameIsGenerated="true">
<module name="ElectronicMallApi" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.rabbiter.em.ElectronicMallApplication" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.rabbiter.em.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="JUnit.CartMapperTest.selectAll" />
<item itemvalue="JUnit.CartMapperTest.selectByUserId" />
<item itemvalue="JUnit.CartMapperTest" />
<item itemvalue="Spring Boot.ElectronicMallApplication" />
</list>
</recent_temporary>
</component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-jdk-9823dce3aa75-28b599e66164-intellij.indexing.shared.core-IU-242.23339.11" />
<option value="bundled-js-predefined-d6986cc7102b-5c90d61e3bab-JavaScript-IU-242.23339.11" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="7bd2279f-84f2-4fb9-84b1-753ae61933b0" name="Changes" comment="" />
<created>1728808808514</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1728808808514</updated>
<workItem from="1728808810076" duration="1765000" />
<workItem from="1728810604248" duration="203000" />
<workItem from="1728810819222" duration="316000" />
<workItem from="1728811143583" duration="1145000" />
<workItem from="1728812560994" duration="18000" />
<workItem from="1728885889340" duration="2236000" />
</task>
<task id="LOCAL-00001" summary="测试">
<option name="closed" value="true" />
<created>1728808859515</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1728808859515</updated>
</task>
<option name="localTasksCounter" value="2" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" />
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="测试" />
<option name="LAST_COMMIT_MESSAGE" value="测试" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<breakpoint enabled="true" type="java-exception">
<properties class="java.lang.NullPointerException" package="java.lang" />
<option name="timeStamp" value="1" />
</breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

View File

@ -1,10 +0,0 @@
<!--
* @Description:
* @Author: zhangfu
* @Date: 2025-07-13 20:17:11
-->
### 打包项目
mvn clean package -Pprod

62
pom.xml
View File

@ -10,70 +10,12 @@
</parent>
<groupId>com.rabbiter</groupId>
<artifactId>ElectronicMallApi</artifactId>
<version>1.0</version>
<version>0.0.1-SNAPSHOT</version>
<name>ElectronicMallApi</name>
<description>ElectronicMallApi</description>
<packaging>jar</packaging>
<properties>
<java.version>1.8</java.version>
</properties>
<profiles>
<!--开发环境-->
<profile>
<id>dev</id>
<properties>
<profile>dev</profile>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<!--测试环境-->
<profile>
<id>test</id>
<properties>
<profile>test</profile>
</properties>
</profile>
<!--生产环境-->
<profile>
<id>prod</id>
<properties>
<profile>prod</profile>
</properties>
</profile>
</profiles>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.rabbiter.em.ElectronicMallApplication</mainClass> <!-- 指定主类 -->
<arguments>
<argument>-XDignore.symbol.file</argument>
</arguments>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<!--指定打包的配置文件且用filtering设置开启过滤-->
<include>application*.yml</include><!--这里使用占位符进行动态引用以确定具体的打包文件-->
<include>application.yml</include><!--主配置文件必须打包-->
<include>**/*.xml</include> <!-- 包含所有 XML -->
</includes>
<filtering>true</filtering><!--开启过滤在打包时application.yml中配置的@env@将被确定到底是什么变量-->
</resource>
</resources>
</build>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -166,7 +108,6 @@
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
@ -193,5 +134,4 @@
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

View File

@ -1,10 +1,7 @@
package com.rabbiter.em.constants;
import com.rabbiter.em.utils.PathUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class Constants {
public static final String CODE_200 = "200";//成功
public static final String CODE_500 = "500";//系统错误
@ -12,12 +9,7 @@ public class Constants {
public static final String CODE_401 = "401";//无权限
public static final String TOKEN_ERROR = "401";//token无效
public static final String CODE_403 = "403";//拒绝执行
public static final String CODE_400 = "400";//无效请求
//文件存储位置
@Value("${file.file}")
public String fileFolderPath ;
@Value("${file.avatar}")
public String avatarFolderPath ;
public static final String fileFolderPath = PathUtils.getClassLoadRootPath() + "/file/";
public static final String avatarFolderPath = PathUtils.getClassLoadRootPath() + "/avatar/";
}

View File

@ -7,7 +7,6 @@ import com.rabbiter.em.entity.AuthorityType;
import com.rabbiter.em.entity.Address;
import com.rabbiter.em.service.AddressService;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.util.List;
@ -33,51 +32,19 @@ public class AddressController {
return Result.success(list);
}
@GetMapping("/deepseek/{qq}")
public Result callDeepSeek(@PathVariable String qq) {
try {
// 验证QQ号格式
if(!qq.matches("^[1-9][0-9]{4,10}$")) {
return Result.error(Constants.CODE_400, "无效的QQ号");
}
// 调用DeepSeek API
RestTemplate restTemplate = new RestTemplate();
String apiUrl = "https://api.deepseek.com/qq/" + qq;
String response = restTemplate.getForObject(apiUrl, String.class);
return Result.success(response);
} catch (Exception e) {
return Result.error(Constants.CODE_500, "调用DeepSeek失败: " + e.getMessage());
}
}
/*
*/
@PostMapping
public Result save(@RequestBody List<Address> addresses) {
// 验证每个地址的IP格式
String ipPattern = "^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$";
for(Address address : addresses) {
String ipAddress = address.getLinkAddress();
if(ipAddress != null && !ipAddress.matches(ipPattern)) {
return Result.error(Constants.CODE_400, "无效的IP地址格式: " + ipAddress);
}
}
boolean success = true;
if(!addressService.saveOrUpdateBatch(addresses)) {
success = false;
}
if(success){
public Result save(@RequestBody Address address) {
boolean b = addressService.saveOrUpdate(address);
if(b){
return Result.success();
}else{
return Result.error(Constants.CODE_500,"批量保存地址失败");
return Result.error(Constants.CODE_500,"保存地址失败");
}
}
@PutMapping
@ -95,4 +62,8 @@ public class AddressController {
return Result.success();
}
}

View File

@ -9,7 +9,7 @@ import com.rabbiter.em.entity.Order;
import com.rabbiter.em.service.OrderService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.xml.fastinfoset.stax.events.Util;
import com.sun.xml.internal.fastinfoset.stax.events.Util;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

View File

@ -13,7 +13,7 @@ import com.rabbiter.em.entity.User;
import com.rabbiter.em.entity.dto.UserDTO;
import com.rabbiter.em.service.UserService;
import com.rabbiter.em.utils.TokenUtils;
import com.sun.xml.fastinfoset.stax.events.Util;
import com.sun.xml.internal.fastinfoset.stax.events.Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

View File

@ -25,9 +25,6 @@ public class AvatarService {
@Resource
private AvatarMapper avatarMapper;
@Resource
private Constants constants;
public String upload(MultipartFile uploadFile){
String url = null;
//通过md5判断文件是否已经存在防止在服务器存储相同文件
@ -45,7 +42,7 @@ public class AvatarService {
System.out.println(originalFilename+" "+type);
long size = uploadFile.getSize() / 1024; //文件大小单位kb
//文件不存在,则保存文件
File folder = new File(constants.avatarFolderPath);
File folder = new File(Constants.avatarFolderPath);
if(!folder.exists()){
folder.mkdir();
}
@ -72,7 +69,7 @@ public class AvatarService {
}
//根据文件名下载文件
public void download(String fileName, HttpServletResponse response){
File file = new File(constants.avatarFolderPath+fileName);
File file = new File(Constants.avatarFolderPath+fileName);
if(!file.exists()){
throw new ServiceException(Constants.CODE_500,"文件不存在");
}
@ -95,7 +92,7 @@ public class AvatarService {
if(delete==1){
String fileName = StrUtil.subAfter(avatar.getUrl(),"/",true);
System.out.println(fileName);
File file = new File(constants.avatarFolderPath+fileName);
File file = new File(Constants.avatarFolderPath+fileName);
System.out.println(file.getAbsolutePath());
if(file.exists()){

View File

@ -30,9 +30,6 @@ public class FileService extends ServiceImpl<FileMapper, MyFile> {
@Resource
private FileMapper fileMapper;
@Resource
private Constants constants;
public String upload(MultipartFile uploadFile){
String originalFilename = uploadFile.getOriginalFilename(); //文件原始名字
String type = originalFilename.substring(originalFilename.lastIndexOf(".")+1); //文件后缀
@ -60,7 +57,7 @@ public class FileService extends ServiceImpl<FileMapper, MyFile> {
myFile.setUrl(url);
}else{
//文件不存在,则保存文件
File folder = new File(constants.fileFolderPath);
File folder = new File(Constants.fileFolderPath);
if(!folder.exists()){
folder.mkdir();
}
@ -87,17 +84,14 @@ public class FileService extends ServiceImpl<FileMapper, MyFile> {
//根据文件名下载文件
public void download(String fileName, HttpServletResponse response){
File file = new File(constants.fileFolderPath+fileName);
File file = new File(Constants.fileFolderPath+fileName);
if(!file.exists()){
throw new ServiceException(constants.CODE_500,"文件不存在");
throw new ServiceException(Constants.CODE_500,"文件不存在");
}
try {
response.reset();
ServletOutputStream os = response.getOutputStream();
response.addHeader("Content-Disposition","attachment;filename="+ URLEncoder.encode(fileName,"UTF-8"));
response.setContentType("application/octet-stream");
ServletOutputStream os = response.getOutputStream();
os.write(FileUtil.readBytes(file));
os.flush();
os.close();

View File

@ -1,27 +0,0 @@
server:
port: 9191
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://139.196.201.231:3306/mall?serverTimezone=GMT%2b8&userSSL=false&allowPublicKeyRetrieval=true
username: "myuser"
password: 'Fzhang5.'
servlet:
multipart:
max-file-size: 30MB
redis:
database: 0
host: 139.196.201.231
port: 6379
password: Amk812s$
lettuce:
pool:
min-idle: 0
max-active: 8
max-idle: 8
max-wait: -1ms
connect-timeout: 30000ms
file:
file: D:/devWorkSpace/file/
avatar: D:/devWorkSpace/avatar/

View File

@ -1,27 +0,0 @@
server:
port: 9191
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://139.196.201.231:3306/mall?serverTimezone=GMT%2b8&userSSL=false&allowPublicKeyRetrieval=true
username: "myuser"
password: 'Fzhang5.'
servlet:
multipart:
max-file-size: 30MB
redis:
database: 0
host: 139.196.201.231
port: 6379
password: Amk812s$
lettuce:
pool:
min-idle: 0
max-active: 8
max-idle: 8
max-wait: -1ms
connect-timeout: 30000ms
file:
file: /home/fzhang5/file/file/
avatar: /home/fzhang5/file/avatar/

View File

@ -1,10 +1,27 @@
server:
port: 9191
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://139.196.201.231:3306/mall?serverTimezone=GMT%2b8&userSSL=false&allowPublicKeyRetrieval=true
username: "myuser"
password: 'Fzhang5.'
servlet:
multipart:
max-file-size: 30MB
redis:
database: 0
host: 127.0.0.1
port: 6379
lettuce:
pool:
min-idle: 0
max-active: 8
max-idle: 8
max-wait: -1ms
connect-timeout: 30000ms
mybatis:
mapper-locations: classpath:mapper/*.xml
configuration:
map-underscore-to-camel-case: true
spring:
profiles:
active: test

View File

@ -0,0 +1,32 @@
package com.rabbiter.em.mapper;
import com.rabbiter.em.entity.Cart;
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;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.*;
@RunWith(SpringRunner.class)
@SpringBootTest
public class CartMapperTest {
@Autowired
private CartMapper cartMapper;
@Test
public void selectByUserId() {
List<Map<String, Object>> list = cartMapper.selectByUserId(2L);
System.out.println(list);
}
@Test
public void selectAll() {
cartMapper.selectList(null).forEach(System.out::println);
}
}

View File

@ -11,9 +11,8 @@ spring:
max-file-size: 30MB
redis:
database: 0
host: 139.196.201.231
host: 127.0.0.1
port: 6379
password: Amk812s$
lettuce:
pool:
min-idle: 0
@ -22,6 +21,7 @@ spring:
max-wait: -1ms
connect-timeout: 30000ms
file:
file: /home/fzhang5/file/file/
avatar: /home/fzhang5/file/avatar/
mybatis:
mapper-locations: classpath:mapper/*.xml
configuration:
map-underscore-to-camel-case: true

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More