feat: 产品中心
This commit is contained in:
parent
f839f2a450
commit
55e63b36e6
|
|
@ -197,7 +197,7 @@ public class ProductModelController extends ControllerBase{
|
|||
* 获取设备介绍详情
|
||||
* @param introId 机型介绍id
|
||||
*/
|
||||
@PostMapping("/getIntroInfo")
|
||||
@GetMapping("/getIntroInfo")
|
||||
public ApiResult<List<ProductModelIntroItem>> getIntroInfo(@Valid @RequestParam @NotNull Integer introId){
|
||||
return ApiResult.success(productModelIntroService.getInfo(introId));
|
||||
}
|
||||
|
|
@ -218,7 +218,7 @@ public class ProductModelController extends ControllerBase{
|
|||
*/
|
||||
@PostMapping("/publishParams")
|
||||
public ApiResult<Void> publishParams(@Valid @RequestBody ProductPublishRequest request){
|
||||
productModelParamsService.publish(request,false);
|
||||
productModelParamsService.publish(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
|
|
@ -228,7 +228,7 @@ public class ProductModelController extends ControllerBase{
|
|||
*/
|
||||
@PostMapping("/getParamsList")
|
||||
public ApiResult<PageData<ProductModelParams>> getParamsList(@Valid @RequestBody ProductModelIntroSearchRequest request){
|
||||
return ApiResult.success(productModelParamsService.getList(request,false));
|
||||
return ApiResult.success(productModelParamsService.getList(request));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull;
|
|||
public class ProductPublishRequest {
|
||||
|
||||
@NotNull
|
||||
private String id;
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 发布状态,1:发布;2:取消发布;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
package com.nflg.mobilebroken.repository.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
|
|
@ -40,6 +42,7 @@ public class ProductModelIntroItem implements Serializable {
|
|||
/**
|
||||
* 机型介绍
|
||||
*/
|
||||
@TableField("`desc`")
|
||||
private String desc;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ public interface IProductModelParamsService extends IService<ProductModelParams>
|
|||
|
||||
void delete(@Valid BatchDeleteRequest request);
|
||||
|
||||
void publish(@Valid ProductPublishRequest request,boolean main);
|
||||
void publish(@Valid ProductPublishRequest request);
|
||||
|
||||
IPage<ProductModelParams> getList(ProductModelIntroSearchRequest request, boolean main);
|
||||
IPage<ProductModelParams> getList(ProductModelIntroSearchRequest request);
|
||||
|
||||
List<ProductModelParamVO> getListByLanguage(Integer modelId, String language,boolean main);
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,9 @@ public class ProductModelParamsServiceImpl extends ServiceImpl<ProductModelParam
|
|||
@Override
|
||||
public Integer add(Integer modelId) {
|
||||
ProductModelParams info=new ProductModelParams()
|
||||
.setModelId(modelId);
|
||||
.setModelId(modelId)
|
||||
.setCreateBy(AdminUserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
save(info);
|
||||
return info.getId();
|
||||
}
|
||||
|
|
@ -87,7 +89,7 @@ public class ProductModelParamsServiceImpl extends ServiceImpl<ProductModelParam
|
|||
}
|
||||
|
||||
@Override
|
||||
public void publish(ProductPublishRequest request,boolean main) {
|
||||
public void publish(ProductPublishRequest request) {
|
||||
ProductModelParams info = getById(request.getId());
|
||||
VUtils.trueThrowBusinessError(Objects.isNull(info)).throwMessage("无效的数据");
|
||||
VUtils.trueThrowBusinessError(Objects.equals(info.getState(), request.getState()))
|
||||
|
|
@ -117,7 +119,7 @@ public class ProductModelParamsServiceImpl extends ServiceImpl<ProductModelParam
|
|||
}
|
||||
|
||||
@Override
|
||||
public IPage<ProductModelParams> getList(ProductModelIntroSearchRequest request, boolean main) {
|
||||
public IPage<ProductModelParams> getList(ProductModelIntroSearchRequest request) {
|
||||
return lambdaQuery()
|
||||
.eq(ProductModelParams::getModelId, request.getModelId())
|
||||
.eq(Objects.nonNull(request.getState()), ProductModelParams::getState, request.getState())
|
||||
|
|
|
|||
Loading…
Reference in New Issue