code2

package com.istudy.web;

 

import com.istudy.common.MyUtils;

import com.istudy.structure.InfoStructure.MyCollectionSchoolWithCode;

import com.istudy.structure.InfoStructure.MyQuestionWithCode;

import com.istudy.structure.InfoStructure.NewAuthSchoolWithCode;

import com.istudy.structure.InfoStructure.RecommendSchoolWithCode;

import com.istudy.structure.InfoStructure.SchoolCommentBasicArrayWithCode;

import com.istudy.structure.InfoStructure.SchoolInfoBasicArrayWithCode;

import com.istudy.structure.InfoStructure.SchoolInfoWithCode;

import com.istudy.structure.InfoStructure.SchoolLoginInfoBasicWithCode;

import com.istudy.structure.InfoStructure.TeacherCommentBasicArrayWithCode;

import com.istudy.structure.InfoStructure.TeacherInfoBasicArrayWithCode;

import com.istudy.structure.InfoStructure.TeacherInfoWithCode;

import com.istudy.structure.InfoStructure.TeacherLoginInfoBasicWithCode;

import com.istudy.structure.InfoStructure.UserInfoBasic;

import com.istudy.structure.InfoStructure.UserInfoBasicWithCode;

 

public class WebServiceCall implements WebServiceCallInterface {

 

@Override

public long signUpStudentWS(String userName, String userPassword, String userNickname, String userSex, String userMobile, String userBirth, String userEmail) {

long retVal;

WebServiceConnection webServiceConnection = new WebServiceConnection();

retVal = webServiceConnection.signUpStudent(userName, userPassword, userNickname, userSex, userMobile, userBirth, userEmail);

return retVal;

}

 

@Override

public long signUpTeacherWS(String userName, String userPassword, String userNickname, String userSex, String userMobile, String userBirth, String userEmail) {

long retVal;

WebServiceConnection webServiceConnection = new WebServiceConnection();

retVal = webServiceConnection.signUpTeacher(userName, userPassword, userNickname, userSex, userMobile, userBirth, userEmail);

return retVal;

}

 

@Override

public long signUpSchoolWS(String userName, String userPassword, String userNickname, String userMobile) {

long retVal;

WebServiceConnection webServiceConnection = new WebServiceConnection();

retVal = webServiceConnection.signUpSchool(userName, userPassword, userNickname, userMobile);

return retVal;

}

 

@Override

public UserInfoBasicWithCode loginStudentWS(String userName, String userPassword) {

UserInfoBasicWithCode userInfoBasicWithCode = new UserInfoBasicWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.loginStudent(userName, userPassword);

if (resByteArray == null) {

return null;

}

userInfoBasicWithCode = (UserInfoBasicWithCode) MyUtils.toObject(resByteArray);

return userInfoBasicWithCode;

}

 

@Override

public SchoolLoginInfoBasicWithCode loginSchoolWS(String schoolName,

String schoolPassword) {

SchoolLoginInfoBasicWithCode schoolLoginInfoBasicWithCode = new SchoolLoginInfoBasicWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.loginSchool(schoolName, schoolPassword);

if (resByteArray == null) {

return null;

}

schoolLoginInfoBasicWithCode = (SchoolLoginInfoBasicWithCode) MyUtils.toObject(resByteArray);

return schoolLoginInfoBasicWithCode;

}

 

@Override

public TeacherLoginInfoBasicWithCode loginTeacherWS(String teacherName,

String teacherPassword) {

TeacherLoginInfoBasicWithCode teacherLoginInfoBasicWithCode = new TeacherLoginInfoBasicWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.loginTeacher(teacherName, teacherPassword);

if (resByteArray == null) {

return null;

}

teacherLoginInfoBasicWithCode = (TeacherLoginInfoBasicWithCode) MyUtils.toObject(resByteArray);

return teacherLoginInfoBasicWithCode;

}

 

@Override

public SchoolInfoBasicArrayWithCode lookingForSchoolWS(int classCode,

int subClassCode, int startId, int limitNum) {

SchoolInfoBasicArrayWithCode schoolInfoBasicArrayWithCode;// = new SchoolInfoBasicArrayWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.lookingForSchool(classCode, subClassCode, startId, limitNum);

if (resByteArray == null) {

return null;

}

schoolInfoBasicArrayWithCode = (SchoolInfoBasicArrayWithCode) MyUtils.toObject(resByteArray);

return schoolInfoBasicArrayWithCode;

}

 

@Override

public SchoolInfoBasicArrayWithCode lookingForSchoolWithDistanceWS( int classCode, int subClassCode, int startId, int limitNum, String sourceLat, String sourceLog) {

SchoolInfoBasicArrayWithCode schoolInfoBasicArrayWithCode;// = new SchoolInfoBasicArrayWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.lookingForSchoolWithDistance(classCode, subClassCode, startId, limitNum, sourceLat, sourceLog);

if (resByteArray == null) {

return null;

}

schoolInfoBasicArrayWithCode = (SchoolInfoBasicArrayWithCode) MyUtils.toObject(resByteArray);

return schoolInfoBasicArrayWithCode;

}

 

@Override

public SchoolInfoWithCode getSchoolFullInfoWS(long schoolId) {

SchoolInfoWithCode schoolInfoWithCode;

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.getSchoolFullInfo(schoolId);

if (resByteArray == null) {

return null;

}

schoolInfoWithCode = (SchoolInfoWithCode) MyUtils.toObject(resByteArray);

return schoolInfoWithCode;

}

 

@Override

public SchoolCommentBasicArrayWithCode getSchoolCommentWS(long schoolId, int startId, int limitNum) {

SchoolCommentBasicArrayWithCode schoolCommentBasicArrayWithCode;

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] retByteArray = webServiceConnection.getSchoolComment(schoolId, startId, limitNum);

if (retByteArray == null) {

return null;

}

schoolCommentBasicArrayWithCode = (SchoolCommentBasicArrayWithCode) MyUtils.toObject(retByteArray);

return schoolCommentBasicArrayWithCode;

}

 

