平台管理端基本完成
This commit is contained in:
parent
39d662fce3
commit
967bddd2de
@ -9,6 +9,7 @@
|
|||||||
<outputRelativeToContentRoot value="true" />
|
<outputRelativeToContentRoot value="true" />
|
||||||
<module name="common-util" />
|
<module name="common-util" />
|
||||||
<module name="service-product-client" />
|
<module name="service-product-client" />
|
||||||
|
<module name="service-gateway" />
|
||||||
<module name="rabbit_util" />
|
<module name="rabbit_util" />
|
||||||
<module name="service-product" />
|
<module name="service-product" />
|
||||||
<module name="service-sys" />
|
<module name="service-sys" />
|
||||||
@ -29,6 +30,7 @@
|
|||||||
<module name="service-acl" options="-parameters" />
|
<module name="service-acl" options="-parameters" />
|
||||||
<module name="service-activity" options="-parameters" />
|
<module name="service-activity" options="-parameters" />
|
||||||
<module name="service-client" options="" />
|
<module name="service-client" options="" />
|
||||||
|
<module name="service-gateway" options="-parameters" />
|
||||||
<module name="service-product" options="-parameters" />
|
<module name="service-product" options="-parameters" />
|
||||||
<module name="service-product-client" options="-parameters" />
|
<module name="service-product-client" options="-parameters" />
|
||||||
<module name="service-search" options="-parameters" />
|
<module name="service-search" options="-parameters" />
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service-client/service-product-client/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service-client/service-product-client/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service-client/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service-client/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service-client/src/main/resources" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service-client/src/main/resources" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service-gateway/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service/service-acl/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service/service-acl/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service/service-activity/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service/service-activity/src/main/java" charset="UTF-8" />
|
||||||
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service/service-product/src/main/java" charset="UTF-8" />
|
<file url="file://$PROJECT_DIR$/guigu-ssyx-parent/service/service-product/src/main/java" charset="UTF-8" />
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
<module>model</module>
|
<module>model</module>
|
||||||
<module>service</module>
|
<module>service</module>
|
||||||
<module>service-client</module>
|
<module>service-client</module>
|
||||||
|
<module>service-gateway</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
|
36
guigu-ssyx-parent/service-gateway/pom.xml
Normal file
36
guigu-ssyx-parent/service-gateway/pom.xml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.atguigu</groupId>
|
||||||
|
<artifactId>guigu-ssyx-parent</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>service-gateway</artifactId>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.atguigu</groupId>
|
||||||
|
<artifactId>common-util</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- 服务注册 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-gateway</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.atguigu.ssyx;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: ServiceGatewayApplication
|
||||||
|
* Package: com.atguigu.ssyx
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/9/20 16:51
|
||||||
|
*/
|
||||||
|
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableDiscoveryClient
|
||||||
|
public class ServiceGatewayApplication {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(ServiceGatewayApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.atguigu.ssyx.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.web.cors.CorsConfiguration;
|
||||||
|
import org.springframework.web.cors.reactive.CorsWebFilter;
|
||||||
|
import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource;
|
||||||
|
import org.springframework.web.util.pattern.PathPatternParser;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ClassName: CorsConfig
|
||||||
|
* Package: com.atguigu.ssyx.config
|
||||||
|
*
|
||||||
|
* @author yovinchen
|
||||||
|
* @Create 2023/9/20 16:52
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class CorsConfig {
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public CorsWebFilter corsFilter() {
|
||||||
|
CorsConfiguration config = new CorsConfiguration();
|
||||||
|
config.addAllowedMethod("*");
|
||||||
|
config.addAllowedOrigin("*");
|
||||||
|
config.addAllowedHeader("*");
|
||||||
|
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(new PathPatternParser());
|
||||||
|
source.registerCorsConfiguration("/**", config);
|
||||||
|
return new CorsWebFilter(source);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,59 @@
|
|||||||
|
server:
|
||||||
|
port: 8200
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
gateway:
|
||||||
|
discovery:
|
||||||
|
locator:
|
||||||
|
enabled: true
|
||||||
|
routes:
|
||||||
|
- id: service-acl
|
||||||
|
uri: lb://service-acl
|
||||||
|
predicates:
|
||||||
|
- Path=/*/acl/**
|
||||||
|
|
||||||
|
- id: service-sys
|
||||||
|
uri: lb://service-sys
|
||||||
|
predicates:
|
||||||
|
- Path=/*/sys/**
|
||||||
|
|
||||||
|
- id: service-product
|
||||||
|
uri: lb://service-product
|
||||||
|
predicates:
|
||||||
|
- Path=/*/product/**
|
||||||
|
|
||||||
|
- id: service-activity
|
||||||
|
uri: lb://service-activity
|
||||||
|
predicates:
|
||||||
|
- Path=/*/activity/**
|
||||||
|
|
||||||
|
- id: service-order
|
||||||
|
uri: lb://service-order
|
||||||
|
predicates:
|
||||||
|
- Path=/*/order/**
|
||||||
|
|
||||||
|
- id: service-payment
|
||||||
|
uri: lb://service-payment
|
||||||
|
predicates:
|
||||||
|
- Path=/*/payment/**
|
||||||
|
|
||||||
|
- id: service-user
|
||||||
|
uri: lb://service-user
|
||||||
|
predicates:
|
||||||
|
- Path=/*/user/**
|
||||||
|
|
||||||
|
- id: service-search
|
||||||
|
uri: lb://service-search
|
||||||
|
predicates:
|
||||||
|
- Path=/*/search/**
|
||||||
|
|
||||||
|
- id: service-home
|
||||||
|
uri: lb://service-home
|
||||||
|
predicates:
|
||||||
|
- Path=/*/home/**
|
||||||
|
|
||||||
|
- id: service-cart
|
||||||
|
uri: lb://service-cart
|
||||||
|
predicates:
|
||||||
|
- Path=/*/cart/**
|
@ -0,0 +1,11 @@
|
|||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: service-gateway
|
||||||
|
profiles:
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 82.157.68.223:8848
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
@ -30,7 +30,6 @@ import java.util.Map;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/acl/user")
|
@RequestMapping("/admin/acl/user")
|
||||||
@Api(tags = "用户管理")
|
@Api(tags = "用户管理")
|
||||||
@CrossOrigin
|
|
||||||
public class AdminController {
|
public class AdminController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -2,7 +2,10 @@ package com.atguigu.ssyx.acl.controller;
|
|||||||
|
|
||||||
import com.atguigu.ssyx.common.result.Result;
|
import com.atguigu.ssyx.common.result.Result;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -18,7 +21,6 @@ import java.util.Map;
|
|||||||
@Api(tags = "登录接口")
|
@Api(tags = "登录接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/acl/index")
|
@RequestMapping("/admin/acl/index")
|
||||||
@CrossOrigin //跨域
|
|
||||||
public class IndexController {
|
public class IndexController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/acl/permission")
|
@RequestMapping("/admin/acl/permission")
|
||||||
@Api(tags = "菜单服务")
|
@Api(tags = "菜单服务")
|
||||||
@CrossOrigin
|
|
||||||
public class PermissionController {
|
public class PermissionController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -28,7 +28,7 @@ import java.util.Map;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/acl/role")
|
@RequestMapping("/admin/acl/role")
|
||||||
@Api(tags = "角色管理")
|
@Api(tags = "角色管理")
|
||||||
@CrossOrigin
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class RoleController {
|
public class RoleController {
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Api(value = "ActivityInfo管理", tags = "活动管理")
|
@Api(value = "ActivityInfo管理", tags = "活动管理")
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
|
||||||
@RequestMapping("/admin/activity/activityInfo")
|
@RequestMapping("/admin/activity/activityInfo")
|
||||||
public class ActivityInfoController {
|
public class ActivityInfoController {
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||||||
* @since 2023-09-17
|
* @since 2023-09-17
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
|
||||||
@RequestMapping("/admin/activity/couponInfo")
|
@RequestMapping("/admin/activity/couponInfo")
|
||||||
public class CouponInfoController {
|
public class CouponInfoController {
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||||||
@Api(value = "Attr管理", tags = "平台属性管理")
|
@Api(value = "Attr管理", tags = "平台属性管理")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "/admin/product/attr")
|
@RequestMapping(value = "/admin/product/attr")
|
||||||
@CrossOrigin
|
|
||||||
public class AttrController {
|
public class AttrController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -26,7 +26,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Api(value = "AttrGroup管理", tags = "平台属性分组管理")
|
@Api(value = "AttrGroup管理", tags = "平台属性分组管理")
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
|
||||||
@RequestMapping(value = "/admin/product/attrGroup")
|
@RequestMapping(value = "/admin/product/attrGroup")
|
||||||
public class AttrGroupController {
|
public class AttrGroupController {
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Api(value = "Category管理", tags = "商品分类管理")
|
@Api(value = "Category管理", tags = "商品分类管理")
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
|
||||||
@RequestMapping(value = "/admin/product/category")
|
@RequestMapping(value = "/admin/product/category")
|
||||||
public class CategoryController {
|
public class CategoryController {
|
||||||
|
|
||||||
|
@ -5,7 +5,6 @@ import com.atguigu.ssyx.product.service.FileUploadService;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -20,7 +19,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
*/
|
*/
|
||||||
@Api(tags = "文件上传接口")
|
@Api(tags = "文件上传接口")
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
|
||||||
@RequestMapping("admin/product")
|
@RequestMapping("admin/product")
|
||||||
public class FileUploadController {
|
public class FileUploadController {
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Api(value = "SkuInfo管理", tags = "商品Sku管理")
|
@Api(value = "SkuInfo管理", tags = "商品Sku管理")
|
||||||
@RestController
|
@RestController
|
||||||
@CrossOrigin
|
|
||||||
@RequestMapping(value = "/admin/product/skuInfo")
|
@RequestMapping(value = "/admin/product/skuInfo")
|
||||||
public class SkuInfoController {
|
public class SkuInfoController {
|
||||||
|
|
||||||
|
@ -7,3 +7,5 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: 82.157.68.223:8848
|
server-addr: 82.157.68.223:8848
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
@ -7,3 +7,5 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: 82.157.68.223:8848
|
server-addr: 82.157.68.223:8848
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
@ -7,7 +7,10 @@ import com.atguigu.ssyx.sys.service.RegionService;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -22,7 +25,7 @@ import java.util.List;
|
|||||||
@Api(value = "地区接口", tags = "地区接口")
|
@Api(value = "地区接口", tags = "地区接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/sys/region")
|
@RequestMapping("/admin/sys/region")
|
||||||
@CrossOrigin
|
|
||||||
public class RegionController {
|
public class RegionController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -24,7 +24,6 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "/admin/sys/regionWare")
|
@RequestMapping(value = "/admin/sys/regionWare")
|
||||||
@Api(value = "开通区域接口", tags = "开通区域接口")
|
@Api(value = "开通区域接口", tags = "开通区域接口")
|
||||||
@CrossOrigin
|
|
||||||
public class RegionWareController {
|
public class RegionWareController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RegionWareService regionWareService;
|
private RegionWareService regionWareService;
|
||||||
|
@ -7,7 +7,6 @@ import com.atguigu.ssyx.sys.service.WareService;
|
|||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@ -25,7 +24,7 @@ import java.util.List;
|
|||||||
@Api(value = "仓库接口", tags = "仓库接口")
|
@Api(value = "仓库接口", tags = "仓库接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/admin/sys/ware")
|
@RequestMapping("/admin/sys/ware")
|
||||||
@CrossOrigin
|
|
||||||
public class WareController {
|
public class WareController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -7,3 +7,5 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
server-addr: 82.157.68.223:8848
|
server-addr: 82.157.68.223:8848
|
||||||
|
username: nacos
|
||||||
|
password: nacos
|
||||||
|
@ -3,4 +3,4 @@ ENV = 'development'
|
|||||||
|
|
||||||
# base api
|
# base api
|
||||||
# VUE_APP_BASE_API = '/dev-api'
|
# VUE_APP_BASE_API = '/dev-api'
|
||||||
VUE_APP_BASE_API = 'http://localhost:9001'
|
VUE_APP_BASE_API = 'http://localhost:8200'
|
||||||
|
@ -3,5 +3,5 @@ ENV = 'production'
|
|||||||
|
|
||||||
# base api
|
# base api
|
||||||
#VUE_APP_BASE_API = '/prod-api'
|
#VUE_APP_BASE_API = '/prod-api'
|
||||||
VUE_APP_BASE_API = 'http://localhost:9001'
|
VUE_APP_BASE_API = 'http://localhost:8200'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user