package com.emato.biz.controller.merchant; import java.util.List; import com.emato.biz.domain.merchant.MerchUser; import com.emato.biz.domain.merchant.MerchUserVO; import com.emato.biz.service.merchant.IMerchUserService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.emato.common.annotation.Log; import com.emato.common.core.controller.BaseController; import com.emato.common.core.domain.AjaxResult; import com.emato.common.enums.BusinessType; import com.emato.common.utils.poi.ExcelUtil; import com.emato.common.core.page.TableDataInfo; /** * 商户用户Controller * * @author admin * @date 2023-04-20 */ @RestController @RequestMapping("/merch/merchUser") public class MerchUserController extends BaseController { @Autowired private IMerchUserService merchUserService; /** * 查询商户用户列表 */ @PreAuthorize("@ss.hasPermi('biz:merchUser:list')") @GetMapping("/list") public TableDataInfo list(MerchUser merchUser) { startPage(); List list = merchUserService.selectMerchUserVOList(merchUser); return getDataTable(list); } /** * 导出商户用户列表 */ @PreAuthorize("@ss.hasPermi('biz:merchUser:export')") @Log(title = "商户用户", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(MerchUser merchUser) { List list = merchUserService.selectMerchUserVOList(merchUser); ExcelUtil util = new ExcelUtil<>(MerchUserVO.class); return util.exportExcel(list, "merchUser"); } /** * 获取商户用户详细信息 */ @PreAuthorize("@ss.hasPermi('biz:merchUser:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return AjaxResult.success(merchUserService.selectMerchUserById(id)); } /** * 新增商户用户 */ @PreAuthorize("@ss.hasPermi('biz:merchUser:add')") @Log(title = "商户用户", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody MerchUser merchUser) { return toAjax(merchUserService.insertMerchUser(merchUser)); } /** * 修改商户用户 */ @PreAuthorize("@ss.hasPermi('biz:merchUser:edit')") @Log(title = "商户用户", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody MerchUser merchUser) { return toAjax(merchUserService.updateMerchUser(merchUser)); } /** * 删除商户用户 */ @PreAuthorize("@ss.hasPermi('biz:merchUser:remove')") @Log(title = "商户用户", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(merchUserService.deleteMerchUserByIds(ids)); } }