Browse Source

添加release版本

徐勤民 2 months ago
parent
commit
9f6d72eec6

+ 4 - 1
src/main/java/com/xuqm/server/appmanager/controller/releases/ReleaseV1Controller.java

@@ -40,9 +40,12 @@ public class ReleaseV1Controller {
         if (null == userInfo) {
             return new HttpResult<>(401, "登录失效", null);
         }
-        if (null == data.getAppId() || null == data.getUrl() || null == data.getVersionCode() || null == data.getVersionName()) {
+        if (null == data.getAppId() || null == data.getUrl() || null == data.getVersionName()) {
             return new HttpResult<>(201, "参数错误", null);
         } else {
+            if (data.getContent()!=null &&data.getContent().length()>50){
+                return new HttpResult<>(201, "更新内容最多50字", null);
+            }
             ApplicationEntity app = applicationRepository.findFirstByAppIdAndTenantNo(data.getAppId(), userInfo.getTenantNo());
             if (null == app) return new HttpResult<>(201, "appId不存在", null);
             ReleaseEntity release = releaseRepository.findFirstByAppIdAndTenantNoAndVersionCodeGreaterThanEqual(data.getAppId(), userInfo.getTenantNo(), data.getVersionCode());

+ 1 - 1
src/main/java/com/xuqm/server/appmanager/controller/releases/data/ReleaseAddData.java

@@ -14,7 +14,7 @@ public class ReleaseAddData {
     private boolean vivo;
     private boolean google;
     private String url;
-    private String versionCode;
+    private long versionCode;
     private String versionName;
     private String content;
 }

+ 1 - 1
src/main/java/com/xuqm/server/appmanager/entitys/sys/v1/ReleaseEntity.java

@@ -27,7 +27,7 @@ public class ReleaseEntity extends AbstractBaseTimeEntity {
     @Enumerated(EnumType.STRING)
     private AppStatus google;
     private String url;
-    private String versionCode;
+    private long versionCode;
     private String versionName;
     private String content;
 }

+ 1 - 1
src/main/java/com/xuqm/server/appmanager/repository/sys/v1/ReleaseRepository.java

@@ -9,6 +9,6 @@ import org.springframework.stereotype.Repository;
 
 @Repository
 public interface ReleaseRepository extends JpaRepository<ReleaseEntity, Long> {
-    ReleaseEntity findFirstByAppIdAndTenantNoAndVersionCodeGreaterThanEqual(String appId, String tenantNo, String versionCode);
+    ReleaseEntity findFirstByAppIdAndTenantNoAndVersionCodeGreaterThanEqual(String appId, String tenantNo, long versionCode);
     Page<ReleaseEntity> findAllByAppIdAndTenantNo(String appId, String tenantNo, Pageable pageable);
 }