package com.crm.preference.controller; import com.crm.base.domain.result.Result; import com.crm.base.security.SecurityUtils; import com.crm.preference.domain.dto.SavedView; import com.crm.preference.service.SavedViewService; import io.swagger.v3.oas.annotations.Operation; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** * 自定义视图接口(票 14)。 * *
平台级第二种偏好,与 {@link ColumnPreferenceController} 同处 {@code /api/preference} 前缀下、 * 挂 {@code /view} 子路径。权限策略同列偏好:不种子化权限点,ApiPermissionInterceptor 对未注册 URL * fail-open。视图为用户私有,userId 从 SecurityContext 获取,不接受前端传入。
* *scope 由业务方约定(商机销售机会工作区本期传 {@code opportunity.sales});内置视图不走本接口 * (内置口径硬编码在业务方),本接口只管理用户自建视图。
*/ @RestController @RequestMapping("/api/preference/view") @RequiredArgsConstructor public class SavedViewController { private final SavedViewService savedViewService; @Operation(summary = "列出当前用户在某 scope 的自定义视图(按 seqNo)", tags = {"A3 商机管理/销售机会/自定义视图"}) @GetMapping("/list") public Result