Skip to content

Commit

Permalink
update: 优化bean注入 (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
Control-body authored Mar 16, 2024
1 parent ae1721b commit d312c43
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.oddfar.campus.business.service.IShopService;
import com.oddfar.campus.common.annotation.ApiResource;
import com.oddfar.campus.common.domain.R;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -22,12 +23,11 @@
@RestController
@RequestMapping("/imt/item")
@ApiResource(name = "I茅台预约商品列Controller")
@RequiredArgsConstructor
public class IItemController {

@Autowired
private IItemMapper iItemMapper;
@Autowired
private IShopService iShopService;
private final IItemMapper iItemMapper;
private final IShopService iShopService;

/**
* 查询I茅台预约商品列列表
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.oddfar.campus.common.annotation.ApiResource;
import com.oddfar.campus.common.domain.PageResult;
import com.oddfar.campus.common.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

Expand All @@ -18,9 +18,9 @@
@RestController
@RequestMapping("/imt/log")
@ApiResource(name = "I茅台日志Controller")
@RequiredArgsConstructor
public class ILogController {
@Autowired
private IMTLogService logService;
private final IMTLogService logService;

@PreAuthorize("@ss.resourceAuth()")
@GetMapping(value = "/list", name = "操作日志-分页")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.oddfar.campus.common.annotation.ApiResource;
import com.oddfar.campus.common.domain.PageResult;
import com.oddfar.campus.common.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
Expand All @@ -22,11 +22,10 @@
@RestController
@RequestMapping("/imt/shop")
@ApiResource(name = "i茅台商品Controller")
@RequiredArgsConstructor
public class IShopController {
@Autowired
private IShopService iShopService;
@Autowired
private IShopMapper iShopMapper;
private final IShopService iShopService;
private final IShopMapper iShopMapper;

/**
* 查询i茅台商品列表
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.oddfar.campus.common.domain.R;
import com.oddfar.campus.common.exception.ServiceException;
import com.oddfar.campus.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

Expand All @@ -24,15 +24,13 @@
@RestController
@RequestMapping("/imt/user")
@ApiResource(name = "I茅台用户Controller")
@RequiredArgsConstructor
public class IUserController {
@Autowired
private IUserService iUserService;
@Autowired
private IUserMapper iUserMapper;
@Autowired
private IMTService imtService;
@Autowired
private IShopService iShopService;

private final IUserService iUserService;
private final IUserMapper iUserMapper;
private final IMTService imtService;
private final IShopService iShopService;

/**
* 查询I茅台用户列表
Expand Down

0 comments on commit d312c43

Please sign in to comment.