Commit f730b062 authored by Quxl's avatar Quxl

xx

parent ee7d3cf0
...@@ -10,7 +10,6 @@ import org.springframework.web.bind.annotation.PostMapping; ...@@ -10,7 +10,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx; import com.egolm.common.bean.Rjx;
import com.egolm.film.api.member.service.MemberService; import com.egolm.film.api.member.service.MemberService;
import com.egolm.film.api.member.service.MemberTokenService; import com.egolm.film.api.member.service.MemberTokenService;
...@@ -44,15 +43,15 @@ public class MemberApplyController { ...@@ -44,15 +43,15 @@ public class MemberApplyController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(paramType="header", dataType="string", name="i18n_language") @ApiImplicitParam(paramType="header", dataType="string", name="i18n_language")
}) })
public Object list(String email) { public Object list(String keyword) {
Integer member_id = null; LoginToken loginToken = tokenService.getToken();
if(StringUtil.isNotBlank(email)) { Integer member_id = (Integer)loginToken.getId();
member_id = memberService.getMemberByEmail(email).getId(); List<Map<String, Object>> list = null;
if(member_id == 3785) {
list = memberService.queryListAll(keyword);
} else { } else {
LoginToken loginToken = tokenService.getToken(); list = memberService.queryListByMemberID(member_id);
member_id = (Integer)loginToken.getId();
} }
List<Map<String, Object>> list = memberService.queryListByMemberID(member_id);
return Rjx.jsonOk().setData(list); return Rjx.jsonOk().setData(list);
} }
......
...@@ -130,4 +130,6 @@ public interface MemberService { ...@@ -130,4 +130,6 @@ public interface MemberService {
void updateToken(Integer member_id, String token_string); void updateToken(Integer member_id, String token_string);
List<Map<String, Object>> queryListAll(String keyword);
} }
...@@ -482,4 +482,15 @@ public class MemberServiceImpl implements MemberService { ...@@ -482,4 +482,15 @@ public class MemberServiceImpl implements MemberService {
jdbcTemplate.executeUpdate(sql, token_string, member_id); jdbcTemplate.executeUpdate(sql, token_string, member_id);
} }
@Override
public List<Map<String, Object>> queryListAll(String keyword) {
if(StringUtil.isBlank(keyword)) {
String sql = "select * from fc_member_film";
return jdbcTemplate.queryForList(sql);
} else {
String sql = "select * from fc_member_film where en_name like ? or cn_name like ?";
return jdbcTemplate.queryForList(sql, "%" + keyword + "%", "%" + keyword + "%");
}
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment