File tree Expand file tree Collapse file tree 2 files changed +748
-2
lines changed
main/java/com/tinyengine/it/service/platform/impl
test/java/com/tinyengine/it/service/platform/impl Expand file tree Collapse file tree 2 files changed +748
-2
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ public List<PlatformHistory> queryAllPlatformHistory() {
5151 */
5252 @ Override
5353 public PlatformHistory queryPlatformHistoryById (Integer id ) {
54+ if (id == null ||id <=0 ) {
55+ throw new IllegalArgumentException ("id cannot be null" );
56+ }
5457 return baseMapper .queryPlatformHistoryById (id );
5558 }
5659
@@ -95,6 +98,7 @@ public Result<PlatformHistory> updatePlatformHistoryById(PlatformHistory platfor
9598 if (platformHistory == null || platformHistory .getId () == null ) {
9699 return Result .failed (ExceptionEnum .CM002 );
97100 }
101+
98102 int updateResult = baseMapper .updatePlatformHistoryById (platformHistory );
99103 if (updateResult != 1 ) {
100104 return Result .failed (ExceptionEnum .CM008 );
@@ -117,10 +121,10 @@ public Result<PlatformHistory> createPlatformHistory(PlatformHistory platformHis
117121 if (platformHistory .getRefId () == null ) {
118122 return Result .failed (ExceptionEnum .CM002 );
119123 }
120- if (platformHistory .getName () == null || platformHistory .getName ().isEmpty ()) {
124+ if (platformHistory .getName () == null || platformHistory .getName ().trim (). isEmpty ()) {
121125 return Result .failed (ExceptionEnum .CM002 );
122126 }
123- if (platformHistory .getVersion () == null || platformHistory .getVersion ().isEmpty ()) {
127+ if (platformHistory .getVersion () == null || platformHistory .getVersion ().trim (). isEmpty ()) {
124128 return Result .failed (ExceptionEnum .CM002 );
125129 }
126130 if (platformHistory .getMaterialHistoryId () == null ) {
You can’t perform that action at this time.
0 commit comments