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