| | |
| | | |
| | | import com.google.gson.*; |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfig; |
| | | import com.yeshi.makemoney.app.entity.config.SystemConfigKey; |
| | | import com.yeshi.makemoney.app.service.inter.config.SystemConfigService; |
| | | import com.yeshi.makemoney.app.service.query.config.SystemConfigQuery; |
| | | import com.yeshi.makemoney.app.vo.AcceptAdminData; |
| | | import net.sf.json.JSONArray; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("add") |
| | | public String add(SystemConfig bean, HttpSession session, String callback) { |
| | | public String add(SystemConfig bean, AcceptAdminData acceptAdminData, String callback) { |
| | | try{ |
| | | bean.setSystem(acceptAdminData.getSystem()); |
| | | systemConfigService.add(bean); |
| | | return loadPrint(callback, JsonUtil.loadTrueResult("")); |
| | | }catch(Exception e){ |
| | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping("getKeyList") |
| | | public String getKeyList() { |
| | | JSONArray array = new JSONArray(); |
| | | for (SystemConfigKey key : SystemConfigKey.values()) { |
| | | JSONObject data = new JSONObject(); |
| | | data.put("key", key.name()); |
| | | data.put("value", key.getDesc()); |
| | | array.add(data); |
| | | } |
| | | return JsonUtil.loadTrueResult(array); |
| | | } |
| | | |
| | | |
| | | } |