|
|
@@ -7,6 +7,7 @@ import com.izouma.nineth.dto.PageQuery;
|
|
|
import com.izouma.nineth.enums.AssetStatus;
|
|
|
import com.izouma.nineth.enums.AuthStatus;
|
|
|
import com.izouma.nineth.enums.CollectionType;
|
|
|
+import com.izouma.nineth.enums.ShowroomType;
|
|
|
import com.izouma.nineth.exception.BusinessException;
|
|
|
import com.izouma.nineth.repo.*;
|
|
|
import com.izouma.nineth.utils.JpaUtils;
|
|
|
@@ -127,7 +128,7 @@ public class ShowroomService {
|
|
|
.userId(asset.getUserId())
|
|
|
.assetId(asset.getId())
|
|
|
.nickname(asset.getOwner())
|
|
|
- .type("USER")
|
|
|
+ .type(ShowroomType.USER)
|
|
|
.status(AuthStatus.SUCCESS)
|
|
|
.build();
|
|
|
showroom = showroomRepo.save(showroom);
|
|
|
@@ -156,7 +157,7 @@ public class ShowroomService {
|
|
|
.publish(false)
|
|
|
.userId(user.getId())
|
|
|
.nickname(user.getNickname())
|
|
|
- .type(type)
|
|
|
+ .type(ShowroomType.valueOf(type))
|
|
|
.status(AuthStatus.NOT_AUTH)
|
|
|
.build();
|
|
|
showroom = showroomRepo.save(showroom);
|
|
|
@@ -221,7 +222,7 @@ public class ShowroomService {
|
|
|
} else {
|
|
|
Collection collection = collectionMap.get(coll.getCollectionId());
|
|
|
if (ObjectUtils.isNotEmpty(collection)) {
|
|
|
- if ("COMPANY_BOX".equals(recordRoom.getType())) {
|
|
|
+ if (ShowroomType.COMPANY_BOX.equals(recordRoom.getType())) {
|
|
|
if (!CollectionType.BLIND_BOX.equals(collection.getType())) {
|
|
|
throw new BusinessException("盲盒展厅,只能添加盲盒");
|
|
|
}
|
|
|
@@ -259,7 +260,7 @@ public class ShowroomService {
|
|
|
|
|
|
public void audit(Long id, AuthStatus status, String reason) {
|
|
|
Showroom showroom = showroomRepo.findById(id).orElseThrow(new BusinessException("无展厅"));
|
|
|
- if (!"COMPANY".equals(showroom.getType())) {
|
|
|
+ if (ShowroomType.USER.equals(showroom.getType())) {
|
|
|
// 非企业类型不需要审核
|
|
|
showroom.setStatus(null);
|
|
|
showroomRepo.save(showroom);
|