补充 world geo nginx snippet、OpenAPI/geo 热更新脚本,以及 popadmin package_name 定价补丁,便于运维对齐。 Co-authored-by: Cursor <cursoragent@cursor.com>
151 lines
7.0 KiB
Java
151 lines
7.0 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.aliyun.control.dto.ApiResponse
|
|
* com.wyrs.admin.controller.AppClientApiController
|
|
* com.wyrs.admin.dto.AdPlacementClientDto
|
|
* com.wyrs.admin.dto.DeveloperAppClientItem
|
|
* com.wyrs.admin.dto.FeedbackSubmitRequest
|
|
* com.wyrs.admin.dto.PaymentSubmitRequest
|
|
* com.wyrs.admin.entity.AppBanner
|
|
* com.wyrs.admin.entity.AppUser
|
|
* com.wyrs.admin.entity.AppVersion
|
|
* com.wyrs.admin.entity.ClientLog
|
|
* com.wyrs.admin.entity.MembershipPrice
|
|
* com.wyrs.admin.entity.PaymentRecord
|
|
* com.wyrs.admin.entity.UserFeedback
|
|
* com.wyrs.admin.entity.UserShareEvent
|
|
* com.wyrs.admin.security.EmailUserAuthHelper
|
|
* com.wyrs.admin.security.EmailUserAuthHelper$EmailUser
|
|
* com.wyrs.admin.service.AppClientService
|
|
* com.wyrs.admin.service.AppClientService$HeartbeatRequest
|
|
* com.wyrs.admin.service.AppClientService$ShareRequest
|
|
* com.wyrs.admin.service.ClientDiagnosticsService
|
|
* com.wyrs.admin.service.config.PaymentChannelConfigService
|
|
* jakarta.servlet.http.HttpServletRequest
|
|
* org.springframework.http.HttpStatus
|
|
* org.springframework.web.bind.annotation.GetMapping
|
|
* org.springframework.web.bind.annotation.PathVariable
|
|
* org.springframework.web.bind.annotation.PostMapping
|
|
* org.springframework.web.bind.annotation.RequestBody
|
|
* org.springframework.web.bind.annotation.RequestMapping
|
|
* org.springframework.web.bind.annotation.RequestParam
|
|
* org.springframework.web.bind.annotation.ResponseStatus
|
|
* org.springframework.web.bind.annotation.RestController
|
|
*/
|
|
package com.wyrs.admin.controller;
|
|
|
|
import com.aliyun.control.dto.ApiResponse;
|
|
import com.wyrs.admin.dto.AdPlacementClientDto;
|
|
import com.wyrs.admin.dto.DeveloperAppClientItem;
|
|
import com.wyrs.admin.dto.FeedbackSubmitRequest;
|
|
import com.wyrs.admin.dto.PaymentSubmitRequest;
|
|
import com.wyrs.admin.entity.AppBanner;
|
|
import com.wyrs.admin.entity.AppUser;
|
|
import com.wyrs.admin.entity.AppVersion;
|
|
import com.wyrs.admin.entity.ClientLog;
|
|
import com.wyrs.admin.entity.MembershipPrice;
|
|
import com.wyrs.admin.entity.PaymentRecord;
|
|
import com.wyrs.admin.entity.UserFeedback;
|
|
import com.wyrs.admin.entity.UserShareEvent;
|
|
import com.wyrs.admin.security.EmailUserAuthHelper;
|
|
import com.wyrs.admin.service.AppClientService;
|
|
import com.wyrs.admin.service.ClientDiagnosticsService;
|
|
import com.wyrs.admin.service.config.PaymentChannelConfigService;
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
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.ResponseStatus;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@RestController
|
|
@RequestMapping(value={"/api/client/{appCode}"})
|
|
public class AppClientApiController {
|
|
private final AppClientService appClientService;
|
|
private final ClientDiagnosticsService clientDiagnosticsService;
|
|
private final EmailUserAuthHelper emailUserAuthHelper;
|
|
private final PaymentChannelConfigService paymentChannelConfigService;
|
|
|
|
@PostMapping(value={"/heartbeat"})
|
|
public ApiResponse<AppUser> heartbeat(@PathVariable String appCode, @RequestBody AppClientService.HeartbeatRequest req, HttpServletRequest request) {
|
|
return ApiResponse.ok((Object)this.appClientService.heartbeat(appCode, req, request));
|
|
}
|
|
|
|
@PostMapping(value={"/logs"})
|
|
public ApiResponse<ClientLog> logs(@PathVariable String appCode, @RequestBody ClientLog log) {
|
|
return ApiResponse.ok((Object)this.appClientService.reportLog(appCode, log));
|
|
}
|
|
|
|
@PostMapping(value={"/diagnostics"})
|
|
@ResponseStatus(value=HttpStatus.CREATED)
|
|
public ApiResponse<Map<String, Object>> diagnostics(@PathVariable String appCode, @RequestBody Map<String, Object> body) {
|
|
String id = this.clientDiagnosticsService.ingest(body);
|
|
return ApiResponse.ok(Map.of("ok", true, "id", id, "appCode", appCode));
|
|
}
|
|
|
|
@PostMapping(value={"/feedback"})
|
|
public ApiResponse<UserFeedback> feedback(@PathVariable String appCode, @RequestBody FeedbackSubmitRequest req, HttpServletRequest request) {
|
|
if ("weiyu-pet".equals(appCode)) {
|
|
EmailUserAuthHelper.EmailUser user = this.emailUserAuthHelper.require(request);
|
|
req.setContact(user.email());
|
|
}
|
|
return ApiResponse.ok((Object)this.appClientService.feedback(appCode, req));
|
|
}
|
|
|
|
@PostMapping(value={"/payment"})
|
|
public ApiResponse<PaymentRecord> payment(@PathVariable String appCode, @RequestBody PaymentSubmitRequest req) {
|
|
return ApiResponse.ok((Object)this.appClientService.payment(appCode, req));
|
|
}
|
|
|
|
@PostMapping(value={"/share"})
|
|
public ApiResponse<UserShareEvent> share(@PathVariable String appCode, @RequestBody AppClientService.ShareRequest req) {
|
|
return ApiResponse.ok((Object)this.appClientService.share(appCode, req));
|
|
}
|
|
|
|
@GetMapping(value={"/version"})
|
|
public ApiResponse<AppVersion> version(@PathVariable String appCode) {
|
|
return ApiResponse.ok((Object)this.appClientService.latestVersion(appCode));
|
|
}
|
|
|
|
@GetMapping(value={"/banners"})
|
|
public ApiResponse<List<AppBanner>> banners(@PathVariable String appCode) {
|
|
return ApiResponse.ok((Object)this.appClientService.enabledBanners(appCode));
|
|
}
|
|
|
|
@GetMapping(value={"/prices"})
|
|
public ApiResponse<List<MembershipPrice>> prices(@PathVariable String appCode) {
|
|
return ApiResponse.ok((Object)this.appClientService.enabledPrices(appCode));
|
|
}
|
|
|
|
@GetMapping(value={"/payment-channels"})
|
|
public ApiResponse<Map<String, Object>> paymentChannels(@PathVariable String appCode) {
|
|
return ApiResponse.ok(Map.of("appCode", appCode, "channels", this.paymentChannelConfigService.listPublicForClient(appCode)));
|
|
}
|
|
|
|
@GetMapping(value={"/developer-apps"})
|
|
public ApiResponse<List<DeveloperAppClientItem>> developerApps(@PathVariable String appCode, @RequestParam(required=false) String channel, HttpServletRequest request) {
|
|
return ApiResponse.ok((Object)this.appClientService.developerApps(appCode, request, channel));
|
|
}
|
|
|
|
@GetMapping(value={"/ad-placements"})
|
|
public ApiResponse<AdPlacementClientDto> adPlacements(@PathVariable String appCode) {
|
|
return ApiResponse.ok((Object)this.appClientService.adPlacements(appCode));
|
|
}
|
|
|
|
public AppClientApiController(AppClientService appClientService, ClientDiagnosticsService clientDiagnosticsService, EmailUserAuthHelper emailUserAuthHelper, PaymentChannelConfigService paymentChannelConfigService) {
|
|
this.appClientService = appClientService;
|
|
this.clientDiagnosticsService = clientDiagnosticsService;
|
|
this.emailUserAuthHelper = emailUserAuthHelper;
|
|
this.paymentChannelConfigService = paymentChannelConfigService;
|
|
}
|
|
}
|
|
|