|
@@ -11,6 +11,7 @@ import com.tzld.longarticle.recommend.server.repository.model.GhDetailExample;
|
|
|
import com.tzld.longarticle.recommend.server.service.exterior.GhDetailService;
|
|
|
import com.tzld.longarticle.recommend.server.util.page.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -63,6 +64,14 @@ public class GhDetailServiceImpl implements GhDetailService {
|
|
|
|
|
|
@Override
|
|
|
public CommonResponse<Void> addGhDetail(GhDetailVo ghDetailVo) {
|
|
|
+ if (ghDetailVo == null
|
|
|
+ || StringUtils.isEmpty(ghDetailVo.getGhId())
|
|
|
+ || StringUtils.isEmpty(ghDetailVo.getGhName())
|
|
|
+ || ghDetailVo.getType() == null
|
|
|
+ || StringUtils.isEmpty(ghDetailVo.getCategory1())) {
|
|
|
+ CommonResponse.create(500, "参数错误");
|
|
|
+ }
|
|
|
+
|
|
|
try {
|
|
|
GhDetail ghDetail = new GhDetail();
|
|
|
BeanUtils.copyProperties(ghDetailVo, ghDetail);
|