Skip to content

Commit 3caca0e

Browse files
committed
修改用户登录逻辑
合并第三方登录逻辑代码块
1 parent a8d4a93 commit 3caca0e

File tree

18 files changed

+316
-256
lines changed

18 files changed

+316
-256
lines changed

springboot-dubbo-api/src/main/java/com/lzq/api/dto/AccountResult.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public class AccountResult implements Serializable{
4545
*/
4646
@TableField(value = "contact_email")
4747
@JsonProperty("contactEmail")
48-
private String contactEmail;
48+
private String contactEmail="";
4949
/**
5050
* 密码
5151
*/
@@ -81,7 +81,7 @@ public class AccountResult implements Serializable{
8181
*/
8282
@TableField("description")
8383
@JsonProperty("description")
84-
private String description;
84+
private String description="";
8585
/**
8686
* 作品数
8787
*/

springboot-dubbo-api/src/main/java/com/lzq/api/pojo/Account.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ public class Account implements Serializable, UserDetails {
7575
* github主键id
7676
*/
7777
@TableField(value = "github_id")
78-
@JsonIgnore
78+
@JsonProperty("githubId")
7979
private String githubId;
8080
/**
8181
* gitee主键id
8282
*/
8383
@TableField(value = "gitee_id")
84-
@JsonIgnore
84+
@JsonProperty("giteeId")
8585
private String giteeId;
8686
/**
8787
* 角色id

springboot-dubbo-api/src/main/java/com/lzq/api/pojo/UserInfo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ public class UserInfo implements Serializable {
1919
private static final long serialVersionUID = 8560308483184278887L;
2020

2121
//用户id
22-
private Integer id;
22+
private String id;
2323
}

springboot-dubbo-api/src/main/java/com/lzq/api/service/AccountService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ public interface AccountService {
3333
*/
3434
Boolean update(Account account) throws Exception;
3535

36+
37+
/**
38+
* 绑定第三方id
39+
*/
40+
Boolean bindGit(Account account);
41+
3642
/**
3743
* 增加作品数
3844
* @param username

springboot-dubbo-service/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183

184184
<build>
185185
<!-- 包名称 -->
186-
<finalName>dubbo-service</finalName>
186+
<finalName>onlineidea-service</finalName>
187187
<plugins>
188188
<plugin>
189189
<groupId>org.springframework.boot</groupId>

springboot-dubbo-service/src/main/java/com/lzq/dubboservice/mapper/AccountMapper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ public interface AccountMapper extends BaseMapper<Account> {
2424
Integer increaseRecycle(@Param("username") String username);
2525

2626
Integer reduceRecycle(@Param("username") String username);
27+
28+
Integer bindGit(Account account);
2729
}

springboot-dubbo-service/src/main/java/com/lzq/dubboservice/service/AccountServiceImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ public Boolean update(Account account) throws NullPointerException {
4848
return baseMapper.update(account,wrapper)>0?true:false;
4949
}
5050

51+
@Override
52+
public Boolean bindGit(Account account) {
53+
return baseMapper.bindGit(account)>0?true:false;
54+
}
55+
5156
@Override
5257
public Boolean addWorks(String username) {
5358
return baseMapper.addWorks(username)>0?true:false;

springboot-dubbo-service/src/main/resources/mapper/AccoutMapper.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,14 @@
2121
<update id="reduceRecycle">
2222
update account set recycle=recycle-1 where username=#{username}
2323
</update>
24+
<update id="bindGit">
25+
update account
26+
<if test=" githubId != '' and githubId != null ">
27+
set github_id=#{githubId}
28+
</if>
29+
<if test=" giteeId != '' and giteeId != null ">
30+
set gitee_id=#{giteeId}
31+
</if>
32+
where username=#{username}
33+
</update>
2434
</mapper>
3.39 MB
Binary file not shown.

springboot-dubbo-web/pom.xml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,12 @@
158158
<artifactId>jasypt-spring-boot</artifactId>
159159
<version>3.0.2</version>
160160
</dependency>
161+
<!--druid连接池-->
162+
<dependency>
163+
<groupId>com.alibaba</groupId>
164+
<artifactId>druid-spring-boot-starter</artifactId>
165+
<version>1.2.4</version>
166+
</dependency>
161167
<!--lombok-->
162168
<dependency>
163169
<groupId>org.projectlombok</groupId>
@@ -176,13 +182,20 @@
176182
<artifactId>qiniu-java-sdk</artifactId>
177183
<version>7.7.0</version>
178184
</dependency>
179-
185+
<!--用于转webp-->
186+
<dependency>
187+
<groupId>com.github.nintha</groupId>
188+
<artifactId>webp-imageio-core</artifactId>
189+
<version>0.1.0</version>
190+
<scope>system</scope>
191+
<systemPath>${project.basedir}/lib/webp-imageio-core-0.1.0.jar</systemPath>
192+
</dependency>
180193
</dependencies>
181194

182195

183196
<build>
184197
<!-- 包名称 -->
185-
<finalName>dubbo-web</finalName>
198+
<finalName>onlineidea-web</finalName>
186199
<plugins>
187200
<plugin>
188201
<groupId>org.springframework.boot</groupId>

0 commit comments

Comments
 (0)