Skip to content

Commit 41cc525

Browse files
committed
自定义Security登录逻辑
合并 创建实例和保存实例内容接口 修改第三方登陆逻辑 使用uuid创建实例id
1 parent de842cb commit 41cc525

28 files changed

+459
-267
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class ExampleAccount implements Serializable {
5353
*/
5454
@TableId(value = "example_id")
5555
@JsonProperty("exampleId")
56-
private Integer exampleId;
56+
private Long exampleId;
5757
/**
5858
* 实列名称
5959
*/

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

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ public class Account implements Serializable, UserDetails {
4646
* 邮箱
4747
*/
4848
@TableField(value = "email")
49-
@JsonProperty("email")
49+
@JsonIgnore
5050
private String email;
5151
/**
5252
* 联系邮箱
5353
*/
5454
@TableField(value = "contact_email")
55-
@JsonProperty("contactEmail")
55+
@JsonIgnore
5656
private String contactEmail;
5757
/**
5858
* 密码
@@ -69,27 +69,25 @@ public class Account implements Serializable, UserDetails {
6969
* 背景颜色
7070
*/
7171
@TableField(value = "backgroud_color")
72-
@JsonProperty("backgroudColor")
72+
@JsonIgnore
7373
private String backgroudColor;
7474
/**
7575
* github主键id
7676
*/
7777
@TableField(value = "github_id")
78-
@JsonProperty("githubId")
7978
@JsonIgnore
8079
private String githubId;
8180
/**
8281
* gitee主键id
8382
*/
8483
@TableField(value = "gitee_id")
85-
@JsonProperty("giteeId")
8684
@JsonIgnore
8785
private String giteeId;
8886
/**
8987
* 角色id
9088
*/
9189
@TableField(value = "role_id")
92-
@JsonProperty("roleId")
90+
@JsonIgnore
9391
private int roleId=1;
9492
/**
9593
* 角色类
@@ -101,37 +99,37 @@ public class Account implements Serializable, UserDetails {
10199
* 描述
102100
*/
103101
@TableField("description")
104-
@JsonProperty("description")
102+
@JsonIgnore
105103
private String description;
106104
/**
107105
* 作品数
108106
*/
109107
@TableField("works")
110-
@JsonProperty("works")
108+
@JsonIgnore
111109
private Integer works;
112110
/**
113111
* 喜爱人数
114112
*/
115113
@TableField("favorites")
116-
@JsonProperty("favorites")
114+
@JsonIgnore
117115
private Integer favorites;
118116
/**
119117
* 粉丝
120118
*/
121119
@TableField("fan")
122-
@JsonProperty("fan")
120+
@JsonIgnore
123121
private Integer fan;
124122
/**
125123
* 关注
126124
*/
127125
@TableField("following")
128-
@JsonProperty("following")
126+
@JsonIgnore
129127
private Integer following;
130128
/**
131129
* 回收站
132130
*/
133131
@TableField("recycle")
134-
@JsonProperty("recycle")
132+
@JsonIgnore
135133
private Integer recycle;
136134
/**
137135
* 创建时间

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class Content implements Serializable {
2727
*/
2828
@TableId(value = "example_id")
2929
@JsonProperty("exampleId")
30-
private Integer exampleId;
30+
private String exampleId;
3131
/**
3232
* css代码
3333
*/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ public class Example implements Serializable {
2626
/**
2727
* 主键
2828
*/
29-
@TableId(value = "example_id",type = IdType.AUTO)
29+
@TableId(value = "example_id")
3030
@JsonProperty("exampleId")
31-
private Integer exampleId;
31+
private String exampleId;
3232
/**
3333
* 实列名称
3434
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ public interface ContentService {
3535
* @param exampleId 实例id
3636
* @return
3737
*/
38-
void deleteContent(Integer exampleId);
38+
void deleteContent(String exampleId);
3939
}

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public interface ExampleService {
3535
* @param exampleId 主键
3636
* @return 是否成功
3737
*/
38-
boolean deleteById(Integer exampleId);
38+
boolean deleteById(String exampleId);
3939

4040

4141
/**
@@ -60,7 +60,15 @@ public interface ExampleService {
6060
/**
6161
* 删除实例(物理删除实例)
6262
* @param exampleId 实例id
63+
* @return
64+
*/
65+
Boolean deleteExample(String exampleId);
66+
67+
/**
68+
* 通过实例id查询实例信息
69+
* @param exampleId
70+
* @return
6371
*/
64-
void deleteExample(Integer exampleId);
72+
Example queryById(String exampleId);
6573

6674
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public interface FavoritesService {
2020
* 删除喜爱(物理)
2121
* @param exampleId
2222
*/
23-
void deleteFavorites(Integer exampleId);
23+
void deleteFavorites(String exampleId);
2424

2525
/**
2626
* 获取用户的喜爱总数

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

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,4 @@ public ISqlInjector sqlInjector(){
3434
return new LogicSqlInjector();
3535
}
3636

37-
// /**
38-
// * sql执行效率插件
39-
// */
40-
// @Bean
41-
// public PerformanceInterceptor performanceInterceptor(){
42-
// PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
43-
// performanceInterceptor.setMaxTime(1000); //ms 设置sql执行的最大时间,如果超过了则不执行
44-
// performanceInterceptor.setFormat(true);
45-
// return performanceInterceptor;
46-
// }
4737
}

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

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import com.qiniu.storage.UploadManager;
1010
import com.qiniu.storage.model.DefaultPutRet;
1111
import com.qiniu.util.Auth;
12+
import org.springframework.beans.factory.annotation.Value;
13+
import org.springframework.stereotype.Component;
1214

1315
import java.io.ByteArrayInputStream;
1416

@@ -17,19 +19,36 @@
1719
* @description:TODO
1820
* @date :2021/8/26 10:53
1921
*/
22+
@Component
2023
public class QiniuyunUtils {
2124

22-
private static final String accessKey = "fIf9nYz-wQo3HD1AlhQ5wrUrdjtygUPGe2dpuLlY";
23-
public static final String secretKey = "ItVUX8sAaxsuj7kgmk3IZ0ip3BHljAx61N8m922C";
24-
public static final String bucket = "lzqwxr";
25+
private static String accessKey;
26+
public static String secretKey;
27+
public static String bucket;
28+
29+
@Value("${qiniuyun.accessKey}")
30+
public void setAccessKey(String accessKey) {
31+
QiniuyunUtils.accessKey = accessKey;
32+
}
33+
34+
@Value("${qiniuyun.secretKey}")
35+
public void setSecretKey(String secretKey) {
36+
QiniuyunUtils.secretKey = secretKey;
37+
}
38+
39+
@Value("${qiniuyun.bucket}")
40+
public void setBucket(String bucket) {
41+
QiniuyunUtils.bucket = bucket;
42+
}
2543

2644
/**
2745
* 上传图片到七牛云
46+
*
2847
* @param bytes
2948
* @param imgname 图片名称
3049
* @return
3150
*/
32-
public static String uploadFiles(byte[] bytes,String imgname) {
51+
public static String uploadFiles(byte[] bytes, String imgname) {
3352
//构造一个带指定 Region 对象的配置类
3453
Configuration cfg = new Configuration(Region.huanan());
3554
//...其他参数参考类注释
@@ -63,9 +82,10 @@ public static String uploadFiles(byte[] bytes,String imgname) {
6382

6483
/**
6584
* 删除七牛云图片
85+
*
6686
* @param imgname
6787
*/
68-
public static void deleteFiles(String imgname){
88+
public static void deleteFiles(String imgname) {
6989
//构造一个带指定 Region 对象的配置类
7090
Configuration cfg = new Configuration(Region.region0());
7191
//...其他参数参考类注释

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
*/
1313
@Repository
1414
public interface ContentMapper extends BaseMapper<Content> {
15-
void deleteContent(@Param("exampleId") Integer exampleId);
15+
void deleteContent(@Param("exampleId") String exampleId);
1616
}

0 commit comments

Comments
 (0)