package com.dsh.guns.modular.system.controller.code; import com.dsh.course.feignClient.account.model.CityManager; import com.dsh.course.feignClient.account.model.TStoreStaff; import com.dsh.course.feignClient.activity.model.QueryBodySideAppointmentVO; import com.dsh.course.feignClient.other.StoreValueConfigClient; import com.dsh.guns.config.UserExt; import com.dsh.guns.modular.system.model.Store; import com.dsh.guns.modular.system.model.StoredValueConfig; import com.dsh.guns.modular.system.util.ResultUtil; import org.json.JSONArray; import org.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; /** * 储值规则配置控制器 */ @Controller @RequestMapping("/storeValueConfig") public class TStoredValueConfigController { private String PREFIX = "/system/storeValueConfig/"; @Autowired private StoreValueConfigClient storeValueConfigClient; /* * 储值管理功能已下线,保留原实现以便后续恢复。 * * @RequestMapping("") * public String index(Model model) { * StoredValueConfig storeValueConfig = storeValueConfigClient.getStoreValueConfig(); * model.addAttribute("description", storeValueConfig.getDescription()); * JSONObject jsonObject = new JSONObject(storeValueConfig.getContent()); * JSONArray timeRulesArray = jsonObject.getJSONArray("time_rules"); * model.addAttribute("content", jsonObject.toString()); * if (timeRulesArray.length() > 0) { * JSONObject timeRule = timeRulesArray.getJSONObject(0); * model.addAttribute("time", timeRule.getString("startTime") + " - " + timeRule.getString("endTime")); * } else { * model.addAttribute("time", ""); * } * return PREFIX + "StoreValueConfig.html"; * } * * @ResponseBody * @RequestMapping(value = "/addStoreValueConfig") * public ResultUtil addStoreValueConfig(@RequestBody StoredValueConfig storedValueConfig) { * storeValueConfigClient.addStoreValueConfig(storedValueConfig); * return ResultUtil.success(); * } */ /** 储值管理功能已下线,避免通过历史菜单或直接 URL 继续访问。 */ @ResponseBody @RequestMapping({"", "/addStoreValueConfig"}) public ResultUtil storeValueConfigUnavailable() { return ResultUtil.error("储值管理功能暂不提供"); } }