/* * 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 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 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> diagnostics(@PathVariable String appCode, @RequestBody Map body) { String id = this.clientDiagnosticsService.ingest(body); return ApiResponse.ok(Map.of("ok", true, "id", id, "appCode", appCode)); } @PostMapping(value={"/feedback"}) public ApiResponse 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 payment(@PathVariable String appCode, @RequestBody PaymentSubmitRequest req) { return ApiResponse.ok((Object)this.appClientService.payment(appCode, req)); } @PostMapping(value={"/share"}) public ApiResponse share(@PathVariable String appCode, @RequestBody AppClientService.ShareRequest req) { return ApiResponse.ok((Object)this.appClientService.share(appCode, req)); } @GetMapping(value={"/version"}) public ApiResponse version(@PathVariable String appCode) { return ApiResponse.ok((Object)this.appClientService.latestVersion(appCode)); } @GetMapping(value={"/banners"}) public ApiResponse> banners(@PathVariable String appCode) { return ApiResponse.ok((Object)this.appClientService.enabledBanners(appCode)); } @GetMapping(value={"/prices"}) public ApiResponse> prices(@PathVariable String appCode) { return ApiResponse.ok((Object)this.appClientService.enabledPrices(appCode)); } @GetMapping(value={"/payment-channels"}) public ApiResponse> paymentChannels(@PathVariable String appCode) { return ApiResponse.ok(Map.of("appCode", appCode, "channels", this.paymentChannelConfigService.listPublicForClient(appCode))); } @GetMapping(value={"/developer-apps"}) public ApiResponse> 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 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; } }