Commit a36a69e4 authored by 赵然's avatar 赵然

zr

parent dbe42fbb
......@@ -3,6 +3,7 @@
<component name="Encoding" native2AsciiForPropertiesFiles="true" defaultCharsetForPropertiesFiles="UTF-8">
<file url="file://$PROJECT_DIR$" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/com/atguigu/springmvc/entities/AwardVO.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/main/com/atguigu/springmvc/handlers/AccountModule.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/main/com/atguigu/springmvc/handlers/ActivityModule.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/main/com/atguigu/springmvc/handlers/AutoModule.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/main/com/atguigu/springmvc/handlers/CoderModule.java" charset="GBK" />
......@@ -13,6 +14,7 @@
<file url="file://$PROJECT_DIR$/src/main/com/atguigu/springmvc/handlers/RedModule.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/main/com/atguigu/springmvc/handlers/SignModule.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/main/com/atguigu/springmvc/handlers/SpringMVCTest.java" charset="GBK" />
<file url="file://$PROJECT_DIR$/src/main/com/atguigu/springmvc/handlers/UserModule.java" charset="GBK" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>
\ No newline at end of file
This diff is collapsed.
......@@ -362,6 +362,7 @@
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
......@@ -183,6 +183,7 @@ $(document).ready(function(){
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
......@@ -232,6 +232,7 @@ $(document).ready(function(){
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
......@@ -211,6 +211,7 @@ function check2(obj){
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
Manifest-Version: 1.0
Class-Path:
Built-By: Administrator
Created-By: IntelliJ IDEA
Build-Jdk: 1.8.0_151
This diff is collapsed.
......@@ -261,6 +261,7 @@
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
......@@ -291,6 +291,7 @@
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
......@@ -204,6 +204,7 @@ $(document).ready(function(){
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="#">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
......@@ -291,6 +291,7 @@
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
......@@ -308,6 +308,7 @@
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
......@@ -291,6 +291,7 @@
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
......@@ -224,6 +224,7 @@ $(document).ready(function(){
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
......@@ -260,6 +260,7 @@
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li class="active">
......
......@@ -258,6 +258,7 @@
<a href="#" class="mws-i-24 i-iphone-4">积分商城助手</a>
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
</ul>
</li>
<li>
......
This diff is collapsed.
package main.com.atguigu.springmvc.handlers;
import io.restassured.response.Response;
import main.com.atguigu.springmvc.common.MatcherString;
import main.com.atguigu.springmvc.service.AccountService;
import main.com.atguigu.springmvc.service.Authorization;
import main.com.atguigu.springmvc.service.NewActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.util.Base64;
import java.util.HashMap;
import java.util.Map;
@Controller
public class AccountModule {
@Autowired
AccountService accountService;
@Autowired
Authorization authorization;
final Base64.Decoder decoder = Base64.getDecoder();
/**
* 功能:设置红包余额
* @return
*/
@RequestMapping(value = "/setAccount", method= RequestMethod.POST)
@ResponseBody
public Map setAccount(HttpServletRequest request) throws Exception {
System.out.println("日志:访问统计");
String partnerId = request.getParameter("userId");
String accountType = request.getParameter("accountType");
String balanceAmount = request.getParameter("balanceAmount");
System.out.println("partnerId为:" + partnerId);
System.out.println("accountType为:" + accountType);
System.out.println("balanceAmount为:" + balanceAmount);
Map<String, String> map = new HashMap<>();
Map<String,String> login_map = authorization.dafuwengLogin(Integer.parseInt(partnerId));
System.out.println("用户login_map为:" + login_map.toString());
String consumer_base64 = String.valueOf(login_map.get("_ac"));
System.out.println("用户consumer_base64为:" + consumer_base64);
String decodedText = new String(decoder.decode(consumer_base64));
System.out.println("助力者consumer_base64转码后为:" + decodedText);
String consumer_id = MatcherString.getString(decodedText, "cid\":(.*?)}", 1);
System.out.println("用户consumer_id为:" + consumer_id);
Response response = accountService.updateConsumerAccount(Integer.parseInt(partnerId), consumer_id, accountType,balanceAmount);
if(response.jsonPath().getString("success").equals("true")){
String result = "账户余额设置成功!\n当前账户余额为:" + response.jsonPath().getString("data.balanceAmount") + "分\n账户变动额度为:" + response.jsonPath().getString("data.changeMoney")+"分";
map.put("message", result);
}else{
String result = "账户余额设置失败!\n"+response.asString();
map.put("message", result);
}
return map;
}
}
package main.com.atguigu.springmvc.service;
import io.restassured.response.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.testng.Assert;
import java.util.HashMap;
import java.util.Map;
import static io.restassured.RestAssured.given;
@Service
public class AccountService {
private String url = "http://activity.m.duibatest.com.cn";
private String url2 = "http://home.m.duibatest.com.cn";
@Autowired
Authorization authorization;
public Response updateConsumerAccount(int uid,String consumerId,String accountType,String balanceAmount) throws Exception{
Map<String, String> map = new HashMap<>();
map.put("consumerId",consumerId);
map.put("accountType",accountType);
map.put("balanceAmount",balanceAmount);
Response response = given().cookies(authorization.dafuwengLogin(uid)).params(map).get(url+"/aaw/automated/updateConsumerAccount");
try{
Assert.assertEquals(response.jsonPath().getString("success"),"true");
}catch(Exception e){
throw new Exception("/aaw/automated/updateConsumerAccount接口失败,返回信息:"+response.asString());
}catch(Error er){
throw new Exception("/aaw/automated/updateConsumerAccount接口失败,返回信息:"+response.asString());
}
return response;
}
// public static void main(String[] args) {
// NewtoolsService service = new NewtoolsService();
// Response response = service.index("17236");
// NewActivityService services = new NewActivityService();
// services.doJoin(response.getDetailedCookies(),"");
// }
}
......@@ -363,6 +363,7 @@
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -184,6 +184,7 @@ $(document).ready(function(){
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -233,6 +233,7 @@ $(document).ready(function(){
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -212,6 +212,7 @@ function check2(obj){
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
This diff is collapsed.
......@@ -262,6 +262,7 @@
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -292,6 +292,7 @@
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -205,6 +205,7 @@ $(document).ready(function(){
<ul>
<li><a href="#">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -292,6 +292,7 @@
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -309,6 +309,7 @@
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -292,6 +292,7 @@
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -225,6 +225,7 @@ $(document).ready(function(){
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -261,6 +261,7 @@
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li class="active">
......
......@@ -259,6 +259,7 @@
<ul>
<li><a href="creatUrl.html">生成免登链接</a></li>
<li><a href="userInfo.html">用户基础信息</a></li>
<li><a href="account.html">钱包账户设置</a></li>
</ul>
</li>
<li>
......
......@@ -66,18 +66,23 @@
$(document).ready(function(){
$("#searchInfo").click(function(e){
$("#result").val("获取执行结果,请等待~");
e.preventDefault();
var userId = $("#user_id2_v").val();
$.post("searchInfo", {"userId":userId},function(data, status){
$("#result").val(data.message);
});
if (userId==null || userId==""){
alert("原始文本不可为空");
return false;
}else {
$("#result").val("获取执行结果,请等待~");
e.preventDefault();
$.post("searchInfo", {"userId": userId}, function (data, status) {
$("#result").val(data.message);
});
}
});
});
</script>
<title>MWS Admin - Charts</title>
......@@ -209,7 +214,7 @@ $(document).ready(function(){
<span class="mws-i-24 i-upload">用户基本信息查询</span>
</div>
<div class="mws-panel-body">
<form class="mws-form" >
<form class="mws-form">
<div class="mws-form-inline">
<div class="mws-form-row" id="user_id2">
......@@ -220,13 +225,13 @@ $(document).ready(function(){
</div>
<div class="mws-form-row">
<label>处理结果</label>
<label>查询结果</label>
<div class="mws-form-item large">
<textarea class="warning" rows="100%" cols="100%" readonly="readonly" id="result" style="background-color:#ccc"></textarea>
</div>
</div>
<div class="mws-button-row">
<input type="submit" value="立即执行" class="mws-button blue" id="searchInfo"/>
<input type="submit" value="立即查询" class="mws-button blue" id="searchInfo"/>
</div>
</div>
</form>
......
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