whycrzg
2021-02-03 f628be11a131a262855908b7815c3027d6bafb4c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// 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;
//     }
// }