|
|
@@ -10,6 +10,7 @@ import com.ytpm.app.enums.LoginType;
|
|
|
import com.ytpm.app.model.YtAppDefaultConfig;
|
|
|
import com.ytpm.app.model.YtDyzPowerRecord;
|
|
|
import com.ytpm.app.model.YtDyzUser;
|
|
|
+import com.ytpm.app.param.AppConfigUpdateParam;
|
|
|
import com.ytpm.app.param.WxLoginParam;
|
|
|
import com.ytpm.app.view.WxDefaultConfig;
|
|
|
import com.ytpm.app.view.WxLoginResult;
|
|
|
@@ -23,6 +24,7 @@ import com.ytpm.question.service.AppUserService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
@@ -162,6 +164,39 @@ public class WxController {
|
|
|
return Result.resultOk(RepMessage.SAVE_SUCCESS);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("同步子应用默认配置")
|
|
|
+ @PostMapping("/updateAppsConfig")
|
|
|
+ public void updateAppsConfig(@RequestBody AppConfigUpdateParam param){
|
|
|
+ if (CollUtil.isNotEmpty(param.getApps()) && param.getDefaultConfig() != null) {
|
|
|
+ String appIds = String.join(",", param.getApps());
|
|
|
+ List<WxDefaultConfig> configs = appUserMapper.getConfigByIds(appIds);
|
|
|
+ YtAppDefaultConfig updateInfo = param.getDefaultConfig();
|
|
|
+ for (WxDefaultConfig config : configs) {
|
|
|
+ YtAppDefaultConfig appConfig = new YtAppDefaultConfig();
|
|
|
+ BeanUtils.copyProperties(config, appConfig);
|
|
|
+ if(StrUtil.isNotEmpty(updateInfo.getTakuAppId())) {
|
|
|
+ appConfig.setTakuAppId(updateInfo.getTakuAppId());
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotEmpty(updateInfo.getTakuKey())) {
|
|
|
+ appConfig.setTakuKey(updateInfo.getTakuKey());
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotEmpty(updateInfo.getTakuBannerPid())) {
|
|
|
+ appConfig.setTakuBannerPid(updateInfo.getTakuBannerPid());
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotEmpty(updateInfo.getTakuNativePid())) {
|
|
|
+ appConfig.setTakuNativePid(updateInfo.getTakuNativePid());
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotEmpty(updateInfo.getTakuRewardPid())) {
|
|
|
+ appConfig.setTakuRewardPid(updateInfo.getTakuRewardPid());
|
|
|
+ }
|
|
|
+ if(StrUtil.isNotEmpty(updateInfo.getTakuInterstitialPid())) {
|
|
|
+ appConfig.setTakuInterstitialPid(updateInfo.getTakuInterstitialPid());
|
|
|
+ }
|
|
|
+ appUserMapper.updateAppConfig(appConfig);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("根据APP_ID获取配置")
|
|
|
@GetMapping("/getConfigs")
|
|
|
public List<WxDefaultConfig> getConfigs(@RequestParam(name = "appIds") String appIds) {
|