1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- package com.sinosoft.lz.system.sms.service;
- import javax.ws.rs.POST;
- import javax.ws.rs.Path;
- import javax.ws.rs.ProduceMime;
- import org.apache.log4j.Logger;
- import com.formaction.Utils;
- import com.formaction.vo.Msg;
- import com.sinosoft.lz.system.sms.dao.ContactPeopleDao;
- @Path("/ContactpeopleService/")
- public class ContactpeopleService {
- private Logger log = Logger.getLogger(this.getClass());
- @POST
- @ProduceMime("application/json")
- @Path("/addContactPeople/")
- public Msg addContactPeople(String params){
- Msg m = new Msg();
- String userId = Utils.getParameter("userId", params)==null?"":Utils.getParameter("userId", params);
- String dept = Utils.getParameter("dept", params)==null?"":Utils.getParameter("dept", params);
- String comp = Utils.getParameter("comp", params)==null?"":Utils.getParameter("comp", params);
- String tel = Utils.getParameter("tel", params)==null?"":Utils.getParameter("tel", params);
- String name = Utils.getParameter("name", params)==null?"":Utils.getParameter("name", params);
- ContactPeopleDao dao = new ContactPeopleDao();
- try {
- m = dao.addPeople(userId, name, tel, comp, dept);
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return m;
- }
- @POST
- @ProduceMime("application/json")
- @Path("/updateContactPeople/")
- public Msg updateContactPeople(String params){
- Msg m = new Msg();
- String userId = Utils.getParameter("userId", params)==null?"":Utils.getParameter("userId", params);
- String fd_id = Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
- String comp = Utils.getParameter("comp", params)==null?"":Utils.getParameter("comp", params);
- String dept = Utils.getParameter("dept", params)==null?"":Utils.getParameter("dept", params);
- String tel = Utils.getParameter("tel", params)==null?"":Utils.getParameter("tel", params);
- String name = Utils.getParameter("name", params)==null?"":Utils.getParameter("name", params);
- ContactPeopleDao dao = new ContactPeopleDao();
- try {
- m = dao.updateContactPeople(userId, fd_id, comp, dept, tel, name);
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return m;
- }
- @POST
- @ProduceMime("application/json")
- @Path("/deleteContactPeople/")
- public Msg deleteContactPeople(String params){
- Msg m = new Msg();
- String userId = Utils.getParameter("userId", params)==null?"":Utils.getParameter("userId", params);
- String fd_id = Utils.getParameter("fd_id", params)==null?"":Utils.getParameter("fd_id", params);
- ContactPeopleDao dao = new ContactPeopleDao();
- try {
- m = dao.deleteContactPeople(fd_id, userId);
- } catch (ClassNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return m;
- }
- @POST
- @ProduceMime("application/json")
- @Path("/getTel/")
- public String getTel(String params){
- String userId = Utils.getParameter("userId", params)==null?"":Utils.getParameter("userId", params);
- ContactPeopleDao dao = new ContactPeopleDao();
- String result = dao.getTel(userId);
- return result;
- }
-
- }
|