ソースを参照

--add queryOrgEmail();

zzy.zhiyuan.foxmail 8 年 前
コミット
08643daa66

+ 9 - 0
src/main/java/com/ekexiu/portal/dao/OrgUserDao.java

@ -4,13 +4,16 @@ import java.sql.Connection;
4 4
import java.sql.SQLException;
5 5

6 6
import org.jfw.apt.annotation.Nullable;
7
import org.jfw.apt.orm.annotation.dao.Column;
7 8
import org.jfw.apt.orm.annotation.dao.DAO;
8 9
import org.jfw.apt.orm.annotation.dao.method.From;
9 10
import org.jfw.apt.orm.annotation.dao.method.operator.Insert;
11
import org.jfw.apt.orm.annotation.dao.method.operator.QueryVal;
10 12
import org.jfw.apt.orm.annotation.dao.method.operator.SelectOne;
11 13
import org.jfw.apt.orm.annotation.dao.method.operator.UpdateWith;
12 14
import org.jfw.apt.orm.annotation.dao.param.Alias;
13 15
import org.jfw.apt.orm.annotation.dao.param.Set;
16
import org.jfw.apt.orm.core.defaultImpl.StringHandler;
14 17

15 18
import com.ekexiu.portal.po.OrgUser;
16 19

@ -31,6 +34,12 @@ public abstract class OrgUserDao {
31 34
	@From(OrgUser.class)
32 35
	public abstract int updatePw(Connection con,String id,@Set String passwd,@Alias("passwd")String key)throws SQLException;
33 36
	
37
	@QueryVal
38
	@Column(handlerClass=StringHandler.class, value = { "EMAIL" })
39
	@From(OrgUser.class)
40
	@Nullable
41
	public abstract String queryOrgEmail(Connection con,String id)throws SQLException;
42
	
34 43
	@SelectOne
35 44
	@Nullable
36 45
	public abstract OrgUser queryOne(Connection con,String id)throws SQLException;

+ 4 - 0
src/main/java/com/ekexiu/portal/service/ImageService.java

@ -153,6 +153,8 @@ public class ImageService {
153 153
	 * @param id 专家ID
154 154
	 * @return 有头像返回1,没有返回0.
155 155
	 */
156
	@Get
157
	@Path("/hasProImg")
156 158
	public int hasProfessorImage(String id) {
157 159
		String headPath = this.headPath+"/"+id+"_l.jpg";
158 160
		File file = new File(headPath);
@ -168,6 +170,8 @@ public class ImageService {
168 170
	 * @param id 企业ID
169 171
	 * @return 有企业logo返回true,否则返回false
170 172
	 */
173
	@Get
174
	@Path("/hasOrgLogo")
171 175
	public boolean hasOrgLogo(String id) {
172 176
		String orgPath = this.orgPath+"/"+id+".jpg";
173 177
		File file = new File(orgPath);

+ 31 - 0
src/main/java/com/ekexiu/portal/service/OrgUserService.java

@ -0,0 +1,31 @@
1
package com.ekexiu.portal.service;
2

3
import java.sql.Connection;
4
import java.sql.SQLException;
5

6
import org.jfw.apt.annotation.Autowrie;
7
import org.jfw.apt.web.annotation.Path;
8
import org.jfw.apt.web.annotation.operate.Get;
9
import org.jfw.apt.web.annotation.param.JdbcConn;
10

11
import com.ekexiu.portal.dao.OrgUserDao;
12

13
@Path("/orgUser")
14
public class OrgUserService {
15
	@Autowrie
16
	private OrgUserDao orgUserDao;
17

18
	public OrgUserDao getOrgUserDao() {
19
		return orgUserDao;
20
	}
21

22
	public void setOrgUserDao(OrgUserDao orgUserDao) {
23
		this.orgUserDao = orgUserDao;
24
	}
25
	
26
	@Get
27
	@Path("/orgEmail")
28
	public String queryOrgEmail(@JdbcConn Connection con,String id)throws SQLException{
29
		return this.orgUserDao.queryOrgEmail(con, id);
30
	}
31
}