XMTT 6 years ago
parent
commit
1e91c56099

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

53
    @SetSentence("active = '0'")
53
    @SetSentence("active = '0'")
54
    int ban(Connection con, String id) throws SQLException;
54
    int ban(Connection con, String id) throws SQLException;
55
55
56
    @UpdateWith
57
    @From(User.class)
58
    @SetSentence("active = '1'")
59
    int active(Connection con, String id) throws SQLException;
60
56
    @Nullable
61
    @Nullable
57
    @SelectOne
62
    @SelectOne
58
    User queryByAccount(Connection con, String account, @Nullable @UnEquals String id) throws SQLException;
63
    User queryByAccount(Connection con,@Nullable Boolean active, String account, @Nullable @UnEquals String id) throws SQLException;
59
64
60
    @PageSelect
65
    @PageSelect
61
    @OrderBy("ORDER BY CREATE_TIME")
66
    @OrderBy("ORDER BY CREATE_TIME")

+ 0 - 3
src/main/java/com/ekexiu/project/storage/system/po/User.java

4
import org.jfw.apt.orm.annotation.entry.Column;
4
import org.jfw.apt.orm.annotation.entry.Column;
5
import org.jfw.apt.orm.annotation.entry.PrimaryKey;
5
import org.jfw.apt.orm.annotation.entry.PrimaryKey;
6
import org.jfw.apt.orm.annotation.entry.Table;
6
import org.jfw.apt.orm.annotation.entry.Table;
7
import org.jfw.apt.orm.annotation.entry.Unique;
8
import org.jfw.apt.orm.annotation.entry.Uniques;
9
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
7
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
10
import org.jfw.apt.orm.core.enums.DE;
8
import org.jfw.apt.orm.core.enums.DE;
11
9
14
 */
12
 */
15
@Table(descp = "用户表", value = "LUSER")
13
@Table(descp = "用户表", value = "LUSER")
16
@PrimaryKey("id")
14
@PrimaryKey("id")
17
@Uniques({@Unique(clolumns = "account", name = "UC_LUSER_ACCOUNT")})
18
public class User implements CreateTimeSupported {
15
public class User implements CreateTimeSupported {
19
16
20
    private String id;
17
    private String id;

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

115
    @Get
115
    @Get
116
    @Path("/check")
116
    @Path("/check")
117
    @LoginUser
117
    @LoginUser
118
    public Boolean check(@JdbcConn Connection con,String account,@Nullable String id)throws SQLException {
119
        return this.userDao.queryByAccount(con, account,id)==null;
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;
120
    }
120
    }
121
121
122
    @Get
122
    @Get
140
        this.userDao.ban(con, id);
140
        this.userDao.ban(con, id);
141
    }
141
    }
142
142
143
    @Get
144
    @Path("/active")
145
    @LoginUser
146
    public void active(@JdbcConn(true) Connection con, String id) throws SQLException {
147
        this.userDao.active(con, id);
148
    }
149
143
    @Get
150
    @Get
144
    @Path("/pq")
151
    @Path("/pq")
145
    @LoginUser
152
    @LoginUser