diy模板新增创建空白模板,移除可选用的已使用的模板

This commit is contained in:
liyj 2025-12-12 16:17:58 +08:00
parent 7d2330f18f
commit 396181c62e
3 changed files with 42 additions and 2 deletions

View File

@ -132,6 +132,7 @@ public class ShopPageAppController extends BaseControllerImpl {
}else { }else {
if (is_use==1&&(shopStoreInfo.getStore_template().equals(tpl_label))) { if (is_use==1&&(shopStoreInfo.getStore_template().equals(tpl_label))) {
current_tpl = item; current_tpl = item;
it.remove();
} }
} }
} else { } else {
@ -553,5 +554,18 @@ public class ShopPageAppController extends BaseControllerImpl {
return shopPageAppService.deletePageApp(appId); return shopPageAppService.deletePageApp(appId);
} }
/**
* 创建空白模板
* @param appName 模板名称
* @param appIndustry 行业
* @return
*/
@ApiOperation(value = "店铺风格表-创建空白模板", notes = "店铺风格表-创建空白模板")
@RequestMapping(value = "/createBlankPageApp", method = RequestMethod.POST)
public CommonResult createBlankPageApp(@RequestParam(name = "appName") String appName,
@RequestParam(name = "appIndustry",required = false,defaultValue = "0") String appIndustry) {
return shopPageAppService.createBlankPageApp(appName,appIndustry);
}
} }

View File

@ -60,4 +60,6 @@ public interface ShopPageAppService extends IBaseService<ShopPageApp> {
CommonResult copyDiyByAppId(Integer appId,String newAppName,String appIndustry); CommonResult copyDiyByAppId(Integer appId,String newAppName,String appIndustry);
CommonResult deletePageApp(Integer appId); CommonResult deletePageApp(Integer appId);
CommonResult createBlankPageApp(String appName,String appIndustry);
} }

View File

@ -1107,6 +1107,32 @@ public class ShopPageAppServiceImpl extends BaseServiceImpl<ShopPageAppMapper, S
return CommonResult.success(); return CommonResult.success();
} }
@Override
public CommonResult createBlankPageApp(String appName,String appIndustry) {
UserDto userDto= ContextUtil.getCurrentUser();
if (userDto == null) {
throw new ApiException("用户未登录");
}
if(userDto.getRole_id()==0){
throw new ApiException("用户无权限");
}
ShopPageApp shopPageApp = new ShopPageApp();
shopPageApp.setApp_name(appName);
shopPageApp.setApp_code("[]");
shopPageApp.setTpl_id(107);
shopPageApp.setTpl_image("");
shopPageApp.setStore_id(Integer.valueOf(userDto.getStore_id()));
shopPageApp.setUser_id(userDto.getId());
shopPageApp.setSubsite_id(0);
shopPageApp.setApp_buildin(0);
shopPageApp.setApp_type(3);
shopPageApp.setApp_tpl("");
shopPageApp.setApp_member_center("");
shopPageApp.setApp_industry(appIndustry);
shopPageAppService.save(shopPageApp);
return CommonResult.success();
}
/** /**
* 生产新的id * 生产新的id
@ -1121,6 +1147,4 @@ public class ShopPageAppServiceImpl extends BaseServiceImpl<ShopPageAppMapper, S
} }
return resultMap; return resultMap;
} }
} }