Commit db44930a by Li Yongyu

程序修改导致的历史接口问题和新增新接口

parent 78235e3e
......@@ -6,7 +6,7 @@
<classes>
<class name="com.puhui.test.RenMai_APITest">
<methods>
<include name="f" invocation-numbers="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 "/>
<include name="f" invocation-numbers="-3 -2 -1 0 1 2 3 4 5 "/>
</methods>
</class>
</classes>
......
......@@ -210,7 +210,7 @@ public class MapUtil {
StringBuffer sb=new StringBuffer();
for(int k=0;k<comma;k++){
//此时是多个,,,
String[] str=strcomma[k].split(":");
String[] str=strcomma[k].split("\":\"");
String str_strcomma=Arrays.toString(str);
// System.out.println("str="+Arrays.toString(str));
//按参数传过来的字符串做为子串,在以逗号为节点的串中分别查找子串的关键字,
......
......@@ -139,7 +139,7 @@ public class ReadProperties {
Properties pps = new Properties();
try {
File directory = new File(".");
String sourceFile = directory.getCanonicalPath() +File.separator+"src"+File.separator+"resources"+File.separator+qudao+"_reflect.properties";
String sourceFile = directory.getCanonicalPath() +File.separator+"src"+File.separator+"resources"+File.separator+qudao+"reflect.properties";
InputStream in = new BufferedInputStream (new FileInputStream(sourceFile));
pps.load(in);
String value = pps.getProperty(key);
......
......@@ -87,8 +87,9 @@ public class Reflect_api {
// return classRoute+ classReflectName;
// }
// }
if("xyzb".equals(system)){
String classReflectName = ReadProperties.GetPropertyByClassName(serviceUrl,system);
if("nwn".equals(system)){
String classReflectName = ReadProperties.GetPropertyByClassName(serviceUrl);
if ( classReflectName!=null ) {
return classRoute+ classReflectName;
}
......
......@@ -39,7 +39,7 @@ public class createPackage extends NWN implements API {
public String for_year;//年
public String product;//平台:1 题库 2 星课堂 3 在线课堂 4 优课',
public String intro;//介绍
public String img_url;//图片地址
public String cover;//图片地址
@Override
public void initialize(HashMap<String, Object> data) {
......@@ -58,7 +58,7 @@ public class createPackage extends NWN implements API {
for_year = MapUtil.getParameter(parameter, "for_year").trim();
product = MapUtil.getParameter(parameter, "product").trim();
intro = MapUtil.getParameter(parameter, "intro").trim();
img_url = MapUtil.getParameter(parameter, "img_url").trim();
cover = MapUtil.getParameter(parameter, "cover").trim();
data.put("parameter", parameter);
return data;
......@@ -128,13 +128,12 @@ public class createPackage extends NWN implements API {
for_year = MapUtil.getParameter(parameter, "for_year").trim();
product = MapUtil.getParameter(parameter, "product").trim();
intro = MapUtil.getParameter(parameter, "intro").trim();
img_url = MapUtil.getParameter(parameter, "img_url").trim();
cover = MapUtil.getParameter(parameter, "cover").trim();
pack_name = MapUtil.killQuotes(pack_name, "\"");
for_year = MapUtil.killQuotes(for_year, "\"");
product = MapUtil.killQuotes(product, "\"");
intro = MapUtil.killQuotes(intro, "\"");
img_url = MapUtil.killQuotes(img_url, "\"");
cover = MapUtil.killQuotes(cover, "\"");
try {
......@@ -156,7 +155,16 @@ public class createPackage extends NWN implements API {
String act_id=rs_bankcard.getString("id").equals("null ")?"null":rs_bankcard.getString("id");
n_package_idList.add(act_id);//
System.out.println("pack_name==" + pack_name);
System.out.println("act_pack_name==" + act_pack_name);
System.out.println("for_year==" + for_year);
System.out.println("act_for_year==" + act_for_year);
System.out.println("product==" + product);
System.out.println("act_product==" + act_product);
System.out.println("intro==" + intro);
System.out.println("act_intro==" + act_intro);
System.out.println("cover==" + cover);
System.out.println("act_cover==" + act_cover);
if(!(pack_name.equals(act_pack_name))){
result = result && false;
failReason = failReason + "t_exam_area info pack_name is not in DB;";
......@@ -173,11 +181,11 @@ public class createPackage extends NWN implements API {
result = result && false;
failReason = failReason + "t_exam_area info intro is not in DB;";
}
if(!(img_url.equals(act_cover))){
if(!(cover.equals(act_cover))){
result = result && false;
failReason = failReason + "t_exam_area info img_url is not in DB;";
failReason = failReason + "t_exam_area info intro is not in DB;";
}
}
} catch (Exception e) {
......
......@@ -45,6 +45,8 @@ public abstract class BasicsGM {
//
public static Connection conn = null;
public static Statement stmt = null;
public static Connection conn1 = null;
public static Statement stmt1 = null;
//
public static Map<String,Object> map=new XMLread().getSystem();// 读取XML配置文件
//
......@@ -85,7 +87,12 @@ public abstract class BasicsGM {
return rs;
}
//查询表名tableName的条件是condition的结果集
public ResultSet sqlFromDB_template(String sql) throws Exception {
ResultSet rs = stmt1.executeQuery(sql);
return rs;
}
//查询表名tableName的条件是condition的结果集,返回数量
public ResultSet selectCountFromDB(String tableName, String condition) throws Exception {
String sql;
......
......@@ -42,10 +42,10 @@ public class NWN extends BasicsGM{
public static List<String> n_admin_username_List = new ArrayList<String>();//n_admin的username
public static List<String> getcode_id_List = new ArrayList<String>();//getcode的id
public static List<String> n_getcode_id_List = new ArrayList<String>();//getcode的id
public static List<String> movie_id_list = new ArrayList<String>();//movid_id的id
public static String level_id_List = "";//层级的id
public static List<String> user_id_List = new ArrayList<String>();//user_id
public static String template_id = "";
// public static String phone_code = "";//手机号验证码
//
//
......@@ -70,6 +70,17 @@ public class NWN extends BasicsGM{
} catch (Exception e) {
e.printStackTrace();
}
try {
Class.forName("com.mysql.jdbc.Driver");
conn1 = DriverManager.getConnection(((system)map.get("nwn_template")).getSqlurl(),
((system)map.get("nwn_template")).getSqlname(),
((system)map.get("nwn_template")).getSqlpwd());
stmt1 = conn1.createStatement();
} catch (Exception e) {
e.printStackTrace();
}
}
if(mysql_local_Online.equals("Online")){
//线上数据库连接
......@@ -190,6 +201,14 @@ public class NWN extends BasicsGM{
// System.out.println(user_idList.toString());
}
public String getCurrentYear(){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
Date date = new Date();
return sdf.format(date);
}
//
//
// //清除用户地区操作表t_exam_area
......
......@@ -100,23 +100,23 @@ public class APITest_nwn extends NWN{
//数据回写
//// HashMap<String, Object> ExpectResult=MapUtil.Expect(data);
// SheetUtils sheet = new SheetUtils("DataAll.xls", "Output");
// sheet.writeExcel(
// data.get("NO").toString(),
// data.get("TCNO").toString() + "_Step" + data.get("Step").toString(),
// data.get("Description").toString(),
// parameter,
//// JSONObject.fromObject(ExpectResult).toString(),
// re.getStatusCode()+"",
//// StringUtils.decodeUnicode(re==null?"":re.asString()),
// StringUtils.decodeUnicode(body),
// codeORerrcode,
// msgORerrmsy,
// result,
// time
// );
// HashMap<String, Object> ExpectResult=MapUtil.Expect(data);
/* SheetUtils sheet = new SheetUtils("DataAll.xls", "Output");
sheet.writeExcel(
data.get("NO").toString(),
data.get("TCNO").toString() + "_Step" + data.get("Step").toString(),
data.get("Description").toString(),
parameter,
// JSONObject.fromObject(ExpectResult).toString(),
re.getStatusCode()+"",
// StringUtils.decodeUnicode(re==null?"":re.asString()),
StringUtils.decodeUnicode(body),
codeORerrcode,
msgORerrmsy,
result,
time
);
*/
if(result.indexOf("Fail")!=-1){
String Expect1=data.get("code")==null?"":data.get("code").toString();
String Expect2=data.get("msg")==null?"":data.get("msg").toString();
......@@ -148,6 +148,16 @@ public class APITest_nwn extends NWN{
} catch (SQLException e) {
e.printStackTrace();
}
try {
if(stmt1!=null){
stmt1.close();
}
if (conn1 != null){
conn1.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
Log.logInfo("========测试结束========");
......
......@@ -2,4 +2,6 @@ xyzb=com.offcn.api.xyzb.
tk=com.offcn.api.tk.
nwn=com.offcn.api.nwn.
nwnht=com.offcn.api.nwn.
nwngg=com.offcn.api.nwn.
\ No newline at end of file
nwngg=com.offcn.api.nwn.
tkapp=com.offcn.api.tk.app
tkht=com.offcn.api.tk.ht
\ No newline at end of file
/user/register=register
/userInfo/bank/save=bank_save
/userInfo/bank/update=bank_update
/userInfo/bank/change=bank_change
/userInfo/personal/update=companyinfo
/userInfo/practitioner/update=WorkerAndStudent
/userInfo/contacts/save=contactsinfo_save
/userInfo/contacts=userInfoContacts
/v1/customer/photo/upload=photo_upload
/photo/list/=list
/v1/third/getMoxieH5Url=getMoxieH5Url_app
/v1/customer/identification=identification
/v1/customer/modifyWorkerInfo=modifyWorkerInfo
/v1/customer/modifyStudentInfo=modifyStudentInfo
/v1/customer/canModify=canModify
/v1/customer/isIdentified=isIdentified
/v1/customer/queryInfo=queryInfo
/v1/customer/schoolOptions=schoolOptions
/user/resetPwd=resetPwd
/sms/resetPwd=getResetPwd
/contract/template=template
/v1/sms/login=smsLogin
/user/exchange=exchange
/v1/grab/location=location
/v1/order/confirm=orderConfirm
/v1/order/cancel=cancelOrder
/v1/bill/list=billList
/v1/bankcard/check=check
/v1/bill/detail=billDetail
/v1/bankcard/getBankcard=getBankcard
/v1/customer/licenses=licenses
/v1/merchant=merchant
/v1/order=order
/v1/order/submit=submit
/city/support=CitySupport
/user/send/code/login=SendCodeLogin
/user/login=login
/userInfo/personal=Personal
/user/twoSubmit=TwoSubmit
/userInfo/identity/save=IdentitySaveAndUpdate
/userInfo/identity/update=IdentitySaveAndUpdate
/buy/save=Save
/userInfo/identity=Identity
/userInfo/identity/upload=IdentityUpload
/userInfo/contacts=Contacts
/v1/grab/contacts=contacts
/order/list=OrderList
/order/status/confirm=Confirm
/order/status/cancel=OrderCancel
/order/success=OrderSuccess
/order/detail=OrderDetails
/order/contract=Contract
/order/pwd/isExist=PasswordExistance
/user/send/code/setDeal=SetDeal
/user/mobileCodeConfirm/setDeal=MobileCodeConfirm
/userCenter/setDealPwd/save=DealPwdSave
/decision/busiagree=BusiAgree
/userCenter/setDealPwd/update=ResetDealPwd
/api/business/hot=Hot
/api/business/detail=BusinessDetail
/user/getContacts=GetContacts
/user/getCurCity=GetCurCity
/api/business/getShareContent=GetShareContent
/api/business/detail/pic=BusinessDetailPic
/user/getLocation=GetLocation
/user/register/sms=RegisterSms
/user/exist=UserIfExist
/oauth/v1/receive/data/rental=DataRental
/v1/order/create=CreateOrder
/v1/procedure/list=ProcedureList
/v1/order/queryInfo=orderQreryInfo
/v1/channel/queryConfig=queryConfig
/oauth/v1/receive/data/rental=rental
\ No newline at end of file
/admin/template/addChildModuleMovie=addChildModuleMovie_template
\ No newline at end of file
......@@ -81,6 +81,22 @@
<sqlpwd>Beta@&amp;123</sqlpwd>
</system>
<system name="nwn_template"><!-- nwn -->
<access_token_uri>http://106.75.5.205:8082/uaa/oauth/token</access_token_uri>
<client_id>bestbuy-acceptance</client_id>
<client_secret>bestbuy-acceptance</client_secret>
<grant_type>client_credentials</grant_type>
<isProduct>false</isProduct>
<RM_URI>http://beta.alitest.eoffcn.com</RM_URI>
<RM_port></RM_port>
<RM_basePath></RM_basePath>
<redis_URI>10.10.229.48</redis_URI>
<redis_db_index>5</redis_db_index>
<sqlurl>jdbc:mysql://39.105.124.219:3312/nwn_template?useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull</sqlurl>
<sqlname>nwnBeta</sqlname>
<sqlpwd>Beta@&amp;123</sqlpwd>
</system>
<system name="nwnht"><!-- nwn后台 -->
<access_token_uri>http://106.75.5.205:8082/uaa/oauth/token</access_token_uri>
<client_id>bestbuy-acceptance</client_id>
......
package test;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import com.offcn.process.NWN;
public class test {
public class test {
public static void main (String[] args) {
String res1 = "page=1&size=10&username=code&phone=code&card_no=code&status=1";
String sss=getParameter_get(res1,"size");
System.out.println(sss);
String year = getCurrentYear();
System.out.println(year);
}
//在parameter中获取get请求中的参数
public static String getCurrentYear(){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
Date date = new Date();
return sdf.format(date);
}
//在parameter中获取get请求中的参数
public static String getParameter_get(String parameter,String Letter){
if(parameter==null){
return "";
......
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