/* * 报名 */ public String doSignupTask(Task task) { String result = null; Map<String, Object> taskParams = task.getTaskParams(); String statusId = (String) taskParams.get(Status.STATUS_ID); String personId = (String) taskParams.get(Status.PERSON_ID); String contact = (String) taskParams.get(Task.TA_SIGNUP_CONTACT); String message = (String) taskParams.get(Task.TA_SIGNUP_MESSAGE); String signup_url = HttpClientUtil.BASE_URL + "data/sign/save?task_id=" + statusId + "&task_user="******"&open_mes=" + contact + "&message=" + message; try { signup_url = StringUtil.replaceBlank(signup_url); result = HttpClientUtil.getRequest(signup_url); } catch (Exception e) { e.printStackTrace(); } return result; }
/*登录任务*/ public String doLoginTask(Task task) { String result = null; Map<String, Object> taskParams = task.getTaskParams(); String collegeId = (String) taskParams.get(User.USER_COLLEGEID); String studentId = (String) taskParams.get(User.USER_STUDENTID); String password = (String) taskParams.get(User.USER_PASSWORD); String isEixst = (String) taskParams.get(Task.TA_LOGIN_ISEXIST); String captcha = (String) taskParams.get(Task.TA_LOGIN_CAPTCHA); String login_url = HttpClientUtil.BASE_URL + "data/user/login?student_id=" + studentId + "&pwd=" + password + "&school=" + collegeId; if (isEixst != null) { login_url += "&issysn=" + isEixst; } if (captcha != null) { login_url += "&code=" + captcha; } try { login_url = StringUtil.replaceBlank(login_url); result = HttpClientUtil.getRequest(login_url); } catch (Exception e) { e.printStackTrace(); // 如果没有连接网络,就会抛出异常,result就会为初值TA_NO:no } return result; }
public String doEvaluateTask(Task task) { String result = null; Map<String, Object> taskParams = task.getTaskParams(); String statusId = (String) taskParams.get(Status.STATUS_ID); String signupId = (String) taskParams.get(SignUp.SIGNUP_ID); String personId = (String) taskParams.get(SignUp.PERSON_ID); String signupPraise = (String) taskParams.get(SignUp.SIGNUP_PRAISE); String signupMessage = (String) taskParams.get(SignUp.SIGNUP_MESSAGE); String evaluate_url = HttpClientUtil.BASE_URL + "data/task/apprise?task_id=" + statusId + "&sign_id=" + signupId + "&users_id=" + personId + "&prise=" + signupPraise + "&msg=" + signupMessage; try { evaluate_url = StringUtil.replaceBlank(evaluate_url); result = HttpClientUtil.getRequest(evaluate_url); } catch (Exception e) { e.printStackTrace(); } return result; }
/* * 留言 */ public String doMessageTask(Task task) { String result = null; Map<String, Object> taskParams = task.getTaskParams(); String statusId = (String) taskParams.get(Status.STATUS_ID); String replyId = (String) taskParams.get(MessageContent.REPLY_ID); String content = (String) taskParams.get(MessageContent.CONTENT); String message_url = HttpClientUtil.BASE_URL + "data/taskmsg/save?task_id=" + statusId + "&message_content=" + content + "&to_user="******"&root_id=" + messageId; } try { message_url = StringUtil.replaceBlank(message_url); result = HttpClientUtil.getRequest(message_url); } catch (Exception e) { e.printStackTrace(); } return result; }
/* * 发布任务 */ public String doReleaseTask(Task task) { String result = null; Map<String, Object> taskParams = task.getTaskParams(); String title = (String) taskParams.get(Status.STATUS_TITLE); String content = (String) taskParams.get(Status.STATUS_CONTENT); String rewards = (String) taskParams.get(Status.STATUS_REWARDS); String endtime = (String) taskParams.get(Status.STATUS_ENDTIME); String release_url = HttpClientUtil.BASE_URL + "data/task/save?title=" + title + "&content=" + content + "&rewards=" + rewards + "&end_of_time=" + endtime + "&task_level=1"; try { release_url = StringUtil.replaceBlank(release_url); result = HttpClientUtil.getRequest(release_url); } catch (Exception e) { e.printStackTrace(); } return result; }
public String doFeedbackTask(Task task) { String result = null; Map<String, Object> taskParams = task.getTaskParams(); String feedbackString = (String) taskParams.get(Task.TA_FEEDBACK_STRING); String feedback_url = HttpClientUtil.BASE_URL + "data/fb/save?opinion=" + feedbackString; try { feedback_url = StringUtil.replaceBlank(feedback_url); result = HttpClientUtil.getRequest(feedback_url); } catch (Exception e) { e.printStackTrace(); } return result; }
public Drawable doGetCaptchaTask(Task task) { Drawable drawable = null; Map<String, Object> taskParams = task.getTaskParams(); String captchaUrl = (String) taskParams.get(Task.TA_GETCAPTCHA_CAPTCHAURL); String get_captcha_url = HttpClientUtil.BASE_URL + "image/code/" + captchaUrl; try { get_captcha_url = StringUtil.replaceBlank(get_captcha_url); drawable = HttpClientUtil.getCaptcha(get_captcha_url); } catch (Exception e) { e.printStackTrace(); // 如果没有连接网络,就会抛出异常,result就会为初值TA_NO:no } return drawable; }
/* * 更新用户数据 */ public String doUpdataUserdata(Task task) { String result = null; Map<String, Object> taskParams = task.getTaskParams(); String url = (String) taskParams.get(Task.TA_UPDATAUSERDATA_URL); String updata_userdata_url = HttpClientUtil.BASE_URL + "data/user/update?" + url; try { updata_userdata_url = StringUtil.replaceBlank(updata_userdata_url); result = HttpClientUtil.getRequest(updata_userdata_url); } catch (Exception e) { e.printStackTrace(); } return result; }
public String doSendPrivateLetterTask(Task task) { String result = null; Map<String, Object> taskParams = task.getTaskParams(); String privateLetterString = (String) taskParams.get(Task.TA_PRIVATE_LETTER_STRING); String personId = (String) taskParams.get(Person.PERSON_ID); String private_letter_url = HttpClientUtil.BASE_URL + "data/pl/send?letter=" + privateLetterString + "&to_user=" + personId; try { private_letter_url = StringUtil.replaceBlank(private_letter_url); result = HttpClientUtil.getRequest(private_letter_url); } catch (Exception e) { e.printStackTrace(); } return result; }
public String doCheckUserTask(Task task) { String result = null; Map<String, Object> taskParams = task.getTaskParams(); String collegeId = (String) taskParams.get(College.COLLEGE_ID); String studentId = (String) taskParams.get(User.USER_STUDENTID); String check_user_url = HttpClientUtil.BASE_URL + "data/user/issysn?school=" + collegeId + "&student_id=" + studentId; try { check_user_url = StringUtil.replaceBlank(check_user_url); result = HttpClientUtil.getRequest(check_user_url); } catch (Exception e) { e.printStackTrace(); // 如果没有连接网络,就会抛出异常,result就会为初值TA_NO:no } return result; }
public String doExecTaskTask(Task task) { String result = null; Map<String, Object> taskParams = task.getTaskParams(); String signUpId = (String) taskParams.get(InfoSignUp.SIGNUP_ID); String contact = (String) taskParams.get(InfoSignUp.PERSON_CONTACT); String signUpString = (String) taskParams.get(InfoSignUp.SIGNUP_STRING); String exec_task_url = HttpClientUtil.BASE_URL + "data/sign/ce_2?sign_id=" + signUpId + "&t_open_mes=" + contact + "&reply=" + signUpString; try { exec_task_url = StringUtil.replaceBlank(exec_task_url); result = HttpClientUtil.getRequest(exec_task_url); } catch (Exception e) { e.printStackTrace(); } return result; }