package com.stylefeng.guns.modular.system.controller; import com.stylefeng.guns.core.base.controller.BaseController; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.beans.factory.annotation.Autowired; import com.stylefeng.guns.core.log.LogObjectHolder; import org.springframework.web.bind.annotation.RequestParam; import com.stylefeng.guns.modular.system.model.AppWithdrawalRule; import com.stylefeng.guns.modular.system.service.IAppWithdrawalRuleService; /** * 控制器 * * @author fengshuonan * @Date 2021-04-16 16:31:45 */ @Controller @RequestMapping("/appWithdrawalRule") public class AppWithdrawalRuleController extends BaseController { private String PREFIX = "/system/appWithdrawalRule/"; @Autowired private IAppWithdrawalRuleService appWithdrawalRuleService; /** * 跳转到首页 */ @RequestMapping("") public String index() { return PREFIX + "appWithdrawalRule.html"; } /** * 跳转到添加 */ @RequestMapping("/appWithdrawalRule_add") public String appWithdrawalRuleAdd() { return PREFIX + "appWithdrawalRule_add.html"; } /** * 跳转到修改 */ @RequestMapping("/appWithdrawalRule_update/{appWithdrawalRuleId}") public String appWithdrawalRuleUpdate(@PathVariable Integer appWithdrawalRuleId, Model model) { AppWithdrawalRule appWithdrawalRule = appWithdrawalRuleService.selectById(appWithdrawalRuleId); model.addAttribute("item",appWithdrawalRule); LogObjectHolder.me().set(appWithdrawalRule); return PREFIX + "appWithdrawalRule_edit.html"; } /** * 获取列表 */ @RequestMapping(value = "/list") @ResponseBody public Object list(String condition) { return appWithdrawalRuleService.selectList(null); } /** * 新增 */ @RequestMapping(value = "/add") @ResponseBody public Object add(AppWithdrawalRule appWithdrawalRule) { appWithdrawalRuleService.insert(appWithdrawalRule); return SUCCESS_TIP; } /** * 删除 */ @RequestMapping(value = "/delete") @ResponseBody public Object delete(@RequestParam Integer appWithdrawalRuleId) { appWithdrawalRuleService.deleteById(appWithdrawalRuleId); return SUCCESS_TIP; } /** * 修改 */ @RequestMapping(value = "/update") @ResponseBody public Object update(AppWithdrawalRule appWithdrawalRule) { appWithdrawalRuleService.updateById(appWithdrawalRule); return SUCCESS_TIP; } /** * 详情 */ @RequestMapping(value = "/detail/{appWithdrawalRuleId}") @ResponseBody public Object detail(@PathVariable("appWithdrawalRuleId") Integer appWithdrawalRuleId) { return appWithdrawalRuleService.selectById(appWithdrawalRuleId); } }