shinnosuke
2026-08-06 f12cbba923cebd30416d170eff2b116f4f013a29
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package com.talentcard.server.business.admin;
 
import java.util.Map;
 
import com.talentcard.server.business.PageResult;
import com.talentcard.server.common.ApiResponse;
import com.talentcard.server.request.CarWashJumpConfigRequest;
import com.talentcard.server.service.CarWashJumpConfigAdminService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
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;
 
@Tag(name = "后台-洗车跳转配置", description = "后台配置不同洗车商家的第三方小程序或网页跳转参数")
@RestController
@RequestMapping("/api/admin/car-wash-merchant-jump-configs")
public class CarWashJumpConfigAdminController {
    private final CarWashJumpConfigAdminService service;
 
    public CarWashJumpConfigAdminController(CarWashJumpConfigAdminService service) {
        this.service = service;
    }
 
    @Operation(summary = "查询洗车商家跳转配置", description = "分页查看不同洗车商家的第三方小程序/网页跳转配置")
    @GetMapping
    public ApiResponse<PageResult<Map<String, Object>>> page(
            @Parameter(description = "洗车商家ID") @RequestParam(required = false) Long merchantId,
            @Parameter(description = "商家名称、地址或手机号关键词") @RequestParam(required = false) String keyword,
            @Parameter(description = "页码") @RequestParam(defaultValue = "1") int page,
            @Parameter(description = "每页条数") @RequestParam(defaultValue = "10") int size
    ) {
        return ApiResponse.success(service.page(merchantId, keyword, page, size));
    }
 
    @Operation(summary = "查询单个洗车商家跳转配置", description = "按洗车商家ID查看第三方小程序/网页跳转配置")
    @GetMapping("/{merchantId}")
    public ApiResponse<Map<String, Object>> detail(@PathVariable Long merchantId) {
        return ApiResponse.success(service.detail(merchantId));
    }
 
    @Operation(summary = "保存洗车商家跳转配置", description = "配置指定洗车商家的第三方小程序AppId、页面路径或网页地址")
    @PutMapping("/{merchantId}")
    public ApiResponse<Map<String, Object>> save(
            @PathVariable Long merchantId,
            @Valid @RequestBody CarWashJumpConfigRequest request
    ) {
        return ApiResponse.success(service.save(merchantId, request));
    }
}