根据系统设置决定是否自动生成分享图(商品创建或者更新的时候自动创建对应分享图)
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user