|
|
@@ -0,0 +1,79 @@
|
|
|
+package com.ruoyi.api.controller.shop;
|
|
|
+
|
|
|
+import com.ruoyi.agent.domain.bo.AgentApplyBo;
|
|
|
+import com.ruoyi.agent.domain.vo.AgentApplyVo;
|
|
|
+import com.ruoyi.agent.service.IAgentApplyService;
|
|
|
+import com.ruoyi.api.controller.common.AbstractApiController;
|
|
|
+import com.ruoyi.common.annotation.RepeatSubmit;
|
|
|
+import com.ruoyi.common.core.domain.PageQuery;
|
|
|
+import com.ruoyi.common.core.domain.R;
|
|
|
+import com.ruoyi.common.core.page.TableDataInfo;
|
|
|
+import com.ruoyi.common.core.validate.AddGroup;
|
|
|
+import com.ruoyi.common.core.validate.EditGroup;
|
|
|
+import com.ruoyi.common.core.validate.QueryGroup;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 代理申请Controller
|
|
|
+ *
|
|
|
+ * @author ruoyi
|
|
|
+ * @date 2025-11-19
|
|
|
+ */
|
|
|
+@Validated
|
|
|
+@Api(value = "代理申请控制器", tags = {"代理申请管理"})
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RestController
|
|
|
+@RequestMapping("/api/agent/agentApply")
|
|
|
+public class ApiAgentApplyController extends AbstractApiController {
|
|
|
+
|
|
|
+ private final IAgentApplyService iAgentApplyService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页查询代理申请列表
|
|
|
+ */
|
|
|
+ @ApiOperation("查询代理申请列表")
|
|
|
+ @GetMapping("/page")
|
|
|
+ public TableDataInfo<AgentApplyVo> page(@Validated(QueryGroup.class) AgentApplyBo bo, PageQuery pageQuery) {
|
|
|
+ return iAgentApplyService.queryPageList(bo, pageQuery);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取代理申请详细信息
|
|
|
+ */
|
|
|
+ @ApiOperation("获取代理申请详细信息")
|
|
|
+ @GetMapping("/info/{agentApplyId}")
|
|
|
+ public R<AgentApplyVo> getInfo(@ApiParam("主键")
|
|
|
+ @NotNull(message = "主键不能为空")
|
|
|
+ @PathVariable("agentApplyId") Long agentApplyId) {
|
|
|
+ return R.ok(iAgentApplyService.queryById(agentApplyId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增代理申请
|
|
|
+ */
|
|
|
+ @ApiOperation("新增代理申请")
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PostMapping("/add")
|
|
|
+ public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentApplyBo bo) {
|
|
|
+ bo.setUserId(getUserId(true));
|
|
|
+ return toAjax(iAgentApplyService.insertByBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改代理申请
|
|
|
+ */
|
|
|
+ @ApiOperation("修改代理申请")
|
|
|
+ @RepeatSubmit()
|
|
|
+ @PostMapping("/edit")
|
|
|
+ public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentApplyBo bo) {
|
|
|
+ return toAjax(iAgentApplyService.updateByBo(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|