fix: 修复问题
This commit is contained in:
27
CLAUDE.md
27
CLAUDE.md
@@ -56,15 +56,32 @@
|
||||
└── frontend/app/web-gold/ # Vue前端
|
||||
```
|
||||
|
||||
## 模块标准结构
|
||||
## ⚠️ 模块标准结构(重要)
|
||||
|
||||
> **所有新模块开发必须严格遵循此结构!** 这是项目架构的核心规范,不可随意变更。
|
||||
|
||||
```
|
||||
module/
|
||||
├── controller/ # REST控制器
|
||||
├── service/ # 业务逻辑(接口+实现)
|
||||
├── mapper/ # 数据访问层
|
||||
└── vo/ # 值对象(SaveReq/PageReq/Resp)
|
||||
├── controller/ # REST控制器 - 通过URL前缀区分 /admin-api 或 /api
|
||||
├── service/ # 业务逻辑层 - 核心业务处理
|
||||
│ ├── XxxService.java # 接口定义
|
||||
│ └── XxxServiceImpl.java # 实现类(@Service)
|
||||
├── mapper/ # 数据访问层 - 继承BaseMapperX<T>
|
||||
│ └── XxxMapper.java
|
||||
└── vo/ # 值对象 - 数据传输对象
|
||||
├── XxxSaveReqVO.java # 创建/更新请求
|
||||
├── XxxPageReqVO.java # 分页查询请求(继承SortablePageParam)
|
||||
└── XxxRespVO.java # 响应对象
|
||||
```
|
||||
|
||||
### 层级职责
|
||||
| 层级 | 职责 | 禁止事项 |
|
||||
|------|------|----------|
|
||||
| Controller | 参数校验、调用Service、返回响应 | 禁止写业务逻辑 |
|
||||
| Service | 业务逻辑处理、事务管理 | 禁止直接操作Mapper(通过Service) |
|
||||
| Mapper | 数据库CRUD操作 | 禁止写业务逻辑 |
|
||||
| VO | 数据传输、格式转换 | 禁止包含业务逻辑 |
|
||||
|
||||
## 关键配置
|
||||
- **后端配置**: `yudao-server/src/main/resources/application-local.yaml`
|
||||
- **数据库**: `jdbc:mysql://8.155.172.147:3306/sion_rui_dev`
|
||||
|
||||
@@ -200,7 +200,7 @@ export function getUserInfoAuth() {
|
||||
* @returns {Promise<Object>} 用户档案
|
||||
*/
|
||||
export async function getUserProfile() {
|
||||
const { data } = await api.get(`/webApi/api/tik/muye/member-profile/get`)
|
||||
const { data } = await api.get(`/webApi/api/tik/member-profile/get`)
|
||||
return data
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.iocoder.yudao.module.tik.muye.memberuserprofile.controller.app;
|
||||
package cn.iocoder.yudao.module.tik.member;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
@@ -15,13 +15,13 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 用户 APP - 会员档案
|
||||
* 用户 App - 会员档案
|
||||
*/
|
||||
@Tag(name = "用户 APP - 会员档案")
|
||||
@Tag(name = "用户 App - 会员档案")
|
||||
@RestController
|
||||
@RequestMapping("/api/tik/muye/member-profile")
|
||||
@RequestMapping("/api/tik/member-profile")
|
||||
@Validated
|
||||
public class AppMemberUserProfileController {
|
||||
public class AppMemberProfileController {
|
||||
|
||||
@Resource
|
||||
private MemberUserProfileService memberUserProfileService;
|
||||
@@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.tik.muye.memberuserprofile.service;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
|
||||
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
|
||||
import cn.iocoder.yudao.module.tik.muye.memberuserprofile.dal.MemberUserProfileDO;
|
||||
import cn.iocoder.yudao.module.tik.muye.memberuserprofile.mapper.MemberUserProfileMapper;
|
||||
import cn.iocoder.yudao.module.tik.muye.memberuserprofile.vo.MemberUserProfilePageReqVO;
|
||||
@@ -29,6 +31,9 @@ public class MemberUserProfileServiceImpl implements MemberUserProfileService {
|
||||
@Resource
|
||||
private MemberUserProfileMapper memberUserProfileMapper;
|
||||
|
||||
@Resource
|
||||
private MemberUserApi memberUserApi;
|
||||
|
||||
@Override
|
||||
public Long createMemberUserProfile(MemberUserProfileSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
@@ -88,6 +93,13 @@ public class MemberUserProfileServiceImpl implements MemberUserProfileService {
|
||||
// 2. 创建新档案
|
||||
profile = new MemberUserProfileDO();
|
||||
profile.setUserId(String.valueOf(userId));
|
||||
// 获取用户手机号
|
||||
MemberUserRespDTO user = memberUserApi.getUser(userId);
|
||||
if (user != null) {
|
||||
profile.setMobile(user.getMobile());
|
||||
} else {
|
||||
profile.setMobile("");
|
||||
}
|
||||
profile.setRegisterTime(LocalDateTime.now());
|
||||
profile.setLastLoginTime(LocalDateTime.now());
|
||||
profile.setTotalPoints(0);
|
||||
|
||||
Reference in New Issue
Block a user