fix: Spring 多构造器类显式 @Autowired 标注 + V95 迁移兼容 MySQL 8.4
- CapacityPlanService / ExternalCallMetricsRecorder / ZiniaoClientImpl: 双构造器(生产 + 测试入口)导致 Spring 6 不自动推断构造器注入, 启动报 'No default constructor found';生产构造器显式加 @Autowired - V95:shop_key 列 V85 建表时已有,原 ADD COLUMN shop_key 会报 duplicate column;MySQL 8.4 不支持 ADD COLUMN IF NOT EXISTS,改 information_schema 动态 SQL;shop_key 缩到 VARCHAR(255) 以容纳 (shop_key, business_date) 唯一键(1000 在 utf8mb4 下超 3072 字节 索引上限);删除多余行改为单表 DELETE
This commit is contained in:
+3
@@ -6,6 +6,7 @@ import com.nanri.aiimage.common.exception.BusinessException;
|
||||
import com.nanri.aiimage.config.ZiniaoProperties;
|
||||
import com.nanri.aiimage.modules.ziniao.model.cache.ZiniaoShopCacheDto;
|
||||
import com.nanri.aiimage.modules.ziniao.model.vo.ZiniaoStaffItemVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatusCode;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
@@ -26,6 +27,8 @@ public class ZiniaoClientImpl implements ZiniaoClient {
|
||||
private final ObjectMapper objectMapper;
|
||||
private final com.nanri.aiimage.metrics.ExternalCallMetricsRecorder externalCallMetrics;
|
||||
|
||||
/** 生产构造:双构造器下 Spring 不会自动推断,必须显式 @Autowired。 */
|
||||
@Autowired
|
||||
public ZiniaoClientImpl(ZiniaoProperties ziniaoProperties, ObjectMapper objectMapper) {
|
||||
this(ziniaoProperties, objectMapper, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user