@Override

public long submitSchoolCommentWS(long schoolId, long userId, String commentScore, String commentContent, int limitNum, int commentPicNum, byte[] commentPic1, byte[] commentPic2, byte[] commentPic3) {

SchoolCommentBasicArrayWithCode schoolCommentBasicArrayWithCode;

WebServiceConnection webServiceConnection = new WebServiceConnection();

String commentPic1String = null;

String commentPic2String = null;

String commentPic3String = null;

if (commentPic1 != null) {

commentPic1String = MyUtils.encode(commentPic1);

}

if (commentPic2 != null) {

commentPic2String = MyUtils.encode(commentPic2);

}

if (commentPic3 != null) {

commentPic3String = MyUtils.encode(commentPic3);

}

long retVal = webServiceConnection.submitSchoolComment(schoolId, userId, commentScore, commentContent, limitNum, commentPicNum, commentPic1String, commentPic2String, commentPic3String);

return retVal;

}

 

@Override

public TeacherInfoBasicArrayWithCode lookingForTeacherWS(int classCode,

int subClassCode, int startId, int limitNum) {

TeacherInfoBasicArrayWithCode teacherInfoBasicArrayWithCode;// = new SchoolInfoBasicArrayWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.lookingForTeacher(classCode, subClassCode, startId, limitNum);

if (resByteArray == null) {

return null;

}

teacherInfoBasicArrayWithCode = (TeacherInfoBasicArrayWithCode) MyUtils.toObject(resByteArray);

return teacherInfoBasicArrayWithCode;

}

 

@Override

public TeacherCommentBasicArrayWithCode getTeacherCommentWS(long teacherId,

int startId, int limitNum) {

TeacherCommentBasicArrayWithCode teacherCommentBasicArrayWithCode;

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] retByteArray = webServiceConnection.getTeacherComment(teacherId, startId, limitNum);

if (retByteArray == null) {

return null;

}

teacherCommentBasicArrayWithCode = (TeacherCommentBasicArrayWithCode) MyUtils.toObject(retByteArray);

return teacherCommentBasicArrayWithCode;

}

 

@Override

public TeacherCommentBasicArrayWithCode submitTeacherCommentWS(long teacherId, long userId, String commentContent, int limitNum) {

TeacherCommentBasicArrayWithCode teacherCommentBasicArrayWithCode;

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] retByteArray = webServiceConnection.submitTeacherComment(teacherId, userId, commentContent, limitNum);

if (retByteArray == null) {

return null;

}

