Skip to content

Commit

Permalink
Merge branch 'elimu-ai:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
venkatesh2k3 authored Jul 24, 2024
2 parents e9e9478 + d69a16d commit 24995ae
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 154 deletions.
30 changes: 20 additions & 10 deletions FUNDING_SPLITS.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
ethereum_address,github_username,impact_percentage
0x5D388Ec24Cc2C0C77458338696aa63AFB706A7b1,nya-elimu,49.39
0xd46Cc93E3eE6a4fb532D9B48E95be7eD8f8f1DA0,jo-elimu,39.00
0x3965d420cde24fe00f742cb31257ca90e04556a7,tomaszsmy,1.14
0x819e4F5E912abb36c8f6c03790e7508e03cc37a3,UmenR,1.08
0x342FaeB14127A79735144bbdC772AbB6b1bBe343,coderabbitai,1.05
0x5367a6d4F5991327Bb20466684790e394bE000dE,Shubham-Vishwakarma,0.73
0x0000000000000000000000000000000000000000,aschworer,0.70
0x513DceE2929a6e0CD115fb65Ec926d6569d98aff,venkatesh2k3,0.58
0x4709ebf314c6492d57f4c6d4f57357d5b2bb074e,vrudas,0.55
0x914dBEe36BcAb63B2D15fAED08839Be43797b421,hhio618,0.55
0x5D388Ec24Cc2C0C77458338696aa63AFB706A7b1,nya-elimu,47.52
0xd46Cc93E3eE6a4fb532D9B48E95be7eD8f8f1DA0,jo-elimu,39.09
0x342FaeB14127A79735144bbdC772AbB6b1bBe343,coderabbitai,2.48
0x3965d420cde24fe00f742cb31257ca90e04556a7,tomaszsmy,1.07
0x819e4F5E912abb36c8f6c03790e7508e03cc37a3,UmenR,1.01
0x513DceE2929a6e0CD115fb65Ec926d6569d98aff,venkatesh2k3,0.69
0x5367a6d4F5991327Bb20466684790e394bE000dE,Shubham-Vishwakarma,0.68
0x0000000000000000000000000000000000000000,aschworer,0.65
0x4709ebf314c6492d57f4c6d4f57357d5b2bb074e,vrudas,0.54
0x914dBEe36BcAb63B2D15fAED08839Be43797b421,hhio618,0.52
0x0000000000000000000000000000000000000000,urosht,0.51
0x78888390AA08D9A25f3BDB8A1B35351D7c7F8a12,Bender-22,0.42
0x914dBEe36BcAb63B2D15fAED08839Be43797b421,watr-sheep,0.34
0x0000000000000000000000000000000000000000,eymaal,0.32
0x0000000000000000000000000000000000000000,jpatel3,0.31
0x0000000000000000000000000000000000000000,Keerthi4308,0.31
0x0000000000000000000000000000000000000000,alexander-kuruvilla,0.29
0x0000000000000000000000000000000000000000,SnehaHS65,0.27
0x0000000000000000000000000000000000000000,vuriaval,0.26
0x0000000000000000000000000000000000000000,SamehNoukary,0.25
88 changes: 0 additions & 88 deletions FUNDING_SPLITS_HIN.csv

This file was deleted.

25 changes: 0 additions & 25 deletions FUNDING_SPLITS_TGL.csv

This file was deleted.

4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>ai.elimu</groupId>
<artifactId>webapp</artifactId>
<packaging>war</packaging>
<version>2.4.18-SNAPSHOT</version>
<version>2.4.20-SNAPSHOT</version>

<properties>
<java.version>11</java.version>
Expand Down Expand Up @@ -90,7 +90,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>0.8.12</version>
<executions>
<execution>
<goals>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ai/elimu/dao/DeviceDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

