Commit 571d8e5c authored by Quxl's avatar Quxl

保存,更新会员基本信息

parent cf745d8e
......@@ -49,6 +49,9 @@ public class MemberInfoController {
@ApiImplicitParam(paramType = "query", dataType = "string", required = false, name = "tel"),
})
public Object save(String email, String realname, String address, String company, String tel) {
LoginToken loginToken = tokenService.getToken();
Integer id = (Integer)loginToken.getId();
memberService.updateMember(id, email, realname, address, company, tel);
return Rjx.jsonOk();
}
......
......@@ -14,4 +14,8 @@ public interface MemberService {
Fc_member getMemberById(Integer id);
void mergeMember(Fc_member member);
void updateMember(Integer id, String email, String realname, String address, String company, String tel);
}
......@@ -43,4 +43,15 @@ public class MemberServiceImpl implements MemberService {
return jdbcTemplate.queryForBean(sql, Fc_member.class, id);
}
@Override
public void mergeMember(Fc_member member) {
jdbcTemplate.merge(member);
}
@Override
public void updateMember(Integer id, String email, String realname, String address, String company, String tel) {
String sql = "update fc_member set email = ?, realname = ?, address = ?, company = ?, tel = ? where id = ?";
jdbcTemplate.executeUpdate(sql, email, realname, address, company, tel, id);
}
}
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