package cn.novalon.gym.manage.app.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.codec.multipart.DefaultPartHttpMessageReader;
import org.springframework.http.codec.multipart.MultipartHttpMessageReader;

@Configuration
public class MultipartConfig {

    @Bean
    public MultipartHttpMessageReader multipartHttpMessageReader() {
        DefaultPartHttpMessageReader partReader = new DefaultPartHttpMessageReader();
        partReader.setMaxHeadersSize(8192);
        partReader.setMaxDiskUsagePerPart(10 * 1024 * 1024);
        partReader.setEnableLoggingRequestDetails(true);
        return new MultipartHttpMessageReader(partReader);
    }
}