problem description
use consul as the registry
spring cloud gateway as the gateway
gateway user
user
spring cloud gateway 404
the environmental background of the problems and what methods you have tried
related codes
spring:
profiles:
active: dev
application:
name: angelcloud-gateway
cloud:
gateway:
discovery:
locator:
enabled: true
-sharp filter:
-sharp remove-non-proxy-headers:
-sharp headers:
-sharp - dummy
routes:
- id: baidu
-sharp /infohttplb
uri: http://www.baidu.com/
-sharp ,/userapi/**,
predicates:
- Path=/baidu/**
-sharp - id: apiuser
-sharp /infohttplb
-sharp uri: lb://ANGELCLOUD-PROVIDER-USER
-sharp ,/userapi/**,
-sharp predicates:
-sharp - Path=/ANGELCLOUD-PROVIDER-USER/**
consul:
host: localhost
port: 8500
healthCheckInterval: 15s
server:
port: 8080
-sharp eureka:
-sharp client:
-sharp service-url:
-sharp defaultZone: http://localhost:8761/eureka/
server:
port: 8030
spring:
profiles:
active: dev
application:
-sharp name: @pom.artifactId@
name: angelcloud-provider-user
datasource:
username: root
password: 123456
url: jdbc:mysql://127.0.0.1:3306/angelcloud_master?characterEncoding=utf-8&useSSL=false
cloud:
consul:
host: localhost
port: 8500
healthCheckInterval: 15s
mybatis-plus:
typeAliasesPackage: com.angel.provider.model.domain
mapper-locations: classpath:mapper/*.xml,classpath*:sdk/mapper/*.xml
configuration:
-sharp
map-underscore-to-camel-case: true
mapper:
mappers: com.angel.provider.mapper.*
not-empty: false
identity: MYSQL
-sharp pagehelper:
-sharp helperDialect: mysql
-sharp reasonable: true
-sharp support-methods-arguments: true
-sharp params: count=countSql
-sharp eureka:
-sharp client:
-sharp service-url:
-sharp defaultZone: http://localhost:8761/eureka/
package com.angel.provider.web.frontend;
import com.angel.provider.model.domain.SysUser;
import com.angel.provider.service.ISysUserService;
import com.baomidou.mybatisplus.plugins.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
/**
*
* ()
*
*
* @author aa
* @since 2018-07-30
*/
@RestController
@RequestMapping("/sysUser")
public class SysUserController {
@Resource
private ISysUserService iSysUserService;
@GetMapping(value = "selectall")
public String selectAll () {
Page<SysUser> page =new Page<SysUser>(0, 10);
Page<SysUser> sysUserPage = iSysUserService.selectPage(page);
List<SysUser> records = sysUserPage.getRecords();
return records.toString();
}
}
what result do you expect? What is the error message actually seen?
the solution is reported to 404 via gateway