平台管理端基本完成
This commit is contained in:
		@@ -13,6 +13,7 @@
 | 
			
		||||
        <module>model</module>
 | 
			
		||||
        <module>service</module>
 | 
			
		||||
        <module>service-client</module>
 | 
			
		||||
        <module>service-gateway</module>
 | 
			
		||||
    </modules>
 | 
			
		||||
 | 
			
		||||
    <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
 | 
			
		||||
@RequestMapping("/admin/acl/user")
 | 
			
		||||
@Api(tags = "用户管理")
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
public class AdminController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,10 @@ package com.atguigu.ssyx.acl.controller;
 | 
			
		||||
 | 
			
		||||
import com.atguigu.ssyx.common.result.Result;
 | 
			
		||||
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.Map;
 | 
			
		||||
@@ -18,7 +21,6 @@ import java.util.Map;
 | 
			
		||||
@Api(tags = "登录接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/admin/acl/index")
 | 
			
		||||
@CrossOrigin     //跨域
 | 
			
		||||
public class IndexController {
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ import java.util.List;
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/admin/acl/permission")
 | 
			
		||||
@Api(tags = "菜单服务")
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
public class PermissionController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
 
 | 
			
		||||
@@ -28,7 +28,7 @@ import java.util.Map;
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/admin/acl/role")
 | 
			
		||||
@Api(tags = "角色管理")
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
@Slf4j
 | 
			
		||||
public class RoleController {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -25,7 +25,7 @@ import java.util.List;
 | 
			
		||||
 */
 | 
			
		||||
@Api(value = "ActivityInfo管理", tags = "活动管理")
 | 
			
		||||
@RestController
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
@RequestMapping("/admin/activity/activityInfo")
 | 
			
		||||
public class ActivityInfoController {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -22,7 +22,7 @@ import java.util.List;
 | 
			
		||||
 * @since 2023-09-17
 | 
			
		||||
 */
 | 
			
		||||
@RestController
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
@RequestMapping("/admin/activity/couponInfo")
 | 
			
		||||
public class CouponInfoController {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -23,7 +23,7 @@ import java.util.List;
 | 
			
		||||
@Api(value = "Attr管理", tags = "平台属性管理")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping(value = "/admin/product/attr")
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
public class AttrController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ import java.util.List;
 | 
			
		||||
 */
 | 
			
		||||
@Api(value = "AttrGroup管理", tags = "平台属性分组管理")
 | 
			
		||||
@RestController
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
@RequestMapping(value = "/admin/product/attrGroup")
 | 
			
		||||
public class AttrGroupController {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ import java.util.List;
 | 
			
		||||
 */
 | 
			
		||||
@Api(value = "Category管理", tags = "商品分类管理")
 | 
			
		||||
@RestController
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
@RequestMapping(value = "/admin/product/category")
 | 
			
		||||
public class CategoryController {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,6 @@ import com.atguigu.ssyx.product.service.FileUploadService;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
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.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
@@ -20,7 +19,7 @@ import org.springframework.web.multipart.MultipartFile;
 | 
			
		||||
 */
 | 
			
		||||
@Api(tags = "文件上传接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
@RequestMapping("admin/product")
 | 
			
		||||
public class FileUploadController {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -26,7 +26,7 @@ import java.util.List;
 | 
			
		||||
 */
 | 
			
		||||
@Api(value = "SkuInfo管理", tags = "商品Sku管理")
 | 
			
		||||
@RestController
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
@RequestMapping(value = "/admin/product/skuInfo")
 | 
			
		||||
public class SkuInfoController {
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7,3 +7,5 @@ spring:
 | 
			
		||||
    nacos:
 | 
			
		||||
      discovery:
 | 
			
		||||
        server-addr: 82.157.68.223:8848
 | 
			
		||||
        username: nacos
 | 
			
		||||
        password: nacos
 | 
			
		||||
 
 | 
			
		||||
@@ -7,3 +7,5 @@ spring:
 | 
			
		||||
    nacos:
 | 
			
		||||
      discovery:
 | 
			
		||||
        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.ApiOperation;
 | 
			
		||||
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;
 | 
			
		||||
 | 
			
		||||
@@ -22,7 +25,7 @@ import java.util.List;
 | 
			
		||||
@Api(value = "地区接口", tags = "地区接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/admin/sys/region")
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
public class RegionController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,6 @@ import org.springframework.web.bind.annotation.*;
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping(value = "/admin/sys/regionWare")
 | 
			
		||||
@Api(value = "开通区域接口", tags = "开通区域接口")
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
public class RegionWareController {
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private RegionWareService regionWareService;
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,6 @@ import com.atguigu.ssyx.sys.service.WareService;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
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.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
@@ -25,7 +24,7 @@ import java.util.List;
 | 
			
		||||
@Api(value = "仓库接口", tags = "仓库接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/admin/sys/ware")
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
 | 
			
		||||
public class WareController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
 
 | 
			
		||||
@@ -7,3 +7,5 @@ spring:
 | 
			
		||||
    nacos:
 | 
			
		||||
      discovery:
 | 
			
		||||
        server-addr: 82.157.68.223:8848
 | 
			
		||||
        username: nacos
 | 
			
		||||
        password: nacos
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user