public interface DeviceDao extends GenericDao<Device> {

Device read(String deviceId) throws DataAccessException;
Device read(String androidId) throws DataAccessException;
}
6 changes: 3 additions & 3 deletions src/main/java/ai/elimu/dao/jpa/DeviceDaoJpa.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
public class DeviceDaoJpa extends GenericDaoJpa<Device> implements DeviceDao {

@Override
public Device read(String deviceId) throws DataAccessException {
public Device read(String androidId) throws DataAccessException {
try {
return (Device) em.createQuery(
"SELECT d " +
"FROM Device d " +
"WHERE d.deviceId = :deviceId")
.setParameter("deviceId", deviceId)
"WHERE d.androidId = :androidId")
.setParameter("androidId", androidId)
.getSingleResult();
} catch (NoResultException e) {
return null;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/ai/elimu/model/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Device extends BaseEntity {

@NotNull
@Column(unique=true)
private String deviceId;
private String androidId;

@NotNull
private String deviceManufacturer;
Expand All @@ -33,12 +33,12 @@ public class Device extends BaseEntity {
@NotNull
private Integer osVersion;

public String getDeviceId() {
return deviceId;
public String getAndroidId() {
return androidId;
}

public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
public void setAndroidId(String androidId) {
this.androidId = androidId;
}

public String getDeviceManufacturer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.io.Resource;
import org.springframework.web.context.ConfigurableWebApplicationContext;
import org.springframework.web.context.ContextLoaderListener;
Expand Down Expand Up @@ -140,16 +137,9 @@ protected void customizeContext(ServletContext servletContext, ConfigurableWebAp
}
}

PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer();
propertyPlaceholderConfigurer.setProperties(PROPERTIES);
applicationContext.addBeanFactoryPostProcessor(new BeanFactoryPostProcessor() {
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException {
PropertyPlaceholderConfigurer propertyPlaceholderConfigurer = new PropertyPlaceholderConfigurer();
propertyPlaceholderConfigurer.setProperties(PROPERTIES);
propertyPlaceholderConfigurer.postProcessBeanFactory(configurableListableBeanFactory);
}
});
PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer();
propertySourcesPlaceholderConfigurer.setProperties(PROPERTIES);
applicationContext.addBeanFactoryPostProcessor(propertySourcesPlaceholderConfigurer);
}

// Add all supported languages
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/META-INF/jpa-schema-export.sql
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@

create table Device (
id bigint not null auto_increment,
deviceId varchar(255),
androidId varchar(255),
deviceManufacturer varchar(255),
deviceModel varchar(255),
deviceSerial varchar(255),
Expand Down Expand Up @@ -695,7 +695,7 @@
add constraint UK_gdl53lyf9qvi56fmbrk9nfrg9 unique (version);

alter table Device
add constraint UK_ktkbd0xm3q2nddw1xxtdaxjy7 unique (deviceId);
add constraint UK_c2646199whiqrkjbht7hwyr3v unique (androidId);

alter table Application
add constraint FKn1pft600om9qs7dn754chjk67
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/db/migration/2004020.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 2.4.20
ALTER TABLE `Device` DROP COLUMN `deviceId`;
ALTER TABLE `Device` CHANGE `deviceId` `androidId` VARCHAR(255);
8 changes: 4 additions & 4 deletions src/test/java/ai/elimu/dao/DeviceDaoTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public void testRead() {
deviceDao.create(getDevice("22"));
deviceDao.create(getDevice("44"));

assertEquals("22", deviceDao.read("22").getDeviceId());
assertEquals("44", deviceDao.read("44").getDeviceId());
assertEquals("22", deviceDao.read("22").getAndroidId());
assertEquals("44", deviceDao.read("44").getAndroidId());
assertNull(deviceDao.read("33"));
}

private Device getDevice(String deviceId) {
private Device getDevice(String androidId) {
Device device = new Device();
device.setDeviceId(deviceId);
device.setAndroidId(androidId);
return device;
}
}

0 comments on commit 24995ae

Please sign in to comment.