Commit 7405a6a7 by manxiaoqiang

reged

parent cfadd04a
package com.reyun.controller;
import com.reyun.model.Account;
import com.reyun.model.App;
import com.reyun.repository.AccountRepository;
import com.reyun.repository.AppRepository;
import com.reyun.repository.TranslationRepository;
import com.reyun.security.annotation.CurrentAccount;
import com.reyun.util.Constant;
import com.reyun.util.HttpClientUtil;
import com.reyun.util.MailUtils;
import com.reyun.util.StringUtil;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@Controller
@RequestMapping(value = "/logtool/{appid}")
public class LogController {
protected static Logger logger = LoggerFactory.getLogger(LogController.class);
@Autowired
AppRepository apprepository;
@Autowired
AccountRepository accountrepository;
@Autowired
TranslationRepository translationRepository;
@RequestMapping(method = RequestMethod.GET)
@ResponseBody
public List getlogs(HttpServletRequest request, @PathVariable Long appid, @CurrentAccount Account loginAccount) {
App app = apprepository.findOne(appid);
Account parent = accountrepository.findOne(app.getAccount());
Account account = loginAccount;
List result = null;
try {
result = getLogs(app.getAppkey());
} catch (IOException e) {
e.printStackTrace();
}
if(result==null) {
result = new ArrayList();
}
return result;
}
public List getLogs(String appId) throws IOException {
List<JSONObject> obList = new ArrayList<JSONObject>();
String[] hostArray = Constant.receiverHost.split(",");
for (String host : hostArray) {
String url = "http://"+host.trim()+":"+ Constant.receiverPort+"/receive/newlylogs/"+appId;
try {
String httpresult = HttpClientUtil.doHttpGetRequest(url, host);
if (!StringUtil.isEmpty(httpresult)) {
try {
JSONObject httpresultObject = new JSONObject(httpresult);
if (httpresultObject.has("result")) {
JSONArray resultArray = httpresultObject.getJSONArray("result");
for (int i=0; i<resultArray.length(); i++) {
JSONObject ob = resultArray.getJSONObject(i);
obList.add(ob);
}
}
} catch (JSONException e) {
e.printStackTrace();
}
}
} catch (Exception e) {
logger.error("url: {}", url, e);
try {
MailUtils.sendSimpleEmail("日志流服务", "日志流服务暂不可用, url: " + url + ", message:" + e.getMessage(), Constant.mlist);
} catch (Exception e1) {
logger.error("邮件服务不可用 getLogs()");
}
continue;
}
}
Collections.sort(obList, new Comparator<JSONObject>() {
public int compare(JSONObject arg0, JSONObject arg1) {
try {
return (arg1.getString("when")).compareTo((String) arg0.getString("when"));
} catch (JSONException e) {
e.printStackTrace();
}
return 0;
}
});
List<String> resultList = new ArrayList<String>();
/*
if (obList.size() >= 40) {
for (int i=0; i<40; i++) {
resultList.add(obList.get(i).toString());
}
} else {
for (int i=0; i<obList.size(); i++) {
resultList.add(obList.get(i).toString());
}
}*/
for (JSONObject ob : obList) {
resultList.add(ob.toString());
}
return resultList;
}
}
...@@ -95,11 +95,7 @@ public class LoginController ...@@ -95,11 +95,7 @@ public class LoginController
Account rootAccount = accountRepository.findOne(rootParent); Account rootAccount = accountRepository.findOne(rootParent);
if (trackAndIoBothExhaust) { if (trackAndIoBothExhaust) {
if (rootAccount.getAllowBehavior()) { if (rootAccount.getAllowBehavior()) {
rtnMap.put("msg", "广告效果监控流量和行为分析流量均用尽!"); rtnMap.put("msg", "行为分析流量用尽!");
rtnMap.put("code", 211);
return ResultModel.OK(rtnMap);
} else {
rtnMap.put("msg", "广告效果监控流量已经用尽!");
rtnMap.put("code", 211); rtnMap.put("code", 211);
return ResultModel.OK(rtnMap); return ResultModel.OK(rtnMap);
} }
......
...@@ -14,10 +14,8 @@ import java.util.List; ...@@ -14,10 +14,8 @@ import java.util.List;
@Transactional @Transactional
public interface NoticeRepository extends JpaRepository<Notice, Long> { public interface NoticeRepository extends JpaRepository<Notice, Long> {
@Query(value = "select * from (select * from notice n where n.isdeploy is true and n.deploy_date <= ?1 and end_date > ?1 order by deploy_date desc ) as notice_top " + @Query(value = "select * from notice n where n.isdeploy is true and (io_account = ?1 or io_account = -1)", nativeQuery = true)
" union select * from (select * from notice n where n.isdeploy is true and n.deploy_date <= ?1 and end_date is null order by deploy_date desc limit 3) as notice_normal " List<Notice> listRecentDeployNotice(Long account);
, nativeQuery = true)
List<Notice> listRecentDeployNotice(Date currentDate);
} }
...@@ -637,9 +637,7 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic ...@@ -637,9 +637,7 @@ public class AccountFlowRestrictServiceImpl implements AccountFlowRestrictServic
if (!packageType.getSuperLevel() && flowRestrict) { if (!packageType.getSuperLevel() && flowRestrict) {
if (rootAccount.getAllowBehavior()) { if (rootAccount.getAllowBehavior()) {
isBothExhaust = (packageType.getTrackFlow().doubleValue() - clickNum.doubleValue() < 0) && thisMonthRemainingFlow.doubleValue() < 0; isBothExhaust = thisMonthRemainingFlow.doubleValue() < 0;
} else {
isBothExhaust = (packageType.getTrackFlow().doubleValue() - clickNum.doubleValue() < 0);
} }
} }
} }
......
...@@ -29,7 +29,7 @@ public class NoticeServiceImpl implements NoticeService { ...@@ -29,7 +29,7 @@ public class NoticeServiceImpl implements NoticeService {
@Override @Override
public List<Notice> listRecentDeployNotice(Long accountId) { public List<Notice> listRecentDeployNotice(Long accountId) {
List<Notice> recentDeployNoticeList = noticeRepository.listRecentDeployNotice(new Date()); List<Notice> recentDeployNoticeList = noticeRepository.listRecentDeployNotice(accountId);
if (!CollectionUtils.isEmpty(recentDeployNoticeList)) { if (!CollectionUtils.isEmpty(recentDeployNoticeList)) {
......
...@@ -22,7 +22,7 @@ public class RegedServiceImpl implements RegedService { ...@@ -22,7 +22,7 @@ public class RegedServiceImpl implements RegedService {
@Autowired @Autowired
AccountRepository accountRepository; AccountRepository accountRepository;
private static final String VERIFY_EMAIL_SEND_URL = Constant.adminUrl + "/api/tool/account/sendemail/"; private static final String VERIFY_EMAIL_SEND_URL = Constant.adminUrl + "/api/tool/ioaccount/sendemail/";
@Override @Override
public Boolean sendActiceEmail(String url, Long id) { public Boolean sendActiceEmail(String url, Long id) {
......
...@@ -51,6 +51,8 @@ public class Constant { ...@@ -51,6 +51,8 @@ public class Constant {
public static String mailPassword = mailBundle.getString("mail.password"); public static String mailPassword = mailBundle.getString("mail.password");
public static String mailContentType = mailBundle.getString("mail.content_type"); public static String mailContentType = mailBundle.getString("mail.content_type");
public static String mailValidTime = mailBundle.getString("mail.valid_time"); public static String mailValidTime = mailBundle.getString("mail.valid_time");
public static String mailList = mailBundle.getString("mail.list");
public static List<String> mlist = Arrays.asList(mailList.split(","));
public static ResourceBundle redis = ResourceBundle.getBundle("redis"); public static ResourceBundle redis = ResourceBundle.getBundle("redis");
......
...@@ -3,3 +3,4 @@ mail.username=${mail.username} ...@@ -3,3 +3,4 @@ mail.username=${mail.username}
mail.password=${mail.password} mail.password=${mail.password}
mail.content_type=${mail.content_type} mail.content_type=${mail.content_type}
mail.valid_time=${mail.valid_time} mail.valid_time=${mail.valid_time}
mail.list=${mail.list}
\ No newline at end of file
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/login.css?r=0.3226349928881973"> <link rel="stylesheet" href="styles/login.css?r=0.11499847006052732">
<script src="scripts/change.js?r=0.7112433344591409"></script> <script src="scripts/change.js?r=0.5983042535372078"></script>
<script src="scripts/regcom1.js?r=0.8485788230318576"></script> <script src="scripts/regcom1.js?r=0.30919134919531643"></script>
<script src="scripts/regui.js?r=0.6336440013255924"></script> <script src="scripts/regui.js?r=0.5395845742896199"></script>
</head> </head>
<body ng-app="app" ng-controller="acvitationCtrl"> <body ng-app="app" ng-controller="acvitationCtrl">
......
...@@ -7,8 +7,8 @@ ...@@ -7,8 +7,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<script src="scripts/change.js?r=0.8273717106785625"></script> <script src="scripts/change.js?r=0.3096894088666886"></script>
<script src="scripts/demo.js?r=0.6742043008562177"></script> <script src="scripts/demo.js?r=0.49110986455343664"></script>
<script type="text/javascript"> <script type="text/javascript">
$.get("/api/demo",function(data) { $.get("/api/demo",function(data) {
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/login.css?r=0.004987573949620128"> <link rel="stylesheet" href="styles/login.css?r=0.7820607058238238">
<script src="scripts/change.js?r=0.7360319485887885"></script> <script src="scripts/change.js?r=0.4579346068203449"></script>
<script src="scripts/regcom2.js?r=0.9184650341048837"></script> <script src="scripts/regcom2.js?r=0.053647717693820596"></script>
<script src="scripts/failure.js?r=0.9326669548172504"></script> <script src="scripts/failure.js?r=0.9843989037908614"></script>
</head> </head>
<body ng-app="app" ng-controller="failureCtrl"> <body ng-app="app" ng-controller="failureCtrl">
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/login.css?r=0.8714517550542951"> <link rel="stylesheet" href="styles/login.css?r=0.16757301287725568">
<script src="scripts/change.js?r=0.722045328002423"></script> <script src="scripts/change.js?r=0.8997952970676124"></script>
<script src="scripts/regcom3.js?r=0.9209529019426554"></script> <script src="scripts/regcom3.js?r=0.05138346133753657"></script>
<script src="scripts/forget.js?r=0.02848458243533969"></script> <script src="scripts/forget.js?r=0.5629009127151221"></script>
</head> </head>
<body ng-app="app" ng-controller="forgetCtrl"> <body ng-app="app" ng-controller="forgetCtrl">
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/home.css?r=0.12386019225232303"> <link rel="stylesheet" href="styles/home.css?r=0.4897955828346312">
<script src="scripts/change.js?r=0.012064240872859955"></script> <script src="scripts/change.js?r=0.3161861866246909"></script>
<script src="scripts/home.js?r=0.8174812090583146"></script> <script src="scripts/home.js?r=0.41972410725429654"></script>
<script src="scripts/homectrl.js?r=0.19571213447488844"></script> <script src="scripts/homectrl.js?r=0.3761741151101887"></script>
<script> <script>
var _hmt = _hmt || []; var _hmt = _hmt || [];
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/index.css?r=0.37707017827779055"> <link rel="stylesheet" href="styles/index.css?r=0.1538209819700569">
<script src="scripts/change.js?r=0.820802059955895"></script> <script src="scripts/change.js?r=0.7190487270709127"></script>
<script src="scripts/com.js?r=0.2901791038457304"></script> <script src="scripts/com.js?r=0.1410635078791529"></script>
<script src="scripts/app.js?r=0.8841697168536484"></script> <script src="scripts/app.js?r=0.5087753545958549"></script>
<script src="scripts/ui.js?r=0.6637934029567987"></script> <script src="scripts/ui.js?r=0.08424989180639386"></script>
</head> </head>
<body ng-app="app" ng-controller="indexCtrl" ng-class="{'noreport':backReport}"> <body ng-app="app" ng-controller="indexCtrl" ng-class="{'noreport':backReport}">
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/login.css?r=0.09618336986750364"> <link rel="stylesheet" href="styles/login.css?r=0.9707226229365915">
<script src="scripts/change.js?r=0.05420921300537884"></script> <script src="scripts/change.js?r=0.7923258431255817"></script>
<script src="scripts/lgcom4.js?r=0.7121068546548486"></script> <script src="scripts/lgcom4.js?r=0.473345436854288"></script>
<script src="scripts/lgui.js?r=0.24842062732204795"></script> <script src="scripts/lgui.js?r=0.5988887476269156"></script>
<script> <script>
var _hmt = _hmt || []; var _hmt = _hmt || [];
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/login.css?r=0.31149819074198604"> <link rel="stylesheet" href="styles/login.css?r=0.6317339739762247">
<script src="scripts/change.js?r=0.8929546170402318"></script> <script src="scripts/change.js?r=0.7653584356885403"></script>
<script src="scripts/regcom5.js?r=0.5510864944662899"></script> <script src="scripts/regcom5.js?r=0.6032860425766557"></script>
<script src="scripts/olduser.js?r=0.7056754943914711"></script> <script src="scripts/olduser.js?r=0.24770011520013213"></script>
</head> </head>
<body ng-app="app" ng-controller="olduserCtrl"> <body ng-app="app" ng-controller="olduserCtrl">
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/login.css?r=0.5230596014298499"> <link rel="stylesheet" href="styles/login.css?r=0.7661028518341482">
<script src="scripts/change.js?r=0.7893789829686284"></script> <script src="scripts/change.js?r=0.2717249090783298"></script>
<script src="scripts/regcom7.js?r=0.5114126577973366"></script> <script src="scripts/regcom7.js?r=0.21323158033192158"></script>
<script src="scripts/resetpwd.js?r=0.8044941681437194"></script> <script src="scripts/resetpwd.js?r=0.5238363628741354"></script>
</head> </head>
<body ng-app="app" ng-controller="resetpwdCtrl"> <body ng-app="app" ng-controller="resetpwdCtrl">
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport"> <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0" name="viewport">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="styles/login.css?r=0.055841729044914246"> <link rel="stylesheet" href="styles/login.css?r=0.8155621050391346">
<script src="scripts/change.js?r=0.5346511888783425"></script> <script src="scripts/change.js?r=0.48537470446899533"></script>
<script src="scripts/regcom8.js?r=0.2486923444084823"></script> <script src="scripts/regcom8.js?r=0.015657729003578424"></script>
<script src="scripts/success.js?r=0.444347481476143"></script> <script src="scripts/success.js?r=0.23272478976286948"></script>
</head> </head>
<body ng-app="app" ng-controller="successCtrl"> <body ng-app="app" ng-controller="successCtrl">
......
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