package com.emato.biz.controller.merchant; import java.util.List; 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.biz.domain.merchant.MerchantBase; import com.emato.biz.service.merchant.IMerchantBaseService; import com.emato.common.utils.poi.ExcelUtil; import com.emato.common.core.page.TableDataInfo; /** * 商户基本信息Controller * * @author yangbo * @date 2021-02-01 */ @RestController @RequestMapping("/biz/merchantbase") public class MerchantBaseController extends BaseController { @Autowired private IMerchantBaseService merchantBaseService; /** * 查询商户基本信息列表 */ @PreAuthorize("@ss.hasPermi('biz:merchantbase:list')") @GetMapping("/list") public TableDataInfo list(MerchantBase merchantBase) { startPage(); List list = merchantBaseService.selectMerchantBaseList(merchantBase); return getDataTable(list); } /** * 导出商户基本信息列表 */ @PreAuthorize("@ss.hasPermi('biz:merchantbase:export')") @Log(title = "商户基本信息", businessType = BusinessType.EXPORT) @GetMapping("/export") public AjaxResult export(MerchantBase merchantBase) { List list = merchantBaseService.selectMerchantBaseList(merchantBase); ExcelUtil util = new ExcelUtil(MerchantBase.class); return util.exportExcel(list, "merchantbase"); } /** * 获取商户基本信息详细信息 */ @PreAuthorize("@ss.hasPermi('biz:merchantbase:query')") @GetMapping(value = "/{merchSn}") public AjaxResult getInfo(@PathVariable("merchSn") String merchSn) { return AjaxResult.success(merchantBaseService.selectMerchantBaseById(merchSn)); } /** * 新增商户基本信息 */ @PreAuthorize("@ss.hasPermi('biz:merchantbase:add')") @Log(title = "商户基本信息", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody MerchantBase merchantBase) { return toAjax(merchantBaseService.insertMerchantBase(merchantBase)); } /** * 修改商户基本信息 */ @PreAuthorize("@ss.hasPermi('biz:merchantbase:edit')") @Log(title = "商户基本信息", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody MerchantBase merchantBase) { return toAjax(merchantBaseService.updateMerchantBase(merchantBase)); } /** * 删除商户基本信息 */ @PreAuthorize("@ss.hasPermi('biz:merchantbase:remove')") @Log(title = "商户基本信息", businessType = BusinessType.DELETE) @DeleteMapping("/{merchSns}") public AjaxResult remove(@PathVariable String[] merchSns) { return toAjax(merchantBaseService.deleteMerchantBaseByIds(merchSns)); } }