Commit f730b062 authored by Quxl's avatar Quxl

xx

parent ee7d3cf0
......@@ -10,7 +10,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.egolm.common.StringUtil;
import com.egolm.common.bean.Rjx;
import com.egolm.film.api.member.service.MemberService;
import com.egolm.film.api.member.service.MemberTokenService;
......@@ -44,15 +43,15 @@ public class MemberApplyController {
@ApiImplicitParams({
@ApiImplicitParam(paramType="header", dataType="string", name="i18n_language")
})
public Object list(String email) {
Integer member_id = null;
if(StringUtil.isNotBlank(email)) {
member_id = memberService.getMemberByEmail(email).getId();
public Object list(String keyword) {
LoginToken loginToken = tokenService.getToken();
Integer member_id = (Integer)loginToken.getId();
List<Map<String, Object>> list = null;
if(member_id == 3785) {
list = memberService.queryListAll(keyword);
} else {
LoginToken loginToken = tokenService.getToken();
member_id = (Integer)loginToken.getId();
list = memberService.queryListByMemberID(member_id);
}
List<Map<String, Object>> list = memberService.queryListByMemberID(member_id);
return Rjx.jsonOk().setData(list);
}
......
......@@ -130,4 +130,6 @@ public interface MemberService {
void updateToken(Integer member_id, String token_string);
List<Map<String, Object>> queryListAll(String keyword);
}
......@@ -482,4 +482,15 @@ public class MemberServiceImpl implements MemberService {
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