package cn.com.citycloud.rent;

import cn.com.citycloud.common.Constants;
import cn.com.citycloud.configuration.privilege.EnablePrivilegeAuthorization;
import cn.com.citycloud.configuration.privilege.EnablePrivilegeAuthorizations;
import cn.com.citycloud.configuration.privilege.PrivilegeType;
import cn.hutool.extra.spring.EnableSpringUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication(scanBasePackages = {"cn.com.citycloud"})
@EnableCircuitBreaker
@EnableTransactionManagement
@EnableFeignClients({"cn.com.citycloud.configuration.feign"})
@EnablePrivilegeAuthorizations({
@EnablePrivilegeAuthorization(sessionKey = Constants.PLATFORM_PRIVILEGE, privilegeType = PrivilegeType.PLATFORM),
@EnablePrivilegeAuthorization(sessionKey = Constants.SYSTEM_PRIVILEGE_KEYWORD, privilegeType = PrivilegeType.MANAGER)
})
@EnableAsync
@EnableSpringUtil
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }
}
