package com.tourguide.api.guide; import com.tourguide.common.api.ApiResponse; import com.tourguide.modules.operation.dto.AgreementResponse; import com.tourguide.modules.operation.dto.MiniAgreementSummaryResponse; import com.tourguide.modules.operation.service.AgreementSettingService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; /** 导游端协议查询接口,内容统一来源于管理后台协议设置。 */ @RestController @RequestMapping("/api/guide/agreements") public class GuideAgreementController { private final AgreementSettingService agreementService; public GuideAgreementController(AgreementSettingService agreementService) { this.agreementService = agreementService; } /** 查询导游端展示的用户协议、合作协议和平台奖惩机制。 */ @GetMapping public ApiResponse> list() { return ApiResponse.success(agreementService.listGuideAgreements()); } /** 按白名单协议编码查询后台配置的协议正文。 */ @GetMapping("/{code}") public ApiResponse detail(@PathVariable String code) { return ApiResponse.success(agreementService.getGuideAgreement(code)); } }