// package com.fgkj.controller;
|
|
import com.fgkj.util.*;
|
//
|
// import java.util.Map;
|
// import java.util.Map.Entry;
|
//
|
// import com.fgkj.dto.Roles;
|
// import com.fgkj.dto.ServiceModel;
|
// import com.fgkj.dto.User;
|
// import com.fgkj.dto.UserRole;
|
// import com.fgkj.services.UserRoleService;
|
// import com.google.gson.Gson;
|
// import com.google.gson.reflect.TypeToken;
|
// import com.opensymphony.xwork2.ActionSupport;
|
//
|
// public class UserRoleAction extends ActionSupport{
|
// private Roles role;
|
// private String result;
|
// private ServiceModel model=new ServiceModel();
|
// private UserRoleService service=new UserRoleService();
|
// private String str;
|
//
|
// public ServiceModel findAll(){
|
// model=service.findAllUserRole();
|
// result=ActionUtil.tojson(model);
|
// //System.out.println(result);
|
//
|
// return "success";
|
// }
|
//
|
// public ServiceModel add(){
|
// Gson gson=new Gson();
|
// UserRole u=new UserRole();
|
// Map<Integer,UserRole> rtn = gson.fromJson(str, new TypeToken<Map<Integer,UserRole>>(){}.getType());
|
// for(Entry<Integer, UserRole> entry : rtn.entrySet()){
|
// UserRole ur = entry.getValue();
|
// u.setRole(new Roles(ur.getRole().getRid(),ur.getRole().getRname()));
|
// u.setUser(new User(ur.getUser().getuId()));
|
// //System.out.println(u);
|
// model=service.addUserRole(u);
|
// }
|
// result=ActionUtil.tojson(model);
|
// //System.out.println(result+"77777");
|
// return "success";
|
// }
|
//
|
// public ServiceModel del(){
|
// //System.out.println(str);
|
// model=service.del(new UserRole(Integer.parseInt(str)));
|
// result=ActionUtil.tojson(model);
|
// return "success";
|
// }
|
//
|
//
|
// public ServiceModel getResult() {
|
// return result;
|
// }
|
// public void setResult(String result) {
|
// this.result = result;
|
// }
|
// public ServiceModel getModel() {
|
// return model;
|
// }
|
// public void setModel(ServiceModel model) {
|
// this.model = model;
|
// }
|
//
|
// public void setRole(Roles role) {
|
// this.role = role;
|
// }
|
// public UserRoleService getService() {
|
// return service;
|
// }
|
// public void setService(UserRoleService service) {
|
// this.service = service;
|
// }
|
//
|
// public ServiceModel getStr() {
|
// return str;
|
// }
|
//
|
// public void setStr(String str) {
|
// this.str = str;
|
// }
|
// }
|