API调用次数加上根据userID查
This commit is contained in:
+11
-5
@@ -134,13 +134,22 @@ public class UsersController {
|
||||
return json.toString();
|
||||
}
|
||||
|
||||
public Object surplusCallCountAction() throws IllegalAccessException {
|
||||
public Object surplusCallCountAction(ApiUserModel model) throws IllegalAccessException {
|
||||
RestfulModelAndView mav = new RestfulModelAndView();
|
||||
ActionContext context = ActionContext.getContext();
|
||||
HttpServletRequest request = context.getRequest();
|
||||
AuthenticationBean instance = (AuthenticationBean) request.getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
|
||||
User user = null;
|
||||
if (model.getUserId() != null && model.getUserId() > 0) {
|
||||
user = userService.findById(model.getUserId());
|
||||
}
|
||||
if (null != instance) {
|
||||
User user = instance.user;
|
||||
user = instance.user;
|
||||
}
|
||||
if (null == instance && user == null) {
|
||||
mav.setModel(new BasicModel(HttpStatusCodeEnum.BAD_REQUEST_ERROR_KEY));
|
||||
return mav;
|
||||
}
|
||||
List<OpenResource> openResourceList = openResourceService.findAll();
|
||||
List<ApiMonitorInfo> list = new ArrayList<ApiMonitorInfo>();
|
||||
long id = user.getId();
|
||||
@@ -180,9 +189,6 @@ public class UsersController {
|
||||
BasicModel basicModel = new BasicModel(200, "ok");
|
||||
basicModel.setResult(list);
|
||||
mav.setModel(basicModel);
|
||||
} else {
|
||||
mav.setModel(new BasicModel(HttpStatusCodeEnum.BAD_REQUEST_ERROR_KEY));
|
||||
}
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user