update 会员组

This commit is contained in:
2023-12-26 14:59:02 +08:00
parent f48e7fe992
commit 2174a550f5
8 changed files with 918 additions and 0 deletions

View File

@@ -0,0 +1,98 @@
package com.jsowell.pile.controller;
import com.jsowell.common.annotation.Log;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.core.domain.AjaxResult;
import com.jsowell.common.core.page.TableDataInfo;
import com.jsowell.common.enums.BusinessType;
import com.jsowell.common.util.poi.ExcelUtil;
import com.jsowell.pile.domain.MemberGroup;
import com.jsowell.pile.service.MemberGroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 会员组Controller
*
* @author jsowell
* @date 2023-12-26
*/
@RestController
@RequestMapping("/member/memberGroup")
public class MemberGroupController extends BaseController
{
@Autowired
private MemberGroupService memberGroupService;
/**
* 查询会员组列表
*/
@PreAuthorize("@ss.hasPermi('member:memberGroup:list')")
@GetMapping("/list")
public TableDataInfo list(MemberGroup memberGroup)
{
startPage();
List<MemberGroup> list = memberGroupService.selectMemberGroupList(memberGroup);
return getDataTable(list);
}
/**
* 导出会员组列表
*/
@PreAuthorize("@ss.hasPermi('member:memberGroup:export')")
@Log(title = "会员组", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MemberGroup memberGroup)
{
List<MemberGroup> list = memberGroupService.selectMemberGroupList(memberGroup);
ExcelUtil<MemberGroup> util = new ExcelUtil<MemberGroup>(MemberGroup.class);
util.exportExcel(response, list, "会员组数据");
}
/**
* 获取会员组详细信息
*/
@PreAuthorize("@ss.hasPermi('member:memberGroup:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(memberGroupService.selectMemberGroupById(id));
}
/**
* 新增会员组
*/
@PreAuthorize("@ss.hasPermi('member:memberGroup:add')")
@Log(title = "会员组", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MemberGroup memberGroup)
{
return toAjax(memberGroupService.insertMemberGroup(memberGroup));
}
/**
* 修改会员组
*/
@PreAuthorize("@ss.hasPermi('member:memberGroup:edit')")
@Log(title = "会员组", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MemberGroup memberGroup)
{
return toAjax(memberGroupService.updateMemberGroup(memberGroup));
}
/**
* 删除会员组
*/
@PreAuthorize("@ss.hasPermi('member:memberGroup:remove')")
@Log(title = "会员组", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(memberGroupService.deleteMemberGroupByIds(ids));
}
}