|
|
@@ -19,6 +19,7 @@ import com.ytpm.general.RepMessage;
|
|
|
import com.ytpm.general.Result;
|
|
|
import com.ytpm.general.ResultTable;
|
|
|
import com.ytpm.service.AgentAppService;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
@@ -26,6 +27,7 @@ import java.util.Objects;
|
|
|
|
|
|
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class AgentAppServiceImpl implements AgentAppService {
|
|
|
|
|
|
@Resource
|
|
|
@@ -60,8 +62,13 @@ public class AgentAppServiceImpl implements AgentAppService {
|
|
|
public Result<?> saveApp(AppParam param, String userId) {
|
|
|
//构造API对象
|
|
|
AddAppParam addAppParam = new AddAppParam(param);
|
|
|
+ Result<AddAppResponse> result = null;
|
|
|
//调用广告平台API 增加应用
|
|
|
- Result<AddAppResponse> result = advertiseFeign.saveApp(addAppParam);
|
|
|
+ try {
|
|
|
+ result=advertiseFeign.saveApp(addAppParam);
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("参数错误{}",e);
|
|
|
+ }
|
|
|
//数据库操作,有appId为修改, 没有时为新增
|
|
|
changeDataAction(param,result,userId);
|
|
|
return Result.resultOk(RepMessage.SAVE_SUCCESS);
|
|
|
@@ -76,8 +83,13 @@ public class AgentAppServiceImpl implements AgentAppService {
|
|
|
if(StrUtil.isNotBlank(param.getAppId())){
|
|
|
appMapper.updateOne(app);
|
|
|
}else{
|
|
|
+ log.debug("result{}",result);
|
|
|
AddAppResponse data = result.getData();
|
|
|
BeanUtil.copyProperties(param, app);
|
|
|
+ app.setScreenOrientation(param.getScreen_orientation());
|
|
|
+ app.setPackageName(param.getPackage_name());
|
|
|
+ app.setStoreOnSale(param.getStore_on_sale());
|
|
|
+ app.setStoreUrl(param.getStore_url());
|
|
|
app.setAppId(data.getUuid());
|
|
|
app.setAppKey(data.getApp_key());
|
|
|
app.setUserId(userId);
|