Compare commits
3 Commits
3ce029ecce
...
04b891e73d
| Author | SHA1 | Date | |
|---|---|---|---|
| 04b891e73d | |||
| e5c79f1abc | |||
| eaa5586211 |
1
.idea/inspectionProfiles/Project_Default.xml
generated
1
.idea/inspectionProfiles/Project_Default.xml
generated
@@ -15,5 +15,6 @@
|
||||
</list>
|
||||
</option>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="SqlNoDataSourceInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
||||
@@ -44,7 +44,7 @@ public class UserRpcService {
|
||||
FindUserByEmailReqDTO findUserByEmailReqDTO = new FindUserByEmailReqDTO();
|
||||
findUserByEmailReqDTO.setEmail(email);
|
||||
|
||||
Response<FindUserByEmailRspDTO> response = userFeignApi.findByPhone(findUserByEmailReqDTO);
|
||||
Response<FindUserByEmailRspDTO> response = userFeignApi.findByEmail(findUserByEmailReqDTO);
|
||||
|
||||
if (!response.isSuccess()) {
|
||||
return null;
|
||||
|
||||
@@ -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<LeafAlloc> 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<String> getAllTags();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<!-- 打包方式 -->
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<artifactId>han-note-api</artifactId>
|
||||
<artifactId>han-note-note-api</artifactId>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>RPC层, 供其他服务调用</description>
|
||||
|
||||
|
||||
@@ -27,13 +27,13 @@ public interface UserFeignApi {
|
||||
Response<Long> registerUser(@RequestBody RegisterUserReqDTO registerUserReqDTO);
|
||||
|
||||
/**
|
||||
* 根据手机号查询用户信息
|
||||
* 根据邮箱号查询用户信息
|
||||
*
|
||||
* @param findUserByEmailReqDTO 查询信息请求
|
||||
* @return 响应
|
||||
*/
|
||||
@PostMapping(value = PREFIX + "/findByEmail")
|
||||
Response<FindUserByEmailRspDTO> findByPhone(@RequestBody FindUserByEmailReqDTO findUserByEmailReqDTO);
|
||||
Response<FindUserByEmailRspDTO> findByEmail(@RequestBody FindUserByEmailReqDTO findUserByEmailReqDTO);
|
||||
|
||||
/**
|
||||
* 更新密码
|
||||
|
||||
27
http-client/gateApi.http
Normal file
27
http-client/gateApi.http
Normal file
@@ -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"
|
||||
}
|
||||
|
||||
0
http-client/http-client.env.json
Normal file
0
http-client/http-client.env.json
Normal file
5
http-client/http-client.private.env.json
Normal file
5
http-client/http-client.private.env.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"dev": {
|
||||
"token": "4bXpiBbjXEDFE4ZpqjCOHu1rP81qepl2ROOygrxRGb61K536ckLuyAwfyQHSMcyRdUzf8CxntLEMfbU2ynbYx9nJKlx4vpWZrHqv2mI4iMhnShQ4mPBi7OPPgZi22O2f"
|
||||
}
|
||||
}
|
||||
@@ -16,11 +16,17 @@ VALUES (1, 1, 1, now(), now(), b'0');
|
||||
INSERT INTO `t_role_permission_rel` (`id`, `role_id`, `permission_id`, `create_time`, `update_time`, `is_deleted`)
|
||||
VALUES (2, 1, 2, now(), now(), b'0');
|
||||
|
||||
INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('美食', now(), now(), 0);
|
||||
INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('娱乐', now(), now(), 0);
|
||||
INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`)
|
||||
VALUES ('美食', now(), now(), 0);
|
||||
INSERT INTO `han_note`.`t_channel` (`name`, `create_time`, `update_time`, `is_deleted`)
|
||||
VALUES ('娱乐', now(), now(), 0);
|
||||
|
||||
INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('高分美剧推荐', now(), now(), 0);
|
||||
INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`) VALUES ('下饭综艺推荐', now(), now(), 0);
|
||||
INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`)
|
||||
VALUES ('高分美剧推荐', now(), now(), 0);
|
||||
INSERT INTO `han_note`.`t_topic` (`name`, `create_time`, `update_time`, `is_deleted`)
|
||||
VALUES ('下饭综艺推荐', now(), now(), 0);
|
||||
|
||||
INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`) VALUES (2, 1, now(), now());
|
||||
INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`) VALUES (2, 2, now(), now());
|
||||
INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`)
|
||||
VALUES (2, 1, now(), now());
|
||||
INSERT INTO `han_note`.`t_channel_topic_rel` (`channel_id`, `topic_id`, `create_time`, `update_time`)
|
||||
VALUES (2, 2, now(), now());
|
||||
|
||||
@@ -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 '个人简介',
|
||||
@@ -16,7 +16,7 @@ CREATE TABLE `t_user`
|
||||
`is_deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '逻辑删除(0:未删除 1:已删除)',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `uk_han_note_id` (`han_note_id`),
|
||||
UNIQUE KEY `uk_phone` (`phone`)
|
||||
UNIQUE KEY `uk_email` (`email`)
|
||||
) ENGINE = InnoDB
|
||||
DEFAULT CHARSET = utf8mb4
|
||||
COLLATE = utf8mb4_unicode_ci COMMENT ='用户表';
|
||||
|
||||
17
sql/leafcreatetable.sql
Normal file
17
sql/leafcreatetable.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
INSERT INTO `leaf`.`leaf` (`biz_tag`, `max_id`, `step`, `description`, `update_time`)
|
||||
VALUES ('leaf-segment-hannote-id', 10100, 2000, '小憨书 ID', now());
|
||||
|
||||
INSERT INTO `leaf`.`leaf` (`biz_tag`, `max_id`, `step`, `description`, `update_time`)
|
||||
VALUES ('leaf-segment-user-id', 100, 2000, '用户 ID', now());
|
||||
|
||||
CREATE TABLE `leaf`
|
||||
(
|
||||
`biz_tag` varchar(128) NOT NULL DEFAULT '',
|
||||
`max_id` bigint(20) NOT NULL DEFAULT '1',
|
||||
`step` int(11) NOT NULL,
|
||||
`description` varchar(256) DEFAULT NULL,
|
||||
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`biz_tag`)
|
||||
) ENGINE = InnoDB;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user