You've already forked FrameTour-BE
This commit is contained in:
@@ -78,4 +78,13 @@ AppFaceController {
|
||||
List<ContentPageVO> contentPageVOS = faceService.faceContentList(faceId);
|
||||
return ApiResponse.success(contentPageVOS);
|
||||
}
|
||||
|
||||
@ApiOperation("绑定人脸")
|
||||
@PostMapping("/{faceId}/bind")
|
||||
public ApiResponse<String> bind(@PathVariable Long faceId) {
|
||||
JwtInfo worker = JwtTokenUtil.getWorker();
|
||||
Long userId = worker.getUserId();
|
||||
faceService.bindFace(faceId, userId);
|
||||
return ApiResponse.success("OK");
|
||||
}
|
||||
}
|
||||
|
@@ -43,6 +43,7 @@ public class GoodsDetailVO {
|
||||
private Integer isBuy;
|
||||
private Integer isFree;
|
||||
private Integer parts;
|
||||
private Integer sort;
|
||||
public Integer getSourceType() {
|
||||
return goodsType;
|
||||
}
|
||||
|
@@ -35,4 +35,5 @@ public class ContentPageVO {
|
||||
private BigDecimal duration;
|
||||
private Integer goodsType;
|
||||
private int freeCount;
|
||||
private Integer sort;
|
||||
}
|
||||
|
@@ -36,4 +36,6 @@ public interface FaceService {
|
||||
List<ContentPageVO> faceContentList(Long faceId);
|
||||
|
||||
ApiResponse<List<ContentPageVO>> contentListUseDefaultFace();
|
||||
|
||||
void bindFace(Long faceId, Long userId);
|
||||
}
|
||||
|
@@ -21,4 +21,5 @@ public interface SourceService {
|
||||
ApiResponse<Integer> update(SourceEntity source);
|
||||
|
||||
ApiResponse cutVideo(Long id);
|
||||
ApiResponse<String> uploadAndUpdateUrl(Long id, org.springframework.web.multipart.MultipartFile file);
|
||||
}
|
||||
|
@@ -381,6 +381,7 @@ public class FaceServiceImpl implements FaceService {
|
||||
List<MemberVideoEntity> memberVideoEntityList = videoMapper.userFaceTemplateVideo(userId, faceId, contentPageVO.getTemplateId());
|
||||
contentPageVO.setGoodsType(0);
|
||||
contentPageVO.setContentType(1);
|
||||
contentPageVO.setSort(contentPageVO.getSort());
|
||||
if (!memberVideoEntityList.isEmpty()) {
|
||||
contentPageVO.setIsBuy(memberVideoEntityList.getFirst().getIsBuy());
|
||||
contentPageVO.setContentId(memberVideoEntityList.getFirst().getVideoId());
|
||||
@@ -420,6 +421,8 @@ public class FaceServiceImpl implements FaceService {
|
||||
ContentPageVO sourceImageContent = new ContentPageVO();
|
||||
sourceVideoContent.setName("录像集");
|
||||
sourceImageContent.setName("照片集");
|
||||
sourceVideoContent.setSort(9999);
|
||||
sourceImageContent.setSort(9999);
|
||||
sourceVideoContent.setScenicId(faceRespVO.getScenicId());
|
||||
sourceImageContent.setScenicId(faceRespVO.getScenicId());
|
||||
sourceVideoContent.setGoodsType(1);
|
||||
@@ -489,5 +492,10 @@ public class FaceServiceImpl implements FaceService {
|
||||
return ApiResponse.success(contentPageVOS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindFace(Long faceId, Long userId) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@@ -7,13 +7,17 @@ import com.ycwl.basic.model.pc.source.entity.SourceEntity;
|
||||
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
||||
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
||||
import com.ycwl.basic.repository.SourceRepository;
|
||||
import com.ycwl.basic.service.pc.ScenicService;
|
||||
import com.ycwl.basic.service.pc.SourceService;
|
||||
import com.ycwl.basic.storage.adapters.IStorageAdapter;
|
||||
import com.ycwl.basic.task.VideoPieceGetter;
|
||||
import com.ycwl.basic.utils.ApiResponse;
|
||||
import com.ycwl.basic.utils.SnowFlakeUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ycwl.basic.storage.StorageFactory;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
@@ -30,6 +34,8 @@ public class SourceServiceImpl implements SourceService {
|
||||
private SourceMapper sourceMapper;
|
||||
@Autowired
|
||||
private SourceRepository sourceRepository;
|
||||
@Autowired
|
||||
private ScenicService scenicService;
|
||||
|
||||
@Override
|
||||
public ApiResponse<PageInfo<SourceRespVO>> pageQuery(SourceReqQuery sourceReqQuery) {
|
||||
@@ -137,4 +143,29 @@ public class SourceServiceImpl implements SourceService {
|
||||
}
|
||||
return ApiResponse.success("任务已下发");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ApiResponse<String> uploadAndUpdateUrl(Long id, MultipartFile file) {
|
||||
SourceRespVO source = sourceMapper.getById(id);
|
||||
if (source == null) {
|
||||
return ApiResponse.fail("该素材不存在");
|
||||
}
|
||||
try {
|
||||
IStorageAdapter adapter = scenicService.getScenicStorageAdapter(source.getScenicId());
|
||||
String uploadedUrl = adapter.uploadFile(file, "source", String.valueOf(id));
|
||||
|
||||
SourceEntity sourceUpd = new SourceEntity();
|
||||
sourceUpd.setId(id);
|
||||
sourceUpd.setUrl(uploadedUrl);
|
||||
|
||||
int updateResult = sourceMapper.update(sourceUpd);
|
||||
if (updateResult > 0) {
|
||||
return ApiResponse.success(uploadedUrl);
|
||||
} else {
|
||||
return ApiResponse.fail("更新URL失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return ApiResponse.fail("文件上传失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -112,7 +112,7 @@
|
||||
</select>
|
||||
<select id="listFor" resultType="com.ycwl.basic.model.mobile.scenic.content.ContentPageVO">
|
||||
select t.id templateId, t.scenic_id, s.name as scenic_name, t.`name`, pid, t.cover_url templateCoverUrl,
|
||||
0 as sourceType,
|
||||
0 as sourceType, sort,
|
||||
t.create_time, t.price
|
||||
from template t left join scenic s on s.id = t.scenic_id
|
||||
where t.scenic_id = #{scenicId} and pid = 0 and t.status = 1
|
||||
|
Reference in New Issue
Block a user