2025-12-18 01:13:19 +07:00
|
|
|
package ru.soune.nocopy.configuration;
|
|
|
|
|
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
|
import ru.soune.nocopy.handler.*;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
|
public class HandlerConfig {
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
public Map<Integer, RequestHandler> handlers(
|
|
|
|
|
RegRequestHandler reg,
|
|
|
|
|
LoginRequestHandler login,
|
|
|
|
|
FileUploadHandler upload,
|
2025-12-21 16:19:12 +07:00
|
|
|
FileEntityHandler file,
|
|
|
|
|
LogoutRequestHandler logoutHandler
|
2025-12-18 01:13:19 +07:00
|
|
|
) {
|
|
|
|
|
Map<Integer, RequestHandler> map = new HashMap<>();
|
|
|
|
|
map.put(20001, login);
|
|
|
|
|
map.put(20002, reg);
|
|
|
|
|
map.put(20004, upload);
|
|
|
|
|
map.put(20005, file);
|
2025-12-21 16:19:12 +07:00
|
|
|
map.put(20006, logoutHandler);
|
2025-12-18 01:13:19 +07:00
|
|
|
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
}
|