|
@ -6,12 +6,14 @@ import java.sql.SQLException;
|
6
|
6
|
import java.util.List;
|
7
|
7
|
|
8
|
8
|
import org.jfw.apt.annotation.Autowrie;
|
|
9
|
import org.jfw.apt.annotation.Nullable;
|
9
|
10
|
import org.jfw.apt.web.annotation.Path;
|
10
|
11
|
import org.jfw.apt.web.annotation.operate.Get;
|
11
|
12
|
import org.jfw.apt.web.annotation.operate.Post;
|
12
|
13
|
import org.jfw.apt.web.annotation.param.JdbcConn;
|
13
|
14
|
import org.jfw.apt.web.annotation.param.PathVar;
|
14
|
15
|
import org.jfw.util.StringUtil;
|
|
16
|
import org.jfw.util.exception.JfwBaseException;
|
15
|
17
|
|
16
|
18
|
import com.ekexiu.portal.dao.AuthApplyDao;
|
17
|
19
|
import com.ekexiu.portal.dao.ProfessorDao;
|
|
@ -55,6 +57,7 @@ public class AuthApplyService {
|
55
|
57
|
@Path
|
56
|
58
|
public String insert(@JdbcConn(true) Connection con, AuthApply authApply) throws SQLException, IOException{
|
57
|
59
|
String authApplyId = StringUtil.buildUUID();
|
|
60
|
authApply.setSolveStatus(0);
|
58
|
61
|
authApply.setAuthApplyId(authApplyId);
|
59
|
62
|
this.authApplyDao.insert(con, authApply);
|
60
|
63
|
return authApplyId;
|
|
@ -62,7 +65,13 @@ public class AuthApplyService {
|
62
|
65
|
|
63
|
66
|
@Post
|
64
|
67
|
@Path("/state")
|
65
|
|
public void updateState(@JdbcConn(true) Connection con,String id,Integer state)throws SQLException{
|
|
68
|
public void updateState(@JdbcConn(true) Connection con,String id,Integer state,@Nullable Integer auth,@Nullable String professorId)throws SQLException, JfwBaseException{
|
|
69
|
if(state==2){
|
|
70
|
if(auth==null) throw new JfwBaseException(10);
|
|
71
|
if(professorId==null) throw new JfwBaseException(10);
|
|
72
|
if(auth>4 || auth <1) throw new JfwBaseException(11);
|
|
73
|
this.professorDao.updateAuthentication(con, professorId, auth);
|
|
74
|
}
|
66
|
75
|
this.authApplyDao.updateSolveStatus(con,state,id);
|
67
|
76
|
}
|
68
|
77
|
|