ソースを参照

新增获取App和增量包的信息

leijie 6 年 前
コミット
6cbc7f6794

+ 47 - 0
show-server/src/main/java/com/ai/ipu/show/dao/AppDao.java

@ -0,0 +1,47 @@
1
package com.ai.ipu.show.dao;
2
3
import com.ai.ipu.server.db.dao.impl.BaseDAO;
4
import com.ailk.common.data.IData;
5
import com.ailk.common.data.IDataset;
6
import com.ailk.org.apache.commons.lang3.StringUtils;
7
8
/**
9
 * @author leijie
10
 * @date 19/5/20 16:24
11
 * @des App版本
12
 */
13
public class AppDao extends BaseDAO{
14
15
    public AppDao(String connName) throws Exception {
16
        super(connName);
17
    }
18
19
    /**
20
     * 获取App版本信息
21
     * @param params
22
     * @return
23
     */
24
    public IDataset queryAppInfo(IData params) throws Exception {
25
        StringBuffer sql = new StringBuffer("SELECT app.APP_VERSION, app.PLATFORM, app.LASTEST_BUNDLE_VERSION FROM app ");
26
        if(!StringUtils.isEmpty(params.getString("PLATFORM"))){
27
            sql.append("WHERE app.PLATFORM = '" + params.getString("PLATFORM") + "'");
28
        }
29
        return queryList(sql.toString(),params);
30
    }
31
32
    /**
33
     * 获取所有app版本号
34
     * @return
35
     */
36
    public IDataset queryAppVs(){
37
38
        return null;
39
    }
40
41
    public IData queryLastest(IData params){
42
43
        return null;
44
    }
45
46
47
}

+ 38 - 0
show-server/src/main/java/com/ai/ipu/show/dao/BundleDao.java

@ -0,0 +1,38 @@
1
package com.ai.ipu.show.dao;
2
3
import com.ai.ipu.server.db.dao.impl.BaseDAO;
4
import com.ailk.common.data.IData;
5
import com.ailk.common.data.IDataset;
6
7
/**
8
 * @author leijie
9
 * @date 19/5/20 15:09
10
 * @des Bundle版本
11
 */
12
public class BundleDao extends BaseDAO{
13
14
    public static final String connName = "rninfo";
15
16
    public BundleDao(String connName) throws Exception {
17
        super(connName);
18
    }
19
20
    public int add(IData param){
21
22
        return 0;
23
    }
24
25
    public int delete(){
26
        return 0;
27
    }
28
29
    public int update(){
30
        return 0;
31
    }
32
33
    public IDataset query(){
34
35
        return null;
36
    }
37
38
}

+ 29 - 0
show-server/src/main/java/com/ai/ipu/show/dao/PatchDao.java

@ -0,0 +1,29 @@
1
package com.ai.ipu.show.dao;
2
3
import com.ai.ipu.server.db.dao.impl.BaseDAO;
4
import com.ailk.common.data.IData;
5
import com.ailk.common.data.IDataset;
6
import com.ailk.org.apache.commons.lang3.StringUtils;
7
8
/**
9
 * @author leijie
10
 * @date 19/5/20 16:25
11
 * @des patch增量包
12
 */
13
public class PatchDao extends BaseDAO{
14
    public PatchDao(String connName) throws Exception {
15
        super(connName);
16
    }
17
18
    /**
19
     * 获取更新包的信息
20
     * @param params
21
     * @return
22
     */
23
    public IDataset queryPatchInfo(IData params) throws Exception {
24
        StringBuilder sql = new StringBuilder("SELECT patch.PATCH_URL FROM patch WHERE patch.PLATFORM = 'Android'");
25
        String s1 = !StringUtils.isEmpty(params.getString("LAST_BUNDLE_VERSION")) ? "AND patch.LAST_BUNDLE_VERSION = '" + params.getString("LAST_BUNDLE_VERSION") + "'":  "";
26
        String s2 = !StringUtils.isEmpty(params.getString("UPDATE_BUNDLE_VERSION")) ? "AND patch.UPDATE_BUNDLE_VERSION = '" + params.getString("UPDATE_BUNDLE_VERSION") + "'" : "";
27
        return queryList(sql.append(s1 + s2).toString(),params);
28
    }
29
}

+ 8 - 0
show-server/src/main/java/com/ai/ipu/show/util/Constant.java

@ -16,4 +16,12 @@ public class Constant {
16 16
		public static final String IMAGE_RANDOM_CODE="IMAGE_RANDOM_CODE";
17 17
		public static final String RANDOM_CODE = "RANDOM_CODE";
18 18
	}
19
20
	/**
21
	 * bundle信息库名字
22
	 */
23
	public static class BundleConnName{
24
		public static final String RN_BUNDLE = "rnbundle";
25
	}
26
19 27
}