Commit 7ef7a979 authored by 33's avatar 33

优化注入

parent 6c97ece9
...@@ -28,12 +28,10 @@ import com.fzm.common.utils.CopyrightSignUtil; ...@@ -28,12 +28,10 @@ import com.fzm.common.utils.CopyrightSignUtil;
import com.fzm.common.utils.ObsUtil; import com.fzm.common.utils.ObsUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.redisson.Redisson; import org.redisson.Redisson;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException; import org.springframework.dao.DuplicateKeyException;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -56,24 +54,37 @@ import java.util.concurrent.TimeUnit; ...@@ -56,24 +54,37 @@ import java.util.concurrent.TimeUnit;
@Slf4j @Slf4j
@Service @Service
@Transactional(rollbackFor = RuntimeException.class) @Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper, CopyrightApply> implements CopyrightApplyService { public class CopyrightApplyServiceImpl extends ServiceImpl<CopyrightApplyMapper, CopyrightApply> implements CopyrightApplyService {
private final CopyrightApplyMapper copyrightApplyMapper; @Resource
private final CopyrightFileService copyrightFileService; private CopyrightApplyMapper copyrightApplyMapper;
private final CopyrightApplyOwnerRelationService copyrightApplyOwnerRelationService; @Resource
private final CopyrightAuthorService copyrightAuthorService; private CopyrightFileService copyrightFileService;
private final CopyrightAuthorityRelationService copyrightAuthorityRelationService; @Resource
private final AuthorityService authorityService; private CopyrightApplyOwnerRelationService copyrightApplyOwnerRelationService;
private final CopyrightOwnerService copyrightOwnerService; @Resource
private final UserService userService; private CopyrightAuthorService copyrightAuthorService;
private final AuthPersonService authPersonService; @Resource
private final ObsUtil obsUtil; private CopyrightAuthorityRelationService copyrightAuthorityRelationService;
private final ThreadPoolTaskExecutor threadPoolTaskExecutor; @Resource
private final OpusCategoryService opusCategoryService; private AuthorityService authorityService;
private final CopyrightProperties copyrightProperties; @Resource
private final DraftService draftService; private CopyrightOwnerService copyrightOwnerService;
private final NotifyPublisher notifyPublisher; @Resource
private UserService userService;
@Resource
private AuthPersonService authPersonService;
@Resource
private ObsUtil obsUtil;
@Resource
private ThreadPoolTaskExecutor threadPoolTaskExecutor;
@Resource
private OpusCategoryService opusCategoryService;
@Resource
private CopyrightProperties copyrightProperties;
@Resource
private DraftService draftService;
@Resource
private NotifyPublisher notifyPublisher;
@Resource @Resource
private NftService nftService; private NftService nftService;
@Resource @Resource
......
...@@ -34,11 +34,9 @@ import com.fzm.common.utils.RedisUtil; ...@@ -34,11 +34,9 @@ import com.fzm.common.utils.RedisUtil;
import com.fzm.common.utils.SmsUtil; import com.fzm.common.utils.SmsUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.dao.DuplicateKeyException; import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -56,21 +54,31 @@ import java.util.stream.Collectors; ...@@ -56,21 +54,31 @@ import java.util.stream.Collectors;
*/ */
@Slf4j @Slf4j
@Service @Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftService { public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftService {
private final ParaChainClient paraChainClient; @Resource
private final RedisUtil redisUtil; private ParaChainClient paraChainClient;
private final UserService userService; @Resource
private final NftMapper nftMapper; private RedisUtil redisUtil;
private final CategoryService categoryService; @Resource
private final CollectionService collectionService; private UserService userService;
private final NftTransferRecordService nftTransferRecordService; @Resource
private final SmsUtil smsUtil; private NftMapper nftMapper;
private final SmsProperties smsProperties; @Resource
private final RabbitTemplate rabbitTemplate; private CategoryService categoryService;
private final ObsUtil obsUtil; @Resource
private final NotifyPublisher notifyPublisher; private CollectionService collectionService;
@Resource
private NftTransferRecordService nftTransferRecordService;
@Resource
private SmsUtil smsUtil;
@Resource
private SmsProperties smsProperties;
@Resource
private RabbitTemplate rabbitTemplate;
@Resource
private ObsUtil obsUtil;
@Resource
private NotifyPublisher notifyPublisher;
@Resource @Resource
private CopyrightApplyService copyrightApplyService; private CopyrightApplyService copyrightApplyService;
......
...@@ -16,9 +16,7 @@ import com.fzm.common.interceptor.LoginUserInfo; ...@@ -16,9 +16,7 @@ import com.fzm.common.interceptor.LoginUserInfo;
import com.fzm.common.mapper.OrderMapper; import com.fzm.common.mapper.OrderMapper;
import com.fzm.common.service.*; import com.fzm.common.service.*;
import com.fzm.common.utils.SnowflakeUtil; import com.fzm.common.utils.SnowflakeUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -35,15 +33,19 @@ import java.util.List; ...@@ -35,15 +33,19 @@ import java.util.List;
*/ */
@Service @Service
@Transactional(rollbackFor = RuntimeException.class) @Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService { public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements OrderService {
private final NftService nftService; @Resource
private final CopyrightApplyService copyrightApplyService; private NftService nftService;
private final SnowflakeUtil snowflakeUtil; @Resource
private final RabbitTemplate rabbitTemplate; private CopyrightApplyService copyrightApplyService;
private final OrderMapper orderMapper; @Resource
private final ChargeService chargeService; private SnowflakeUtil snowflakeUtil;
@Resource
private RabbitTemplate rabbitTemplate;
@Resource
private OrderMapper orderMapper;
@Resource
private ChargeService chargeService;
@Resource @Resource
private WxPayService wxPayService; private WxPayService wxPayService;
......
...@@ -17,7 +17,6 @@ import com.fzm.common.properties.WxPayProperties; ...@@ -17,7 +17,6 @@ import com.fzm.common.properties.WxPayProperties;
import com.fzm.common.service.*; import com.fzm.common.service.*;
import com.fzm.common.utils.SnowflakeUtil; import com.fzm.common.utils.SnowflakeUtil;
import com.wechat.pay.contrib.apache.httpclient.util.AesUtil; import com.wechat.pay.contrib.apache.httpclient.util.AesUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.CloseableHttpResponse;
...@@ -29,7 +28,6 @@ import org.apache.http.util.EntityUtils; ...@@ -29,7 +28,6 @@ import org.apache.http.util.EntityUtils;
import org.redisson.Redisson; import org.redisson.Redisson;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Base64Utils; import org.springframework.util.Base64Utils;
...@@ -55,17 +53,23 @@ import java.util.concurrent.TimeUnit; ...@@ -55,17 +53,23 @@ import java.util.concurrent.TimeUnit;
@Slf4j @Slf4j
@Service @Service
@Transactional(rollbackFor = RuntimeException.class) @Transactional(rollbackFor = RuntimeException.class)
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class WxPayServiceImpl implements WxPayService { public class WxPayServiceImpl implements WxPayService {
private final CloseableHttpClient httpClient; @Resource
private final WxPayProperties wxPayProperties; private CloseableHttpClient httpClient;
private final PrivateKey wxPrivateKey; @Resource
private final OrderService orderService; private WxPayProperties wxPayProperties;
private final PaymentService paymentService; @Resource
private final RabbitTemplate rabbitTemplate; private PrivateKey wxPrivateKey;
private final SnowflakeUtil snowflakeUtil; @Resource
private final SmsService smsService; private OrderService orderService;
@Resource
private PaymentService paymentService;
@Resource
private RabbitTemplate rabbitTemplate;
@Resource
private SnowflakeUtil snowflakeUtil;
@Resource
private SmsService smsService;
@Resource @Resource
private Redisson redisson; private Redisson redisson;
@Resource @Resource
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment