Browse Source

三方登录等

root 5 years ago
parent
commit
905809e689

BIN
1.dmp


+ 2 - 2
facade/src/app/routes/passport/login/login.component.ts

@@ -116,8 +116,8 @@ export class UserLoginComponent implements OnDestroy {
116
 
116
 
117
     const data = {
117
     const data = {
118
         grant_type: 'password',
118
         grant_type: 'password',
119
-        client_id: this.settingsService.app.clientId || environment.client_id,
120
-        client_secret: this.settingsService.app.clientSecret || environment.client_secret,
119
+        client_id: this.settingsService.user.client.clientId || environment.client_id,
120
+        client_secret: this.settingsService.user.client.clientSecret || environment.client_secret,
121
         scope: '*',
121
         scope: '*',
122
         username: this.userName.value,
122
         username: this.userName.value,
123
         password: this.password.value,
123
         password: this.password.value,

+ 8 - 0
src/main/java/com/kingkong/bljs/api/IndexController.java

@@ -3,6 +3,7 @@ package com.kingkong.bljs.api;
3
 import com.alibaba.fastjson.JSONArray;
3
 import com.alibaba.fastjson.JSONArray;
4
 import com.alibaba.fastjson.JSONObject;
4
 import com.alibaba.fastjson.JSONObject;
5
 import com.kingkong.bljs.dao.AppMapper;
5
 import com.kingkong.bljs.dao.AppMapper;
6
+import com.kingkong.bljs.dao.ClientMapper;
6
 import com.kingkong.bljs.dao.ThreeloginMapper;
7
 import com.kingkong.bljs.dao.ThreeloginMapper;
7
 import com.kingkong.bljs.entity.App;
8
 import com.kingkong.bljs.entity.App;
8
 import com.kingkong.bljs.security.CustomUser;
9
 import com.kingkong.bljs.security.CustomUser;
@@ -61,6 +62,9 @@ public class IndexController extends ApiController {
61
     @Autowired
62
     @Autowired
62
     private ThreeloginMapper threeloginMapper;
63
     private ThreeloginMapper threeloginMapper;
63
 
64
 
65
+    @Autowired
66
+    private  ClientMapper clientMapper;
67
+
64
 
68
 
65
     @GetMapping("app")
69
     @GetMapping("app")
66
     public Map app(@RequestParam("app_id") String app_id) throws Exception{
70
     public Map app(@RequestParam("app_id") String app_id) throws Exception{
@@ -72,6 +76,8 @@ public class IndexController extends ApiController {
72
         Map user = new HashMap();
76
         Map user = new HashMap();
73
         user.put("threeLogin", threeloginMapper.selectByAppId(app_id));
77
         user.put("threeLogin", threeloginMapper.selectByAppId(app_id));
74
 
78
 
79
+        user.put("client" , clientMapper.selectDefaultClient(app_id));
80
+
75
         result.put("user",user);
81
         result.put("user",user);
76
 
82
 
77
         return result;
83
         return result;
@@ -88,6 +94,8 @@ public class IndexController extends ApiController {
88
         Map user = userService.getCurrentUser();
94
         Map user = userService.getCurrentUser();
89
         user.put("threeLogin", threeloginMapper.selectByAppId(app_id));
95
         user.put("threeLogin", threeloginMapper.selectByAppId(app_id));
90
 
96
 
97
+        user.put("client" , clientMapper.selectDefaultClient(app_id));
98
+
91
         result.put("app",appInfo(app_id));
99
         result.put("app",appInfo(app_id));
92
         if(null == user){
100
         if(null == user){
93
             result.put("user",new HashMap<>());
101
             result.put("user",new HashMap<>());

+ 10 - 20
src/main/java/com/kingkong/bljs/dao/AppMapper.java

@@ -12,7 +12,7 @@ public interface AppMapper {
12
      * This method was generated by MyBatis Generator.
12
      * This method was generated by MyBatis Generator.
13
      * This method corresponds to the database table K_USER.K_APP
13
      * This method corresponds to the database table K_USER.K_APP
14
      *
14
      *
15
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
15
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
16
      */
16
      */
17
     @Delete({
17
     @Delete({
18
         "delete from K_USER.K_APP",
18
         "delete from K_USER.K_APP",
@@ -24,19 +24,17 @@ public interface AppMapper {
24
      * This method was generated by MyBatis Generator.
24
      * This method was generated by MyBatis Generator.
25
      * This method corresponds to the database table K_USER.K_APP
25
      * This method corresponds to the database table K_USER.K_APP
26
      *
26
      *
27
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
27
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
28
      */
28
      */
29
     @Insert({
29
     @Insert({
30
         "insert into K_USER.K_APP (ID, NAME, ",
30
         "insert into K_USER.K_APP (ID, NAME, ",
31
         "NOTE, STATUS, ICON, ",
31
         "NOTE, STATUS, ICON, ",
32
         "CREATED_AT, UPDATED_AT, ",
32
         "CREATED_AT, UPDATED_AT, ",
33
-        "DELETED_AT, CLIENT_ID, ",
34
-        "CLIENT_SECRET, REDIRECT_URI)",
33
+        "DELETED_AT)",
35
         "values (#{id,jdbcType=DECIMAL}, #{name,jdbcType=VARCHAR}, ",
34
         "values (#{id,jdbcType=DECIMAL}, #{name,jdbcType=VARCHAR}, ",
36
         "#{note,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL}, #{icon,jdbcType=VARCHAR}, ",
35
         "#{note,jdbcType=VARCHAR}, #{status,jdbcType=DECIMAL}, #{icon,jdbcType=VARCHAR}, ",
37
         "#{createdAt,jdbcType=DATE}, #{updatedAt,jdbcType=DATE}, ",
36
         "#{createdAt,jdbcType=DATE}, #{updatedAt,jdbcType=DATE}, ",
38
-        "#{deletedAt,jdbcType=DATE}, #{clientId,jdbcType=VARCHAR}, ",
39
-        "#{clientSecret,jdbcType=VARCHAR}, #{redirectUri,jdbcType=VARCHAR})"
37
+        "#{deletedAt,jdbcType=DATE})"
40
     })
38
     })
41
     int insert(App record);
39
     int insert(App record);
42
 
40
 
@@ -44,7 +42,7 @@ public interface AppMapper {
44
      * This method was generated by MyBatis Generator.
42
      * This method was generated by MyBatis Generator.
45
      * This method corresponds to the database table K_USER.K_APP
43
      * This method corresponds to the database table K_USER.K_APP
46
      *
44
      *
47
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
45
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
48
      */
46
      */
49
     int insertSelective(App record);
47
     int insertSelective(App record);
50
 
48
 
@@ -52,12 +50,11 @@ public interface AppMapper {
52
      * This method was generated by MyBatis Generator.
50
      * This method was generated by MyBatis Generator.
53
      * This method corresponds to the database table K_USER.K_APP
51
      * This method corresponds to the database table K_USER.K_APP
54
      *
52
      *
55
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
53
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
56
      */
54
      */
57
     @Select({
55
     @Select({
58
         "select",
56
         "select",
59
-        "ID, NAME, NOTE, STATUS, ICON, CREATED_AT, UPDATED_AT, DELETED_AT, CLIENT_ID, ",
60
-        "CLIENT_SECRET, REDIRECT_URI",
57
+        "ID, NAME, NOTE, STATUS, ICON, CREATED_AT, UPDATED_AT, DELETED_AT",
61
         "from K_USER.K_APP",
58
         "from K_USER.K_APP",
62
         "where ID = #{id,jdbcType=DECIMAL}"
59
         "where ID = #{id,jdbcType=DECIMAL}"
63
     })
60
     })
@@ -68,7 +65,7 @@ public interface AppMapper {
68
      * This method was generated by MyBatis Generator.
65
      * This method was generated by MyBatis Generator.
69
      * This method corresponds to the database table K_USER.K_APP
66
      * This method corresponds to the database table K_USER.K_APP
70
      *
67
      *
71
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
68
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
72
      */
69
      */
73
     int updateByPrimaryKeySelective(App record);
70
     int updateByPrimaryKeySelective(App record);
74
 
71
 
@@ -76,7 +73,7 @@ public interface AppMapper {
76
      * This method was generated by MyBatis Generator.
73
      * This method was generated by MyBatis Generator.
77
      * This method corresponds to the database table K_USER.K_APP
74
      * This method corresponds to the database table K_USER.K_APP
78
      *
75
      *
79
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
76
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
80
      */
77
      */
81
     @Update({
78
     @Update({
82
         "update K_USER.K_APP",
79
         "update K_USER.K_APP",
@@ -86,15 +83,8 @@ public interface AppMapper {
86
           "ICON = #{icon,jdbcType=VARCHAR},",
83
           "ICON = #{icon,jdbcType=VARCHAR},",
87
           "CREATED_AT = #{createdAt,jdbcType=DATE},",
84
           "CREATED_AT = #{createdAt,jdbcType=DATE},",
88
           "UPDATED_AT = #{updatedAt,jdbcType=DATE},",
85
           "UPDATED_AT = #{updatedAt,jdbcType=DATE},",
89
-          "DELETED_AT = #{deletedAt,jdbcType=DATE},",
90
-          "CLIENT_ID = #{clientId,jdbcType=VARCHAR},",
91
-          "CLIENT_SECRET = #{clientSecret,jdbcType=VARCHAR},",
92
-          "REDIRECT_URI = #{redirectUri,jdbcType=VARCHAR}",
86
+          "DELETED_AT = #{deletedAt,jdbcType=DATE}",
93
         "where ID = #{id,jdbcType=DECIMAL}"
87
         "where ID = #{id,jdbcType=DECIMAL}"
94
     })
88
     })
95
     int updateByPrimaryKey(App record);
89
     int updateByPrimaryKey(App record);
96
-
97
-
98
-    @Select({"select * from k_app where client_id=#{clientId}"})
99
-    App selectByClientId(String clientId);
100
 }
90
 }

+ 21 - 12
src/main/java/com/kingkong/bljs/dao/ClientMapper.java

@@ -12,7 +12,7 @@ public interface ClientMapper {
12
      * This method was generated by MyBatis Generator.
12
      * This method was generated by MyBatis Generator.
13
      * This method corresponds to the database table K_USER.K_CLIENT
13
      * This method corresponds to the database table K_USER.K_CLIENT
14
      *
14
      *
15
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
15
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
16
      */
16
      */
17
     @Delete({
17
     @Delete({
18
         "delete from K_USER.K_CLIENT",
18
         "delete from K_USER.K_CLIENT",
@@ -24,19 +24,19 @@ public interface ClientMapper {
24
      * This method was generated by MyBatis Generator.
24
      * This method was generated by MyBatis Generator.
25
      * This method corresponds to the database table K_USER.K_CLIENT
25
      * This method corresponds to the database table K_USER.K_CLIENT
26
      *
26
      *
27
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
27
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
28
      */
28
      */
29
     @Insert({
29
     @Insert({
30
         "insert into K_USER.K_CLIENT (CLIENT_ID, ID, ",
30
         "insert into K_USER.K_CLIENT (CLIENT_ID, ID, ",
31
         "NAME, CLIENT_SECRET, ",
31
         "NAME, CLIENT_SECRET, ",
32
         "REDIRECT_URI, CREATED_AT, ",
32
         "REDIRECT_URI, CREATED_AT, ",
33
         "UPDATED_AT, DELETED_AT, ",
33
         "UPDATED_AT, DELETED_AT, ",
34
-        "APP_ID)",
34
+        "APP_ID, TYPE)",
35
         "values (#{clientId,jdbcType=VARCHAR}, #{id,jdbcType=DECIMAL}, ",
35
         "values (#{clientId,jdbcType=VARCHAR}, #{id,jdbcType=DECIMAL}, ",
36
         "#{name,jdbcType=VARCHAR}, #{clientSecret,jdbcType=VARCHAR}, ",
36
         "#{name,jdbcType=VARCHAR}, #{clientSecret,jdbcType=VARCHAR}, ",
37
         "#{redirectUri,jdbcType=VARCHAR}, #{createdAt,jdbcType=DATE}, ",
37
         "#{redirectUri,jdbcType=VARCHAR}, #{createdAt,jdbcType=DATE}, ",
38
         "#{updatedAt,jdbcType=DATE}, #{deletedAt,jdbcType=DATE}, ",
38
         "#{updatedAt,jdbcType=DATE}, #{deletedAt,jdbcType=DATE}, ",
39
-        "#{appId,jdbcType=DECIMAL})"
39
+        "#{appId,jdbcType=DECIMAL}, #{type,jdbcType=DECIMAL})"
40
     })
40
     })
41
     int insert(Client record);
41
     int insert(Client record);
42
 
42
 
@@ -44,7 +44,7 @@ public interface ClientMapper {
44
      * This method was generated by MyBatis Generator.
44
      * This method was generated by MyBatis Generator.
45
      * This method corresponds to the database table K_USER.K_CLIENT
45
      * This method corresponds to the database table K_USER.K_CLIENT
46
      *
46
      *
47
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
47
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
48
      */
48
      */
49
     int insertSelective(Client record);
49
     int insertSelective(Client record);
50
 
50
 
@@ -52,12 +52,12 @@ public interface ClientMapper {
52
      * This method was generated by MyBatis Generator.
52
      * This method was generated by MyBatis Generator.
53
      * This method corresponds to the database table K_USER.K_CLIENT
53
      * This method corresponds to the database table K_USER.K_CLIENT
54
      *
54
      *
55
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
55
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
56
      */
56
      */
57
     @Select({
57
     @Select({
58
         "select",
58
         "select",
59
         "CLIENT_ID, ID, NAME, CLIENT_SECRET, REDIRECT_URI, CREATED_AT, UPDATED_AT, DELETED_AT, ",
59
         "CLIENT_ID, ID, NAME, CLIENT_SECRET, REDIRECT_URI, CREATED_AT, UPDATED_AT, DELETED_AT, ",
60
-        "APP_ID",
60
+        "APP_ID, TYPE",
61
         "from K_USER.K_CLIENT",
61
         "from K_USER.K_CLIENT",
62
         "where CLIENT_ID = #{clientId,jdbcType=VARCHAR}"
62
         "where CLIENT_ID = #{clientId,jdbcType=VARCHAR}"
63
     })
63
     })
@@ -68,7 +68,7 @@ public interface ClientMapper {
68
      * This method was generated by MyBatis Generator.
68
      * This method was generated by MyBatis Generator.
69
      * This method corresponds to the database table K_USER.K_CLIENT
69
      * This method corresponds to the database table K_USER.K_CLIENT
70
      *
70
      *
71
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
71
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
72
      */
72
      */
73
     int updateByPrimaryKeySelective(Client record);
73
     int updateByPrimaryKeySelective(Client record);
74
 
74
 
@@ -76,7 +76,7 @@ public interface ClientMapper {
76
      * This method was generated by MyBatis Generator.
76
      * This method was generated by MyBatis Generator.
77
      * This method corresponds to the database table K_USER.K_CLIENT
77
      * This method corresponds to the database table K_USER.K_CLIENT
78
      *
78
      *
79
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
79
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
80
      */
80
      */
81
     @Update({
81
     @Update({
82
         "update K_USER.K_CLIENT",
82
         "update K_USER.K_CLIENT",
@@ -87,11 +87,20 @@ public interface ClientMapper {
87
           "CREATED_AT = #{createdAt,jdbcType=DATE},",
87
           "CREATED_AT = #{createdAt,jdbcType=DATE},",
88
           "UPDATED_AT = #{updatedAt,jdbcType=DATE},",
88
           "UPDATED_AT = #{updatedAt,jdbcType=DATE},",
89
           "DELETED_AT = #{deletedAt,jdbcType=DATE},",
89
           "DELETED_AT = #{deletedAt,jdbcType=DATE},",
90
-          "APP_ID = #{appId,jdbcType=DECIMAL}",
90
+          "APP_ID = #{appId,jdbcType=DECIMAL},",
91
+          "TYPE = #{type,jdbcType=DECIMAL}",
91
         "where CLIENT_ID = #{clientId,jdbcType=VARCHAR}"
92
         "where CLIENT_ID = #{clientId,jdbcType=VARCHAR}"
92
     })
93
     })
93
     int updateByPrimaryKey(Client record);
94
     int updateByPrimaryKey(Client record);
94
 
95
 
95
-    @Select({"select * from k_client where client_id=#{clientId}"})
96
-    Client selectByClientId(String clientId);
96
+
97
+    @Select({
98
+            "select",
99
+            "CLIENT_ID, ID, NAME, CLIENT_SECRET, REDIRECT_URI, CREATED_AT, UPDATED_AT, DELETED_AT, ",
100
+            "APP_ID, TYPE",
101
+            "from K_USER.K_CLIENT",
102
+            "where app_id = #{appId,jdbcType=DECIMAL} and type=1"
103
+    })
104
+    @ResultMap("com.kingkong.bljs.dao.ClientMapper.BaseResultMap")
105
+    Client selectDefaultClient(String appId);
97
 }
106
 }

+ 18 - 84
src/main/java/com/kingkong/bljs/entity/App.java

@@ -8,7 +8,7 @@ public class App {
8
      * This field was generated by MyBatis Generator.
8
      * This field was generated by MyBatis Generator.
9
      * This field corresponds to the database column K_USER.K_APP.ID
9
      * This field corresponds to the database column K_USER.K_APP.ID
10
      *
10
      *
11
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
11
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
12
      */
12
      */
13
     private Integer id;
13
     private Integer id;
14
 
14
 
@@ -17,7 +17,7 @@ public class App {
17
      * This field was generated by MyBatis Generator.
17
      * This field was generated by MyBatis Generator.
18
      * This field corresponds to the database column K_USER.K_APP.NAME
18
      * This field corresponds to the database column K_USER.K_APP.NAME
19
      *
19
      *
20
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
20
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
21
      */
21
      */
22
     private String name;
22
     private String name;
23
 
23
 
@@ -26,7 +26,7 @@ public class App {
26
      * This field was generated by MyBatis Generator.
26
      * This field was generated by MyBatis Generator.
27
      * This field corresponds to the database column K_USER.K_APP.NOTE
27
      * This field corresponds to the database column K_USER.K_APP.NOTE
28
      *
28
      *
29
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
29
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
30
      */
30
      */
31
     private String note;
31
     private String note;
32
 
32
 
@@ -35,7 +35,7 @@ public class App {
35
      * This field was generated by MyBatis Generator.
35
      * This field was generated by MyBatis Generator.
36
      * This field corresponds to the database column K_USER.K_APP.STATUS
36
      * This field corresponds to the database column K_USER.K_APP.STATUS
37
      *
37
      *
38
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
38
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
39
      */
39
      */
40
     private Short status;
40
     private Short status;
41
 
41
 
@@ -44,7 +44,7 @@ public class App {
44
      * This field was generated by MyBatis Generator.
44
      * This field was generated by MyBatis Generator.
45
      * This field corresponds to the database column K_USER.K_APP.ICON
45
      * This field corresponds to the database column K_USER.K_APP.ICON
46
      *
46
      *
47
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
47
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
48
      */
48
      */
49
     private String icon;
49
     private String icon;
50
 
50
 
@@ -53,7 +53,7 @@ public class App {
53
      * This field was generated by MyBatis Generator.
53
      * This field was generated by MyBatis Generator.
54
      * This field corresponds to the database column K_USER.K_APP.CREATED_AT
54
      * This field corresponds to the database column K_USER.K_APP.CREATED_AT
55
      *
55
      *
56
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
56
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
57
      */
57
      */
58
     private Date createdAt;
58
     private Date createdAt;
59
 
59
 
@@ -62,7 +62,7 @@ public class App {
62
      * This field was generated by MyBatis Generator.
62
      * This field was generated by MyBatis Generator.
63
      * This field corresponds to the database column K_USER.K_APP.UPDATED_AT
63
      * This field corresponds to the database column K_USER.K_APP.UPDATED_AT
64
      *
64
      *
65
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
65
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
66
      */
66
      */
67
     private Date updatedAt;
67
     private Date updatedAt;
68
 
68
 
@@ -71,44 +71,17 @@ public class App {
71
      * This field was generated by MyBatis Generator.
71
      * This field was generated by MyBatis Generator.
72
      * This field corresponds to the database column K_USER.K_APP.DELETED_AT
72
      * This field corresponds to the database column K_USER.K_APP.DELETED_AT
73
      *
73
      *
74
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
74
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
75
      */
75
      */
76
     private Date deletedAt;
76
     private Date deletedAt;
77
 
77
 
78
-    /**
79
-     *
80
-     * This field was generated by MyBatis Generator.
81
-     * This field corresponds to the database column K_USER.K_APP.CLIENT_ID
82
-     *
83
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
84
-     */
85
-    private String clientId;
86
-
87
-    /**
88
-     *
89
-     * This field was generated by MyBatis Generator.
90
-     * This field corresponds to the database column K_USER.K_APP.CLIENT_SECRET
91
-     *
92
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
93
-     */
94
-    private String clientSecret;
95
-
96
-    /**
97
-     *
98
-     * This field was generated by MyBatis Generator.
99
-     * This field corresponds to the database column K_USER.K_APP.REDIRECT_URI
100
-     *
101
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
102
-     */
103
-    private String redirectUri;
104
-
105
     /**
78
     /**
106
      * This method was generated by MyBatis Generator.
79
      * This method was generated by MyBatis Generator.
107
      * This method corresponds to the database table K_USER.K_APP
80
      * This method corresponds to the database table K_USER.K_APP
108
      *
81
      *
109
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
82
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
110
      */
83
      */
111
-    public App(Integer id, String name, String note, Short status, String icon, Date createdAt, Date updatedAt, Date deletedAt, String clientId, String clientSecret, String redirectUri) {
84
+    public App(Integer id, String name, String note, Short status, String icon, Date createdAt, Date updatedAt, Date deletedAt) {
112
         this.id = id;
85
         this.id = id;
113
         this.name = name;
86
         this.name = name;
114
         this.note = note;
87
         this.note = note;
@@ -117,9 +90,6 @@ public class App {
117
         this.createdAt = createdAt;
90
         this.createdAt = createdAt;
118
         this.updatedAt = updatedAt;
91
         this.updatedAt = updatedAt;
119
         this.deletedAt = deletedAt;
92
         this.deletedAt = deletedAt;
120
-        this.clientId = clientId;
121
-        this.clientSecret = clientSecret;
122
-        this.redirectUri = redirectUri;
123
     }
93
     }
124
 
94
 
125
     /**
95
     /**
@@ -128,7 +98,7 @@ public class App {
128
      *
98
      *
129
      * @return the value of K_USER.K_APP.ID
99
      * @return the value of K_USER.K_APP.ID
130
      *
100
      *
131
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
101
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
132
      */
102
      */
133
     public Integer getId() {
103
     public Integer getId() {
134
         return id;
104
         return id;
@@ -140,7 +110,7 @@ public class App {
140
      *
110
      *
141
      * @return the value of K_USER.K_APP.NAME
111
      * @return the value of K_USER.K_APP.NAME
142
      *
112
      *
143
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
113
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
144
      */
114
      */
145
     public String getName() {
115
     public String getName() {
146
         return name;
116
         return name;
@@ -152,7 +122,7 @@ public class App {
152
      *
122
      *
153
      * @return the value of K_USER.K_APP.NOTE
123
      * @return the value of K_USER.K_APP.NOTE
154
      *
124
      *
155
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
125
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
156
      */
126
      */
157
     public String getNote() {
127
     public String getNote() {
158
         return note;
128
         return note;
@@ -164,7 +134,7 @@ public class App {
164
      *
134
      *
165
      * @return the value of K_USER.K_APP.STATUS
135
      * @return the value of K_USER.K_APP.STATUS
166
      *
136
      *
167
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
137
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
168
      */
138
      */
169
     public Short getStatus() {
139
     public Short getStatus() {
170
         return status;
140
         return status;
@@ -176,7 +146,7 @@ public class App {
176
      *
146
      *
177
      * @return the value of K_USER.K_APP.ICON
147
      * @return the value of K_USER.K_APP.ICON
178
      *
148
      *
179
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
149
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
180
      */
150
      */
181
     public String getIcon() {
151
     public String getIcon() {
182
         return icon;
152
         return icon;
@@ -188,7 +158,7 @@ public class App {
188
      *
158
      *
189
      * @return the value of K_USER.K_APP.CREATED_AT
159
      * @return the value of K_USER.K_APP.CREATED_AT
190
      *
160
      *
191
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
161
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
192
      */
162
      */
193
     public Date getCreatedAt() {
163
     public Date getCreatedAt() {
194
         return createdAt;
164
         return createdAt;
@@ -200,7 +170,7 @@ public class App {
200
      *
170
      *
201
      * @return the value of K_USER.K_APP.UPDATED_AT
171
      * @return the value of K_USER.K_APP.UPDATED_AT
202
      *
172
      *
203
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
173
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
204
      */
174
      */
205
     public Date getUpdatedAt() {
175
     public Date getUpdatedAt() {
206
         return updatedAt;
176
         return updatedAt;
@@ -212,45 +182,9 @@ public class App {
212
      *
182
      *
213
      * @return the value of K_USER.K_APP.DELETED_AT
183
      * @return the value of K_USER.K_APP.DELETED_AT
214
      *
184
      *
215
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
185
+     * @mbg.generated Mon May 27 17:44:13 CST 2019
216
      */
186
      */
217
     public Date getDeletedAt() {
187
     public Date getDeletedAt() {
218
         return deletedAt;
188
         return deletedAt;
219
     }
189
     }
220
-
221
-    /**
222
-     * This method was generated by MyBatis Generator.
223
-     * This method returns the value of the database column K_USER.K_APP.CLIENT_ID
224
-     *
225
-     * @return the value of K_USER.K_APP.CLIENT_ID
226
-     *
227
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
228
-     */
229
-    public String getClientId() {
230
-        return clientId;
231
-    }
232
-
233
-    /**
234
-     * This method was generated by MyBatis Generator.
235
-     * This method returns the value of the database column K_USER.K_APP.CLIENT_SECRET
236
-     *
237
-     * @return the value of K_USER.K_APP.CLIENT_SECRET
238
-     *
239
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
240
-     */
241
-    public String getClientSecret() {
242
-        return clientSecret;
243
-    }
244
-
245
-    /**
246
-     * This method was generated by MyBatis Generator.
247
-     * This method returns the value of the database column K_USER.K_APP.REDIRECT_URI
248
-     *
249
-     * @return the value of K_USER.K_APP.REDIRECT_URI
250
-     *
251
-     * @mbg.generated Fri May 24 16:36:22 CST 2019
252
-     */
253
-    public String getRedirectUri() {
254
-        return redirectUri;
255
-    }
256
 }
190
 }

+ 42 - 20
src/main/java/com/kingkong/bljs/entity/Client.java

@@ -8,7 +8,7 @@ public class Client {
8
      * This field was generated by MyBatis Generator.
8
      * This field was generated by MyBatis Generator.
9
      * This field corresponds to the database column K_USER.K_CLIENT.CLIENT_ID
9
      * This field corresponds to the database column K_USER.K_CLIENT.CLIENT_ID
10
      *
10
      *
11
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
11
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
12
      */
12
      */
13
     private String clientId;
13
     private String clientId;
14
 
14
 
@@ -17,7 +17,7 @@ public class Client {
17
      * This field was generated by MyBatis Generator.
17
      * This field was generated by MyBatis Generator.
18
      * This field corresponds to the database column K_USER.K_CLIENT.ID
18
      * This field corresponds to the database column K_USER.K_CLIENT.ID
19
      *
19
      *
20
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
20
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
21
      */
21
      */
22
     private Integer id;
22
     private Integer id;
23
 
23
 
@@ -26,7 +26,7 @@ public class Client {
26
      * This field was generated by MyBatis Generator.
26
      * This field was generated by MyBatis Generator.
27
      * This field corresponds to the database column K_USER.K_CLIENT.NAME
27
      * This field corresponds to the database column K_USER.K_CLIENT.NAME
28
      *
28
      *
29
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
29
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
30
      */
30
      */
31
     private String name;
31
     private String name;
32
 
32
 
@@ -35,7 +35,7 @@ public class Client {
35
      * This field was generated by MyBatis Generator.
35
      * This field was generated by MyBatis Generator.
36
      * This field corresponds to the database column K_USER.K_CLIENT.CLIENT_SECRET
36
      * This field corresponds to the database column K_USER.K_CLIENT.CLIENT_SECRET
37
      *
37
      *
38
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
38
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
39
      */
39
      */
40
     private String clientSecret;
40
     private String clientSecret;
41
 
41
 
@@ -44,7 +44,7 @@ public class Client {
44
      * This field was generated by MyBatis Generator.
44
      * This field was generated by MyBatis Generator.
45
      * This field corresponds to the database column K_USER.K_CLIENT.REDIRECT_URI
45
      * This field corresponds to the database column K_USER.K_CLIENT.REDIRECT_URI
46
      *
46
      *
47
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
47
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
48
      */
48
      */
49
     private String redirectUri;
49
     private String redirectUri;
50
 
50
 
@@ -53,7 +53,7 @@ public class Client {
53
      * This field was generated by MyBatis Generator.
53
      * This field was generated by MyBatis Generator.
54
      * This field corresponds to the database column K_USER.K_CLIENT.CREATED_AT
54
      * This field corresponds to the database column K_USER.K_CLIENT.CREATED_AT
55
      *
55
      *
56
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
56
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
57
      */
57
      */
58
     private Date createdAt;
58
     private Date createdAt;
59
 
59
 
@@ -62,7 +62,7 @@ public class Client {
62
      * This field was generated by MyBatis Generator.
62
      * This field was generated by MyBatis Generator.
63
      * This field corresponds to the database column K_USER.K_CLIENT.UPDATED_AT
63
      * This field corresponds to the database column K_USER.K_CLIENT.UPDATED_AT
64
      *
64
      *
65
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
65
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
66
      */
66
      */
67
     private Date updatedAt;
67
     private Date updatedAt;
68
 
68
 
@@ -71,7 +71,7 @@ public class Client {
71
      * This field was generated by MyBatis Generator.
71
      * This field was generated by MyBatis Generator.
72
      * This field corresponds to the database column K_USER.K_CLIENT.DELETED_AT
72
      * This field corresponds to the database column K_USER.K_CLIENT.DELETED_AT
73
      *
73
      *
74
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
74
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
75
      */
75
      */
76
     private Date deletedAt;
76
     private Date deletedAt;
77
 
77
 
@@ -80,17 +80,26 @@ public class Client {
80
      * This field was generated by MyBatis Generator.
80
      * This field was generated by MyBatis Generator.
81
      * This field corresponds to the database column K_USER.K_CLIENT.APP_ID
81
      * This field corresponds to the database column K_USER.K_CLIENT.APP_ID
82
      *
82
      *
83
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
83
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
84
      */
84
      */
85
     private Integer appId;
85
     private Integer appId;
86
 
86
 
87
+    /**
88
+     *
89
+     * This field was generated by MyBatis Generator.
90
+     * This field corresponds to the database column K_USER.K_CLIENT.TYPE
91
+     *
92
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
93
+     */
94
+    private Short type;
95
+
87
     /**
96
     /**
88
      * This method was generated by MyBatis Generator.
97
      * This method was generated by MyBatis Generator.
89
      * This method corresponds to the database table K_USER.K_CLIENT
98
      * This method corresponds to the database table K_USER.K_CLIENT
90
      *
99
      *
91
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
100
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
92
      */
101
      */
93
-    public Client(String clientId, Integer id, String name, String clientSecret, String redirectUri, Date createdAt, Date updatedAt, Date deletedAt, Integer appId) {
102
+    public Client(String clientId, Integer id, String name, String clientSecret, String redirectUri, Date createdAt, Date updatedAt, Date deletedAt, Integer appId, Short type) {
94
         this.clientId = clientId;
103
         this.clientId = clientId;
95
         this.id = id;
104
         this.id = id;
96
         this.name = name;
105
         this.name = name;
@@ -100,6 +109,7 @@ public class Client {
100
         this.updatedAt = updatedAt;
109
         this.updatedAt = updatedAt;
101
         this.deletedAt = deletedAt;
110
         this.deletedAt = deletedAt;
102
         this.appId = appId;
111
         this.appId = appId;
112
+        this.type = type;
103
     }
113
     }
104
 
114
 
105
     /**
115
     /**
@@ -108,7 +118,7 @@ public class Client {
108
      *
118
      *
109
      * @return the value of K_USER.K_CLIENT.CLIENT_ID
119
      * @return the value of K_USER.K_CLIENT.CLIENT_ID
110
      *
120
      *
111
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
121
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
112
      */
122
      */
113
     public String getClientId() {
123
     public String getClientId() {
114
         return clientId;
124
         return clientId;
@@ -120,7 +130,7 @@ public class Client {
120
      *
130
      *
121
      * @return the value of K_USER.K_CLIENT.ID
131
      * @return the value of K_USER.K_CLIENT.ID
122
      *
132
      *
123
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
133
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
124
      */
134
      */
125
     public Integer getId() {
135
     public Integer getId() {
126
         return id;
136
         return id;
@@ -132,7 +142,7 @@ public class Client {
132
      *
142
      *
133
      * @return the value of K_USER.K_CLIENT.NAME
143
      * @return the value of K_USER.K_CLIENT.NAME
134
      *
144
      *
135
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
145
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
136
      */
146
      */
137
     public String getName() {
147
     public String getName() {
138
         return name;
148
         return name;
@@ -144,7 +154,7 @@ public class Client {
144
      *
154
      *
145
      * @return the value of K_USER.K_CLIENT.CLIENT_SECRET
155
      * @return the value of K_USER.K_CLIENT.CLIENT_SECRET
146
      *
156
      *
147
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
157
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
148
      */
158
      */
149
     public String getClientSecret() {
159
     public String getClientSecret() {
150
         return clientSecret;
160
         return clientSecret;
@@ -156,7 +166,7 @@ public class Client {
156
      *
166
      *
157
      * @return the value of K_USER.K_CLIENT.REDIRECT_URI
167
      * @return the value of K_USER.K_CLIENT.REDIRECT_URI
158
      *
168
      *
159
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
169
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
160
      */
170
      */
161
     public String getRedirectUri() {
171
     public String getRedirectUri() {
162
         return redirectUri;
172
         return redirectUri;
@@ -168,7 +178,7 @@ public class Client {
168
      *
178
      *
169
      * @return the value of K_USER.K_CLIENT.CREATED_AT
179
      * @return the value of K_USER.K_CLIENT.CREATED_AT
170
      *
180
      *
171
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
181
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
172
      */
182
      */
173
     public Date getCreatedAt() {
183
     public Date getCreatedAt() {
174
         return createdAt;
184
         return createdAt;
@@ -180,7 +190,7 @@ public class Client {
180
      *
190
      *
181
      * @return the value of K_USER.K_CLIENT.UPDATED_AT
191
      * @return the value of K_USER.K_CLIENT.UPDATED_AT
182
      *
192
      *
183
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
193
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
184
      */
194
      */
185
     public Date getUpdatedAt() {
195
     public Date getUpdatedAt() {
186
         return updatedAt;
196
         return updatedAt;
@@ -192,7 +202,7 @@ public class Client {
192
      *
202
      *
193
      * @return the value of K_USER.K_CLIENT.DELETED_AT
203
      * @return the value of K_USER.K_CLIENT.DELETED_AT
194
      *
204
      *
195
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
205
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
196
      */
206
      */
197
     public Date getDeletedAt() {
207
     public Date getDeletedAt() {
198
         return deletedAt;
208
         return deletedAt;
@@ -204,9 +214,21 @@ public class Client {
204
      *
214
      *
205
      * @return the value of K_USER.K_CLIENT.APP_ID
215
      * @return the value of K_USER.K_CLIENT.APP_ID
206
      *
216
      *
207
-     * @mbg.generated Mon May 27 16:39:18 CST 2019
217
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
208
      */
218
      */
209
     public Integer getAppId() {
219
     public Integer getAppId() {
210
         return appId;
220
         return appId;
211
     }
221
     }
222
+
223
+    /**
224
+     * This method was generated by MyBatis Generator.
225
+     * This method returns the value of the database column K_USER.K_CLIENT.TYPE
226
+     *
227
+     * @return the value of K_USER.K_CLIENT.TYPE
228
+     *
229
+     * @mbg.generated Mon May 27 17:34:01 CST 2019
230
+     */
231
+    public Short getType() {
232
+        return type;
233
+    }
212
 }
234
 }

+ 2 - 2
src/main/java/com/kingkong/bljs/security/CustomClientDetailService.java

@@ -22,14 +22,14 @@ public class CustomClientDetailService implements ClientDetailsService {
22
     @Override
22
     @Override
23
     public ClientDetails loadClientByClientId(String s) throws ClientRegistrationException {
23
     public ClientDetails loadClientByClientId(String s) throws ClientRegistrationException {
24
 
24
 
25
-        Client client = clientMapper.selectByClientId(s);
25
+        Client client = clientMapper.selectByPrimaryKey(s);
26
 
26
 
27
         if(null == client)
27
         if(null == client)
28
             throw new ClientRegistrationException("incorrect client id");
28
             throw new ClientRegistrationException("incorrect client id");
29
 
29
 
30
         BaseClientDetails clientDetails = new BaseClientDetails();
30
         BaseClientDetails clientDetails = new BaseClientDetails();
31
         clientDetails.setClientId(s);
31
         clientDetails.setClientId(s);
32
-        clientDetails.setClientSecret("{noop}" + client.getClientId());
32
+        clientDetails.setClientSecret("{noop}" + client.getClientSecret());
33
         clientDetails.setAuthorizedGrantTypes(Arrays.asList("authorization_code","client_credentials", "refresh_token", "password", "implicit"));
33
         clientDetails.setAuthorizedGrantTypes(Arrays.asList("authorization_code","client_credentials", "refresh_token", "password", "implicit"));
34
         clientDetails.setScope(Arrays.asList("*","all"));
34
         clientDetails.setScope(Arrays.asList("*","all"));
35
         Set<String> uris = new HashSet<>();
35
         Set<String> uris = new HashSet<>();

+ 3 - 0
src/main/java/com/kingkong/bljs/security/CustomUserDetailsService.java

@@ -39,6 +39,9 @@ public class CustomUserDetailsService implements UserDetailsService {
39
     @Value("${app.default.app_id}")
39
     @Value("${app.default.app_id}")
40
     private String default_app_id;
40
     private String default_app_id;
41
 
41
 
42
+    @Autowired
43
+    private CustomAuthenticationDetailsSource customAuthenticationDetailsSource;
44
+
42
 
45
 
43
 
46
 
44
     @Override
47
     @Override

+ 1 - 1
src/main/resources/generatorConfig.xml

@@ -87,7 +87,7 @@
87
 
87
 
88
 
88
 
89
 
89
 
90
-        <table tableName="k_client" schema="k_user" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
90
+        <table tableName="k_app" schema="k_user" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
91
                enableSelectByExample="false" selectByExampleQueryId="false">
91
                enableSelectByExample="false" selectByExampleQueryId="false">
92
 
92
 
93
             <!-- optional   , only for mybatis3 runtime
93
             <!-- optional   , only for mybatis3 runtime

+ 5 - 36
src/main/resources/mapper/AppMapper.xml

@@ -5,7 +5,7 @@
5
     <!--
5
     <!--
6
       WARNING - @mbg.generated
6
       WARNING - @mbg.generated
7
       This element is automatically generated by MyBatis Generator, do not modify.
7
       This element is automatically generated by MyBatis Generator, do not modify.
8
-      This element was generated on Fri May 24 16:36:22 CST 2019.
8
+      This element was generated on Mon May 27 17:44:13 CST 2019.
9
     -->
9
     -->
10
     <constructor>
10
     <constructor>
11
       <idArg column="ID" javaType="java.lang.Integer" jdbcType="DECIMAL" />
11
       <idArg column="ID" javaType="java.lang.Integer" jdbcType="DECIMAL" />
@@ -16,25 +16,21 @@
16
       <arg column="CREATED_AT" javaType="java.util.Date" jdbcType="DATE" />
16
       <arg column="CREATED_AT" javaType="java.util.Date" jdbcType="DATE" />
17
       <arg column="UPDATED_AT" javaType="java.util.Date" jdbcType="DATE" />
17
       <arg column="UPDATED_AT" javaType="java.util.Date" jdbcType="DATE" />
18
       <arg column="DELETED_AT" javaType="java.util.Date" jdbcType="DATE" />
18
       <arg column="DELETED_AT" javaType="java.util.Date" jdbcType="DATE" />
19
-      <arg column="CLIENT_ID" javaType="java.lang.String" jdbcType="VARCHAR" />
20
-      <arg column="CLIENT_SECRET" javaType="java.lang.String" jdbcType="VARCHAR" />
21
-      <arg column="REDIRECT_URI" javaType="java.lang.String" jdbcType="VARCHAR" />
22
     </constructor>
19
     </constructor>
23
   </resultMap>
20
   </resultMap>
24
   <sql id="Base_Column_List">
21
   <sql id="Base_Column_List">
25
     <!--
22
     <!--
26
       WARNING - @mbg.generated
23
       WARNING - @mbg.generated
27
       This element is automatically generated by MyBatis Generator, do not modify.
24
       This element is automatically generated by MyBatis Generator, do not modify.
28
-      This element was generated on Fri May 24 16:36:22 CST 2019.
25
+      This element was generated on Mon May 27 17:44:13 CST 2019.
29
     -->
26
     -->
30
-    ID, NAME, NOTE, STATUS, ICON, CREATED_AT, UPDATED_AT, DELETED_AT, CLIENT_ID, CLIENT_SECRET, 
31
-    REDIRECT_URI
27
+    ID, NAME, NOTE, STATUS, ICON, CREATED_AT, UPDATED_AT, DELETED_AT
32
   </sql>
28
   </sql>
33
   <insert id="insertSelective" parameterType="com.kingkong.bljs.entity.App">
29
   <insert id="insertSelective" parameterType="com.kingkong.bljs.entity.App">
34
     <!--
30
     <!--
35
       WARNING - @mbg.generated
31
       WARNING - @mbg.generated
36
       This element is automatically generated by MyBatis Generator, do not modify.
32
       This element is automatically generated by MyBatis Generator, do not modify.
37
-      This element was generated on Fri May 24 16:36:22 CST 2019.
33
+      This element was generated on Mon May 27 17:44:13 CST 2019.
38
     -->
34
     -->
39
     insert into K_USER.K_APP
35
     insert into K_USER.K_APP
40
     <trim prefix="(" suffix=")" suffixOverrides=",">
36
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -62,15 +58,6 @@
62
       <if test="deletedAt != null">
58
       <if test="deletedAt != null">
63
         DELETED_AT,
59
         DELETED_AT,
64
       </if>
60
       </if>
65
-      <if test="clientId != null">
66
-        CLIENT_ID,
67
-      </if>
68
-      <if test="clientSecret != null">
69
-        CLIENT_SECRET,
70
-      </if>
71
-      <if test="redirectUri != null">
72
-        REDIRECT_URI,
73
-      </if>
74
     </trim>
61
     </trim>
75
     <trim prefix="values (" suffix=")" suffixOverrides=",">
62
     <trim prefix="values (" suffix=")" suffixOverrides=",">
76
       <if test="id != null">
63
       <if test="id != null">
@@ -97,22 +84,13 @@
97
       <if test="deletedAt != null">
84
       <if test="deletedAt != null">
98
         #{deletedAt,jdbcType=DATE},
85
         #{deletedAt,jdbcType=DATE},
99
       </if>
86
       </if>
100
-      <if test="clientId != null">
101
-        #{clientId,jdbcType=VARCHAR},
102
-      </if>
103
-      <if test="clientSecret != null">
104
-        #{clientSecret,jdbcType=VARCHAR},
105
-      </if>
106
-      <if test="redirectUri != null">
107
-        #{redirectUri,jdbcType=VARCHAR},
108
-      </if>
109
     </trim>
87
     </trim>
110
   </insert>
88
   </insert>
111
   <update id="updateByPrimaryKeySelective" parameterType="com.kingkong.bljs.entity.App">
89
   <update id="updateByPrimaryKeySelective" parameterType="com.kingkong.bljs.entity.App">
112
     <!--
90
     <!--
113
       WARNING - @mbg.generated
91
       WARNING - @mbg.generated
114
       This element is automatically generated by MyBatis Generator, do not modify.
92
       This element is automatically generated by MyBatis Generator, do not modify.
115
-      This element was generated on Fri May 24 16:36:22 CST 2019.
93
+      This element was generated on Mon May 27 17:44:13 CST 2019.
116
     -->
94
     -->
117
     update K_USER.K_APP
95
     update K_USER.K_APP
118
     <set>
96
     <set>
@@ -137,15 +115,6 @@
137
       <if test="deletedAt != null">
115
       <if test="deletedAt != null">
138
         DELETED_AT = #{deletedAt,jdbcType=DATE},
116
         DELETED_AT = #{deletedAt,jdbcType=DATE},
139
       </if>
117
       </if>
140
-      <if test="clientId != null">
141
-        CLIENT_ID = #{clientId,jdbcType=VARCHAR},
142
-      </if>
143
-      <if test="clientSecret != null">
144
-        CLIENT_SECRET = #{clientSecret,jdbcType=VARCHAR},
145
-      </if>
146
-      <if test="redirectUri != null">
147
-        REDIRECT_URI = #{redirectUri,jdbcType=VARCHAR},
148
-      </if>
149
     </set>
118
     </set>
150
     where ID = #{id,jdbcType=DECIMAL}
119
     where ID = #{id,jdbcType=DECIMAL}
151
   </update>
120
   </update>

+ 15 - 5
src/main/resources/mapper/ClientMapper.xml

@@ -5,7 +5,7 @@
5
     <!--
5
     <!--
6
       WARNING - @mbg.generated
6
       WARNING - @mbg.generated
7
       This element is automatically generated by MyBatis Generator, do not modify.
7
       This element is automatically generated by MyBatis Generator, do not modify.
8
-      This element was generated on Mon May 27 16:39:18 CST 2019.
8
+      This element was generated on Mon May 27 17:34:01 CST 2019.
9
     -->
9
     -->
10
     <constructor>
10
     <constructor>
11
       <idArg column="CLIENT_ID" javaType="java.lang.String" jdbcType="VARCHAR" />
11
       <idArg column="CLIENT_ID" javaType="java.lang.String" jdbcType="VARCHAR" />
@@ -17,22 +17,23 @@
17
       <arg column="UPDATED_AT" javaType="java.util.Date" jdbcType="DATE" />
17
       <arg column="UPDATED_AT" javaType="java.util.Date" jdbcType="DATE" />
18
       <arg column="DELETED_AT" javaType="java.util.Date" jdbcType="DATE" />
18
       <arg column="DELETED_AT" javaType="java.util.Date" jdbcType="DATE" />
19
       <arg column="APP_ID" javaType="java.lang.Integer" jdbcType="DECIMAL" />
19
       <arg column="APP_ID" javaType="java.lang.Integer" jdbcType="DECIMAL" />
20
+      <arg column="TYPE" javaType="java.lang.Short" jdbcType="DECIMAL" />
20
     </constructor>
21
     </constructor>
21
   </resultMap>
22
   </resultMap>
22
   <sql id="Base_Column_List">
23
   <sql id="Base_Column_List">
23
     <!--
24
     <!--
24
       WARNING - @mbg.generated
25
       WARNING - @mbg.generated
25
       This element is automatically generated by MyBatis Generator, do not modify.
26
       This element is automatically generated by MyBatis Generator, do not modify.
26
-      This element was generated on Mon May 27 16:39:18 CST 2019.
27
+      This element was generated on Mon May 27 17:34:01 CST 2019.
27
     -->
28
     -->
28
     CLIENT_ID, ID, NAME, CLIENT_SECRET, REDIRECT_URI, CREATED_AT, UPDATED_AT, DELETED_AT, 
29
     CLIENT_ID, ID, NAME, CLIENT_SECRET, REDIRECT_URI, CREATED_AT, UPDATED_AT, DELETED_AT, 
29
-    APP_ID
30
+    APP_ID, TYPE
30
   </sql>
31
   </sql>
31
   <insert id="insertSelective" parameterType="com.kingkong.bljs.entity.Client">
32
   <insert id="insertSelective" parameterType="com.kingkong.bljs.entity.Client">
32
     <!--
33
     <!--
33
       WARNING - @mbg.generated
34
       WARNING - @mbg.generated
34
       This element is automatically generated by MyBatis Generator, do not modify.
35
       This element is automatically generated by MyBatis Generator, do not modify.
35
-      This element was generated on Mon May 27 16:39:18 CST 2019.
36
+      This element was generated on Mon May 27 17:34:01 CST 2019.
36
     -->
37
     -->
37
     insert into K_USER.K_CLIENT
38
     insert into K_USER.K_CLIENT
38
     <trim prefix="(" suffix=")" suffixOverrides=",">
39
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -63,6 +64,9 @@
63
       <if test="appId != null">
64
       <if test="appId != null">
64
         APP_ID,
65
         APP_ID,
65
       </if>
66
       </if>
67
+      <if test="type != null">
68
+        TYPE,
69
+      </if>
66
     </trim>
70
     </trim>
67
     <trim prefix="values (" suffix=")" suffixOverrides=",">
71
     <trim prefix="values (" suffix=")" suffixOverrides=",">
68
       <if test="clientId != null">
72
       <if test="clientId != null">
@@ -92,13 +96,16 @@
92
       <if test="appId != null">
96
       <if test="appId != null">
93
         #{appId,jdbcType=DECIMAL},
97
         #{appId,jdbcType=DECIMAL},
94
       </if>
98
       </if>
99
+      <if test="type != null">
100
+        #{type,jdbcType=DECIMAL},
101
+      </if>
95
     </trim>
102
     </trim>
96
   </insert>
103
   </insert>
97
   <update id="updateByPrimaryKeySelective" parameterType="com.kingkong.bljs.entity.Client">
104
   <update id="updateByPrimaryKeySelective" parameterType="com.kingkong.bljs.entity.Client">
98
     <!--
105
     <!--
99
       WARNING - @mbg.generated
106
       WARNING - @mbg.generated
100
       This element is automatically generated by MyBatis Generator, do not modify.
107
       This element is automatically generated by MyBatis Generator, do not modify.
101
-      This element was generated on Mon May 27 16:39:18 CST 2019.
108
+      This element was generated on Mon May 27 17:34:01 CST 2019.
102
     -->
109
     -->
103
     update K_USER.K_CLIENT
110
     update K_USER.K_CLIENT
104
     <set>
111
     <set>
@@ -126,6 +133,9 @@
126
       <if test="appId != null">
133
       <if test="appId != null">
127
         APP_ID = #{appId,jdbcType=DECIMAL},
134
         APP_ID = #{appId,jdbcType=DECIMAL},
128
       </if>
135
       </if>
136
+      <if test="type != null">
137
+        TYPE = #{type,jdbcType=DECIMAL},
138
+      </if>
129
     </set>
139
     </set>
130
     where CLIENT_ID = #{clientId,jdbcType=VARCHAR}
140
     where CLIENT_ID = #{clientId,jdbcType=VARCHAR}
131
   </update>
141
   </update>