Commit 9c157f80 by zhouhaibao

refactor(controller): 修改依赖注入方式从构造器注入改为字段注入

- 在 StrategySopConfirmController 中移除 @RequiredArgsConstructor 注解并使用 @Autowired 字段注入
- 在 StrategySopController 中移除 @RequiredArgsConstructor 注解并使用 @Autowired 字段注入
- 在 StrategySopMetaController 中移除 @RequiredArgsConstructor 注解并使用 @Autowired 字段注入
- 在 StrategySopRecordController 中移除 @RequiredArgsConstructor 注解并使用 @Autowired 字段注入
- 统一控制器层依赖注入方式,提升代码可读性
- 保持原有功能不变的情况下优化代码结构
1 parent 481983d5
...@@ -15,14 +15,15 @@ import com.rop.annotation.ServiceMethod; ...@@ -15,14 +15,15 @@ import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean; import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j @Slf4j
@Api("营销SOP-策略确认") @Api("营销SOP-策略确认")
@RequiredArgsConstructor
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES) @ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class StrategySopConfirmController { public class StrategySopConfirmController {
private final SopStrategyRemote sopStrategyRemote; @Autowired
private SopStrategyRemote sopStrategyRemote;
@ApiOperation("策略任务确认") @ApiOperation("策略任务确认")
@ServiceMethod(method = "dj.api.smartcarlife.sop.strategy.confirm") @ServiceMethod(method = "dj.api.smartcarlife.sop.strategy.confirm")
......
...@@ -27,14 +27,15 @@ import io.swagger.annotations.Api; ...@@ -27,14 +27,15 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j @Slf4j
@Api("营销SOP-策略管理") @Api("营销SOP-策略管理")
@RequiredArgsConstructor
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES) @ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class StrategySopController { public class StrategySopController {
private final SopStrategyRemote sopStrategyRemote; @Autowired
private SopStrategyRemote sopStrategyRemote;
@ApiOperation("查询策略列表") @ApiOperation("查询策略列表")
@ServiceMethod(method = "dj.api.smartcarlife.sop.strategy.list") @ServiceMethod(method = "dj.api.smartcarlife.sop.strategy.list")
......
...@@ -14,14 +14,15 @@ import com.rop.annotation.ServiceMethod; ...@@ -14,14 +14,15 @@ import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean; import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j @Slf4j
@Api("营销SOP-策略元数据") @Api("营销SOP-策略元数据")
@RequiredArgsConstructor
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES) @ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class StrategySopMetaController { public class StrategySopMetaController {
private final SopStrategyRemote sopStrategyRemote; @Autowired
private SopStrategyRemote sopStrategyRemote;
@ApiOperation("查询策略元数据") @ApiOperation("查询策略元数据")
@ServiceMethod(method = "dj.api.smartcarlife.sop.strategy.meta") @ServiceMethod(method = "dj.api.smartcarlife.sop.strategy.meta")
......
...@@ -18,14 +18,15 @@ import com.rop.annotation.ServiceMethod; ...@@ -18,14 +18,15 @@ import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean; import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j @Slf4j
@Api("营销SOP-策略执行记录") @Api("营销SOP-策略执行记录")
@RequiredArgsConstructor
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES) @ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class StrategySopRecordController { public class StrategySopRecordController {
private final SopStrategyRemote sopStrategyRemote; @Autowired
private SopStrategyRemote sopStrategyRemote;
@ApiOperation("查询策略执行记录") @ApiOperation("查询策略执行记录")
@ServiceMethod(method = "dj.api.smartcarlife.sop.strategy.records") @ServiceMethod(method = "dj.api.smartcarlife.sop.strategy.records")
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!