我正在运行这个命令:
protoc protobuf/file.proto --proto_path=protobuf --proto_path=protobuf --python_out=out/builtin_pb --grpc_out=out/builtin_pb --plugin=protoc-gen-grpc=/usr/local/bin/grpc_python_plugin
Run Code Online (Sandbox Code Playgroud)
其中 file.proto 有:
syntax = "proto3";
import "google/protobuf/any.proto";
Run Code Online (Sandbox Code Playgroud)
还有类似的东西:
google.protobuf.Any arg = 3;
Run Code Online (Sandbox Code Playgroud)
但是,它有错误:
google/protobuf/any.proto: File not found.
bess_msg.proto: Import "google/protobuf/any.proto" was not found or had errors.
bess_msg.proto:251:3: "google.protobuf.Any" is not defined
...
Run Code Online (Sandbox Code Playgroud)
我可以遵循哪些步骤来确保 any.proto 正确安装?
谢谢
当我们初始化我们的商店时:
StoreModule.provideStore({r1: Reducer1, r2: Reducer2, ...})
Run Code Online (Sandbox Code Playgroud)
我们确实将Reducer传递给Store进行存储.但我们实际上从未将初始状态传递给商店,除了在reducers函数中定义它:
const someReducer = (state = initialState, act: Action) => { ... }
Run Code Online (Sandbox Code Playgroud)
那么,当应用程序引导时,所有的reducer被调用一次从reducer定义中获取初始状态,然后将状态存储在NgRx Store中?如果是这样,每个减速器是否必须具有初始状态值?否则州将永远不确定?
并且,如果在引导程序中调用所有reducers,那么NgRx如何确保reduce必须达到默认情况?:
case ...:
...
default:
return initialState
Run Code Online (Sandbox Code Playgroud)
非常感谢!任何帮助赞赏!!
我有这个安全配置:
@Override
public void configure(HttpSecurity http) throws Exception {
http
.addFilterBefore(
new JwtLoginFilter("/login", authenticationManager()),
UsernamePasswordAuthenticationFilter.class)
.addFilterBefore(
new JwtAuthenticationFilter(),
UsernamePasswordAuthenticationFilter.class);
http.csrf().disable()
.authorizeRequests().antMatchers("/", "/register").permitAll()
.and()
.authorizeRequests().anyRequest().authenticated();
}
Run Code Online (Sandbox Code Playgroud)
这两个过滤器正在执行身份验证工作:loginFilter 检查帖子正文中的凭据,然后将 cookie 添加到响应中。authenticationFilter 检查 auth cookie。
但是,permitAll 不会让根路由和“/register”路由通过(也就是仍然通过 authenticationFilter,我认为 permitAll 会让这些路由通过过滤器)
怎么了?
根据春季的标准文件上传方式:https : //spring.io/guides/gs/uploading-files/ 我们将使用@RequestParam(“ file”)MultipartFile文件接收从表单上传的文件。
但是我不知道为什么注释是“ RequestParam”而不是“ RequestBody”之类的,因为在表单中我们指定了“ method = post”,所以数据不应该在表单主体内吗?
非常感谢!
我想知道在线游戏的 HTTP 和 TCP 数据传输协议之间的区别。我听说很多人使用 TCP 或 UDP 在网络游戏的客户端和服务器之间传输数据。但是你能使用http吗?我知道http主要用于网页浏览,但是如果我可以设置Web服务器并让我的游戏应用程序使用GET和POST方法,我仍然可以来回发送数据,对吗?是不是这种沟通方式太慢或者没有必要?
关于 TCP 传输协议的一件事是,如果我要使用 TCP 编写一些游戏应用程序,数据通常是使用称为“套接字”的东西(如 Java 中的 Socket 类)传输的吗?那么UDP呢?
非常感谢!感谢任何答案!
spring ×2
spring-boot ×2
angular ×1
http ×1
java ×1
ngrx ×1
ngrx-store ×1
spring-mvc ×1
tcp ×1