|
|
@@ -0,0 +1,115 @@
|
|
|
+package org.dromara.customer.controller;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import jakarta.servlet.http.HttpServletResponse;
|
|
|
+import jakarta.validation.constraints.*;
|
|
|
+import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
|
|
+import org.dromara.common.log.annotation.Log;
|
|
|
+import org.dromara.common.web.core.BaseController;
|
|
|
+import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
+import org.dromara.common.core.domain.R;
|
|
|
+import org.dromara.common.core.validate.AddGroup;
|
|
|
+import org.dromara.common.core.validate.EditGroup;
|
|
|
+import org.dromara.common.log.enums.BusinessType;
|
|
|
+import org.dromara.common.excel.utils.ExcelUtil;
|
|
|
+import org.dromara.customer.domain.vo.PartnerInfoVo;
|
|
|
+import org.dromara.customer.domain.bo.PartnerInfoBo;
|
|
|
+import org.dromara.customer.service.IPartnerInfoService;
|
|
|
+import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 伙伴商基本信息
|
|
|
+ * 前端访问路由地址为:/customer/partnerInfo
|
|
|
+ *
|
|
|
+ * @author LionLi
|
|
|
+ * @date 2026-01-21
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RestController
|
|
|
+@RequestMapping("/partnerInfo")
|
|
|
+public class PartnerInfoController extends BaseController {
|
|
|
+
|
|
|
+ private final IPartnerInfoService partnerInfoService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询伙伴商基本信息列表
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:partnerInfo:list")
|
|
|
+ @GetMapping("/list")
|
|
|
+ public TableDataInfo<PartnerInfoVo> list(PartnerInfoBo bo, PageQuery pageQuery) {
|
|
|
+ return partnerInfoService.queryPageList(bo, pageQuery);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出伙伴商基本信息列表
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:partnerInfo:export")
|
|
|
+ @Log(title = "伙伴商基本信息", businessType = BusinessType.EXPORT)
|
|
|
+ @PostMapping("/export")
|
|
|
+ public void export(PartnerInfoBo bo, HttpServletResponse response) {
|
|
|
+ List<PartnerInfoVo> list = partnerInfoService.queryList(bo);
|
|
|
+ ExcelUtil.exportExcel(list, "伙伴商基本信息", PartnerInfoVo.class, response);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取伙伴商基本信息详细信息
|
|
|
+ *
|
|
|
+ * @param id 主键
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:partnerInfo:query")
|
|
|
+ @GetMapping("/{id}")
|
|
|
+ public R<PartnerInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
|
|
+ @PathVariable("id") Long id) {
|
|
|
+ return R.ok(partnerInfoService.queryById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前登录用户的伙伴商信息
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:partnerInfo:query")
|
|
|
+ @GetMapping("/current")
|
|
|
+ public R<PartnerInfoVo> getCurrentPartnerInfo() {
|
|
|
+ return R.ok(partnerInfoService.queryCurrentPartnerInfo());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增伙伴商基本信息
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:partnerInfo:add")
|
|
|
+ @Log(title = "伙伴商基本信息", businessType = BusinessType.INSERT)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PostMapping()
|
|
|
+ public R<Void> add(@Validated(AddGroup.class) @RequestBody PartnerInfoBo bo) {
|
|
|
+ return toAjax(partnerInfoService.insertByBo(bo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改伙伴商基本信息
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:partnerInfo:edit")
|
|
|
+ @Log(title = "伙伴商基本信息", businessType = BusinessType.UPDATE)
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PutMapping()
|
|
|
+ public R<Void> edit(@Validated(EditGroup.class) @RequestBody PartnerInfoBo bo) {
|
|
|
+ return toAjax(partnerInfoService.updateByBo(bo));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除伙伴商基本信息
|
|
|
+ *
|
|
|
+ * @param ids 主键串
|
|
|
+ */
|
|
|
+ @SaCheckPermission("customer:partnerInfo:remove")
|
|
|
+ @Log(title = "伙伴商基本信息", businessType = BusinessType.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
|
|
+ @PathVariable("ids") Long[] ids) {
|
|
|
+ return toAjax(partnerInfoService.deleteWithValidByIds(List.of(ids), true));
|
|
|
+ }
|
|
|
+}
|