|
@@ -8,6 +8,8 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 用户等级控制器(内部兼容层,已由会员体系 /api/membership 接管)
|
|
* 用户等级控制器(内部兼容层,已由会员体系 /api/membership 接管)
|
|
|
*/
|
|
*/
|
|
@@ -19,6 +21,24 @@ public class UserLevelController {
|
|
|
|
|
|
|
|
private final UserLevelService userLevelService;
|
|
private final UserLevelService userLevelService;
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取所有等级列表(公开)
|
|
|
|
|
+ * GET /api/level/list
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/list")
|
|
|
|
|
+ public Result<List<UserLevelResponse>> listLevels() {
|
|
|
|
|
+ return Result.success(userLevelService.listLevels());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取等级详情(公开)
|
|
|
|
|
+ * GET /api/level/{id}
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/{id}")
|
|
|
|
|
+ public Result<UserLevelResponse> getLevel(@PathVariable Long id) {
|
|
|
|
|
+ return Result.success(userLevelService.getLevel(id));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 获取当前用户等级信息(供 /api/auth/user/info 的 levelInfo 字段使用)
|
|
* 获取当前用户等级信息(供 /api/auth/user/info 的 levelInfo 字段使用)
|
|
|
* GET /api/level/my
|
|
* GET /api/level/my
|