teacherCommentBasicArrayWithCode = (TeacherCommentBasicArrayWithCode) MyUtils.toObject(retByteArray);

return teacherCommentBasicArrayWithCode;

}

 

@Override

public TeacherInfoWithCode getTeacherFullInfoWS(long teacherId) {

TeacherInfoWithCode teacherInfoWithCode;

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.getTeacherFullInfo(teacherId);

if (resByteArray == null) {

return null;

}

teacherInfoWithCode = (TeacherInfoWithCode) MyUtils.toObject(resByteArray);

return teacherInfoWithCode;

}

 

@Override

public long addToCollectionWS(int userType, long userId, int collectionUserType, long collectionUserId) {

long retVal;

WebServiceConnection webServiceConnection = new WebServiceConnection();

retVal = webServiceConnection.addToCollection(userType, userId, collectionUserType, collectionUserId);

return retVal;

}

 

@Override

public MyCollectionSchoolWithCode getMyCollectionSchoolWS(int userType, long userId, int startId, int limitNum) {

MyCollectionSchoolWithCode myCollectionSchoolWithCode;

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.getMyCollectionSchool(userType, userId, startId, limitNum);

if (resByteArray == null) {

return null;

}

myCollectionSchoolWithCode = (MyCollectionSchoolWithCode) MyUtils.toObject(resByteArray);

return myCollectionSchoolWithCode;

}

 

@Override

public SchoolInfoBasicArrayWithCode lookingForSchoolViaPlaceWS(String placeNameString, int startId, int limitNum) {

SchoolInfoBasicArrayWithCode schoolInfoBasicArrayWithCode;// = new SchoolInfoBasicArrayWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.lookingForSchoolViaPlace(placeNameString, startId, limitNum);

if (resByteArray == null) {

return null;

}

schoolInfoBasicArrayWithCode = (SchoolInfoBasicArrayWithCode) MyUtils.toObject(resByteArray);

return schoolInfoBasicArrayWithCode;

}

 

@Override

public UserInfoBasicWithCode modifyMyProfileStudentWS(long userId, String userNickname, String userSex, String userBirth, String userMobile, String userEmail) {

UserInfoBasicWithCode userInfoBasicWithCode = new UserInfoBasicWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.modifyMyProfileStudent(userId, userNickname, userSex, userBirth, userMobile, userEmail);

if (resByteArray == null) {

return null;

}

userInfoBasicWithCode = (UserInfoBasicWithCode) MyUtils.toObject(resByteArray);

return userInfoBasicWithCode;

}

 

@Override

public RecommendSchoolWithCode getRecommendSchoolWS() {

RecommendSchoolWithCode recommendSchoolWithCode = new RecommendSchoolWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.getRecommendSchool();

if (resByteArray == null) {

return null;

}

recommendSchoolWithCode = (RecommendSchoolWithCode) MyUtils.toObject(resByteArray);

return recommendSchoolWithCode;

}

 

@Override

public NewAuthSchoolWithCode getNewAuthSchoolWS() {

NewAuthSchoolWithCode newAuthSchoolWithCode = new NewAuthSchoolWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.getNewAuthSchool();

if (resByteArray == null) {

return null;

}

newAuthSchoolWithCode = (NewAuthSchoolWithCode) MyUtils.toObject(resByteArray);

return newAuthSchoolWithCode;

}

 

@Override

public MyQuestionWithCode getMyQuestionWithCodeWS(long userId, int startId, int limitNum) {

MyQuestionWithCode myQuestionWithCode = new MyQuestionWithCode();

WebServiceConnection webServiceConnection = new WebServiceConnection();

byte[] resByteArray = webServiceConnection.getMyQuestion(userId, startId, limitNum);

if (resByteArray == null) {

return null;

}

myQuestionWithCode = (MyQuestionWithCode) MyUtils.toObject(resByteArray);

return myQuestionWithCode;

}

 

@Override

public long wantToAskWS(long userId, String questionScore, String questionTitle, String questionContent) {

long retVal;

WebServiceConnection webServiceConnection = new WebServiceConnection();

retVal = webServiceConnection.wantToAsk(userId, questionScore, questionTitle, questionContent);

return retVal;

}

 

}

 

posted on 2015-01-19 01:49  mimamo  阅读(151)  评论(0)    收藏  举报

导航