package com.stylefeng.guns.modular.system.controller.general; 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.TCashWithdrawal; import com.stylefeng.guns.modular.system.service.ITCashWithdrawalService; /** * 控制器 * * @author fengshuonan * @Date 2023-03-23 10:14:44 */ @Controller @RequestMapping("/tCashWithdrawal") public class TCashWithdrawalController extends BaseController { private String PREFIX = "/system/tCashWithdrawal/"; @Autowired private ITCashWithdrawalService tCashWithdrawalService; /** * 跳转到首页 */ @RequestMapping("") public String index() { return PREFIX + "tCashWithdrawal.html"; } /** * 跳转到添加 */ @RequestMapping("/tCashWithdrawal_add") public String tCashWithdrawalAdd() { return PREFIX + "tCashWithdrawal_add.html"; } /** * 跳转到修改 */ @RequestMapping("/tCashWithdrawal_update/{tCashWithdrawalId}") public String tCashWithdrawalUpdate(@PathVariable Integer tCashWithdrawalId, Model model) { TCashWithdrawal tCashWithdrawal = tCashWithdrawalService.selectById(tCashWithdrawalId); model.addAttribute("item",tCashWithdrawal); LogObjectHolder.me().set(tCashWithdrawal); return PREFIX + "tCashWithdrawal_edit.html"; } /** * 获取列表 */ @RequestMapping(value = "/list") @ResponseBody public Object list(String condition) { return tCashWithdrawalService.selectList(null); } /** * 新增 */ @RequestMapping(value = "/add") @ResponseBody public Object add(TCashWithdrawal tCashWithdrawal) { tCashWithdrawalService.insert(tCashWithdrawal); return SUCCESS_TIP; } /** * 删除 */ @RequestMapping(value = "/delete") @ResponseBody public Object delete(@RequestParam Integer tCashWithdrawalId) { tCashWithdrawalService.deleteById(tCashWithdrawalId); return SUCCESS_TIP; } /** * 修改 */ @RequestMapping(value = "/update") @ResponseBody public Object update(TCashWithdrawal tCashWithdrawal) { tCashWithdrawalService.updateById(tCashWithdrawal); return SUCCESS_TIP; } /** * 详情 */ @RequestMapping(value = "/detail/{tCashWithdrawalId}") @ResponseBody public Object detail(@PathVariable("tCashWithdrawalId") Integer tCashWithdrawalId) { return tCashWithdrawalService.selectById(tCashWithdrawalId); } }