@@ -356,5 +356,12 @@ public class UserMouldVideoController extends BaseController { | |||||
} | } | ||||
} | } | ||||
@ApiOperation("获取视频是否生成成功") | |||||
@GetMapping("/checkVideoStatus") | |||||
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||||
public ResultData checkVideoStatus(@RequestParam("list") List<Long> list) { | |||||
return userMouldVideoService.checkVideoStatus(getMemberId(),list); | |||||
} | |||||
} | } |
@@ -25,4 +25,6 @@ public interface UserMouldVideoMapper extends CommonMapper<UserMouldVideo, Long> | |||||
List<UserMouldVideo> getNotHaveUrl(UserMouldVideo record); | List<UserMouldVideo> getNotHaveUrl(UserMouldVideo record); | ||||
Integer checkVideoStatus(@Param("userId") Long userId, @Param("list") List<Long> list); | |||||
} | } |
@@ -60,4 +60,6 @@ public interface UserMouldVideoService { | |||||
List<UserMouldVideo> getNotHaveUrl(); | List<UserMouldVideo> getNotHaveUrl(); | ||||
UserMouldVideo getUserVideo(Long id); | UserMouldVideo getUserVideo(Long id); | ||||
ResultData checkVideoStatus(Long userId, List<Long> ids); | |||||
} | } |
@@ -38,6 +38,7 @@ import org.springframework.scheduling.annotation.AsyncResult; | |||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
import org.springframework.transaction.annotation.Propagation; | import org.springframework.transaction.annotation.Propagation; | ||||
import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
import org.springframework.util.CollectionUtils; | |||||
import java.net.URL; | import java.net.URL; | ||||
import java.util.*; | import java.util.*; | ||||
@@ -575,4 +576,16 @@ public class UserMouldVideoServiceImpl implements UserMouldVideoService { | |||||
return userMouldVideoMapper.selectById(id); | return userMouldVideoMapper.selectById(id); | ||||
} | } | ||||
@Override | |||||
public ResultData checkVideoStatus(Long userId, List<Long> ids) { | |||||
if (CollectionUtils.isEmpty(ids)){ | |||||
return new ResultData(ErrorCode.VIDEO_CREATING.getCode(),""); | |||||
} | |||||
Integer integer = userMouldVideoMapper.checkVideoStatus(userId,ids); | |||||
if (integer > 0){ | |||||
return new ResultData("生成视频成功"); | |||||
} | |||||
return new ResultData(ErrorCode.VIDEO_CREATING.getCode(),"视频生成中"); | |||||
} | |||||
} | } |
@@ -181,5 +181,18 @@ | |||||
and (`cover_img` = '' or `cover_img` is null) | and (`cover_img` = '' or `cover_img` is null) | ||||
</select> | </select> | ||||
<select id="checkVideoStatus" resultType="java.lang.Integer"> | |||||
select count(1) | |||||
from user_mould_video | |||||
where user_id = #{userId} | |||||
and (video_status = 5 or video_status = 11) | |||||
<if test="list != null and list.size > 0"> | |||||
and id in | |||||
<foreach collection="list" index="index" item="id" open="(" separator="," close=")"> | |||||
#{id} | |||||
</foreach> | |||||
</if> | |||||
</select> | |||||
</mapper> | </mapper> |