XMTT 6 years ago
parent
commit
7097fddf95

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

13
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
13
import org.jfw.apt.orm.annotation.dao.method.operator.Update;
14
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
14
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
15
import org.jfw.apt.orm.annotation.dao.param.Set;
15
import org.jfw.apt.orm.annotation.dao.param.Set;
16
import org.jfw.apt.orm.annotation.dao.param.UnEquals;
17
import org.jfw.util.PageQueryResult;
16
import org.jfw.util.PageQueryResult;
18
17
19
import java.sql.Connection;
18
import java.sql.Connection;
32
    @SelectOne
31
    @SelectOne
33
    User query(Connection con, String id) throws SQLException;
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
    @Nullable
34
    @Nullable
40
    @SelectOne
35
    @SelectOne
41
    User login(Connection con, String account, String passwd) throws SQLException;
36
    User login(Connection con, String account, String passwd) throws SQLException;
60
55
61
    @Nullable
56
    @Nullable
62
    @SelectOne
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
    @PageSelect
60
    @PageSelect
66
    @OrderBy("ORDER BY CREATE_TIME")
61
    @OrderBy("ORDER BY CREATE_TIME")

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

114
114
115
    @Get
115
    @Get
116
    @Path("/check")
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
    @Get
128
    @Get