host配置
This commit is contained in:
@@ -29,9 +29,9 @@ public class ListingController {
|
|||||||
@Operation(summary = "批量保存/更新商品", description = "根据 id 是否存在判断新增或更新,同时保存图片")
|
@Operation(summary = "批量保存/更新商品", description = "根据 id 是否存在判断新增或更新,同时保存图片")
|
||||||
@PostMapping("/batch")
|
@PostMapping("/batch")
|
||||||
public Response<Void> saveOrUpdate(
|
public Response<Void> saveOrUpdate(
|
||||||
@Parameter(description = "商品保存/更新表单") @RequestBody ListingSaveDTO dto) {
|
@Parameter(description = "商品保存/更新表单列表") @RequestBody List<ListingSaveDTO> dtoList) {
|
||||||
Long sellerId = UserContext.getUserId();
|
Long sellerId = UserContext.getUserId();
|
||||||
listingService.saveOrUpdate(dto, sellerId);
|
listingService.saveOrUpdate(dtoList, sellerId);
|
||||||
return Response.success();
|
return Response.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import com.aida.seller.module.listing.vo.ListingPageVO;
|
|||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品 Service 接口
|
* 商品 Service 接口
|
||||||
*/
|
*/
|
||||||
@@ -21,6 +23,14 @@ public interface ListingService extends IService<ListingEntity> {
|
|||||||
*/
|
*/
|
||||||
void saveOrUpdate(ListingSaveDTO dto, Long sellerId);
|
void saveOrUpdate(ListingSaveDTO dto, Long sellerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量保存或更新商品(含图片)
|
||||||
|
*
|
||||||
|
* @param dtoList 商品信息列表
|
||||||
|
* @param sellerId 卖家ID
|
||||||
|
*/
|
||||||
|
void saveOrUpdate(List<ListingSaveDTO> dtoList, Long sellerId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取商品详情(含所有图片)
|
* 获取商品详情(含所有图片)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -100,6 +100,18 @@ public class ListingServiceImpl extends ServiceImpl<ListingMapper, ListingEntity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void saveOrUpdate(List<ListingSaveDTO> dtoList, Long sellerId) {
|
||||||
|
if (CollectionUtils.isEmpty(dtoList)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ListingSaveDTO dto : dtoList) {
|
||||||
|
saveOrUpdate(dto, sellerId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ListingSaveDTO getById(Long id, Long sellerId) {
|
public ListingSaveDTO getById(Long id, Long sellerId) {
|
||||||
ListingEntity entity = this.getOne(
|
ListingEntity entity = this.getOne(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
# ============================================================
|
# ============================================================
|
||||||
|
|
||||||
nacos:
|
nacos:
|
||||||
namespace: dev
|
namespace: ltx
|
||||||
host: 18.167.251.121:28848
|
host: 18.167.251.121:28848
|
||||||
username: nacos
|
username: nacos
|
||||||
password: Aidlab123123!
|
password: Aidlab123123!
|
||||||
@@ -23,7 +23,6 @@ spring:
|
|||||||
username: ${nacos.username}
|
username: ${nacos.username}
|
||||||
password: ${nacos.password}
|
password: ${nacos.password}
|
||||||
hostname: master-aida-seller
|
hostname: master-aida-seller
|
||||||
ip-type: hostname
|
|
||||||
config:
|
config:
|
||||||
server-addr: ${nacos.host}
|
server-addr: ${nacos.host}
|
||||||
namespace: ${nacos.namespace}
|
namespace: ${nacos.namespace}
|
||||||
|
|||||||
Reference in New Issue
Block a user