XMTT vor 6 Jahren
Ursprung
Commit
7097fddf95

+ 1 - 6
src/main/java/com/ekexiu/project/storage/system/dao/UserDao.java

@ -13,7 +13,6 @@ import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
13 13
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
14 14
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
15 15
import org.jfw.apt.orm.annotation.dao.param.Set;
16
import org.jfw.apt.orm.annotation.dao.param.UnEquals;
17 16
import org.jfw.util.PageQueryResult;
18 17
19 18
import java.sql.Connection;
@ -32,10 +31,6 @@ public interface UserDao {
32 31
    @SelectOne
33 32
    User query(Connection con, String id) throws SQLException;
34 33
35
    @Nullable
36
    @SelectOne
37
    User querybyAccount(Connection con, String account) throws SQLException;
38
39 34
    @Nullable
40 35
    @SelectOne
41 36
    User login(Connection con, String account, String passwd) throws SQLException;
@ -60,7 +55,7 @@ public interface UserDao {
60 55
61 56
    @Nullable
62 57
    @SelectOne
63
    User queryByAccount(Connection con,@Nullable Boolean active, String account, @Nullable @UnEquals String id) throws SQLException;
58
    User queryByAccount(Connection con,String account) throws SQLException;
64 59
65 60
    @PageSelect
66 61
    @OrderBy("ORDER BY CREATE_TIME")

+ 9 - 3
src/main/java/com/ekexiu/project/storage/system/service/SysService.java

@ -114,9 +114,15 @@ public class SysService {
114 114
115 115
    @Get
116 116
    @Path("/check")
117
    @LoginUser
118
    public Boolean check(@JdbcConn Connection con,@Nullable Boolean active, String account,@Nullable String id)throws SQLException {
119
        return this.userDao.queryByAccount(con,active, account,id)==null;
117
    public int check(@JdbcConn Connection con, String account)throws SQLException {
118
        User user =  this.userDao.queryByAccount(con, account);
119
        if (user == null) {
120
            return 1;
121
        }else if(user.isActive()){
122
            return 0;
123
        }else{
124
            return -1;
125
        }
120 126
    }
121 127
122 128
    @Get