This repository has been archived by the owner on Sep 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #276 from ZFGCCP/release/1.1.2
Release/1.1.2
- Loading branch information
Showing
34 changed files
with
1,849 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE `SYSTEM_SETTINGS` ( | ||
`SYSTEM_SETTING_ID` INT(11) NOT NULL AUTO_INCREMENT, | ||
`VALUE` VARCHAR(50) NOT NULL, | ||
`CODE` VARCHAR(50) NOT NULL, | ||
`CREATED_TS` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
`UPDATED_TS` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', | ||
PRIMARY KEY (`SYSTEM_SETTING_ID`) | ||
) | ||
COLLATE='latin1_swedish_ci' | ||
ENGINE=InnoDB | ||
AUTO_INCREMENT=2 | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.zfgc.controller; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
|
||
import com.zfgc.model.config.ServerConfig; | ||
|
||
@Controller | ||
@RequestMapping(value="/config") | ||
public class ConfigController extends BaseController { | ||
|
||
@RequestMapping(value="", method=RequestMethod.GET, produces="application/json") | ||
@ResponseBody | ||
public ResponseEntity getServerSideConfig(){ | ||
ServerConfig config = new ServerConfig(); | ||
config.setIdpEntityId(zfgcSamlConfig.getEntityId()); | ||
|
||
return ResponseEntity.ok(config); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.zfgc.dao; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.zfgc.dbobj.SystemSettingsDbObj; | ||
import com.zfgc.dbobj.SystemSettingsDbObjExample; | ||
import com.zfgc.mappers.SystemSettingsDbObjMapper; | ||
import com.zfgc.model.system.SystemSettings; | ||
|
||
@Component | ||
public class SystemSettingsDao extends AbstractDao<SystemSettingsDbObjExample, SystemSettingsDbObj, SystemSettings>{ | ||
|
||
@Autowired | ||
private SystemSettingsDbObjMapper systemSettingsDbObjMapper; | ||
|
||
@Override | ||
public List<SystemSettingsDbObj> get(SystemSettingsDbObjExample ex) throws RuntimeException { | ||
return systemSettingsDbObjMapper.selectByExample(ex); | ||
} | ||
|
||
@Override | ||
public void hardDelete(SystemSettings obj) throws RuntimeException { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
@Override | ||
public void updateOrInsert(SystemSettings obj) throws RuntimeException { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
@Override | ||
public void updateByExample(SystemSettings obj, SystemSettingsDbObjExample ex) throws RuntimeException { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
@Override | ||
public Integer deleteByExample(SystemSettings obj, SystemSettingsDbObjExample ex) throws RuntimeException { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
@Override | ||
public Long countByExample(SystemSettings obj, SystemSettingsDbObjExample ex) throws RuntimeException { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/zfgc/dataprovider/SystemSettingsDataProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.zfgc.dataprovider; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.zfgc.dao.SystemSettingsDao; | ||
import com.zfgc.dbobj.SystemSettingsDbObj; | ||
import com.zfgc.dbobj.SystemSettingsDbObjExample; | ||
import com.zfgc.exception.ZfgcNotFoundException; | ||
import com.zfgc.model.system.SystemSettings; | ||
|
||
@Component | ||
public class SystemSettingsDataProvider extends AbstractDataProvider { | ||
|
||
@Autowired | ||
private SystemSettingsDao systemSettingsDao; | ||
|
||
public String getSystemValue(String settingName) { | ||
SystemSettingsDbObjExample ex = systemSettingsDao.getExample(); | ||
ex.createCriteria().andCodeEqualTo(settingName); | ||
|
||
List<SystemSettingsDbObj> dbObj = systemSettingsDao.get(ex); | ||
|
||
if(dbObj.size() > 0) { | ||
return mapper.map(dbObj.get(0), SystemSettings.class).getValue(); | ||
} | ||
else { | ||
throw new ZfgcNotFoundException("The system value " + settingName + " was not found."); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.