liujie
2026-08-21 a7c8a8f6055e1a03414f2227d12ff2e87ec52d41
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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<MiniAgreementSummaryResponse>> list() {
        return ApiResponse.success(agreementService.listGuideAgreements());
    }
 
    /** 按白名单协议编码查询后台配置的协议正文。 */
    @GetMapping("/{code}")
    public ApiResponse<AgreementResponse> detail(@PathVariable String code) {
        return ApiResponse.success(agreementService.getGuideAgreement(code));
    }
}