初始化
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
//AI 模版项:脱衣/换脸/绘画列表共用
|
||||
class AiChangeFaceVideoMod {
|
||||
String? id;
|
||||
String? title;
|
||||
String? sourceURL;
|
||||
int? status;
|
||||
int? playTime;
|
||||
String? cover;
|
||||
String? type;
|
||||
int? moduleType;
|
||||
int? hotValue;
|
||||
String? hotMark;
|
||||
int? coin;
|
||||
int? vipCoin;
|
||||
String? newUrl; // 图生视频结果
|
||||
int? styleType; // ai绘画
|
||||
|
||||
AiChangeFaceVideoMod.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
id = json['id'];
|
||||
title = json['title'];
|
||||
sourceURL = json['sourceURL'];
|
||||
status = json['status'];
|
||||
playTime = json['playTime'];
|
||||
cover = json['cover'];
|
||||
type = json['type'];
|
||||
moduleType = json['moduleType'];
|
||||
hotValue = json['hotValue'];
|
||||
hotMark = json['hotMark'];
|
||||
coin = json['coin'];
|
||||
vipCoin = json['vipCoin'];
|
||||
newUrl = json['newUrl'];
|
||||
styleType = json['styleType'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
//ai女友余额
|
||||
class AIGirlFriendBalanceModel {
|
||||
num? balance;
|
||||
|
||||
AIGirlFriendBalanceModel.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
balance = json['balance'];
|
||||
}
|
||||
}
|
||||
|
||||
//ai跳转url
|
||||
class AIGirlFriendUrlModel {
|
||||
String? url;
|
||||
|
||||
AIGirlFriendUrlModel.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
url = json['url'] ?? json['authUrl'];
|
||||
}
|
||||
}
|
||||
|
||||
//ai女友货币档位列表
|
||||
class AIGirlFriendCurrencys {
|
||||
List<AIGirlFriendCurrency>? list;
|
||||
|
||||
AIGirlFriendCurrencys.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
list = (json['list'] as List?)?.map((e) => AIGirlFriendCurrency.fromJson(e)).toList();
|
||||
}
|
||||
}
|
||||
|
||||
class AIGirlFriendCurrency {
|
||||
String? id; //货币id
|
||||
String? name; //货币名称
|
||||
num? coins; //购买货币数(对应积分数量)
|
||||
num? price; //价格(对应需要支付的金币数量),
|
||||
String? couponDesc; //优惠描述
|
||||
int? type;
|
||||
|
||||
AIGirlFriendCurrency.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
coins = json['coins'];
|
||||
price = json['price'];
|
||||
couponDesc = json['couponDesc'];
|
||||
type = json['type'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
import 'package:hgdj/hj_utils/text_util.dart';
|
||||
|
||||
import '../../../hj_model/splash/ads_model.dart';
|
||||
import 'ai_change_face_video_model.dart';
|
||||
|
||||
//ai脱衣模版
|
||||
class AiModList {
|
||||
/// 脱衣模版
|
||||
List<AdsInfoModel>? aiUndressMod;
|
||||
|
||||
/// 图片转视频模版
|
||||
List<AdsInfoModel>? aiImgToVideoMod;
|
||||
|
||||
//ai绘画模版
|
||||
List<AiChangeFaceVideoMod>? aiTextToImgMod;
|
||||
|
||||
AiModList();
|
||||
|
||||
AiModList.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
aiUndressMod = (json['aiUndressMod'] as List?)
|
||||
?.map((e) => AdsInfoModel.fromJson(e))
|
||||
.toList();
|
||||
aiImgToVideoMod = (json['aiImgToVideoMod'] as List?)
|
||||
?.map((e) => AdsInfoModel.fromJson(e))
|
||||
.toList();
|
||||
aiTextToImgMod = (json['aiTextToImgMod'] as List?)
|
||||
?.map((e) => AiChangeFaceVideoMod.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
//ai换脸模版
|
||||
class AiChangeModList {
|
||||
String? categoryId;
|
||||
List<AICategoryMod>? categoryList;
|
||||
List<TemplateModel>? templateList;
|
||||
|
||||
AiChangeModList.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
categoryId = json['categoryId'];
|
||||
categoryList = (json['categoryList'] as List?)
|
||||
?.map((e) => AICategoryMod.fromJson(e))
|
||||
.toList();
|
||||
templateList = (json['templateList'] as List?)
|
||||
?.map((e) => TemplateModel.fromJson(e))
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
class AICategoryMod {
|
||||
int? appId;
|
||||
String? createdAt;
|
||||
String? id;
|
||||
String? name;
|
||||
int? sortCode;
|
||||
int? status;
|
||||
List<String>? templateIds;
|
||||
int? type;
|
||||
String? updatedAt;
|
||||
|
||||
AICategoryMod.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
appId = json['appId'];
|
||||
createdAt = json['createdAt'];
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
sortCode = json['sortCode'];
|
||||
status = json['status'];
|
||||
templateIds = parseStringList(json['templateIds']);
|
||||
type = json['type'];
|
||||
updatedAt = json['updatedAt'];
|
||||
}
|
||||
}
|
||||
|
||||
class TemplateModel {
|
||||
String? categoryId; //分类id
|
||||
int? coin; //价格(金豆)
|
||||
String? cover; //封面
|
||||
String? createdAt; //创建时间
|
||||
String? id;
|
||||
int? moduleType; //换脸模版类型 0 图片 1 视频
|
||||
String? mp4Url; //视频mp4地址
|
||||
String? m3u8Url;
|
||||
String? title;
|
||||
int? usedCount; //模版使用次数
|
||||
int? vipCoin;
|
||||
|
||||
/// 上架时间戳,模版列表按它排序;时间解析不了按 0 排最前
|
||||
int get timestamp =>
|
||||
DateTime.tryParse(createdAt ?? '')?.millisecondsSinceEpoch ?? 0;
|
||||
|
||||
TemplateModel.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
categoryId = json['categoryId'];
|
||||
coin = json['coin'];
|
||||
cover = json['cover'];
|
||||
createdAt = json['createdAt'];
|
||||
id = json['id'];
|
||||
m3u8Url = json['m3u8Url'];
|
||||
moduleType = json['moduleType'];
|
||||
mp4Url = json['mp4Url'];
|
||||
title = json['title'];
|
||||
usedCount = json['usedCount'];
|
||||
vipCoin = json['vipCoin'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
ai 视频换脸的数据注释:
|
||||
modCover 模版图片
|
||||
modMp4Url 模版视频
|
||||
picture换脸图片(用户提交的)
|
||||
cover换脸后封面大图
|
||||
url换脸后视频地址
|
||||
*/
|
||||
|
||||
import 'package:hgdj/hj_utils/text_util.dart';
|
||||
|
||||
import '../../../config/address.dart';
|
||||
|
||||
class AiRecordModel {
|
||||
String? id;
|
||||
int? uid;
|
||||
String? originPic;
|
||||
String? imgUrl;
|
||||
String? newImgUrl;
|
||||
String? styleUrl;
|
||||
String? text;
|
||||
List<String>? originPics;
|
||||
List<String>? newPic;
|
||||
List<String>? picture;
|
||||
int? coin;
|
||||
int? status;
|
||||
String? remark;
|
||||
String? url;
|
||||
String? updateAct;
|
||||
String? createdAt;
|
||||
String? updatedAt;
|
||||
String? vidId;
|
||||
String? modPic;
|
||||
String? modCover;
|
||||
String? modMp4Url;
|
||||
String? cover;
|
||||
String? content;
|
||||
String? characterSetting; //小说人物设定/故事背景等
|
||||
String? description; //故事情节描述
|
||||
String? details; //细节说明/其他要求
|
||||
String? locationScene; //地点场景
|
||||
|
||||
/// 换脸结果视频地址。query 用 cdn= 而不是 VideoModel 的 c=,两边接口不同,别顺手统一
|
||||
String get realVideoUrl =>
|
||||
"${Address.baseApiPath}/vid/h5/m3u8/$url?token=${Address.token}&cdn=${Address.cdnAddress}";
|
||||
|
||||
AiRecordModel.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
id = json['id'];
|
||||
uid = json['uid'];
|
||||
originPic = json['originPic'];
|
||||
newImgUrl = json['newImgUrl'];
|
||||
imgUrl = json['imgUrl'];
|
||||
styleUrl = json['styleUrl'];
|
||||
text = json['text'];
|
||||
originPics = parseStringList(json['originPics']);
|
||||
picture = parseStringList(json['picture']);
|
||||
newPic = parseStringList(json['newPic']);
|
||||
coin = json['coin'];
|
||||
status = json['status'];
|
||||
remark = json['remark'];
|
||||
url = json['url'];
|
||||
updateAct = json['updateAct'];
|
||||
createdAt = json['createdAt'];
|
||||
updatedAt = json['updatedAt'];
|
||||
vidId = json['vidId'];
|
||||
modPic = json['modPic'];
|
||||
modCover = json['modCover'];
|
||||
modMp4Url = json['modMp4Url'];
|
||||
cover = json['cover'];
|
||||
content = json['content'];
|
||||
characterSetting = json['characterSetting'];
|
||||
description = json['description'];
|
||||
details = json['details'];
|
||||
locationScene = json['locationScene'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
import '../../../hj_model/video_model.dart';
|
||||
|
||||
class AISquareItemModel {
|
||||
String? createdAt;
|
||||
String? gender;
|
||||
String? generateImage;
|
||||
String? generateVideo;
|
||||
String? generateVideoCover;
|
||||
String? id;
|
||||
String? name;
|
||||
String? originContent;
|
||||
String? originalImage;
|
||||
String? originalVideo;
|
||||
String? originalVideoCover;
|
||||
String? portrait;
|
||||
String? reason;
|
||||
String? reviewAt;
|
||||
int? sortCode;
|
||||
int? status;
|
||||
String? template;
|
||||
String? title;
|
||||
|
||||
/// 1-ai图片换脸 2-ai视频换脸 3-ai脱衣 4-ai图生视频 5-ai绘画
|
||||
int? type;
|
||||
int? uid;
|
||||
String? updatedAt;
|
||||
|
||||
/// 生成结果视频的播放地址,借 VideoModel 拼(拼接规则只在那一处维护)
|
||||
String get realGenerateVideoUrl => (VideoModel()..sourceURL = generateVideo).realVideoUrl;
|
||||
|
||||
String get typeString => switch (type) {
|
||||
1 => '图片换脸',
|
||||
2 => '视频换脸',
|
||||
3 => 'AI脱衣',
|
||||
4 => '图生视频',
|
||||
5 => 'AI绘画',
|
||||
_ => '',
|
||||
};
|
||||
|
||||
AISquareItemModel.fromJson(dynamic json) {
|
||||
json ??= {};
|
||||
createdAt = json['createdAt'];
|
||||
gender = json['gender'];
|
||||
generateImage = json['generateImage'];
|
||||
generateVideo = json['generateVideo'];
|
||||
generateVideoCover = json['generateVideoCover'];
|
||||
id = json['id'];
|
||||
name = json['name'];
|
||||
originContent = json['originContent'];
|
||||
originalImage = json['originalImage'];
|
||||
originalVideo = json['originalVideo'];
|
||||
originalVideoCover = json['originalVideoCover'];
|
||||
portrait = json['portrait'];
|
||||
reason = json['reason'];
|
||||
reviewAt = json['reviewAt'];
|
||||
sortCode = json['sortCode'];
|
||||
status = json['status'];
|
||||
template = json['template'];
|
||||
title = json['title'];
|
||||
type = json['type'];
|
||||
uid = json['uid'];
|
||||
updatedAt = json['updatedAt'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user