项目结构调整
parent
06dfa7b635
commit
11f9815d2a
8
pom.xml
8
pom.xml
|
|
@ -222,6 +222,13 @@
|
|||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 鞋库通 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>xkt</artifactId>
|
||||
<version>${ruoyi.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
|
@ -251,6 +258,7 @@
|
|||
<module>ruoyi-quartz</module>
|
||||
<module>ruoyi-generator</module>
|
||||
<module>ruoyi-common</module>
|
||||
<module>xkt</module>
|
||||
</modules>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,12 @@
|
|||
<artifactId>ruoyi-generator</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 鞋库通 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>xkt</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class CommonController {
|
|||
private OSSProperties ossProperties;
|
||||
|
||||
@ApiOperation("获取OSS临时访问凭证")
|
||||
@GetMapping("/getCredentials")
|
||||
@GetMapping("/oss/getCredentials")
|
||||
public R<STSCredentialsVO> getCredentials() {
|
||||
STSCredentialsVO vo = new STSCredentialsVO();
|
||||
Credentials credentials = ossClient.createStsCredentials();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ruoyi.web.controller.xkt;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.web.controller.xkt.vo.TestVO;
|
||||
import com.ruoyi.xkt.dto.TestDTO;
|
||||
import com.ruoyi.xkt.service.ITestService;
|
||||
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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-03-26 14:40
|
||||
*/
|
||||
@Api(tags = "鞋库通测试")
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/xkt/test")
|
||||
public class XktTestController {
|
||||
|
||||
@Autowired
|
||||
private ITestService iTestService;
|
||||
|
||||
@ApiOperation("执行测试")
|
||||
@GetMapping("/execute")
|
||||
public R<List<TestVO>> execute() {
|
||||
List<TestDTO> dtoList = iTestService.listTest();
|
||||
return R.ok(BeanUtil.copyToList(dtoList, TestVO.class));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.ruoyi.web.controller.xkt.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-03-26 14:46
|
||||
*/
|
||||
@ApiModel
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class TestVO {
|
||||
|
||||
@ApiModelProperty("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String description;
|
||||
|
||||
}
|
||||
|
|
@ -21,6 +21,7 @@ oss:
|
|||
regionId: cn-beijing
|
||||
roleArn: acs:ram::1919425406190533:role/sts-role
|
||||
expiredDuration: 3600
|
||||
tempDir: E:/temp/
|
||||
|
||||
# 开发环境配置
|
||||
server:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.ruoyi.framework.config;
|
||||
|
||||
import com.ruoyi.framework.config.properties.PermitAllUrlProperties;
|
||||
import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter;
|
||||
import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl;
|
||||
import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
|
@ -16,10 +20,6 @@ import org.springframework.security.web.SecurityFilterChain;
|
|||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
import org.springframework.security.web.authentication.logout.LogoutFilter;
|
||||
import org.springframework.web.filter.CorsFilter;
|
||||
import com.ruoyi.framework.config.properties.PermitAllUrlProperties;
|
||||
import com.ruoyi.framework.security.filter.JwtAuthenticationTokenFilter;
|
||||
import com.ruoyi.framework.security.handle.AuthenticationEntryPointImpl;
|
||||
import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
|
||||
|
||||
/**
|
||||
* spring security配置
|
||||
|
|
@ -111,7 +111,7 @@ public class SecurityConfig
|
|||
.authorizeHttpRequests((requests) -> {
|
||||
permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
|
||||
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
|
||||
requests.antMatchers("/login", "/register", "/captchaImage").permitAll()
|
||||
requests.antMatchers("/login", "/register", "/captchaImage", "/xkt/test/execute").permitAll()
|
||||
// 静态资源,可匿名访问
|
||||
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll()
|
||||
.antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
|
||||
|
|
|
|||
|
|
@ -26,4 +26,6 @@ public class OSSProperties {
|
|||
private String roleArn;
|
||||
|
||||
private Long expiredDuration;
|
||||
|
||||
private String tempDir;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
package com.ruoyi.system.service;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-03-18 16:07
|
||||
*/
|
||||
public interface ITestService {
|
||||
|
||||
void insertTest();
|
||||
|
||||
void updateTest();
|
||||
|
||||
void listTest();
|
||||
}
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.system.domain.TestDO;
|
||||
import com.ruoyi.system.mapper.TestMapper;
|
||||
import com.ruoyi.system.service.ITestService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-03-18 16:08
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class TestService implements ITestService {
|
||||
@Autowired
|
||||
private TestMapper testMapper;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void insertTest() {
|
||||
TestDO testDO = new TestDO();
|
||||
testDO.setDescription("测试插入" + DateUtil.now());
|
||||
testDO.setVersion(0L);
|
||||
testMapper.insert(testDO);
|
||||
log.info("插入:{}", testDO);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void updateTest() {
|
||||
TestDO testDO = new TestDO();
|
||||
testDO.setId(1L);
|
||||
testDO.setDescription("测试修改" + DateUtil.now());
|
||||
testDO.setVersion(1L);
|
||||
log.info("修改:{}", testMapper.updateById(testDO));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void listTest() {
|
||||
List<TestDO> testDOList = testMapper.selectList(Wrappers.lambdaQuery(TestDO.class).eq(TestDO::getId, 1));
|
||||
log.info("查询:{}", testDOList);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>ruoyi</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>3.8.9</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>xkt</artifactId>
|
||||
|
||||
<description>
|
||||
鞋库通业务
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<!-- 核心模块-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-framework</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.ruoyi.system.domain;
|
||||
package com.ruoyi.xkt.domain;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
|
|
@ -12,7 +12,7 @@ import lombok.Data;
|
|||
*/
|
||||
@Data
|
||||
@TableName("test")
|
||||
public class TestDO {
|
||||
public class Test {
|
||||
|
||||
@TableId
|
||||
private Long id;
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.ruoyi.xkt.dto;
|
||||
|
||||
import com.ruoyi.xkt.domain.Test;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-03-26 14:47
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class TestDTO extends Test {
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package com.ruoyi.system.mapper;
|
||||
package com.ruoyi.xkt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.system.domain.TestDO;
|
||||
import com.ruoyi.xkt.domain.Test;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
|
|
@ -9,5 +9,5 @@ import org.springframework.stereotype.Repository;
|
|||
* @date 2025-03-18 16:05
|
||||
*/
|
||||
@Repository
|
||||
public interface TestMapper extends BaseMapper<TestDO> {
|
||||
public interface TestMapper extends BaseMapper<Test> {
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.ruoyi.xkt.service;
|
||||
|
||||
import com.ruoyi.xkt.dto.TestDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-03-18 16:07
|
||||
*/
|
||||
public interface ITestService {
|
||||
|
||||
void insertTest(TestDTO testDTO);
|
||||
|
||||
void updateTest(TestDTO testDTO);
|
||||
|
||||
List<TestDTO> listTest();
|
||||
}
|
||||
|
|
@ -0,0 +1,52 @@
|
|||
package com.ruoyi.xkt.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.xkt.domain.Test;
|
||||
import com.ruoyi.xkt.dto.TestDTO;
|
||||
import com.ruoyi.xkt.mapper.TestMapper;
|
||||
import com.ruoyi.xkt.service.ITestService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author liangyq
|
||||
* @date 2025-03-18 16:08
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class TestServiceImpl implements ITestService {
|
||||
@Autowired
|
||||
private TestMapper testMapper;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void insertTest(TestDTO testDTO) {
|
||||
Test test = new Test();
|
||||
test.setDescription(testDTO.getDescription());
|
||||
test.setVersion(0L);
|
||||
testMapper.insert(test);
|
||||
log.info("插入:{}", test);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public void updateTest(TestDTO testDTO) {
|
||||
Test test = new Test();
|
||||
test.setId(testDTO.getId());
|
||||
test.setDescription(testDTO.getDescription());
|
||||
test.setVersion(testDTO.getVersion());
|
||||
log.info("修改:{}", testMapper.updateById(test));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TestDTO> listTest() {
|
||||
List<Test> testList = testMapper.selectList(Wrappers.lambdaQuery(Test.class).eq(Test::getId, 1));
|
||||
log.info("查询:{}", testList);
|
||||
return BeanUtil.copyToList(testList, TestDTO.class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.ruoyi.xkt.mapper.TestMapper">
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue