TSPTPStyleModel.swift 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // TSGenerateStyleModel.swift
  3. // AIEmoji
  4. //
  5. // Created by 100Years on 2025/2/25.
  6. //
  7. import ObjectMapper
  8. class TSGenerateModel: TSBaseModel {
  9. var imageName:String = ""
  10. var imageText:String = ""
  11. var prompt:String = ""
  12. var isVip:Bool = false
  13. var specialStyle:Int = 0 //0 普通类型,1 热门类型,2 新类型,3 max,
  14. var input:Bool = false //是否输入框
  15. var model:String = "" //走新的通道,根据内容确定
  16. var unionType:Int = 0 //聚合类型,相同的为一类
  17. var hintType:Int = 1 // 提示上传图片类型
  18. var template:String = "" //创建视频 V2的 模板
  19. override func mapping(map: ObjectMapper.Map) {
  20. imageName <- map["imageName"]
  21. imageText <- map["imageText"]
  22. prompt <- map["prompt"]
  23. isVip <- map["isVip"]
  24. specialStyle <- map["specialStyle"]
  25. input <- map["input"]
  26. model <- map["model"]
  27. unionType <- map["unionType"]
  28. hintType <- map["hintType"]
  29. template <- map["template"]
  30. }
  31. }
  32. class TSGenerateStyleModel: TSGenerateModel {
  33. var clickType:Int = 0 //0 无响应, 1空类型 2.换图
  34. var style:String = "" //风格类型(本地用)
  35. var styleId:String = "" //风格类型(网络用)
  36. var advance:Bool = false //走新的通道,chatgpt
  37. override func mapping(map: ObjectMapper.Map) {
  38. super.mapping(map: map)
  39. clickType <- map["clickType"]
  40. style <- map["style"]
  41. styleId <- map["styleId"]
  42. advance <- map["advance"]
  43. }
  44. var actionInfoModel:TSActionInfoModel? //对应生成的结果
  45. var isSelected: Bool = false //改风格,是否被选中
  46. var inputText:String = "" //用户自己补充的风格文字
  47. var upLoadImage:UIImage? //上传的图片
  48. var upLoadImageUrl:String? //上传的图片的 url
  49. var generateSize:CGSize? //生成图片的尺寸
  50. }
  51. extension TSGenerateStyleModel {
  52. var specialStyleImageNamed:String{
  53. if specialStyle == 1 {
  54. return "ptp_style_hot"
  55. }else if specialStyle == 2 {
  56. return "ptp_style_new"
  57. }else if specialStyle == 3 {
  58. return "ptp_style_max"
  59. }
  60. return ""
  61. }
  62. }