根据系统设置决定是否自动生成分享图(商品创建或者更新的时候自动创建对应分享图)

This commit is contained in:
Menethil
2018-07-29 17:49:41 +08:00
parent d1061b126c
commit 42834c5488
2 changed files with 8 additions and 0 deletions

View File

@@ -32,6 +32,9 @@ public class QCodeService {
* @param goodName
*/
public void createGoodShareImage(String goodId, String goodPicUrl, String goodName) {
if (!SystemConfig.isAutoCreateShareImage())
return;
try {
//创建该商品的二维码
File file = wxMaService.getQrcodeService().createWxaCodeUnlimit(goodId, "pages/index/index");

View File

@@ -60,6 +60,11 @@ public class SystemConfig extends BaseConfig {
return getConfig(PRE_FIX + "mallname");
}
public static boolean isAutoCreateShareImage() {
int autoCreate = getConfigInt("shareimage.autocreate");
return autoCreate == 0 ? false : true;
}
@Override
public String getPrefix() {
return PRE_FIX;