mirror of
https://github.com/dyiop/astute.git
synced 2025-04-05 13:00:16 -04:00
Session login and logout fixes
This commit is contained in:
parent
cc8e8f5feb
commit
931f2fd3bc
|
@ -107,6 +107,8 @@ public abstract class DAO {
|
|||
|
||||
public abstract List<ServiceType> getServiceTypes() throws AstuteException;
|
||||
|
||||
public abstract List<FeeType> getFeeTypes() throws AstuteException;
|
||||
|
||||
public abstract void createServiceType(String desc) throws AstuteException;
|
||||
|
||||
public abstract void updateServiceType(int serviceTypeId, String desc) throws AstuteException;
|
||||
|
|
|
@ -292,6 +292,25 @@ public class SqlDAO extends DAO {
|
|||
}
|
||||
}
|
||||
|
||||
public List<FeeType> getFeeTypes() throws AstuteException {
|
||||
try {
|
||||
List<FeeType> feeTypes = new ArrayList<FeeType>();
|
||||
Statement stmt = conn.createStatement();
|
||||
String sql = "SELECT FEE_TYPE_ID, FEE_TYPE_DESC FROM FEE_TYPE ORDER BY 1 ";
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
int feeTypeId = rs.getInt(1);
|
||||
String desc = rs.getString(2);
|
||||
FeeType feeType = new FeeType(feeTypeId, desc);
|
||||
feeTypes.add(feeType);
|
||||
}
|
||||
return feeTypes;
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
throw new AstuteException(DB_ERROR,e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
public void createServiceType(String desc) throws AstuteException {
|
||||
try {
|
||||
Statement stmt = conn.createStatement();
|
||||
|
|
27
AstuteSystem/src/main/java/com/astute/model/FeeType.java
Normal file
27
AstuteSystem/src/main/java/com/astute/model/FeeType.java
Normal file
|
@ -0,0 +1,27 @@
|
|||
package com.astute.model;
|
||||
|
||||
public class FeeType {
|
||||
int feeTypeId;
|
||||
String feeTypeDesc;
|
||||
|
||||
public FeeType(int feeTypeId, String feeTypeDesc) {
|
||||
this.feeTypeId = feeTypeId;
|
||||
this.feeTypeDesc = feeTypeDesc;
|
||||
}
|
||||
|
||||
public int getFeeTypeId() {
|
||||
return feeTypeId;
|
||||
}
|
||||
|
||||
public void setFeeTypeId(int feeTypeId) {
|
||||
this.feeTypeId = feeTypeId;
|
||||
}
|
||||
|
||||
public String getFeeTypeDesc() {
|
||||
return feeTypeDesc;
|
||||
}
|
||||
|
||||
public void setFeeTypeDesc(String feeTypeDesc) {
|
||||
this.feeTypeDesc = feeTypeDesc;
|
||||
}
|
||||
}
|
|
@ -107,5 +107,13 @@ public class POResource {
|
|||
return new ApiResponse(POService.getServiceTypes()).toResponse();
|
||||
}
|
||||
|
||||
@Path("/feeTypes")
|
||||
@GET
|
||||
public Response getFeeTypes(@QueryParam("sessionId") String sessionId) throws AstuteException {
|
||||
authService.authenticateSession(sessionId);
|
||||
return new ApiResponse(POService.getFeeTypes()).toResponse();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.astute.service;
|
||||
|
||||
import com.astute.exceptions.*;
|
||||
import com.astute.model.FeeType;
|
||||
import com.astute.model.PO;
|
||||
import com.astute.model.PODetail;
|
||||
import com.astute.model.ServiceType;
|
||||
|
@ -61,4 +62,10 @@ public class POService extends Service{
|
|||
public List<ServiceType> getServiceTypes() throws AstuteException {
|
||||
return getDao().getServiceTypes();
|
||||
}
|
||||
|
||||
|
||||
public List<FeeType> getFeeTypes() throws AstuteException {
|
||||
return getDao().getFeeTypes();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user