diff --git a/han-note-auth/src/main/java/com/hanserwei/hannote/auth/rpc/UserRpcService.java b/han-note-auth/src/main/java/com/hanserwei/hannote/auth/rpc/UserRpcService.java index 42dee32..5e2900a 100644 --- a/han-note-auth/src/main/java/com/hanserwei/hannote/auth/rpc/UserRpcService.java +++ b/han-note-auth/src/main/java/com/hanserwei/hannote/auth/rpc/UserRpcService.java @@ -44,7 +44,7 @@ public class UserRpcService { FindUserByEmailReqDTO findUserByEmailReqDTO = new FindUserByEmailReqDTO(); findUserByEmailReqDTO.setEmail(email); - Response response = userFeignApi.findByPhone(findUserByEmailReqDTO); + Response response = userFeignApi.findByEmail(findUserByEmailReqDTO); if (!response.isSuccess()) { return null; diff --git a/han-note-distributed-id-generator/han-note-distributed-id-generator-biz/src/main/java/com/hanserwei/hannote/distributed/id/generator/biz/core/segment/dao/IDAllocMapper.java b/han-note-distributed-id-generator/han-note-distributed-id-generator-biz/src/main/java/com/hanserwei/hannote/distributed/id/generator/biz/core/segment/dao/IDAllocMapper.java index f0035ff..cd66df2 100644 --- a/han-note-distributed-id-generator/han-note-distributed-id-generator-biz/src/main/java/com/hanserwei/hannote/distributed/id/generator/biz/core/segment/dao/IDAllocMapper.java +++ b/han-note-distributed-id-generator/han-note-distributed-id-generator-biz/src/main/java/com/hanserwei/hannote/distributed/id/generator/biz/core/segment/dao/IDAllocMapper.java @@ -13,7 +13,7 @@ import java.util.List; @Mapper public interface IDAllocMapper { - @Select("SELECT biz_tag, max_id, step, update_time FROM leaf_alloc") + @Select("SELECT biz_tag, max_id, step, update_time FROM leaf") @Results(value = { @Result(column = "biz_tag", property = "key"), @Result(column = "max_id", property = "maxId"), @@ -22,7 +22,7 @@ public interface IDAllocMapper { }) List getAllLeafAllocs(); - @Select("SELECT biz_tag, max_id, step FROM leaf_alloc WHERE biz_tag = #{tag}") + @Select("SELECT biz_tag, max_id, step FROM leaf WHERE biz_tag = #{tag}") @Results(value = { @Result(column = "biz_tag", property = "key"), @Result(column = "max_id", property = "maxId"), @@ -30,12 +30,12 @@ public interface IDAllocMapper { }) LeafAlloc getLeafAlloc(@Param("tag") String tag); - @Update("UPDATE leaf_alloc SET max_id = max_id + step WHERE biz_tag = #{tag}") + @Update("UPDATE leaf SET max_id = max_id + step WHERE biz_tag = #{tag}") void updateMaxId(@Param("tag") String tag); - @Update("UPDATE leaf_alloc SET max_id = max_id + #{leafAlloc.step} WHERE biz_tag = #{leafAlloc.key}") + @Update("UPDATE leaf SET max_id = max_id + #{leafAlloc.step} WHERE biz_tag = #{leafAlloc.key}") void updateMaxIdByCustomStep(@Param("leafAlloc") LeafAlloc leafAlloc); - @Select("SELECT biz_tag FROM leaf_alloc") + @Select("SELECT biz_tag FROM leaf") List getAllTags(); } diff --git a/han-note-user/han-note-user-api/src/main/java/com/hanserwei/hannote/user/api/UserFeignApi.java b/han-note-user/han-note-user-api/src/main/java/com/hanserwei/hannote/user/api/UserFeignApi.java index a81f968..04332f6 100644 --- a/han-note-user/han-note-user-api/src/main/java/com/hanserwei/hannote/user/api/UserFeignApi.java +++ b/han-note-user/han-note-user-api/src/main/java/com/hanserwei/hannote/user/api/UserFeignApi.java @@ -27,13 +27,13 @@ public interface UserFeignApi { Response registerUser(@RequestBody RegisterUserReqDTO registerUserReqDTO); /** - * 根据手机号查询用户信息 + * 根据邮箱号查询用户信息 * * @param findUserByEmailReqDTO 查询信息请求 * @return 响应 */ @PostMapping(value = PREFIX + "/findByEmail") - Response findByPhone(@RequestBody FindUserByEmailReqDTO findUserByEmailReqDTO); + Response findByEmail(@RequestBody FindUserByEmailReqDTO findUserByEmailReqDTO); /** * 更新密码 diff --git a/http-client/gateApi.http b/http-client/gateApi.http new file mode 100644 index 0000000..ada30a4 --- /dev/null +++ b/http-client/gateApi.http @@ -0,0 +1,27 @@ +### 获取验证码 +POST http://localhost:8000/auth/verification/code/send +Content-Type: application/json + +{ + "email": "ssw010723@gmail.com" +} + +### 登录/注册 +POST http://localhost:8000/auth/login +Content-Type: application/json + +{ + "email": "ssw010723@gmail.com", + "code": "135466", + "type": 1 +} + +### 修改密码 +POST http://localhost:8000/auth/password/update +Content-Type: application/json +Authorization: Bearer {{token}} + +{ + "newPassword": "wwgb1314" +} + diff --git a/http-client/http-client.env.json b/http-client/http-client.env.json new file mode 100644 index 0000000..e69de29 diff --git a/http-client/http-client.private.env.json b/http-client/http-client.private.env.json new file mode 100644 index 0000000..504c96b --- /dev/null +++ b/http-client/http-client.private.env.json @@ -0,0 +1,5 @@ +{ + "dev": { + "token": "4bXpiBbjXEDFE4ZpqjCOHu1rP81qepl2ROOygrxRGb61K536ckLuyAwfyQHSMcyRdUzf8CxntLEMfbU2ynbYx9nJKlx4vpWZrHqv2mI4iMhnShQ4mPBi7OPPgZi22O2f" + } +} \ No newline at end of file diff --git a/sql/createTable.sql b/sql/createTable.sql index 1e6521e..560deda 100644 --- a/sql/createTable.sql +++ b/sql/createTable.sql @@ -1,13 +1,13 @@ CREATE TABLE `t_user` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '主键ID', - `han_note_id` varchar(15) NOT NULL COMMENT '小哈书号(唯一凭证)', + `han_note_id` varchar(15) NOT NULL COMMENT '小憨书号(唯一凭证)', `password` varchar(64) DEFAULT NULL COMMENT '密码', `nickname` varchar(24) NOT NULL COMMENT '昵称', `avatar` varchar(120) DEFAULT NULL COMMENT '头像', `birthday` date DEFAULT NULL COMMENT '生日', `background_img` varchar(120) DEFAULT NULL COMMENT '背景图', - `phone` varchar(11) NOT NULL COMMENT '手机号', + `email` varchar(32) NOT NULL COMMENT '邮箱号', `sex` tinyint DEFAULT '0' COMMENT '性别(0:女 1:男)', `status` tinyint NOT NULL DEFAULT '0' COMMENT '状态(0:启用 1:禁用)', `introduction` varchar(100) DEFAULT NULL COMMENT '个人简介',