|
@@ -8,6 +8,7 @@ import com.fdkankan.common.exception.BusinessException;
|
|
import com.fdkankan.common.response.ResultData;
|
|
import com.fdkankan.common.response.ResultData;
|
|
import com.fdkankan.ucenter.entity.SceneApply;
|
|
import com.fdkankan.ucenter.entity.SceneApply;
|
|
import com.fdkankan.ucenter.service.ISceneApplyService;
|
|
import com.fdkankan.ucenter.service.ISceneApplyService;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
@@ -24,7 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
* @since 2022-07-15
|
|
* @since 2022-07-15
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("/demo/scen")
|
|
|
|
|
|
+@RequestMapping("/demo/scene")
|
|
public class SceneApplyController {
|
|
public class SceneApplyController {
|
|
@Autowired
|
|
@Autowired
|
|
private ISceneApplyService sceneApplyService;
|
|
private ISceneApplyService sceneApplyService;
|
|
@@ -34,6 +35,11 @@ public class SceneApplyController {
|
|
*/
|
|
*/
|
|
@PostMapping("/save")
|
|
@PostMapping("/save")
|
|
public ResultData save(@RequestBody SceneApply sceneApplyEntity){
|
|
public ResultData save(@RequestBody SceneApply sceneApplyEntity){
|
|
|
|
+ if(StringUtils.isEmpty(sceneApplyEntity.getName()) || StringUtils.isEmpty(sceneApplyEntity.getPhone())
|
|
|
|
+ || StringUtils.isEmpty(sceneApplyEntity.getCompany()) || StringUtils.isEmpty(sceneApplyEntity.getJob())
|
|
|
|
+ || StringUtils.isEmpty(sceneApplyEntity.getCountry()) || StringUtils.isEmpty(sceneApplyEntity.getRemark())){
|
|
|
|
+ throw new BusinessException(ErrorCode.MISSING_REQUIRED_PARAMETERS);
|
|
|
|
+ }
|
|
sceneApplyService.save(sceneApplyEntity);
|
|
sceneApplyService.save(sceneApplyEntity);
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
}
|
|
}
|