Repository navigation
Expand file tree
/
Copy pathAppSetting.java
More file actions
51 lines (40 loc) · 1.39 KB
/
Copy pathAppSetting.java
File metadata and controls
51 lines (40 loc) · 1.39 KB
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
50
51
package com.raysmond.blog.services;
import com.domingosuarez.boot.autoconfigure.jade4j.JadeHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author Raysmond
*/
@JadeHelper("App")
@Service
public class AppSetting {
public static final String SITE_NAME = "site_name";
public static final String SITE_SLOGAN = "site_slogan";
public static final String PAGE_SIZE = "page_size";
@Autowired
private SettingService settingService;
private String siteName = "SpringBlog";
private String siteSlogan = "An interesting place to discover";
private Integer pageSize = 5;
public String getSiteName() {
return (String) settingService.get(SITE_NAME, siteName);
}
public void setSiteName(String siteName) {
this.siteName = siteName;
settingService.put(SITE_NAME, siteName);
}
public Integer getPageSize() {
return (Integer) settingService.get(PAGE_SIZE, pageSize);
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
settingService.put(PAGE_SIZE, pageSize);
}
public String getSiteSlogan() {
return (String) settingService.get(SITE_SLOGAN, siteSlogan);
}
public void setSiteSlogan(String siteSlogan) {
this.siteSlogan = siteSlogan;
settingService.put(SITE_SLOGAN, siteSlogan);
}
}