| @@ -0,0 +1,2 @@ | |||||
| ALTER TABLE `mallink_suimang_test`.`voice_material` | |||||
| ADD COLUMN `type` int NULL COMMENT '1-上传、2-录音' AFTER `type`; | |||||
| @@ -63,6 +63,9 @@ public class PhotoSpeakVideoController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private MusicInfoService musicInfoService; | private MusicInfoService musicInfoService; | ||||
| @Autowired | |||||
| private VoiceMaterialService voiceMaterialService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @GetMapping("list") | @GetMapping("list") | ||||
| @ApiImplicitParams({ | @ApiImplicitParams({ | ||||
| @@ -93,6 +96,10 @@ public class PhotoSpeakVideoController extends BaseController { | |||||
| VoiceInfo voiceInfo = voiceInfoService.getById(photoSpeakVideo.getVoiceMouldId()); | VoiceInfo voiceInfo = voiceInfoService.getById(photoSpeakVideo.getVoiceMouldId()); | ||||
| photoSpeakVideo.setVoiceInfo(voiceInfo); | photoSpeakVideo.setVoiceInfo(voiceInfo); | ||||
| } | } | ||||
| if(photoSpeakVideo.getVoiceMaterialId() != null){ | |||||
| VoiceMaterial voiceMaterial = voiceMaterialService.getById(photoSpeakVideo.getVoiceMaterialId()); | |||||
| photoSpeakVideo.setVoiceMaterial(voiceMaterial); | |||||
| } | |||||
| return new ResultData(photoSpeakVideo); | return new ResultData(photoSpeakVideo); | ||||
| } | } | ||||
| @@ -69,7 +69,7 @@ public class VoiceMaterialController extends BaseController { | |||||
| public ResultData save(@RequestBody VoiceMaterial record) { | public ResultData save(@RequestBody VoiceMaterial record) { | ||||
| logger.debug("[" + getIpAddr() + "] VoiceMaterialController::save"); | logger.debug("[" + getIpAddr() + "] VoiceMaterialController::save"); | ||||
| if(record == null)record = new VoiceMaterial(); | if(record == null)record = new VoiceMaterial(); | ||||
| record.setSendType(EnumMouldSendType.build.getCode()); | |||||
| // record.setSendType(EnumMouldSendType.build.getCode()); | |||||
| record.setUserId(getMemberId()); | record.setUserId(getMemberId()); | ||||
| if(StringUtils.isBlank(record.getVideoId())){ | if(StringUtils.isBlank(record.getVideoId())){ | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"音频为空"); | return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"音频为空"); | ||||
| @@ -77,6 +77,9 @@ public class VoiceMaterialController extends BaseController { | |||||
| if(record.getTitle() == null){ | if(record.getTitle() == null){ | ||||
| record.setTitle("用户自建"); | record.setTitle("用户自建"); | ||||
| } | } | ||||
| if(record.getSendType() == null){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"上传音频类型不能为空"); | |||||
| } | |||||
| record.setPrice(0); | record.setPrice(0); | ||||
| record.setSalePrice(0); | record.setSalePrice(0); | ||||
| record.setStatus(EnumaMouldPatchStatus.put_on.getCode()); | record.setStatus(EnumaMouldPatchStatus.put_on.getCode()); | ||||
| @@ -366,11 +366,10 @@ public class WxUserGrantController extends BaseController { | |||||
| // if(isValidCode) { | // if(isValidCode) { | ||||
| basicInfo = wxCUserBasicInfoService.register(getTenantInfo(),phone,password); | basicInfo = wxCUserBasicInfoService.register(getTenantInfo(),phone,password); | ||||
| //TODO 用户 | |||||
| // Boolean aBoolean = userCreateVideoNumService.initializationUserCreateVideoNum(basicInfo.getId()); | |||||
| // if (!aBoolean){ | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "初始化创建视频时间表失败"); | |||||
| // } | |||||
| Boolean aBoolean = userCreateVideoNumService.initializationUserCreateVideoNum(basicInfo.getId()); | |||||
| if (!aBoolean){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "初始化创建视频时间表失败"); | |||||
| } | |||||
| return new ResultData(); | return new ResultData(); | ||||
| // } else { | // } else { | ||||
| // return new ResultData(ErrorCode.MSG_VERIFY_CODE_NOT_FOUND); | // return new ResultData(ErrorCode.MSG_VERIFY_CODE_NOT_FOUND); | ||||
| @@ -416,11 +415,10 @@ public class WxUserGrantController extends BaseController { | |||||
| // if(isValidCode) { | // if(isValidCode) { | ||||
| basicInfo = wxCUserBasicInfoService.registerEmail(getTenantInfo(),email,password); | basicInfo = wxCUserBasicInfoService.registerEmail(getTenantInfo(),email,password); | ||||
| //TODO 用户 | |||||
| // Boolean aBoolean = userCreateVideoNumService.initializationUserCreateVideoNum(basicInfo.getId()); | |||||
| // if (!aBoolean){ | |||||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "初始化创建视频时间表失败"); | |||||
| // } | |||||
| Boolean aBoolean = userCreateVideoNumService.initializationUserCreateVideoNum(basicInfo.getId()); | |||||
| if (!aBoolean){ | |||||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "初始化创建视频时间表失败"); | |||||
| } | |||||
| return new ResultData(); | return new ResultData(); | ||||
| // } else { | // } else { | ||||
| // return new ResultData(ErrorCode.MSG_VERIFY_CODE_NOT_FOUND); | // return new ResultData(ErrorCode.MSG_VERIFY_CODE_NOT_FOUND); | ||||
| @@ -2,7 +2,11 @@ package com.iformall.domain.po.sm; | |||||
| import com.baomidou.mybatisplus.annotation.TableField; | import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -10,8 +14,11 @@ import java.util.List; | |||||
| /** | /** | ||||
| * 声音表 | * 声音表 | ||||
| */ | */ | ||||
| @TableName(value = "voice_info") | |||||
| @Data | @Data | ||||
| public class VoiceInfo { | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class VoiceInfo extends TenantEntity { | |||||
| /** | /** | ||||
| * 主键ID | * 主键ID | ||||
| */ | */ | ||||
| @@ -21,14 +28,6 @@ public class VoiceInfo { | |||||
| */ | */ | ||||
| private Long languageId; | private Long languageId; | ||||
| /** | /** | ||||
| * 租户ID | |||||
| */ | |||||
| private String tenantId; | |||||
| /** | |||||
| * 父租户ID | |||||
| */ | |||||
| private String parentTenantId; | |||||
| /** | |||||
| * 性别 | * 性别 | ||||
| */ | */ | ||||
| private Integer sex; | private Integer sex; | ||||
| @@ -1,7 +1,11 @@ | |||||
| package com.iformall.domain.po.sm; | package com.iformall.domain.po.sm; | ||||
| import com.baomidou.mybatisplus.annotation.TableName; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import lombok.Data; | import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.Objects; | import java.util.Objects; | ||||
| @@ -9,21 +13,16 @@ import java.util.Objects; | |||||
| /** | /** | ||||
| * 语种表 | * 语种表 | ||||
| */ | */ | ||||
| @TableName(value = "voice_language") | |||||
| @Data | @Data | ||||
| public class VoiceLanguage implements Comparable { | |||||
| @ToString(callSuper = true) | |||||
| @EqualsAndHashCode(callSuper = true) | |||||
| public class VoiceLanguage extends TenantEntity { | |||||
| /** | /** | ||||
| * 主键ID | * 主键ID | ||||
| */ | */ | ||||
| private Long id; | private Long id; | ||||
| /** | |||||
| * 租户ID | |||||
| */ | |||||
| private String tenantId; | |||||
| /** | |||||
| * 父租户ID | |||||
| */ | |||||
| private String parentTenantId; | |||||
| /** | /** | ||||
| * 国家code | * 国家code | ||||
| */ | */ | ||||
| @@ -40,6 +39,10 @@ public class VoiceLanguage implements Comparable { | |||||
| * | * | ||||
| */ | */ | ||||
| private String name; | private String name; | ||||
| /** | |||||
| * | |||||
| */ | |||||
| private String chineseName; | |||||
| /** | /** | ||||
| * 图片 | * 图片 | ||||
| */ | */ | ||||
| @@ -57,19 +60,4 @@ public class VoiceLanguage implements Comparable { | |||||
| */ | */ | ||||
| private Integer isDel; | private Integer isDel; | ||||
| @Override | |||||
| public int compareTo(Object obj) { | |||||
| // 判断是否是学生类型 | |||||
| if (obj instanceof VoiceLanguage) { | |||||
| VoiceLanguage s = (VoiceLanguage) obj; | |||||
| // 如果是学生类型,如果学号相等,则不加入Set | |||||
| if (Objects.equals(s.getLanguage(), this.getLanguage()) && Objects.equals(s.getCountry(), this.getCountry())) { | |||||
| return 0; | |||||
| } else { | |||||
| return 1; | |||||
| } | |||||
| } else { | |||||
| return 0; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -118,5 +118,7 @@ public class VoiceMaterial extends TenantEntity { | |||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| private List<Integer> sendTypes; | private List<Integer> sendTypes; | ||||
| private Integer type; | |||||
| } | } | ||||
| @@ -7,7 +7,7 @@ import org.apache.ibatis.annotations.Param; | |||||
| import java.util.HashSet; | import java.util.HashSet; | ||||
| public interface VoiceLanguageMapper extends CommonMapper<VoiceLanguage, String> { | |||||
| public interface VoiceLanguageMapper extends CommonMapper<VoiceLanguage, Long> { | |||||
| void saveBatch(@Param("set") HashSet<VoiceLanguage> set); | void saveBatch(@Param("set") HashSet<VoiceLanguage> set); | ||||
| } | } | ||||
| @@ -20,7 +20,7 @@ public class VoiceLanguageServiceImpl implements VoiceLanguageService { | |||||
| @Override | @Override | ||||
| public List<VoiceLanguage> voiceTotal() { | public List<VoiceLanguage> voiceTotal() { | ||||
| List<VoiceLanguage> languages = voiceLanguageMapper.selectList(new LambdaQueryWrapper<VoiceLanguage>().eq(VoiceLanguage::getIsDel, 0).orderByAsc(VoiceLanguage::getName).select(VoiceLanguage::getId, VoiceLanguage::getName, VoiceLanguage::getImg)); | |||||
| List<VoiceLanguage> languages = voiceLanguageMapper.selectList(new LambdaQueryWrapper<VoiceLanguage>().eq(VoiceLanguage::getIsDel, 0).orderByAsc(VoiceLanguage::getName)); | |||||
| return CollectionUtils.isEmpty(languages) ? Lists.newArrayList() : languages; | return CollectionUtils.isEmpty(languages) ? Lists.newArrayList() : languages; | ||||
| } | } | ||||
| } | } | ||||