-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: qx <[email protected]>
- Loading branch information
Showing
17 changed files
with
308 additions
and
83 deletions.
There are no files selected for viewing
Binary file modified
BIN
+44 Bytes
(100%)
WebRoot/WEB-INF/classes/com/fullwish/action/service/EquipServer.class
Binary file not shown.
Binary file added
BIN
+2.3 KB
WebRoot/WEB-INF/classes/com/fullwish/action/service/MissionServer.class
Binary file not shown.
Binary file removed
BIN
-1.42 KB
WebRoot/WEB-INF/classes/com/fullwish/action/service/SkillsServer.class
Binary file not shown.
Binary file added
BIN
+369 Bytes
WebRoot/WEB-INF/classes/com/fullwish/service/mission/MissionService.class
Binary file not shown.
Binary file added
BIN
+3.12 KB
WebRoot/WEB-INF/classes/com/fullwish/serviceImpl/mission/MissionServiceImpl.class
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" | ||
pageEncoding="UTF-8"%> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>技能添加界面</title> | ||
</head> | ||
<body> | ||
<form action="/server_controller/mission_addfinish" method="post" > | ||
<input type="text" name="mission_id">:mission_id(任务名)</input></br> | ||
<input type="text" name="mission_level">:mission_level(任务等级)</input></br> | ||
<input type="text" name="mission_exp">:mission_exp(经验值)</input></br> | ||
<!-- <input type="text" name="mission_visible">:mission_visible(0,禁用,1启用.默认启用)</input></br> --> | ||
<input type="submit" name="提交"/> | ||
</form> | ||
</body> | ||
</html> |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/** | ||
* | ||
*/ | ||
package com.fullwish.action.service; | ||
|
||
import javax.annotation.Resource; | ||
|
||
import org.springframework.stereotype.Controller; | ||
|
||
import com.fullwish.bean.entity.Mission; | ||
import com.fullwish.service.mission.MissionService; | ||
import com.opensymphony.xwork2.ActionSupport; | ||
|
||
/** | ||
* @author fullwish | ||
* | ||
*/ | ||
@Controller | ||
public class MissionServer extends ActionSupport { | ||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = -6310224311290570208L; | ||
|
||
private String mission_id; | ||
|
||
private String mission_level; | ||
|
||
private String mission_exp; | ||
|
||
@Resource(name = "missionServiceImpl") | ||
MissionService missionService; | ||
|
||
// ·ÃÎÊ·¾¶ 192.168.2.3:8080/server_controller/skills_add | ||
public String add() { | ||
System.out.println("MissionServer add method start"); | ||
System.out.println(mission_level); | ||
System.out.println(mission_exp); | ||
System.out.println("MissionServer add method over"); | ||
return "addpage"; | ||
} | ||
|
||
// ·ÃÎÊ·¾¶ 192.168.2.3:8080/server_controller/skills_addfinish | ||
public String addfinish() { | ||
System.out.println("MissionServer addfinish method start"); | ||
// ´´½¨mission | ||
Mission mission = new Mission(); | ||
String missionId = mission_id; | ||
int missionExp = Integer.parseInt(mission_exp); | ||
int missionLevel = Integer.parseInt(mission_level); | ||
Boolean mission_visible = true; | ||
|
||
mission.setMission_exp(missionExp); | ||
mission.setMission_id(missionId); | ||
mission.setMission_level(missionLevel); | ||
mission.setMission_visible(mission_visible); | ||
|
||
missionService.save(mission); | ||
|
||
System.out.println(mission_id); | ||
System.out.println(mission_level); | ||
System.out.println(mission_exp); | ||
System.out.println("MissionServer addfinish method over"); | ||
return "addfinish"; | ||
} | ||
|
||
public void setMission_exp(String mission_exp) { | ||
this.mission_exp = mission_exp; | ||
} | ||
|
||
public void setMission_level(String mission_level) { | ||
this.mission_level = mission_level; | ||
} | ||
|
||
public String getMission_id() { | ||
return mission_id; | ||
} | ||
|
||
public void setMission_id(String mission_id) { | ||
this.mission_id = mission_id; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package com.fullwish.service.mission; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.fullwish.bean.entity.Mission; | ||
import com.fullwish.service.base.DAO; | ||
|
||
public interface MissionService extends DAO<Mission> { | ||
|
||
/** | ||
* 启用指定装备 | ||
* | ||
* @param mission_id | ||
*/ | ||
public void enable(Serializable... mission_id); | ||
|
||
/** | ||
* 判断装备是否存在 | ||
* | ||
* @param mission_id | ||
* @return | ||
*/ | ||
public boolean exsit(String mission_id); | ||
|
||
/** | ||
* 判断用户名及密码是否正确 | ||
* | ||
* @param user_email | ||
* @param user_password | ||
* @return | ||
*/ | ||
// public boolean checkUser(String user_email, String user_password); | ||
/** | ||
* 用户信息(user_country,user_career,user_nickname) | ||
* | ||
* @param user_email | ||
* 用户名 | ||
* @param user_country | ||
* 用户国家 | ||
* @param user_career | ||
* 用户职业 | ||
* @param user_nickname | ||
* 用户昵称 | ||
*/ | ||
// public void updateEquipInfo(String user_email, String user_country, | ||
// String user_career, String user_nickname); | ||
} |
105 changes: 105 additions & 0 deletions
105
src/com/fullwish/serviceImpl/mission/MissionServiceImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
package com.fullwish.serviceImpl.mission; | ||
|
||
import java.io.Serializable; | ||
|
||
import javax.persistence.Query; | ||
|
||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Propagation; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import com.fullwish.bean.entity.Mission; | ||
import com.fullwish.service.base.DaoSupport; | ||
import com.fullwish.service.mission.MissionService; | ||
|
||
@Service | ||
@Transactional | ||
public class MissionServiceImpl extends DaoSupport<Mission> implements | ||
MissionService { | ||
// public void updatePassword(String tools_id, String newpassword){ | ||
// em.createQuery("update tools o set o.password=?1 where o.tools_id=?2") | ||
// .setParameter(1, MD5.MD5Encode(newpassword)).setParameter(2, | ||
// tools_id).executeUpdate(); | ||
// } | ||
|
||
@Override | ||
public void save(Mission entity) { | ||
// entity.setMission_password(MD5.MD5Encode(entity.getMission_password())); | ||
super.save(entity); | ||
} | ||
|
||
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true) | ||
public boolean exsit(String mission_id) { | ||
long count = (Long) em.createQuery( | ||
"select count(o) from Mission o where o.Mission_id=?1") | ||
.setParameter(1, mission_id).getSingleResult(); | ||
return count > 0; | ||
} | ||
|
||
/* | ||
* public boolean checkMission(String user_email, String user_password) { | ||
* long count = (Long) em .createQuery( "select count(o) from Mission o | ||
* where o.user_email=?1 and o.user_password=?2") // user±íÒª´óд | ||
* .setParameter(1, user_email).setParameter(2, | ||
* MD5.MD5Encode(user_password)).getSingleResult(); // | ||
* System.out.println("check over"); return count > 0; } | ||
*/ | ||
|
||
/* | ||
* public boolean checkMission(String username, String password){ long count = | ||
* (Long)em.createQuery("select count(o) from Buyer o where o.username=?1 | ||
* and o.password=?2") .setParameter(1, username).setParameter(2, | ||
* MD5.MD5Encode(password)).getSingleResult(); return count>0; } | ||
*/ | ||
|
||
@Override | ||
public void delete(Serializable... entityIds) { | ||
visible(false, entityIds); | ||
} | ||
|
||
@Override | ||
public long getCount() { | ||
return (Long) em.createQuery( | ||
"select count(o) from Mission o where o.mission_visible=?1") | ||
.setParameter(1, true).getSingleResult(); | ||
} | ||
|
||
private void visible(boolean visible, Serializable... tools_ids) { | ||
if (tools_ids != null && tools_ids.length > 0) { | ||
StringBuffer jpql = new StringBuffer(); | ||
for (int i = 0; i < tools_ids.length; i++) { | ||
jpql.append('?').append(i + 2).append(','); | ||
} | ||
jpql.deleteCharAt(jpql.length() - 1); | ||
Query query = em | ||
.createQuery("update Mission b set b.mission_visible=?1 where b.mission_id in(" | ||
+ jpql.toString() + ")"); | ||
query.setParameter(1, visible); | ||
for (int i = 0; i < tools_ids.length; i++) { | ||
query.setParameter(i + 2, tools_ids[i]); | ||
} | ||
query.executeUpdate(); | ||
} | ||
} | ||
|
||
public void enable(Serializable... mission_ids) { | ||
visible(true, mission_ids); | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see com.fullwish.service.tools.MissionService#updateMissionInfo(java.lang.String, | ||
* java.lang.String, java.lang.String, java.lang.String) | ||
*/ | ||
/* | ||
* public void updateMissionInfo(String user_email, String user_country, | ||
* String user_career, String user_nickname) { // update tools o set | ||
* o.user_action=2,o.user_attack=3 // where o.user_email="[email protected]"; | ||
* em .createQuery( "update Mission o set o.user_country=?1, | ||
* o.user_career=?2, o.user_nickname=?3 where o.user_email=?4") | ||
* .setParameter(1, user_country).setParameter(2, user_career) | ||
* .setParameter(3, user_nickname).setParameter(4, user_email) | ||
* .executeUpdate(); } | ||
*/ | ||
} |
Oops, something went wrong.