whycrzh
2021-01-28 9f05d9863af714b206bdfffe2096d60a942c9d23
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
87
// package com.fgkj.controller;
 
import com.fgkj.util.*;
//
// import java.util.List;
//
// import com.fgkj.dto.Limit;
// import com.fgkj.dto.RoleLimit;
// import com.fgkj.dto.Roles;
// import com.fgkj.dto.ServiceModel;
// import com.fgkj.dto.UserRole;
//
// import com.fgkj.services.RoleLimitService;
// import com.google.gson.Gson;
// import com.google.gson.reflect.TypeToken;
// import com.opensymphony.xwork2.ActionSupport;
//
// public class RoleLimitAction extends ActionSupport{
//     private RoleLimit rl;
//     private String rolelimits;
//     private String result;
//     ServiceModel model = new ServiceModel();
//     RoleLimitService service=new RoleLimitService();
//
//     public ServiceModel findAll(){
//         model=service.findRoleLimitall();
//         result=ActionUtil.tojson(model);
//         //System.out.println(result);
//         return "success";
//     }
//     public ServiceModel addRoleLimit(){
//
//         model=service.addRoleLimit(rl);
//
//         result=ActionUtil.tojson(model);
//         return "success";
//
//     }
//     public ServiceModel delRoleLimit() {
//         model=service.delRoleLimit(rl);
//         result=ActionUtil.tojson(model);
//
//         return "success";
//     }
//     public ServiceModel updateRoleLimit() {
//         //System.out.println("开始修改。。。");
//         //System.out.println(rolelimits);
//         Gson gson=new Gson();
//         UserRole u=new UserRole();
//         List<RoleLimit> rtn = gson.fromJson(rolelimits, new TypeToken<List<RoleLimit>>(){}.getType());
//         for (RoleLimit roleLimit : rtn) {
//              // System.out.println(roleLimit);
//               model=service.updateRoleLimit(roleLimit);
//         }
//         result=ActionUtil.tojson(model);
//         return "success";
//     }
//
//     public ServiceModel getRolelimits() {
//         return rolelimits;
//     }
//     public void setRolelimits(String rolelimits) {
//         this.rolelimits = rolelimits;
//     }
//     public ServiceModel getResult() {
//         return result;
//     }
//     public ServiceModel getModel() {
//         return model;
//     }
//     public RoleLimitService getService() {
//         return service;
//     }
//     public void setService(RoleLimitService service) {
//         this.service = service;
//     }
//     public static void main(String[] args) {
//         RoleLimitAction rla=new RoleLimitAction();
//         Roles r=new Roles();
//         r.setRid(1);
//         Limit l=new Limit();
//         l.setLid(2);
//         rla.updateRoleLimit();
//         rla.findAll();
//     }
//
// }