use autowired to fetch freshserviceimpl instance

This commit is contained in:
2021-08-18 18:06:56 +08:00
parent 2546987df5
commit 9e03b00796
2 changed files with 7 additions and 7 deletions

View File

@@ -60,6 +60,7 @@ public class freshController {
} }
ServletUtil.createSuccessResponse(200, result, response); ServletUtil.createSuccessResponse(200, result, response);
} }
@RequestMapping(value = "/updating", method = RequestMethod.POST) @RequestMapping(value = "/updating", method = RequestMethod.POST)
public void updating(HttpServletRequest request, HttpServletResponse response) throws Exception { public void updating(HttpServletRequest request, HttpServletResponse response) throws Exception {
String oldVersionId = request.getParameter("oldVersionId"); String oldVersionId = request.getParameter("oldVersionId");

View File

@@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
@Service @Service
public class refreshServiceImpl implements refreshService { public class refreshServiceImpl implements refreshService {
@Autowired
freshServiceImpl ser = new freshServiceImpl(); freshServiceImpl ser = new freshServiceImpl();
//version1大返回一个正数小返回一个负数相等返回0 //version1大返回一个正数小返回一个负数相等返回0
@@ -35,7 +35,6 @@ public class refreshServiceImpl implements refreshService {
@Override @Override
public fresh new_version(String oldVersion) throws Exception { public fresh new_version(String oldVersion) throws Exception {
freshServiceImpl ser=new freshServiceImpl();
String newVersion = ser.query().VersionId; String newVersion = ser.query().VersionId;
if (compareVersion(oldVersion, newVersion) < 0) { if (compareVersion(oldVersion, newVersion) < 0) {
return ser.query(); return ser.query();