44323
2023-11-27 aa925d851857f50eff0556411366690d9a78a0e5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
 
package com.dsh;
 
 
import cn.mb.cloud.common.core.annotation.MBCloudApplication;
import cn.mb.cloud.common.data.web.WebConfig;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Import;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.scheduling.annotation.EnableScheduling;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
 
import javax.annotation.PostConstruct;
import java.util.TimeZone;
 
/**
 * @author jason
 */
@EnableSwagger2
@EnableFeignClients
@MBCloudApplication
@EnableScheduling//开启定时任务
@Import({WebConfig.class})
@MapperScan("com.dsh.account.mapper")
public class AccountApplication {
    public static void main(String[] args) {
        try {
            SpringApplication.run(AccountApplication.class, args);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
 
    @Bean
    public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
        PropertySourcesPlaceholderConfigurer c = new PropertySourcesPlaceholderConfigurer();
        c.setIgnoreUnresolvablePlaceholders(true);
        return c;
    }
 
    @PostConstruct
    void started() {
        TimeZone.setDefault(TimeZone.getTimeZone("GMT+8"));
    }
}